Resource allocation method, device and electronic equipment

By dynamically obtaining resource information of the server cluster and resource requirements for component grouping, and using allocation strategies suitable for different server counts, the problem of microservice component allocation under different server specifications and performance is solved, and efficient and flexible resource allocation is achieved.

CN119046016BActive Publication Date: 2025-03-18HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411524469.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-18
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The prior art is difficult to effectively allocate microservice components in server clusters, especially when server specifications and performance are different, resulting in a unified deployment planning scheme not applicable.

Method used

By obtaining resource information of the server cluster and resource requirements for component grouping, a dynamic resource allocation method is adopted, including a first allocation strategy and a second allocation strategy, to ensure the reasonable allocation of resources. The first allocation strategy applies to the situation where the number of servers is not less than the number of component packets. The second allocation strategy applies to the resource allocation under constraints when the number of servers is insufficient.

Benefits of technology

It realizes dynamic and flexible allocation of resources to components when server specifications and performance are inconsistent, which improves the executability and success rate of resource allocation and reduces invalid resource allocation and conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046016B_ABST
    Figure CN119046016B_ABST
Patent Text Reader

Abstract

The present application provides a resource allocation method, device and electronic device. The resource allocation method includes: determining the total available resources of the server cluster according to the available resources of each server in the server cluster obtained, and determining the total resource demand according to the resource demand of each component group, and determining that the total available resources meet the total resource demand; if the number of servers is not less than the number of component groups, a first allocation strategy is used to allocate a server to each component group; if the number of servers in the server cluster is less than the number of component groups and not less than a first threshold, or the allocation using the first allocation strategy fails, a second allocation strategy is used to allocate servers to the component groups under constraints; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of resource allocation, and in particular, relates to a resource allocation method, device and electronic device. Background Art

[0002] Architecture-based industry platforms usually adopt microservice architecture, which means that the platform is composed of many microservice components, each of which undertakes different business functions. When allocating server resources to these microservice components, the existing method follows a unified deployment plan to ensure efficient resource utilization and convenient management.

[0003] However, in actual applications, due to differences in server procurement sources, brands, models, and configurations, servers have different specifications and performance. This diversity often makes it difficult to apply a unified deployment plan. Therefore, how to reasonably allocate microservice components to each server has become an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a resource allocation method, device and electronic device, which can dynamically and flexibly allocate resources to components during server resource allocation, regardless of whether the server specifications and configurations in a server cluster are consistent.

[0005] In a first aspect, an embodiment of the present application provides a resource allocation method, the method comprising: obtaining the number of servers in a server cluster, the available resources of each server, and the resource requirements of each component group to be allocated; the component group includes at least one component; wherein the components in the same component group are allocated to the same server; determining the total available resources of the server cluster based on the available resources of each server, and determining the total resource requirements based on the resource requirements of each component group, and determining that the total available resources meet the total resource requirements; if the number of servers is not less than the number of component groups, a first allocation strategy is used to allocate a server to each component group; if the number of servers is less than the number of component groups and is not less than a first threshold, or the allocation using the first allocation strategy fails, a second allocation strategy is used to allocate servers to the component groups under constraints; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server.

[0006] In a possible implementation of the first aspect, a first allocation strategy is adopted to allocate a server to each component group, including: traversing each server combination, determining a target server combination, and using the target server combination as the component allocation result; wherein the arrangement order of servers in a server combination corresponds to the arrangement order of the component groups; and the available resources of each server in the target server combination meet the resource requirements of the corresponding component group.

[0007] In a possible implementation of the first aspect, traversing each server combination to determine a target server combination includes: matching resource requirements of servers in the server combination with component groups in sequence based on the currently traversed server combination; in the event that the matching between the server and the component group fails, updating the currently traversed server combination, and returning to execute the step of matching resource requirements of servers in the server combination with component groups in sequence based on the currently traversed server combination and subsequent steps until a server combination that meets the search criteria is traversed, and determining the server combination that meets the search criteria as the target server combination; updating the currently traversed server combination includes: updating the currently traversed server combination based on available resources of each server in the traversed server combination, wherein the updated currently traversed server combination does not include a replacement combination of the traversed server combination, and the replacement combination is: replacing a first server in the traversed server combination with a second server, the first server being a server that fails to match the component group, and the second server being a server whose available resources are not greater than those of the first server.

[0008] In a possible implementation of the first aspect, a second allocation strategy is used under constraints to allocate servers to component groups, including: for the component groups under the current index category, matching is performed according to a preset order of available resources and a preset order of resource requirements of the component groups under the constraints until the match is successful or the matching of the last server is completed; if the component groups under the current index category are successfully matched with the servers, the available resources of the server are updated based on the resource requirements of the component groups, and the next index category is used as the current index category, and the step of performing matching for the component groups under the current index category under the constraints according to a preset order of available resources and a preset order of resource requirements of the component groups and subsequent steps are returned; when all component groups are successfully matched with servers, the component allocation results are obtained based on the successfully matched component groups and servers.

[0009] In a possible implementation of the first aspect, matching is performed according to a preset order of available resources and a preset order of resource requirements of component groups until a match is successful, including: determining a current component grouping according to the preset order of resource requirements, and determining a current server that matches the current component grouping according to the preset order of available resources; if the current component grouping successfully matches the current server, updating the available resources of the current server using the resource requirements of the current component group; updating the preset order of available resources using the updated available resources of the current server, and returning to execute the step of determining the current component grouping according to the preset order of resource requirements and subsequent steps.

[0010] In a possible implementation of the first aspect, the preset order includes an order from small to large and / or an order from large to small; the method also includes: if for the component grouping under the current index category, under constraints, matching is performed in the order of available resources from small to large, and in the order of resource requirements of the component grouping from small to large, until the matching of the last server is completed, then the preset order is updated to the order from large to small, and the component grouping under the current index category is re-executed, under constraints, matching is performed in the preset order of available resources from small to large, and in the order of resource requirements of the component grouping, until the matching is successful or the matching of the last server is completed and subsequent steps.

[0011] In a possible implementation of the first aspect, after allocating a server to each component group using the first allocation strategy or allocating servers to the component groups using the second allocation strategy under constraints, it also includes: determining the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups based on the component allocation results; and adjusting the allocation of component groups based on the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups.

[0012] In a possible implementation of the first aspect, based on the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups, the allocation of component groups is adjusted, including: if there are a third server and a fourth server in the server cluster, the component groups in the third server are adjusted and allocated to the fourth server with the goal that the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is not greater than a preset difference; wherein the allocated number of component groups in the third server is greater than the allocated number of component groups in the fourth server, and the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is greater than the preset difference, and the index categories of the component groups in the third server and the fourth server are the same, and the resource configuration data of the third server is consistent with the resource configuration data in the fourth server; if there are a fifth server and a sixth server in the server cluster, the component groups in the fifth server are allocated and exchanged with the component groups in the sixth server; wherein the resource occupancy rate of the fifth server is less than the resource occupancy rate of the sixth server, and the resource configuration data of the fifth server is greater than the resource configuration data of the sixth server.

[0013] In a second aspect, an embodiment of the present application provides a resource allocation device, the device comprising:

[0014] The acquisition module is used to obtain the number of servers in the server cluster, the available resources of each server, and the resource requirements of each component group to be allocated; the component group includes at least one component; wherein the components in the same component group are allocated to the same server.

[0015] The resource judgment module is used to determine the total available resources of the server cluster according to the available resources of each server, determine the total resource demand according to the resource demand of each component group, and determine whether the total available resources meet the total resource demand.

[0016] The resource allocation module is used to allocate a server to each component group using a first allocation strategy if the number of servers is not less than the number of component groups.

[0017] The resource allocation module is also used to allocate servers to component groups using a second allocation strategy under constraints if the number of servers is less than the number of component groups and not less than a first threshold, or if the allocation using the first allocation strategy fails; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: the electronic device comprises a processor and a memory and a data interface coupled to the processor; wherein the data interface is used for data communication, the memory is used for program data, and the program data, when executed by the processor, is used to implement the method provided above for application to the first aspect and any possible implementation method thereof.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program / instructions. When the computer program / instructions are executed on an electronic device, the electronic device executes the method of the first aspect and any possible implementation method thereof.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, enables an electronic device to execute the method of the above-mentioned first aspect and any possible implementation method thereof.

[0021] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect below, and will not be repeated here.

[0022] Compared with the prior art, the beneficial effect of the embodiment of the present application is that by obtaining the resource information of the server cluster (the available resources of each server) and the resource requirements of each component group to be allocated, the total available resources of the server and the total resource requirements of the component group are summarized respectively. Under the basic principle that the total available resources need to meet the total resource requirements, the comparison result of the resource amounts of the two is used as a preliminary assessment of the resource status, which can effectively avoid resource scheduling problems caused by insufficient hardware resources of the server cluster before actually starting to allocate resources. This not only helps to reduce the invalid resource allocation that may occur later, but also greatly improves the executability and success rate of the resource allocation strategy.

[0023] In addition, on the basis of ensuring that the total available resources meet the total resource requirements, two different allocation strategies are formulated according to the number of servers and the number of component groups, and taking into account possible failures in the allocation process. When the number of servers is not less than the number of component groups, the first allocation strategy is adopted to deploy the components in the same component group on the same server, and each component group is allocated to an independent server to ensure resource isolation and optimal performance. This allocation strategy can not only simplify the allocation process when there are sufficient server resources; it can also maximize the use of server resources while reducing resource conflicts between component groups.

[0024] When the number of servers is limited (i.e. the number of servers is less than the number of component groups and not less than the number of index categories) or the first allocation strategy fails, the second allocation strategy is introduced, and resource allocation is performed under the constraint of combining index categories. Under the limited number of servers, by following the constraint that component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server, not only the probability of component groups successfully matching servers is greatly increased, but also conflicts caused by resource competition between component groups of different index categories are successfully avoided; at the same time, this strategy greatly improves the efficiency of server use, effectively reduces the degree of resource fragmentation, and promotes the concentration and efficient use of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0026] Figure 1 It is a schematic diagram of the architecture of an application environment provided by an embodiment of the present application;

[0027] Figure 2 is a flowchart of a resource allocation method provided by an embodiment of the present application;

[0028] Figure 3 This is a schematic diagram of the effect of the search path provided by an embodiment of the present application;

[0029] Figure 4 is a flow chart of a second allocation strategy provided in an embodiment of the present application;

[0030] Figure 5 is a schematic diagram of the effect of resource transfer provided by another embodiment of the present application;

[0031] Figure 6 This is a schematic diagram of the effect of resource transfer provided by an embodiment of the present application;

[0032] Figure 7 It is a flowchart of a product deployment method provided by an embodiment of the present application;

[0033] Figure 8 is a flowchart of a product deployment method provided by another embodiment of the present application;

[0034] Fig. 9 This is an example diagram of a product deployment process provided by an embodiment of the present application;

[0035] Fig.10 is a schematic diagram of the structure of a resource allocation device provided by another embodiment of the present application;

[0036] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0038] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0039] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0040] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when..." depending on the context. Similarly, the phrase "if it is determined" can be interpreted as meaning "uponce determined" depending on the context.

[0041] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0042] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0043] The architecture-based industry platform adopts a microservice architecture, which means that the platform contains a large number of microservice components, and the deployment and configuration of each component may be different. In actual applications, the diversity of servers, such as servers purchased from different manufacturers or reused servers, may cause significant differences in hardware configuration, performance, and compatibility between servers from different sources and specifications. This may cause some microservice components to run poorly or not run at all on some servers. In addition, the diversity of servers has also increased the complexity of deployment and configuration, making the existing standardized deployment solutions not universal among multiple servers. In view of this, how to reasonably allocate microservice components to each server has become a difficult problem that needs to be solved urgently.

[0044] Based on this, the embodiments of the present application provide a resource allocation method, device and electronic device. The technical principle of the method is: by obtaining the resource information of the server cluster (the available resources of each server) and the resource requirements of each component group to be allocated, the total available resources of the server and the total resource requirements of the component group are summarized respectively. Under the basic principle that the total available resources need to meet the total resource requirements, the comparison result of the resource amounts of the two is used as a preliminary assessment of the resource status. On the basis of ensuring that the total available resources meet the total resource requirements, three different allocation strategies are formulated according to the number of servers and the number of component groups, and taking into account possible failures in the allocation process.

[0045] Specifically, when the number of servers is not less than the number of component groups, the first allocation strategy is adopted to deploy the components in the same component group in the same server, which can not only simplify the allocation process, but also reduce resource conflicts. When faced with a limited number of servers (that is, the number of servers is less than the number of component groups and not less than the number of index categories) or the first allocation strategy fails, the second allocation strategy is introduced, and the resource allocation under the constraint conditions is combined with the index category. When the preset order in the second allocation strategy adopts the order from small to large combined with the index category to perform resource allocation under the constraint conditions and fails, the preset order is updated using the order from large to small, and the order from large to small combined with the index category is re-adopted to perform resource allocation under the constraint conditions. In this way, through the cooperation of the two allocation strategies, not only the probability of component groups successfully matching servers is greatly improved, but also the conflicts caused by resource competition between component groups of different index categories are successfully avoided.

[0046] Finally, after the component groups are allocated to the servers using the above strategy, based on the principle of balance, the component group allocation is adjusted for servers with higher resource utilization or a higher number of component group allocations and servers with lower resource utilization or a smaller number of component group allocations, so as to balance the load on each server.

[0047] See also Figure 1 , Figure 1 This is a diagram of an implementation environment architecture of a resource allocation method provided in an embodiment of the present application. The implementation environment architecture includes: a server cluster 101 (including server 1, server 2, server 3, ..., server N) and a terminal device 102.

[0048] The resource allocation method provided in the embodiment of the present application can be applied to the terminal device 102. Optionally, the terminal device 102 can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device 102.

[0049] The terminal device 102 has a display function, for example, the display function can be realized through a graphics processing unit (GPU), a display screen, and an application processor.

[0050] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0051] Figure 2 A schematic diagram of a resource allocation method provided in an embodiment of the present application. Figure 2 , the method may include:

[0052] 201. Obtain the number of servers in a server cluster, available resources of each server, and resource requirements of each component group to be allocated; the component group includes at least one component; wherein components in the same component group are allocated to the same server.

[0053] Optionally, a microservice component is a software unit that complies with the microservice architecture design and independently completes a certain technical or business task. For example: operation management center service, algorithm warehouse service, intelligent search service, etc.

[0054] Optionally, the available resources of the server and the resource requirements of the component group may include, but are not limited to, at least one of the following resource types: the number of central processing units (CPUs), memory, and hard disks (including solid state drives (SSDs) and / or mechanical hard disks (HDDs)). It should be noted that the available resources of the server and the resource requirements of the component group may be the same or different in resource types.

[0055] In a possible implementation, avoiding resource grabbing between components in a microservice architecture is the key to ensuring system stability and performance. Component groups can be obtained based on the platform software layering and business logic division. Component groups can be a collection of one or more components. Usually, components in the same component group are deployed on the same server during deployment.

[0056] As an example, microservice components are grouped according to business logic, and microservice components with similar business logic or functions are divided into the same component group. This ensures that these microservice components share the same resource pool when processing similar types of requests, thereby avoiding resource contention across business logics, improving resource utilization efficiency and system maintainability. For example: component grouping is divided into: operation management group, architecture group, retrieval group, image search group, etc.; among them, the operation management group can include components such as operation management center service, backup service, software version management service, call chain service, network time protocol (Network Time Protocol, ntp) timing service, system monitoring alarm service, license management service, etc.; the architecture group can include demonstration service, unified service, emergency stop service, identity authentication service, front-end service, Internet portal service, enhanced identity authentication service, mobile service, etc. The retrieval group can include resource management service, service data management center service, distributed search and analysis engine service, integrated service support center service, resource sharing service, etc. The image search group can include image indexing service, image search service, etc.

[0057] In another possible implementation, microservice components are grouped according to resource requirements, such as CPU, memory, hard disk, etc. Microservice components with similar resource requirements are grouped into the same component group to allocate resources more reasonably, thereby more accurately controlling resource allocation and avoiding microservice components with high resource requirements from affecting other microservice components with low resource requirements. For example, microservices that require a lot of computing resources (such as data analysis services) are deployed separately from microservices with high memory requirements (such as cache services) to avoid resource contention between them.

[0058] In another possible implementation, microservice components are grouped by access mode, and grouped according to the access mode of microservices (such as more reads and less writes, less reads and more writes, real-time requirements, etc.). Microservices with similar access modes are grouped into the same component group to better optimize access performance and resource usage, improve access efficiency and system scalability. For example, microservice components with more reads and less writes are grouped into the same component group to improve read performance by using optimization technologies such as caching.

[0059] 202. Determine total available resources of the server cluster according to available resources of each server, determine total resource requirements according to resource requirements of each component group, and determine that the total available resources meet the total resource requirements.

[0060] Optionally, the required number of CPUs, the required capacity of memory, the required capacity of SSD hard disks and / or the required capacity of HDD hard disks contained in the total resource requirements of the component group to be allocated are compared one by one with the available number of CPUs, the remaining capacity of memory, the remaining capacity of SSD hard disks, and the remaining capacity of HDD hard disks contained in the total available resources of the server cluster. If there is at least one item in the total available resources of the server cluster that is less than the corresponding item in the total resource requirements, it is determined that the total available resources do not meet the total resource requirements. If all items of the total available resources in the server cluster are greater than or equal to the corresponding items in the total resource requirements, it is determined that the total available resources meet the total resource requirements.

[0061] When the total available resources of the server cluster do not meet the total resource demand, the system will provide feedback to the user or administrator that the arrangement cannot be done normally, and prompt information that the available resources of the server cluster are insufficient. The specific reasons for the shortage can be further prompted. For example, the available number of CPUs is insufficient; or the required capacity of SSD hard disks is insufficient.

[0062] 203. If the number of servers is not less than the number of component groups, a first allocation strategy is used to allocate one server to each component group.

[0063] Optionally, the first allocation strategy may be: sorting the component groups according to resource requirements from small to large or from large to small, and sorting the servers according to available resources from small to large or from large to small, and matching the resource requirements in the component groups from small to large with the servers sorted from small to large; or, matching the resource requirements in the component groups from large to small with the servers sorted from large to small.

[0064] For example, assume that the resource requirements of the four component groups are in the order of a1, a2, b1, and b2 from small to large. If there are five servers 1 to 5, based on the available resources, they are assumed to be server 1, server 2, and server 3 from small to large. First, assign a server to component group a1, search server 1, and determine whether the available resources of server 1 meet the resource requirements of component group a1; if so, assign component group a1 to server 1. After the component group a1 is assigned to server 1, since each component is assigned a server, when assigning a2 to a server, it is directly matched with server 2 to determine whether the available resources of server 2 meet the resource requirements of component group a2. If so, component group a2 is assigned to server 2. If not, it is determined whether the available resources of server 3 meet the resource requirements of component group a2. If so, component group a2 is assigned to server 3. By analogy, assuming that component group a2 is assigned to server 3 (the available resources of server 2 do not meet the resource requirements of component group a2), component group b1 is assigned to server 4, and component group b2 is assigned to server 5, the match is successful. Assuming that server 4 cannot meet the resource requirements of component group b1, and server 5 meets the resource requirements of component group b1, component group b1 is assigned to server 5. Since the resource requirements of component group b2 are greater than those of component group b1, server 4 will inevitably be unable to meet the resource requirements of component group b2, which ultimately results in no matching independent server resources for component group b2, and this resource allocation fails.

[0065] Therefore, it can be understood that when the number of component groups is less than the number of servers, in the process of matching the resource requirements in the component groups in order from small to large according to the order of the servers, it is allowed that the available resources of the servers not greater than the first number do not meet the resource requirements of the component groups. The first number is the difference between the number of component groups and the number of servers.

[0066] In a possible implementation, when the number of component groups is the same as the number of servers, in the process of matching the resource requirements in the component groups in descending order according to the order of the servers, if one server does not meet the resource requirements of the component group that matches it, it indicates that the first allocation strategy allocation fails. The same is true for descending order, which will not be repeated here.

[0067] In one implementation, the first allocation strategy adopts a depth-first search strategy to form multiple search paths according to various combinations of servers, and each server is regarded as a node in the path. Specifically, a recursive function is first defined, and the input parameters include the component groups to be allocated and the current search path. The recursive benchmark case includes: selecting one of the search paths, if the component groups to be allocated in the search path have been successfully allocated, then the current allocation plan is recorded and returned, and no other search paths are searched. If there is an unsuccessful allocation in the search path, the search for subsequent nodes in the search path is terminated, and another unsearched path is selected to re-search and allocate all component groups.

[0068] Optionally, during the search process of each search path, if it is found that the node currently searching the search path cannot successfully allocate the resource requirements of the unallocated smallest unit group in the target set (for example, in the current search path, if the resources of the current search node cannot meet the unallocated component group with the smallest resource requirements in the component set), the search of the current search path is terminated prematurely.

[0069] As an example, see Figure 3 , assuming that there are three component groups, namely a1, a2, and a3, and the arrangement order of the component groups is a1, a2, and a3, and there are three servers 1 to 3 in the server cluster, the corresponding search paths may include: {1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}. Take {1, 2, 3} as the current search path, and match the resources of component group a1 with server 1, component group a2 with server 2, and component group a3 with server 3 in turn to confirm whether the available resources of each server can meet the resource requirements of the corresponding component group. If satisfied, no other search paths will be searched, and {1, 2, 3} will be used as the component allocation result of the first allocation strategy. If it is not satisfied, then select one of the remaining unsearched search paths {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1} as the current search path. For example, {1, 3, 2} can be selected as the current search path to match the resources of component group a1 with server 1, component group a2 with server 3, and component group a3 with server 2 respectively, to confirm whether the available resources of each server can meet the resource requirements of the corresponding component group, and so on, until a search path that meets the resource requirements of the component group is matched or all search paths are searched, then the search ends.

[0070] 204. If the number of servers is less than the number of component groups and is not less than the first threshold, or the allocation using the first allocation strategy fails, then the second allocation strategy is used to allocate servers to the component groups under constraints; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server.

[0071] It should be noted that if there are high requirements for the security level or deployment in the same server may lead to resource preemption or component groups that need to be deployed on different servers according to deployment requirements, if they are deployed in the same server, they will form a potential mutually exclusive relationship, for example, they will preempt each other's memory and network resources in the server, or because the security policy requires the isolation of different data processing and access control, or because abnormal situations occur due to failure to meet deployment requirements, so these component groups are divided into different index categories, and when allocating servers, the component groups of different index categories are restricted from being allocated to different servers. For example, there may be a risk of resource preemption between the inspection component and the operation management center component, so it is not recommended to deploy them on the same server.

[0072] It is understandable that mutually exclusive component groupings are not limited to situations where there is resource competition between component groups or there are high security requirements. In fact, according to specific deployment requirements, even if there is no resource competition between components or there are no special security requirements, they may need to be deployed on different servers.

[0073] Optionally, the assigned component groups are divided into index categories according to the "peak shaving and valley filling" merge index strategy to balance the server load and avoid resource overload during peak hours and idleness during valley hours. The core of the "peak shaving and valley filling" strategy is to balance the resource requirements of different time periods, ensuring that the server can operate normally during high-load periods and fully utilize resources during low-load periods. Therefore, index categories can be configured for component groups according to their resource demand patterns.

[0074] Specifically, if two component groups have high resource demands in the same period, different index categories should be configured for them to avoid resource competition when they are allocated to the same server. On the contrary, if one component group has high resource demands in the first period, and another component group has high resource demands in the second period, the same index category can be configured for them so that component groups of the same index category are allocated to the same server, which can achieve resource complementarity and balance and avoid resource competition.

[0075] In one implementation, an identifier is used to represent the index category of the component grouping. Different identifiers correspond to different index categories. For example, 1, 2, 3, 4 or A, B, C, D, etc. may be used.

[0076] In actual applications, for the convenience of management, a list is usually used to record the components contained in all component groups (as shown in Table 1 below), and an index identifier is given to each component group.

[0077] As an example, referring to Table 1, a grouping list of component groups included in all component collections is shown.

[0078]

[0079] In some embodiments, in the process of assigning component groups to servers, component groups with the same index identifier are taken as a set, and the component groups with the same index identifier are searched in sequence, and for the resource requirements of each component group searched, the server to which the component group with the same index identifier has been assigned is searched first. If the available resources of the server to which the component group with the same index identifier has been assigned cannot meet the resource requirements of the component group, the server to which the component group has not been assigned is searched again. That is, the component groups with the same index category are preferentially assigned to the same server.

[0080] Optionally, integrate the resources of multiple servers into one or more virtual resource pools to form a unified resource management platform. Dynamically allocate resources to component groups of different index categories based on real-time resource demand and available resources. Optionally, use containerization technology (such as Kubernetes) or virtualization technology (such as VMware) to automatically manage resource allocation in resource pools.

[0081] As an example, suppose there are 4 servers (S1, S2, S3, S4), and their resources are integrated into a resource pool. The total resources of the resource pool are: total CPU: 16, total memory: 64GB, total hard disk: 2000GB; the resource configuration of each server is as follows: S1: 4 CPUs, 16GB memory, 500GB hard disk; S2: 4 CPUs, 16GB memory, 500GB hard disk; S3: 4 CPUs, 16GB memory, 500GB hard disk; S4: 4 CPUs, 16GB memory, 1000GB hard disk.

[0082] Assume that there are three component groups, namely component group a1, component group a2, and component group b1. The index categories of component group a1 and component group a2 are the same, and the index categories of component groups a1, a2 and component group b1 are different. The resource requirements of component group a1 are: 4 CPUs, 16GB memory, 100GB hard disk; the resource requirements of component group a2 are: 2 CPUs, 8GB memory, 50GB hard disk. The resource requirements of component group b1 are: 2 CPUs, 8GB memory, 300GB hard disk.

[0083] In the resource pool, the process of dynamically allocating resources is as follows: Check the resource pool status: Check the available resources of each server. First, allocate a server to component set a1: Select a server (for example, S1) from the resource pool; If the requirements of component set a1 are met, server S1 is allocated to component set a1, and the resource pool status is updated: S1: 0 CPU, 0GB memory, 400GB hard disk (remaining); S2: 4 CPU, 16GB memory, 500GB hard disk, S3: 4 CPU, 16GB memory, 500GB hard disk; S4: 4 CPU, 16GB memory, 1000GB hard disk. To allocate a server for component set a2, first confirm whether the available resources of the updated server S1 meet the resource requirements of component set a2. If so, allocate component set a2 to server S1. If not, select another server (for example, server S2) to meet the requirements of component set a2. Then, allocate server S2 to component set a2 and update the resource pool status: S1: 0 CPUs, 0GB memory, 400GB hard disk, S2: 2 CPUs, 8GB memory, 450GB hard disk (remaining), S3: 4 CPUs, 16GB memory, 500GB hard disk, S4: 4 CPUs, 16GB memory, 1000GB hard disk. When assigning servers to component group b1, since servers S1 and S2 have been assigned to the index categories corresponding to component groups a1 and a2, and the index categories corresponding to component group b1 are different from the index categories corresponding to component groups a1 and a2, component group b1 cannot be assigned to servers S1 and S2, and can only be assigned to the remaining servers S3 and S4. The allocation method refers to component set a1 and will not be repeated here.

[0084] In one possible implementation, in order to prevent component groups of different index categories from being scheduled to the same server, Kubernetes' anti-affinity policy can be used. In Kubernetes, by configuring the anti-affinity rule (Pod Anti-Affinity Rule) in the deployment (Deployment), it is ensured that component groups of different index categories are scheduled to different servers, thereby achieving decentralized deployment of component groups of different index categories.

[0085] Furthermore, in Kubernetes, there are two component groups A and B with different index categories, each with different resource requirements and images. To ensure that these two component groups are not scheduled to the same server, anti-affinity rules can be used in their Deployment configuration. Specifically, anti-affinity rules are defined under the affinity field in the Specification section of the Deployment. Pods with specific labels are selected by specifying a labelSelector, and a topologyKey is set to determine the granularity of scheduling. In this example, topologyKey is set to "kubernetes.io / hostname" to represent the node level. After completing this configuration, when the Kubernetes scheduler schedules a new Pod, it checks whether the Pod matches the label selector defined in the podAntiAffinity rule with the Pod that has been scheduled to a node. If it matches, the scheduler will not schedule the Pod to the node, thereby ensuring that component group A and component group B are not scheduled to the same server. In this way, the distribution of component groups of different index categories in the Kubernetes cluster can be effectively managed to ensure that component groups of different index categories do not interfere with each other.

[0086] The method provided in the embodiment of the present application obtains the resource information of the server cluster (the available resources of each server) and the resource requirements of each component group to be allocated, and summarizes the total available resources of the server and the total resource requirements of the component group. Under the basic principle that the total available resources need to meet the total resource requirements, the comparison result of the resource amounts of the two is used as a preliminary assessment of the resource status, which can effectively avoid resource scheduling problems caused by insufficient hardware resources of the server cluster before actually starting to allocate resources. This not only helps to reduce the invalid resource allocation that may occur later, but also greatly improves the executability and success rate of the resource allocation strategy.

[0087] In addition, on the basis of ensuring that the total available resources meet the total resource requirements, two different allocation strategies are formulated according to the number of servers and the number of component groups, and taking into account possible failures in the allocation process. When the number of servers is not less than the number of component groups, the first allocation strategy is adopted to deploy the components in the same component group on the same server, and each component group is allocated to an independent server to ensure resource isolation and optimal performance. This allocation strategy can not only simplify the allocation process when there are sufficient server resources; it can also maximize the use of server resources while reducing resource conflicts between component groups.

[0088] When the number of servers is limited (i.e. the number of servers is less than the number of component groups and not less than the number of index categories) or the first allocation strategy fails, the second allocation strategy is introduced, and resource allocation is performed under the constraint of combining index categories. Under the limited number of servers, by following the constraint that component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server, not only the probability of component groups successfully matching servers is greatly increased, but also conflicts caused by resource competition between component groups of different index categories are successfully avoided; at the same time, this strategy greatly improves the efficiency of server use, effectively reduces the degree of resource fragmentation, and promotes the concentration and efficient use of resources.

[0089] In a possible implementation, given that the available resources of each server are different, and the resource requirements of the component groups are also different, coupled with the large number of servers and component groups, a complex and possibly messy allocation environment is formed. In order to ensure that in such an environment, the first search strategy can be fully utilized to comprehensively allocate servers to the component groups, while avoiding the failure of the allocation strategy due to ignoring a certain server combination, this embodiment adopts a method of traversing all potential server combinations. It is intended to significantly improve the success probability of the first allocation strategy, ensure that each component group can be accurately matched to a server that meets its resource requirements, thereby optimizing resource allocation and improving overall system performance. Therefore, in an implementation, a server is allocated to each component group using the first allocation strategy, including: traversing each server combination, determining a target server combination, and using the target server combination as a component allocation result; wherein the server arrangement order in a server combination corresponds to the arrangement order of the component group; the available resources of each server in the target server combination meet the resource requirements of the corresponding component group.

[0090] Optionally, the servers in the server cluster are combined in various forms according to the number of component groups. In the process of combining servers, it is necessary to ensure that the number of servers included in each server combination is not less than the number of component groups, and the total available resources in the server combination meet the total resource requirements. The server combination represents the order of the servers in the combination during the search process.

[0091] Furthermore, the number of servers in the server combination is consistent with the number of component groupings.

[0092] Optionally, in the process of traversing each server combination, the arrangement order of the component groups remains unchanged.

[0093] In some embodiments, when the number of servers is greater than the number of component groups, and the number of servers in the server combination is consistent with the number of component groups, in order to avoid invalid traversal, when determining the server combination, first determine whether the total available resources under various combinations of servers must meet the total resource requirements of the component groups.

[0094] As an example, suppose there are three component groups, namely a1, a2, and a3, and the arrangement order of the component groups is a1, a2, and a3, and there are four servers 1 to 4 in the server cluster. If the total available resources of the combination of server 1, server 2, and server 3 cannot meet the total resource demand, then various combinations including server 1, server 2, and server 3 are excluded from the server combination. Specifically, the combinations of {1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, and {3, 2, 1} are not considered as server combinations.

[0095] In one embodiment of the present application, when traversing server combinations, the available resources of the servers that failed to match in the currently traversed server combinations are used to screen the server combinations that have not been traversed, so as to avoid unnecessary subsequent traversal operations. In this way, server combinations that cannot produce results are pre-empted, thereby reducing the search task volume and significantly improving the search efficiency.

[0096] Based on the above, each server combination is traversed to determine the target server combination, including: based on the currently traversed server combination, the servers in the server combination are matched with the component groupings in turn for resource requirements; in the case of failure to match the server with the component grouping, the currently traversed server combination is updated, and the step of matching the servers in the server combination with the component groupings in turn for resource requirements based on the currently traversed server combination and subsequent steps is returned to execute, until a server combination that meets the search criteria is traversed, and the server combination that meets the search criteria is determined as the target server combination.

[0097] The search conditions include: the servers in the server combination correspond to the component groups one by one, and the available resources of the servers in the server combination are not less than the resource requirements of the corresponding component groups.

[0098] Optionally, updating the currently traversed server combination includes: updating the currently traversed server combination based on the available resources of each server in the traversed server combination, wherein the updated currently traversed server combination does not include a replacement combination of the traversed server combination, and the replacement combination is: replacing the first server in the traversed server combination with the second server, the first server being a server that fails to match the component grouping, and the second server being a server whose available resources are not greater than those of the first server.

[0099] Optionally, the second server is a server whose available resources of the target resource type are not greater than those of the first server, and the target resource type is a resource type in the first server that does not satisfy the component grouping.

[0100] For example, assuming that there are 3 component groups, namely a1, a2, and a3, and assuming that the arrangement order of the component groups is {a1, a2, a3}, assuming that the arrangement order of the component groups is a1, a2, a3, and there are 4 servers 1 to 4 in the server cluster, the server cluster may include: {1, 2, 3}, {1, 2, 4}, {1, 3, 2}, {1, 3, 4}, {1, 4, 2}, {1, 4, 3}, {2, 1, 3} , {2, 1, 4}, {2, 3, 1}, {2, 3, 4}, {2, 4, 1}, {2, 4, 3}, {3, 1, 2}, {3, 1, 4}, {3, 2, 1}, {3, 2, 4}, {3, 4, 1}, {3, 4, 2}, {4, 1, 3}, {4, 1, 2}, {4, 2, 1}, {4, 2, 3}, {4, 3, 1}, {4, 3, 2}, a total of 24 combinations. Assume that the total available resources of each of the 24 combinations are not less than the total resource requirements. Take {1, 2, 3} as the current traversed server combination, and traverse the servers by component grouping, including:

[0101] First, component group a1 is matched with server 1 to determine whether the available resources of server 1 meet the resource requirements of component group a1; if so, component group a1 is allocated to server 1. If not, the subsequent matching task of the server combination is terminated, and one of the remaining 23 server combinations is used to update the currently traversed server combination.

[0102] Among them, before the update, since server 1 (i.e., the first server) failed to match component group a1, that is, the available resources of server 1 were less than the resource requirements of component group a1, then the remaining 23 groups of server combinations were eliminated, and the combination including the server designated to match component group a1 and whose available resources did not exceed server 1 (i.e., the second server) was eliminated.

[0103] The elimination process includes two parts: First, the remaining 23 server combinations with the same server 1 position as the server combination {1, 2, 3} are eliminated. That is, {1, 2, 4}, {1, 3, 2}, {1, 3, 4}, {1, 4, 2}, {1, 4, 3} are eliminated to obtain the remaining 18 server combinations. Second, from the remaining 18 server combinations, the combinations containing servers that are designated to match component grouping a1 and have less available resources than server 1 are eliminated. Assuming that the available resources of server 2 are less than the available resources of server 1, {2, 1, 3}, {2, 1, 4}, {2, 3, 1}, {2, 3, 4}, {2, 4, 1}, {2, 4, 3} are eliminated. Afterwards, the currently traversed server combination is updated with one of the groups {3, 1, 2}, {3, 1, 4}, {3, 2, 1}, {3, 2, 4}, {3, 4, 1}, {3, 4, 2}, {4, 1, 3}, {4, 1, 2}, {4, 2, 1}, {4, 2, 3}, {4, 3, 1}, {4, 3, 2}, and the step of matching component group a1 with server 1 is returned. However, it should be noted that server 1 needs to be replaced with the server at the corresponding position in the updated currently traversed server combination.

[0104] It can be understood that {1, 2, 4}, {1, 3, 2}, {1, 3, 4}, {1, 4, 2}, {1, 4, 3}, {2, 1, 3}, {2, 1, 4}, {2, 3, 1}, {2, 3, 4}, {2, 4, 1}, {2, 4, 3} are replacement combinations of {1, 2, 3}.

[0105] If component group a1 is successfully matched with server 1, component group a2 is matched with server 2 to determine whether the available resources of server 2 meet the resource requirements of component group a2; if so, component group a2 is allocated to server 2. If not, the subsequent matching task of the server combination is terminated, and one of the remaining 23 server combinations is used to update the currently traversed server combination in accordance with the above-mentioned update method, which will not be described in detail here. The matching process of component group a3 can refer to that of component group a2, which will not be described in detail here.

[0106] In another possible implementation, in the currently traversed server combination, the servers and components in the server combination may be grouped to perform parallel matching of resource requirements.

[0107] Optionally, the parallel matching method can be executed by relying on multi-threading or distributed computing. In the multi-threading solution, a dynamic thread pool is constructed to flexibly adjust the number of threads according to the current number of servers in the system. The main thread creates a worker thread. After the main thread creates and starts all worker threads (each worker thread is used to process the matching task of a specific component group), it can wait for these worker threads to complete the task, collect the matching results of each worker thread, and summarize the results to determine whether the currently traversed server combination is matched successfully. If there is no match, the main thread updates the currently traversed server combination and sends the servers in the server combination to the corresponding worker thread to perform a new round of matching tasks through the worker thread. This maximizes the use of system resources and improves the matching speed.

[0108] When faced with a large number of component groups, a distributed computing solution is used to achieve more efficient parallel processing. Under this framework, matching tasks are intelligently assigned to multiple computing nodes. Each computing node focuses on processing its assigned component group and, after completing the matching, aggregates the results to the master node. The master node determines whether the currently traversed server combination is matched successfully. If not, the master node updates the currently traversed server combination and sends the servers in the server combination to the corresponding computing nodes to perform a new round of matching tasks.

[0109] In one embodiment of the present application, when faced with a limited number of servers (i.e., the number of servers is less than the number of component groups and not less than the number of index categories) or the first allocation strategy fails, index categories are configured for component groups, servers are sorted according to the available resources of the servers, and component groups are sorted according to the resource requirements of the component groups, and servers are matched with component groups according to the sorting of servers and component groups under constraints to overcome the allocation problem of component groups due to a limited number of servers or the failure of the first allocation strategy. The success rate of resource allocation is improved while avoiding conflicts caused by resource competition between component groups of different index categories.

[0110] Therefore, under the constraint condition, the second allocation strategy is adopted to allocate servers for component groups, including: for the component groups under the current index category, under the constraint condition, matching is performed according to the preset order of available resources and the preset order of resource requirements of the component groups, until the match is successful or the matching of the last server is completed; if the component groups under the current index category are successfully matched with the server, the available resources of the server are updated based on the resource requirements of the component groups, and the next index category is used as the current index category, and the step of matching the component groups under the current index category under the constraint condition according to the preset order of available resources and the preset order of resource requirements of the component groups and subsequent steps are returned. In the case that all component groups are successfully matched with the server, the component allocation result is obtained based on the successfully matched component groups and servers.

[0111] Optionally, the preset order can be from large to small (corresponding to the maximum adaptation strategy) or from small to large (corresponding to the minimum adaptation strategy). Among them, the minimum adaptation strategy prioritizes matching servers with smaller available resources with component groups with smaller resource requirements under the constraints, which helps to reduce resource waste and ensure that the resources of each server are fully utilized. The maximum adaptation strategy prioritizes matching servers with larger available resources with component groups with larger resource requirements under the constraints, which helps to reduce resource fragmentation. It can achieve centralized allocation of component groups of the same index category, making operations more focused and avoiding the scattered deployment of these components on multiple servers, thereby improving management and maintenance efficiency.

[0112] In some embodiments, the resource types in the server are compared in the order of memory, CPU, and hard disk, that is, the available resources of the memory, the available resources of the CPU, and the available resources of the hard disk are compared in sequence. Of course, the comparison order and resource types can be adjusted at any time according to actual needs.

[0113] For example, the available memory resources of server 1 are 16GB, the available CPU resources are 4, and the available hard disk resources are 500GB; the available memory resources of server 2 are 16GB, the available CPU resources are 8, and the available hard disk resources are 500GB; the available memory resources of server 3 are 32GB, the available CPU resources are 4, and the available hard disk resources are 1000GB; then server 3 has the highest memory usage, and server 1 and server 2 have the same memory usage. Then compare the available CPU resources of server 1 and server 2, where server 2 is higher than server 1. It can be concluded that the order of available resources from large to small is server 3, server 2, and server 1.

[0114] Optionally, the preset order is from small to large; for the component grouping under the current index category, the server and the component grouping are matched according to the preset order of available resources and the preset order of resource requirements of the component grouping under the constraint condition until the match is successful or the matching of the last server is completed, and the component allocation result is obtained, including:

[0115] For the component groups under the current index category, servers and component groups are matched in the order of available resources from small to large and the order of resource requirements of component groups from small to large under the constraints until the match is successful or the matching of the last server is completed.

[0116] If the component group under the current index category successfully matches the server, the available resources of the corresponding server are updated based on the resource requirements of the current index category, and the next index category is used as the current index category. Return to execute the component group under the current index category, and match the server with the component group in the order of available resources from small to large and the resource requirements of the component group from small to large under the constraints until the match is successful or the last server is matched and the subsequent steps are completed. In the case that all component groups are assigned servers, the component allocation results are determined based on the successfully matched component groups and servers.

[0117] Optionally, the component groups are allocated according to the index category, that is, after the component groups in the previous index category are allocated, the component groups in the next index category are allocated.

[0118] For example, refer to Figure 4 , taking the preset order from small to large as an example, assuming that the index categories are labeled A and B, wherein index category A includes 2 component groups, namely component group a1 and component group a2. Index category B includes 2 component groups, namely component group b1 and component group b2. Assume that the resource requirements of the above 4 component groups are in the order of a1, a2, b1, b2 from small to large. Of course, it can also be a random allocation, which is not limited to this embodiment of the present application. If there are 3 servers 1~3, based on the order of available resources from small to large, it is assumed that they are server 1, server 2, and server 3.

[0119] First, assign a server to component group a1, search server 1, and determine whether the available resources of server 1 meet the resource requirements of component group a1; if so, assign component group a1 to server 1. If not, search server 2 and perform the same determination steps as server 1, and so on.

[0120] If component group a1 is allocated to server 1, the available resources in server 1 are updated. Then, the server is allocated to component group a2. First, server 1 is searched. If the updated available resources of server 1 can meet the resource requirements of component group a2, component group a2 is deployed in server 1. If not, server 2 is searched to determine whether the available resources of server 2 meet the resource requirements of component group a2. If so, component group a2 is allocated to server 2. If not, server 3 is searched and the same judgment steps as server 1 are performed.

[0121] If component group a1 is allocated to server 1 and component group a2 is allocated to server 2, the available resources in server 2 are updated. Since component group a1 is allocated to server 1 and component group a2 is allocated to server 2, and the component groups of different index categories included in the constraint conditions are allocated to different servers, the resource demand judgment process of server 1 and server 2 for component group b1 is skipped, and server 3 is searched to determine whether the available resources of server 3 meet the resource demand of component group b1. If so, component group b1 is allocated to server 3. If not, a prompt message is displayed.

[0122] If component group b1 is allocated to server 3, the available resources in server 3 are updated. Then, component group b2 is allocated to a server. First, server 3 is searched. If the updated available resources of server 3 can satisfy component group b2, component group b2 is deployed in server 3. If not, the second allocation strategy is confirmed to have failed.

[0123] Understandably, Figure 4 The allocation process using the second allocation strategy under the constraint condition is simply shown, and the specific details are subject to the above text description.

[0124] In one implementation, matching is performed according to a preset order of available resources and a preset order of resource requirements of component groups until a match is successful, including: determining the current component grouping according to the preset order of resource requirements, and determining the current server that matches the current component grouping according to the preset order of available resources; if the current component grouping successfully matches the current server, updating the available resources of the current server using the resource requirements of the current component grouping; updating the preset order of available resources using the updated available resources of the current server, and returning to execute the step of determining the current component grouping according to the preset order of resource requirements and subsequent steps.

[0125] As an example, taking the preset order as the order from small to large, based on the above Figure 4In the index category, component group and server, first assign a server to component group a1, assuming that component group a1 is assigned to server 2, and update the available resources in server 2. Then re-sort the three servers 1 to 3, assuming that the new sorting is server 2, server 1, server 3. Use the new sorting to update the preset sequence of the servers, and when subsequently assigning a server to component group a2, first match component group a2 with server 2 to confirm whether the available resources of server 2 meet the resource requirements of component group a2. The same applies to other unassigned component groups, which will not be repeated here.

[0126] In a possible implementation, the preset order includes an order from small to large and / or an order from large to small; if the second allocation strategy fails to allocate the servers in the order from small to large, in order to successfully allocate the servers to the component groups, the available resources of the servers and the resource requirements of the component groups are matched again in the order from large to small. Therefore, the method also includes: if the component groups under the current index category are matched in the order from small to large of available resources and the order from small to large of resource requirements of the component groups under the constraints until the last server is matched, then the preset order is updated to the order from large to small, and the component groups under the current index category are re-executed under the constraints according to the preset order from small to large of available resources and the resource requirements of the component groups until the matching is successful or the matching of the last server is completed and the subsequent steps.

[0127] Therefore, for the component groupings under the current index category, servers and component groupings are matched according to the order of available resources from small to large and the order of resource requirements of component groupings from small to large under constraints until the match is successful or the matching of the last server is completed, and then it also includes: if the component groupings under the current index category fail to match with all servers, then, under the constraints, the third allocation strategy is used to allocate servers to all component groups; servers and component groupings are matched according to the order of available resources of the servers from large to small and the order of resource requirements of the component groupings from large to small.

[0128] For the component grouping under the current index category, under the constraint condition, the server and the component grouping are matched in the order of the available resources of the server from large to small, and the resource requirements of the component grouping from large to small, until the match is successful or the matching of the last server is completed; if the component grouping under the current index category is successfully matched with the server, the available resources of the corresponding server are updated based on the resource requirements of the current index category, and the next index category is used as the current index category, and the execution of the step and subsequent steps of matching the server and the component grouping under the current index category under the constraint condition in the order of the available resources of the server from large to small, and the resource requirements of the component grouping from large to small, until the match is successful or the matching of the last server is completed; when all component groups and servers are successfully matched, the component allocation result is determined based on the successfully matched component groups and servers.

[0129] It should be noted that, in the embodiment of using the third allocation strategy to allocate component groups, Figure 4 The resource requirements of the four component groups are modified to be in the order of b2, b1, a2, a1 from large to small, and the available resources of the servers are modified to be in the order of server 3, server 2, server 1 from large to small. Figure 4 The embodiment in which the component groups are allocated in the order from small to large is not described in detail here.

[0130] In one embodiment of the present application, after the component group allocation is initially completed, in order to further optimize the resource utilization efficiency, the component groups between the servers will be allocated and adjusted according to the resource occupancy rate of each server and / or the allocated number of component groups based on the principle of resource balancing. Therefore, after using the first allocation strategy to allocate a server to each component group or using the second allocation strategy to allocate servers to component groups under constraints, it also includes: determining the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups based on the component allocation result; and adjusting the allocation of component groups based on the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups.

[0131] Optionally, the resource usage rate of the server obtained based on the resource usage in the server includes: memory usage percentage, CPU usage percentage, mechanical hard disk usage percentage and / or solid state drive usage percentage.

[0132] In some embodiments, the comparison order is based on the memory occupancy percentage, CPU occupancy percentage, mechanical hard disk occupancy percentage, and solid-state hard disk occupancy percentage (custom comparison rules can also be used). If two servers are compared, they are compared in the above comparison order. If the previous item in the comparison order is the same, the next item is compared. If the previous item is different, the resource occupancy rate of the two servers can be determined.

[0133] For example, the memory usage percentage of server 1 is 80%, and the CPU usage percentage is 40%, the memory usage percentage of server 2 is 75%, and the CPU usage percentage is 40%, and the memory usage percentage of server 3 is 75%, and the CPU usage percentage is 41%. By comparison, we can see that server 1 has the highest memory usage percentage, followed by server 2 and server 3, which have the same memory usage percentage; then comparing the CPU usage percentages of server 2 and server 3, we can see that server 3 has a higher usage percentage than server 2. So we can get the resource usage percentage ranking from high to low as server 1, server 3, and server 2.

[0134] In one of the embodiments of the present application, in order to fully and efficiently utilize server resources, component groups of servers with high resource utilization and servers with low resource utilization are exchanged, or some component groups of a server with a larger number of component groups are transferred to a server with a smaller number of component groups, so as to achieve a balanced configuration of server resources and ensure that the resources of each server can be efficiently utilized.

[0135] Therefore, based on the resource occupancy rate of each server in the server cluster and / or the allocated quantity of the component group, the allocation adjustment of the component group is performed, including:

[0136] Optionally, if there are a third server and a fourth server in the server cluster, the component groups in the third server are adjusted and allocated to the fourth server with the goal of ensuring that the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is not greater than a preset difference; wherein the allocated number of component groups in the third server is greater than the allocated number of component groups in the fourth server, and the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is greater than the preset difference, and the index categories of the component groups in the third server and the fourth server are the same, and the resource configuration data of the third server is consistent with the resource configuration data in the fourth server.

[0137] Optionally, the resource configuration data of the server is used to represent the configured resource amount of the CPU, memory, and hard disk, and the configured resource amount includes occupied resources and unoccupied resources.

[0138] As an example, see Figure 5 , set the preset difference value to 1, traverse all servers, and select servers with the same index category and resource configuration data for the allocated component resources. Select two servers (assuming they are server 1 and server 2), and compare the number of component groupings allocated in server 1 and server 2. Assume that the number of component groups in server 1 (such as Figure 5 3) and the number of components grouped with server 2 (as shown in Figure 5 If the difference between the two components shown in FIG1 and FIG2 is 2 is greater than 1, one of the component groups of server 1 is transferred to server 2 based on the preset difference. In this way, through adjustment, the resource allocation between servers is balanced and the stability and efficiency of the system are maintained.

[0139] Optionally, the difference between the difference between the number of component groups allocated in the third server and the number of component groups allocated in the fourth server and a preset difference is determined, and if the difference is less than or equal to the preset difference, the component groups in the third server with the number of the difference are transferred to the fourth server. If the difference is greater than the preset difference, the component groups in the third server with half the number of the difference are transferred to the fourth server.

[0140] It can be understood that if the difference is an odd number, after the third server is transferred to the fourth server, the number of component groups allocated in the fourth server is one less than the number of component groups allocated in the third server. For example, when the difference is 3, one component group in the third server is transferred to the fourth server. If the difference is an even number, half of the component groups in the difference are transferred to the fourth server.

[0141] Optionally, if there are a fifth server and a sixth server in the server cluster, the component grouping in the fifth server and the component grouping in the sixth server are allocated and exchanged; wherein, the resource occupancy rate of the fifth server is less than the resource occupancy rate of the sixth server, and the resource configuration data of the fifth server is greater than the resource configuration data of the sixth server.

[0142] It can be understood that the allocation exchange of component groups between two servers is applied to different resource configuration data between the servers, and the allocation number of component groups in the server with larger resource configuration data is smaller.

[0143] As an example, see Figure 6 , refer to Figure 5 , set the preset difference value to 1, traverse all servers, select server 3 and server 4; among them, the resource configuration data of server 3 is larger and the number of component groupings allocated is smaller, and the resource configuration data of server 4 is smaller and the number of component groupings allocated is larger. Then exchange the component groups of server 4 and server 3.

[0144] In a possible implementation, considering that the logic of component allocation is allocated with component group as the smallest unit, the middleware selection set in the component group is firstly used. If the component group does not have a specific middleware assigned, the corresponding middleware will be searched from the server where the component group is deployed. If the server does not have a middleware, the middleware of the server with the component group of the same "index category" deployed will be searched. If no middleware is found, the global default middleware will be used.

[0145] The middleware is a component that can provide a single basic service, including database, message service, cache service, etc. For example, the middleware can be a component module corresponding to the dependent component shown in Table 1.

[0146] In actual applications, when a product needs to be deployed, the components in the product are allocated to the server based on the above-mentioned component allocation method.

[0147] After the successfully matched component grouping and the server obtain the component grouping result, a product deployment strategy (i.e., the prefabricated deployment strategy hereinafter) can be generated based on the component grouping result, so as to perform the deployment of related components based on the component deployment list. Therefore, the embodiment of the present application also provides a product deployment method, referring to Figure 7 , Figure 7 A schematic flow chart of a product deployment method provided in an embodiment of the present application is shown, and the product deployment method is applied to a terminal device, and the terminal device includes an installation package of the product, and the installation package of the product includes an interface program module, a background service program module, and a product package. As an example but not a limitation, the product deployment method includes the following steps:

[0148] Step 701, triggering the interface program module to obtain a component deployment list of the product.

[0149] In an application scenario, an installation tool can be made, and the installation tool is combined with the product package of the product to form the product installation package, and the technical support personnel copy the product installation package to the terminal device. The installation tool includes an interface program module that can run on the terminal device and a background service program module that can run on the first target server. For example, if the operating system of the terminal device is a Windows system, then the interface program module needs to be able to run on the Windows system.

[0150] Before executing step 701, the terminal device needs to run the interface program module first, and then execute step 701 based on running the interface program module. For example, the technical support personnel can double-click the interface program module to realize the operation of the interface program module.

[0151] The component deployment list includes a list of components that need to be installed on each target server. The target server is the server on which the product is to be deployed, that is, the server on which the components of the product need to be deployed. The number of target servers can be at least one. Optionally, the number of target servers can be determined based on the scale of the product deployment site. For example, the larger the scale of the deployment site, the more target servers there are, and the more second target servers need to be added.

[0152] When the number of target servers is equal to 1, the target server is the first target server. When the number of target servers is greater than 1, the target servers may include at least one second target server in addition to the first target server, and the first target server and the second target server jointly implement the installation of product components. For example, the number of target servers is 2, including one first target server and one second target server respectively, and the component deployment list includes 20 components, 8 components can be installed on the first target server, and 12 components can be installed on the second target server.

[0153] In a possible implementation, the terminal device may fill in the device information of each target server to the interface program module; and the interface program module is triggered to determine the first target server based on the device information of each target server.

[0154] The device information of the target server includes but is not limited to the Internet Protocol (IP) address, user name and password of the target server.

[0155] Optionally, the filling order of the device information of each target server may be determined, and the target server corresponding to the device information arranged at a preset position in the filling order may be determined as the first target server. For example, the target server corresponding to the first filled device information may be determined as the first target server.

[0156] Of course, the first target server may also be determined by other means (for example, a technical support person specifies the first target server), and this application does not limit this.

[0157] In one embodiment, after the terminal device fills in the device information of each target server to the interface program module, it can also trigger the interface program module to send the device information of each target server to the first target server, so that the first target server automatically adds each target server to the operation and maintenance platform based on the device information of each target server.

[0158] The component list that needs to be installed on each target server may include identification information of at least one component to indicate that the corresponding component needs to be installed on the corresponding target server. For example, if the component list that needs to be installed on target server A includes identification information of component A and identification information of component B, then the component list may indicate that component A and component B need to be installed on target server A. The identification information of the above components may be used to identify the uniqueness of the components. For example, the name of the component may be used as the identification information of the component.

[0159] It should be noted that the product includes many components, and the components in the component list of the above component deployment list may be some of all the components of the product, or may be all the components, which are related to the sales items of the product purchased by the user. If the user has purchased all the sales items of the product, then it can be determined that the components in the component list of the above component deployment list are all the components of the product. If the user has purchased some of the sales items of the product, then it can be determined that the components in the component list of the above component deployment list are components associated with the some of the sales items purchased by the user. The sales items of the product can be understood as the business functions of the product.

[0160] In a possible implementation, triggering the interface program module to obtain a component deployment list of a product includes: triggering the interface program module to obtain a target component list of the product; triggering the interface program module to determine a list of components to be installed on each target server from the target component list based on the number of target servers and available resources; triggering the interface program module to generate a component deployment list based on the list of components to be installed on each target server. The target component list may include identification information of components to be deployed to each target server.

[0161] The available resources of the target server include, but are not limited to, at least one of the following resource types: the number of central processing units (CPUs), memory, and hard disks (including solid state drives (SSDs) and / or hard disk drives (HDDs)).

[0162] When determining the list of components that need to be installed on each target server, the interface program module can be triggered to determine the number of components of each target server based on the number of target servers and available resources, and based on the number of components of each target server, determine the list of components that need to be installed on each target server from the target component list.

[0163] As an example but not limitation, based on the number of components of each target server, a corresponding number of components can be allocated to each target server according to the order of components in the target component list, or the components in the target component list can be randomly allocated to each target server and the number of components randomly allocated to each target server can be the corresponding number of components.

[0164] In one possible implementation, the product installation package also includes the product's sales items and a component association table, which triggers the interface program module to obtain the product's target component list, including: triggering the interface program module to determine the component list associated with the sales items in the product's authorization file from the association table, and generating a target component list.

[0165] In one application scenario, in addition to making an installation tool, you can also make a relationship table between the sales items and components of the product, and combine the made installation tool, the relationship table and the product package to form the installation package of the product. Therefore, the above relationship table can be determined from the installation package of the product. Optionally, the above relationship table describes the list of components associated with each sales item of the product, that is, the list of components involved in each business function of the product.

[0166] The interface program module can determine the components that need to be installed through the sales items in the authorization file purchased by the user in combination with the above-mentioned association relationship table, thereby generating a target component list.

[0167] In a possible implementation, the terminal device can import the authorization file into the interface program module, and on this basis, the interface program module can generate a target component list based on the authorization file. For example, after the terminal device runs the interface program module, it can trigger the interface program module to display an authorization file import page, and the technical support personnel import the authorization file of the product purchased by the user on the authorization file import page, thereby importing the authorization file into the interface program module.

[0168] Since the above-mentioned association table describes the list of components associated with each sales item of the product, you can first find the sales item in the authorization file from the above-mentioned association table, and then find the list of components associated with the sales item in the above-mentioned association table, so as to obtain the list of components associated with the sales item in the authorization file.

[0169] In a possible implementation, the installation package of the product also includes a web component deployment strategy of the product, the web component deployment strategy represents the allocation rules of the web components in the web container of the product and the parameter configuration information of the web container, and the triggering interface program module generates a component deployment list based on the list of components to be installed on each target server, including:

[0170] The triggering interface program module determines the number of web containers to be installed on each target server, the list of web components to be run in each web container, and the parameter configuration information of each web container based on the list of components to be installed on each target server and the web component deployment strategy;

[0171] The trigger interface program module generates a component deployment list based on a list of components to be installed on each target server, the number of web containers, a list of web components to be run in each web container, and parameter configuration information of each web container.

[0172] In one application scenario, in addition to making installation tools and a relationship table between the sales items and components of the product, a web component deployment strategy can also be made, and the installation tools, relationship table, web component deployment strategy and product package are combined to form the product installation package. Therefore, the web component deployment strategy can be determined from the product installation package. By configuring the above installation tools, relationship table and web component deployment strategy in the product installation package in advance, all configuration operations involved in the product deployment process can be completed in advance. After the configuration is completed, the product installation and subsequent authorization activation operations can be completed at one time.

[0173] Optionally, the allocation rules of the product's web components and the parameter configuration information of the web container can be set on the basis of considering improving product stability and facilitating later maintenance. The above allocation rules include, but are not limited to, specifying that a certain web component is deployed separately in a web container, limiting the upper limit of web components deployed in a web container, and specifying that certain web components are deployed in the same web container. For example, the device access component is deployed separately in a web container, and the corresponding web components such as the one-card pass and the parking lot are deployed in the same web container. When setting the parameter configuration information of the web container, it can be set based on the performance of the web components that need to be installed in the web container and / or the number of web components that need to be installed. For example, if the performance of a web component is relatively high, more memory can be allocated to the web container where the web component is installed; if there are many web components that need to be installed in a web container, more memory and threads can be allocated to the web container.

[0174] Step 702, triggering the interface program module to send the product package, the background service program module and the component deployment list to the first target server of the target server, so that the first target server triggers the background service program module to control each target server to install the corresponding components in the product package based on the component deployment list.

[0175] The terminal device sends the product package, background service program module, component deployment list and other contents to the first target server by triggering the interface program module, which does not require the participation of technical support personnel and can shield the interaction between the technical support personnel and the first target server.

[0176] In one possible implementation, after executing step 702, the terminal device can also trigger the interface program module to obtain the installation progress of the components on each target server, where the components on each target server are components in the list of components that need to be installed on each target server; when the installation progress of the components on each target server indicates that the installation is complete, the interface program module is triggered to activate the components installed on each target server based on the product authorization file.

[0177] Since the authorization file is imported into the interface program module before the component is installed, the interface program module can directly activate the component based on the authorization file after the component is installed. This process does not require human intervention, which improves the authorization activation efficiency of the product.

[0178] In order to facilitate technical support personnel to understand the installation progress of components, after the first target server feeds back the installation progress of components on each target server to the terminal device, the terminal device can trigger the interface program module to display the installation progress of components on each target server in real time.

[0179] The embodiment of the present application can shield the interaction between technical support personnel and the first target server through the interface program module, and there is no need for technical support personnel to participate in the above-mentioned product deployment process. By triggering the interface program module to send the product package, background service program module and component deployment list to the first target server, the first target server can automatically install the components of the product based on this information, thereby realizing automatic deployment of the product, reducing the difficulty of product deployment operations, and improving product availability.

[0180] See also Figure 8 , Figure 8 Another schematic flow chart of the product deployment method provided in the embodiment of the present application is shown, and the product deployment method is applied to the first target server. As an example but not limitation, the product deployment method includes the following steps:

[0181] Step 801, receiving a product package, a background service program module and a component deployment list from a terminal device.

[0182] The component deployment list includes a list of components that need to be installed on each target server, where the target server is the server on which the product is to be deployed. The background service program module is used to complete the product installation. Product installation includes but is not limited to the installation of the product's operation and maintenance platform and the installation of components.

[0183] In one possible implementation, when the number of target servers is an integer greater than 1, the target server also includes a second target server, and when receiving the product package, the background service program module and the component deployment list from the terminal device, the device information of each target server from the terminal device can also be received; the background service program module is triggered to install the product based on the product package. The operation and maintenance platform, and based on the device information of each target server, each target server is added to the operation and maintenance platform.

[0184] The first target server adds each target server to the operation and maintenance platform by triggering the background service program module. This process does not require manual participation, thereby improving the efficiency of adding target servers.

[0185] The above product package includes an installation package of the product's operation and maintenance platform. The first target server can trigger the background service program module to install the operation and maintenance platform based on the installation package of the operation and maintenance platform in the product package. After each target server is added to the operation and maintenance platform, the components installed on each target server can be managed and maintained through the operation and maintenance platform.

[0186] After adding each target server to the operation and maintenance platform, the background service program module can add more target servers at the product deployment site, thereby achieving coordinated allocation of product components and improving component installation efficiency and product operation efficiency.

[0187] Step 802 , triggering the background service program module to control each target server to install the corresponding components in the product package based on the component deployment list.

[0188] The first target server controls the corresponding components in the product package installed on each target server by triggering the background service program module based on the component deployment list, thereby realizing automatic installation of product components, thereby realizing automatic deployment of the product, reducing the difficulty of product deployment operations, and improving product availability.

[0189] The component deployment list includes a list of components that need to be installed on each target server. Any component list includes identification information of at least one component. Based on the identification information of the component, the installation package of the component can be found in the product package, and the component can be installed on the corresponding target server based on the installation package of the component. For example, the list of components that need to be installed on target server A includes identification information of component A and identification information of component B. Based on the identification information of component A and identification information of component B, the installation packages of component A and component B can be found in the product package. Based on the installation package of component A, target server A can be controlled to install component A, and based on the installation package of component B, target server A can be controlled to install component B.

[0190] In a possible implementation, the component deployment list also includes the number of web containers to be installed on each target server, a list of web components to be run in each web container, and parameter configuration information of each web container. The triggering background service program module controls each target server to install the corresponding component in the product package based on the component deployment list, including:

[0191] For any target server, trigger the background service program module to determine the installation package of the non-web component of the target server, the installation package of the web container, and the installation package of the web component to be run in each web container from the product package based on the component deployment list, and the non-web component of the target server is the non-web component in the list of components to be installed on the target server;

[0192] The triggering background service program module controls the target server to install the corresponding components based on the installation package of the non-web components of the target server, the installation package of the web container, the installation packages of the web components that need to be run in each web container, and the parameter configuration information of each web container.

[0193] In order to distinguish web components from other components in the product, the components of the product can be divided into web components and non-web components. Non-web components are components of the product other than web components. The components that need to be installed on any target server usually include web components and non-web components. Web components are usually installed in web containers, so the product package also includes the installation package of the web container. Based on the installation package of the web container, a corresponding number of web containers can be installed on the corresponding target server.

[0194] Of course, it is understandable that the components that need to be installed on any target server may all be web components or all be non-web components. For a target server where all components that need to be installed are web components, the background service program module can be triggered to determine the installation package of the web container and the installation package of the web component that needs to be installed on the target server from the product package based on the component deployment list, and based on the installation package of the web container, the installation package of the web component that needs to be installed on the target server, and the parameter configuration information of each web container that needs to be installed on the target server, control the target server to install the corresponding web component. For a target server where all components that need to be installed are non-web components, the background service program module can be triggered to determine the installation package of the non-web component that needs to be installed on the target server from the product package based on the component deployment list, and based on the installation package of the non-web component, control the target server to install the corresponding non-web component.

[0195] Of course, it is understandable that the first target server can also trigger the background service program module in other ways to control the corresponding components in the installation product package of each target server based on the component deployment list, and this application does not limit this.

[0196] In a possible implementation, the process of controlling the first target server to install the corresponding component is as follows:

[0197] The background service program module is triggered to install a corresponding number of web containers on the first target server based on the installation package of the web container, and to update the parameters of the corresponding web container based on the parameter configuration information of each web container.

[0198] The triggering background service program module installs the web component into the corresponding web container based on the installation package of the web component that needs to be run in each web container.

[0199] The background service program module is triggered to install the non-web component to a designated location of the first target server based on the installation package of the non-web component.

[0200] For the first target server, the corresponding number may refer to the number of web containers that need to be installed on the first target server.

[0201] The updating of the parameters of the corresponding web container based on the parameter configuration information of each web container may be that after each web container is installed, the parameters of each web container are set or updated to the corresponding parameter configuration information.

[0202] The above-mentioned designated location may refer to a pre-set installation path of the non-web component.

[0203] In a possible implementation, when the number of target servers is greater than 1, the target servers further include a second target server, and the process of controlling the second target server to install the corresponding component is as follows:

[0204] The background service program module is triggered to send the installation package of the non-web component of the second target server, the installation package of the web container, the installation package of the web component that needs to be run in each web container, and the parameter configuration information of each web container to the second target server. The installation package of the non-web component of the second target server, the installation package of the web container, the installation package of the web component that needs to be run in each web container, and the parameter configuration information of each web container are used to instruct the second target server to install the corresponding component.

[0205] After the second target server receives the installation package of the non-web component, the installation package of the web container, the installation package of the web component to be run in each web container, and the parameter configuration information of each web container sent by the first target server, the installation process of its components is the same as the installation process of the components on the first target server. The specific process can be found in the relevant description of the component installation on the first target server, which will not be repeated here.

[0206] In a possible implementation, the process of controlling each target server to install a corresponding component in the product package further includes:

[0207] The background service program module is triggered to obtain the installation progress of the components on each target server, and send the installation progress of the components on each target server to the terminal device. The components on each target server are components in the component list that needs to be installed on each target server.

[0208] The first target server sends the installation progress of the components on each target server to the terminal device, which can facilitate the terminal device to understand the installation status of the components on each target server and quickly activate the components installed on each target server when the installation is completed, thereby improving the authorization activation efficiency of the product.

[0209] The embodiment of the present application can realize automatic installation of product components by receiving product packages, background service program modules and component deployment lists from terminal devices, and triggering the background service program modules to control the installation of corresponding components on each target server based on the product packages and component deployment lists, thereby realizing automatic deployment of products, reducing the difficulty of product deployment operations and improving product availability.

[0210] like Fig. 9 The following is an example diagram of a product deployment process provided by an embodiment of the present application. The product deployment process is described as follows:

[0211] 1. Create a product installation package and copy the product installation package to the terminal device. That is, the technical support personnel copy the installation package to the terminal device.

[0212] 2. The terminal device runs the interface program module in the product installation package, and imports the authorization file purchased by the user on the authorization file import page displayed in the interface program module, and fills in the server information (that is, the device information of each target server to be added) on the server filling page displayed in the interface program module.

[0213] 3. The terminal device trigger interface program module generates a final component deployment list through the authorization file, combined with the deployment strategy preset in the product installation package, the association table between sales items and components, and the number of added target servers.

[0214] 4. The terminal device triggers the interface program module to upload the product package, the background service program module and the component deployment list to the first target server.

[0215] 5. The first target server runs the background service program module so that the background service program module can be triggered and used later.

[0216] 6. The first target server triggers the background service program module to install the operation and maintenance platform based on the installation package of the operation and maintenance platform in the product package.

[0217] 7. The first target server triggers the background service program module to add each target server on the operation and maintenance platform.

[0218] 8. The first target server triggers the background service program module to install components based on the product package and component deployment list.

[0219] 9. After the installation is completed on each target server, the terminal device triggers the interface program module to import the authorization file and activate the product.

[0220] Depend on Fig. 9 It can be seen from the described product deployment process that the embodiment of the present application can deploy the product to each target server by running the interface program module on the terminal device, which reduces the difficulty of technical support personnel to deploy the product. The list of components to be installed this time can be determined by the sales items purchased in the authorization file, which can avoid the problem of missing or overinstalling. According to the deployment strategy, the web components running in the web container are reasonably allocated and the parameters are optimized, which improves the stability of the product to a certain extent and facilitates later maintenance.

[0221] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0222] Corresponding to the resource allocation method described in the above embodiment, Figure 7 A structural block diagram of a resource allocation device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0223] Reference Fig.10 The resource allocation device includes: an acquisition module 1001, a resource judgment module 1002, a resource allocation module 1003 and a resource balancing module 1004, wherein:

[0224] The acquisition module 1001 is used to acquire the number of servers in the server cluster, the available resources of each server, and the resource requirements of each component group to be allocated; the component group includes at least one component; wherein the components in the same component group are allocated to the same server;

[0225] The resource determination module 1002 is used to determine the total available resources of the server cluster according to the available resources of each server, and determine the total resource demand according to the resource demand of each component group, and determine whether the total available resources meet the total resource demand;

[0226] The resource allocation module 1003 is configured to allocate a server to each component group using a first allocation strategy if the number of servers is not less than the number of component groups;

[0227] The resource allocation module 1003 is also used to allocate servers to component groups using a second allocation strategy under constraints if the number of servers is less than the number of component groups and not less than a first threshold, or if the allocation using the first allocation strategy fails; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: component groups of different index categories are allocated to different servers, and component groups of the same index category are preferentially allocated to the same server.

[0228] In one possible implementation, the resource allocation module 1003 is specifically used to traverse each server combination, determine the target server combination, and use the target server combination as the component allocation result; wherein the arrangement order of servers in a server combination corresponds to the arrangement order of the component groupings; the available resources of each server in the target server combination meet the resource requirements of the corresponding component groupings.

[0229] In a possible implementation, the resource allocation module 1003 is specifically configured to:

[0230] Based on the currently traversed server combination, the servers in the server combination are matched with the component groups in turn for resource requirements; in the event that the matching between the server and the component group fails, the currently traversed server combination is updated, and the step of matching the servers in the server combination with the component groups in turn for resource requirements based on the currently traversed server combination and subsequent steps are returned until a server combination that meets the search criteria is traversed, and the server combination that meets the search criteria is determined as the target server combination.

[0231] The currently traversed server combination is updated based on the available resources of each server in the traversed server combination, wherein the updated currently traversed server combination does not include a replacement combination of the traversed server combination, and the replacement combination is: replacing the first server in the traversed server combination with the second server, the first server being a server that fails to match the component grouping, and the second server being a server whose available resources are not greater than those of the first server.

[0232] In one possible implementation, the resource allocation module 1003 is specifically used to match the component grouping under the current index category, under constraints, in accordance with a preset order of available resources and a preset order of resource requirements of the component grouping, until the match is successful or the matching of the last server is completed; if the component grouping under the current index category is successfully matched with the server, the available resources of the server are updated based on the resource requirements of the component grouping, and the next index category is used as the current index category, and the step and subsequent steps of matching the component grouping under the current index category, under constraints, in accordance with a preset order of available resources and a preset order of resource requirements of the component grouping are returned; when all component groups are successfully matched with the server, the component allocation result is obtained based on the successfully matched component grouping and server.

[0233] In one possible implementation, the preset order is from small to large; the resource allocation module 1003 is specifically used to match according to the preset order of available resources and the preset order of resource requirements of the component grouping until the match is successful, including: determining the current component grouping according to the preset order of resource requirements, and determining the current server matching the current component grouping according to the preset order of available resources; if the current component grouping successfully matches the current server, then using the resource requirements of the current component grouping to update the available resources of the current server; using the updated available resources of the current server to update the preset order of available resources, and returning to execute the step of determining the current component grouping according to the preset order of resource requirements and subsequent steps.

[0234] In one possible implementation, the preset order includes an order from small to large and / or an order from large to small; the resource allocation module 1003 is specifically used to update the preset order to an order from large to small if, for the component grouping under the current index category, under constraints, the matching is performed in the order of available resources from small to large and the order of resource requirements of the component grouping from small to large until the matching of the last server is completed, and re-execute the step and subsequent steps of matching the component grouping under the current index category under constraints according to the preset order of available resources from small to large and the order of resource requirements of the component grouping until the matching is successful or the matching of the last server is completed.

[0235] In one possible implementation, the resource balancing module 1004 is used to determine the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups based on the component allocation results; and adjust the allocation of component groups based on the resource occupancy rate of each server in the server cluster and / or the allocated number of component groups.

[0236] In a possible implementation, the resource balancing module 1004 is specifically configured to:

[0237] If there are a third server and a fourth server in the server cluster, the component groups in the third server are adjusted and allocated to the fourth server with the goal that the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is not greater than the preset difference.

[0238] Among them, the allocated number of component groups in the third server is greater than the allocated number of component groups in the fourth server, and the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is greater than a preset difference, and the index categories of the component groups in the third server and the fourth server are the same, and the resource configuration data of the third server is consistent with the resource configuration data in the fourth server.

[0239] If there are a fifth server and a sixth server in the server cluster, the component grouping in the fifth server and the component grouping in the sixth server are allocated and exchanged; wherein the resource occupancy rate of the fifth server is less than the resource occupancy rate of the sixth server, and the resource configuration data of the fifth server is greater than the resource configuration data of the sixth server.

[0240] It should be understood that the various units recorded in the resource allocation device and the reference Figure 2 The various steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the resource allocation device and the units contained therein, and will not be repeated here. The resource allocation device can be pre-implemented in the browser or other security applications of the electronic device, and can also be loaded into the browser or its security application of the electronic device by downloading or the like. The corresponding units in the resource allocation device can cooperate with the units in the electronic device to implement the solution of the embodiment of the present application.

[0241] The several modules or units mentioned in the above detailed description are not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0242] It should be noted that for details not disclosed in the resource allocation device of the embodiment of the present application, please refer to the details disclosed in the above embodiments of the present application, which will not be repeated here.

[0243] Reference below Fig.11 , Fig.11 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application is shown. Fig.11As shown, the electronic device 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation instructions of the electronic device are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0244] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0245] In particular, according to an embodiment of the present application, the above reference flow chart Figure 2 The described process can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1109, and / or installed from a removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the electronic device of the present application are executed.

[0246] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction-executing electronic device, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium such as a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0247] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operating instructions of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the aforementioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operating instruction, or can be implemented with a combination of dedicated hardware and computer instructions.

[0248] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor, for example, it may be described as follows: a processor includes an acquisition module, a merging module, and a transmission module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0249] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment, or may exist independently without being installed in the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the resource allocation method described in the present application or. For example, it can be executed Figure 2 The various steps of the resource allocation method are shown.

[0250] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the present application embodiment is executed. For example, Figure 2 The various steps of the resource allocation method are shown.

[0251] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) by each other to form a technical solution.

Claims

1. A resource allocation method, characterized in that: include: Obtain the number of servers in the server cluster, the available resources of each server, and the resource requirements of each component group to be allocated; The component group includes at least one component; wherein the components in the same component group are allocated to the same server; Determining the total available resources of the server cluster according to the available resources of each of the servers, and determining the total resource demand according to the resource demand of each of the component groups, and determining that the total available resources meet the total resource demand; If the number of the servers is not less than the number of the component groups, one server is allocated to each of the component groups; If the number of the servers is less than the number of the component groups and not less than the first threshold, or the allocation of one server to each component group fails, the server is allocated to the component group under a constraint condition; wherein each component group is configured with an index category, and the first threshold is the number of the index categories; the constraint condition includes: the component groups of different index categories are allocated to different servers, and the component groups of the same index category are preferentially allocated to the same server; The allocating servers to the component groups under constraints includes: matching the component groups with the servers under the constraints in accordance with a preset order of the available resources and a preset order of the resource requirements of the component groups, and allocating the servers to the component groups.

2. The resource allocation method according to claim 1, characterized in that: The step of allocating a server to each component group comprises: Traverse each server combination, determine the target server combination, and use the target server combination as the component allocation result; wherein the arrangement order of servers in the server combination corresponds to the arrangement order of the component grouping; and the available resources of each server in the target server combination meet the resource requirements of the corresponding component grouping.

3. The resource allocation method according to claim 2, characterized in that: The traversing each server combination to determine the target server combination includes: Based on the currently traversed server combination, the servers in the server combination are sequentially matched with the component groups to perform resource requirements; In the case where the server fails to match the component group, the currently traversed server combination is updated, and the step of matching the resource requirements of the servers in the server combination with the component group in sequence based on the currently traversed server combination and subsequent steps are returned until a server combination that meets the search condition is traversed, and the server combination that meets the search condition is determined as the target server combination; The updating of the currently traversed server combination comprises: The currently traversed server combination is updated based on the available resources of each server in the traversed server combination, wherein the updated currently traversed server combination does not include a replacement combination of the traversed server combination, and the replacement combination is: replacing the first server in the traversed server combination with a second server, the first server being a server that fails to match the component grouping, and the second server being a server whose available resources are not greater than those of the first server.

4. The resource allocation method according to claim 1, characterized in that: The matching of the component groups with the servers under the constraint conditions according to the preset order of the available resources and the preset order of the resource requirements of the component groups, and allocating the servers to the component groups, comprises: For the component group under the current index category, matching is performed according to the preset order of the available resources and the preset order of the resource requirements of the component group under the constraint condition until the matching is successful or the matching of the last server is completed; If the component group under the current index category successfully matches the server, then based on the resource requirements of the component group, the available resources of the server are updated, and the next index category is used as the current index category, and the step of matching the component group under the current index category according to the preset order of the available resources and the preset order of the resource requirements of the component group under the constraint condition and subsequent steps are returned; In the case that all component groups are successfully matched with servers, component allocation results are obtained based on the successfully matched component groups and servers.

5. The resource allocation method according to claim 4, characterized in that: The matching is performed according to the preset order of the available resources and the preset order of the resource requirements of the component groups until a match is successful, including: Determining a current component group according to the preset order of the resource requirements, and determining a current server matching the current component group according to the preset order of the available resources; If the current component group matches the current server successfully, the available resources of the current server are updated using the resource requirements of the current component group; The preset order of the available resources is updated by using the updated available resources of the current server, and the step of determining the current component grouping according to the preset order of the resource requirements and subsequent steps are returned to be executed.

6. The resource allocation method according to claim 4, characterized in that: The preset order includes an order from small to large and / or an order from large to small; the method further includes: If, for the component grouping under the current index category, under the constraints, matching is performed in the ascending order of the available resources and in the ascending order of the resource requirements of the component grouping until the matching of the last server is completed, then the preset order is updated to the descending order, and the step of re-executing the step of matching for the component grouping under the current index category under the constraints, matching is performed in the ascending order of the available resources and in the preset order of the resource requirements of the component grouping until the matching is successful or the matching of the last server is completed and subsequent steps.

7. The resource allocation method according to any one of claims 1 to 6, characterized in that: The method further comprises: Based on the component allocation result, determining the resource occupancy rate of each server in the server cluster and / or the allocation quantity of the component grouping; Based on the resource occupancy rate of each server in the server cluster and / or the allocated quantity of the component grouping, the allocation of the component grouping is adjusted.

8. The resource allocation method according to claim 7, characterized in that: The adjusting the allocation of component groups based on the resource occupancy rate of each server in the server cluster and / or the allocated quantity of component groups includes: If there are a third server and a fourth server in the server cluster, the component groups in the third server are adjusted and allocated to the fourth server with the goal that the difference between the allocated number of component groups in the third server and the allocated number of component groups in the fourth server is not greater than a preset difference; The number of component groups allocated in the third server is greater than the number of component groups allocated in the fourth server, and the difference between the number of component groups allocated in the third server and the number of component groups allocated in the fourth server is greater than the preset difference, and the index categories of the component groups in the third server and the fourth server are the same, and the resource configuration data of the third server is consistent with the resource configuration data in the fourth server; If there are a fifth server and a sixth server in the server cluster, the component grouping in the fifth server and the component grouping in the sixth server are allocated and exchanged; wherein the resource occupancy rate of the fifth server is less than the resource occupancy rate of the sixth server, and the resource configuration data of the fifth server is greater than the resource configuration data of the sixth server.

9. A resource allocation device, characterized in that: include: An acquisition module is used to obtain the number of servers in the server cluster, the available resources of each server, and the resource requirements of each component group to be allocated; The component group includes at least one component; wherein the components in the same component group are allocated to the same server; A resource determination module, configured to determine the total available resources of the server cluster according to the available resources of each of the servers, determine the total resource requirement according to the resource requirement of each of the component groups, and determine whether the total available resources meet the total resource requirement; A resource allocation module, configured to allocate one server to each component group if the number of the servers is not less than the number of the component groups; The resource allocation module is further configured to allocate servers to the component groups under constraints if the number of servers is less than the number of component groups and not less than a first threshold, or if the allocation of one server to each component group fails; wherein each component group is configured with an index category, and the first threshold is the number of index categories; the constraints include: the component groups of different index categories are allocated to different servers, and the component groups of the same index category are preferentially allocated to the same server; The resource allocation module is specifically used to match the component grouping with the server under constraint conditions and in accordance with the preset order of the available resources and the preset order of the resource requirements of the component grouping, and allocate the server to the component grouping.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • Method and system for graph data division

    CN106649441A

  • Elastic scheduling method and system for cluster resources, electronic equipment and storage medium

    CN117632414A