A service migration method, a computer device, and a storage medium
By classifying the service image and core number of migration services, and pairing and allocating the largest and minimum core examples, the problem of waste of service migration resources in the existing technology is solved, and efficient utilization of server resources and load balancing is achieved.
Patent Information
- Application Number
- CN202310294067.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-03-23
AI Technical Summary
The service migration method in the prior art has the problem of unreasonable resource allocation, resulting in resource waste.
By obtaining the service portrait of each service to be migrated, all services to be migrated are classified according to the number of cores in the service portrait, the initial core classification set is obtained, and the largest core instance and the smallest core instance are paired and allocated servers to form a service migration plan.
It maximizes the utilization rate of server resources, meets the purpose of server load balancing, improves the operation stability of services, and avoids resource waste.
Smart Images

Figure CN116319807B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a service migration method, a computer device, and a storage medium. Background Art
[0002] With the rapid development of the Internet era and the advent of the mobile Internet era, the number of users of major websites and platforms has increased rapidly. Therefore, the capacity of services has increased exponentially. To cope with the service capacity risk under high concurrency, service migration is usually carried out, that is, migrating the services on independent physical servers to private clouds, or migrating from public clouds to private clouds, etc.
[0003] Currently, the migration layout and deployment distribution of services are all carried out by manual resource migration, that is, one machine to one machine. Assuming that the machine packages of the migrated machine and the destination migration machine are inconsistent, then redundancy has to be used to balance the peer-to-peer migration. For example, if a machine originally using a 32-core CPU becomes a 24-core machine after migrating to the cloud, then it is equivalent to deploying one 32-core machine with two 24-core machines. Or if a 32-core machine migrates to a 48-core machine, then there will be a waste of 16-core resources for both.
[0004] It can be seen that the service migration method in the prior art has the problem of unreasonable resource allocation, resulting in resource waste. Summary of the Invention
[0005] Aiming at the deficiencies in the prior art, the service migration method, computer device, and storage medium provided by the present invention solve the problem of resource waste in the service migration method in the prior art. It can not only maximize the utilization rate of server resources, but also meet the purpose of server load balancing and improve the running stability of services.
[0006] In a first aspect, the present invention provides a service migration method, the method including: obtaining a service portrait of each service to be migrated; wherein, the service portrait includes a service name, the number of cores, and the number of instances; classifying all services to be migrated according to the number of cores in the service portrait to obtain an initial core classification set; pairing the maximum core instance and the minimum core instance in the initial core classification set to allocate servers, obtaining at least one first allocation server and a first core classification set; if there is only one type of core instance in the first core classification set, allocating the core instances in the first core classification set to the corresponding first allocation servers according to the remaining core capacity of the at least one first allocation server, obtaining a service migration plan; the server migration plan includes the number of first allocation servers and the service names allocated to each first allocation server.
[0007] Optionally, pair the maximum core instance and the minimum core instance in the initial core classification set and assign them to servers, to obtain at least one first assigned server and a first core classification set, including: pairing the maximum core instance and the minimum core instance, and assigning a first assigned server to each pair, to obtain at least one first assigned server; using the initial core classification set after removing the core instances of the assigned servers as the first core classification set.
[0008] Optionally, when the number of instances of the maximum core instance in the initial core classification set is less than the number of instances of the minimum core instance, after assigning a first assigned server to each pair to obtain at least one first assigned server, the method further includes: according to the remaining core capacity of the at least one first assigned server, assigning the remaining minimum core instances in the initial core classification set to the at least one first assigned server.
[0009] Optionally, when there are at least two types of core instances in the first core classification set, the method further includes: if the maximum core instance in the first core classification set is the same as the maximum core instance in the initial core classification set, pairing the maximum core instance and the minimum core instance in the first core classification set and assigning them to servers, to obtain at least one second assigned server; removing the core instances of the assigned servers from the first core classification set to obtain an updated first core classification set, and when there are no core instances in the updated first core classification set, obtaining a server migration plan including the number of first assigned servers, the number of second assigned servers, and the service names assigned to each first assigned server and each second assigned server.
[0010] Optionally, when there are at least two types of core instances in the first core classification set, the method further includes: if the maximum core instance in the first core classification set is different from the maximum core instance in the initial core classification set, according to the remaining core capacity of the at least one first assigned server, selecting matching core instances from the first core classification set based on the principle of gradually filling the at least one first assigned server and assigning them to the at least one first assigned server.
[0011] Optionally, the method further includes: when the at least one first assigned server is full and there are still core instances in the first core classification set, using the first core classification set after removing the core instances of the assigned servers as the updated first core classification set, and pairing and assigning all the core instances in the updated first core classification set based on the rated core capacity of the servers, to obtain at least one third assigned server.
[0012] Optionally, when the service portrait further includes mutually exclusive information, after obtaining the service migration plan, the method further includes: judging whether there are mutually exclusive services in the currently assigned server according to the mutually exclusive information in each service portrait; if there are mutually exclusive services in the currently assigned server, obtaining the minimum core service among the mutually exclusive services; obtaining a target core service from the assigned servers that have not adjusted the mutual exclusion relationship according to the core number of the minimum core service; replacing the minimum core service with the target core service to obtain an optimized migration plan for the currently assigned server.
[0013] Optionally, when the service portrait further includes peak hours, after obtaining the service migration plan, the method further includes: judging whether there are services with the same peak hours in the currently assigned server according to the peak hours in each service portrait; if there are services with the same peak hours in the currently assigned server, obtaining the minimum core service among the services with the same peak hours; obtaining a target core service from the assigned servers that have not adjusted the peak hours according to the core number and peak hours of the minimum core service; replacing the minimum core service with the target core service to obtain an optimized migration plan for the currently assigned server.
[0014] In a second aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining a service portrait of each service to be migrated; wherein the service portrait includes a service name, a core number, and an instance number; classifying all services to be migrated according to the core number in the service portrait to obtain an initial core classification set; pairing the maximum core instance and the minimum core instance in the initial core classification set to assign servers, obtaining at least one first assigned server and a first core classification set; if there is only one type of core instance in the first core classification set, according to the remaining core capacity of the at least one first assigned server, assigning the core instances in the first core classification set to the corresponding first assigned servers to obtain a service migration plan; the server migration plan includes the number of first assigned servers and the service names assigned to each first assigned server.
[0015] In a third aspect, the present invention provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a service profile for each service to be migrated; wherein the service profile includes a service name, the number of cores, and the number of instances; classifying all services to be migrated according to the number of cores in the service profile to obtain an initial core classification set; pairing the maximum core instance and the minimum core instance in the initial core classification set to allocate servers, obtaining at least one first allocated server and a first core classification set; if there is only one type of core instance in the first core classification set, allocating the core instances in the first core classification set to the corresponding first allocated servers according to the remaining core capacity of the at least one first allocated server, obtaining a service migration plan; the server migration plan includes the number of first allocated servers and the service names allocated to each first allocated server.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] 1. The present invention creates service profiles for all services to be migrated, classifies them according to the number of cores in the service profiles to obtain an initial core classification set, and pairs and allocates servers for the maximum core instance and the minimum core instance in the initial core classification set, so that a maximum core instance and a minimum core instance can be allocated to the same server, achieving the purpose of server load balancing and preventing the problem of unstable operation caused by deploying multiple large core instances in the server.
[0018] 2. Based on the principle of gradually filling at least one first allocated server, the present invention allocates the remaining one type of core instance in the first core classification set to the servers, which can maximize the resource utilization rate of the servers and avoid the problem of waste of server resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The figure shows a schematic flow chart of a service migration method provided by an embodiment of the present invention;
[0020] Figure 2 The figure shows a schematic layout diagram of a service to be migrated provided by an embodiment of the present invention;
[0021] Figure 3 The figure shows a schematic flow chart of another service migration method provided by an embodiment of the present invention;
[0022] Figure 4 The figure shows a schematic flow chart of yet another service migration method provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the scope of protection of this application.
[0024] In a first aspect, the present invention provides a service migration method, which specifically includes the following embodiments:
[0025] Embodiment 1
[0026] Figure 1 The following shows a schematic flowchart of a service migration method provided by an embodiment of the present invention. As Figure 1 shown, it specifically includes the following steps:
[0027] Step S101: Obtain the service portraits of each service to be migrated.
[0028] As Figure 2 shown, the resource pool that needs to perform service migration includes Server 1, Server 2, and Server 3. Multiple different services are deployed on each server, and the same service may be deployed on different servers respectively. For example, Service A is deployed on Server 1 and Server 2 respectively, so the number of instances of Service A is 2. Therefore, the number of the same service in the services to be migrated is the number of instances. In the prior art, the method of resource flat migration is to migrate the to-be-migrated Server 1, Server 2, and Server 3 to at least three other independent servers respectively, that is, Server 1 corresponds to at least one server, Server 2 corresponds to at least one server, and Server 3 corresponds to at least one server. According to the background technology, when the machine packages of the migrated machine and the destination migration machine are inconsistent, serious resource waste will occur. To solve the above problems, in this embodiment, it is first necessary to obtain the service portraits of each service.
[0029] Before performing service migration in this embodiment, the service portraits of each service to be migrated will be obtained according to the deployment information of the services and the resource monitoring information of the services in the current resource pool. Among them, the deployment information includes where the service is deployed, what the port is, what kind of package is required, how many instances there are, which services must be co-located with, and which services must not be co-located with; the resource monitoring information includes the CPU utilization rate and memory utilization rate in each time period, and analyzes and outputs the peak time period of the service. For example, Service A has a peak consumption from 8 to 9 am and is idle from 21 to 4 am; the service portrait includes but is not limited to the service name, number of cores, number of instances, deployment port, deployment path, mutual exclusion information, peak time period, and idle time period.
[0030] Step S102: Classify all services to be migrated according to the number of cores in the service portrait to obtain an initial core classification set.
[0031] It should be noted that the number of cores in the service portrait represents the number of CPU cores occupied by the service, including but not limited to 16 cores, 8 cores, 4 cores, 2 cores, and 1 core. In this embodiment, all services to be migrated are classified according to the number of cores of the service, and the obtained initial core classification set includes 16-core instances, 8-core instances, 4-core instances, 2-core instances, and 1-core instances, and each instance includes multiple services. For example, there are 2 service A and 4 service E in the 16-core instance.
[0032] Step S103: Pair the largest core instance and the smallest core instance in the initial core classification set and allocate servers to obtain at least one first allocated server and a first core classification set.
[0033] In this embodiment, pairing the largest core instance and the smallest core instance in the initial core classification set and allocating servers to obtain at least one first allocated server and a first core classification set includes: pairing the largest core instance and the smallest core instance, and allocating a first allocated server to each pair to obtain at least one first allocated server; using the initial core classification set after removing the core instances with allocated servers as the first core classification set.
[0034] It should be noted that in this embodiment, pairing the largest core instance and the smallest core instance in the initial core classification set and allocating the first allocated server is equivalent to allocating one largest core instance and one smallest core instance in the initial core classification set to one first allocated service. If there are 10 largest 16-core core instances and 8 smallest 1-core core instances in the initial core classification set, then 8 16-core core instances and 8 1-core core instances are respectively allocated to 8 first allocated servers, and each first allocated server includes 1 16-core core instance and 1 1-core core instance. Further, the core classification set obtained after removing the 8 allocated 16-core core instances and 8 1-core core instances from the initial core classification set is used as the first core classification set.
[0035] Further, when the number of instances of the largest core instance in the initial core classification set is less than the number of instances of the smallest core instance, after allocating a first allocated server to each pair to obtain at least one first allocated server, it further includes: allocating the remaining smallest core instances in the initial core classification set to the at least one first allocated server according to the remaining core capacity of the at least one first allocated server.
[0036] It should be noted that if there are 2 core instances with a maximum of 16 cores and 8 core instances with a minimum of 1 core in the initial core classification set, then the 2 core instances with 16 cores and 2 core instances with 1 core are respectively allocated to 2 first allocation servers, and each first allocation server includes 1 core instance with 16 cores and 1 core instance with 1 core; thus, it can be seen that there are still 6 core instances with a minimum of 1 core in the initial core classification set, and the remaining minimum core instances are allocated to one or more first allocation servers according to the remaining core capacity of all first allocation servers, that is, if the remaining core capacity of the first first allocation server is 15, then all 6 minimum core instances with 1 core are put into the first first allocation server; if the remaining core capacity of the first first allocation server is 3, then 3 minimum core instances with 1 core are allocated to the first first allocation server, and the remaining 3 1-core instances are allocated according to the remaining core capacity of the second second allocation server; therefore, the allocation principle of this embodiment is to gradually fill at least one first allocation server.
[0037] It should be noted that in this embodiment, the maximum core instances and the minimum core instances are paired and allocated first to meet the purpose of server load balancing, prevent the problem of unstable operation caused by deploying multiple large core instances in the server, and thus improve the operation stability of the server.
[0038] Step S104, if there is only one type of core instance in the first core classification set, allocate the core instances in the first core classification set to the corresponding first allocation servers according to the remaining core capacity of the at least one first allocation server to obtain a service migration plan.
[0039] It should be noted that when there is only one type of core instance in the first core classification set currently, for example, when there are only 6 core instances with 4 cores, based on the principle of gradually filling the at least one first allocation server, the 6 core instances with 4 cores are allocated to the corresponding first allocation servers, thereby obtaining a server migration plan, so that the operation and maintenance staff can prepare the server and migrate the service according to the server migration plan; wherein, the server migration plan includes the number of first allocation servers and the service names allocated to each first allocation server.
[0040] In this embodiment, in this step, based on the principle of gradually filling the at least one first allocation server, the remaining one type of core instance in the first core classification set is allocated to the server, which can maximize the resource utilization rate of the server and avoid the problem of server resource waste.
[0041] Compared with the prior art, this embodiment has the following beneficial effects:
[0042] In this embodiment, service portraits are created for all services to be migrated, and classification is performed based on the number of cores in the service portraits to obtain an initial core classification set. Then, the largest core instance and the smallest core instance in the initial core classification set are paired and assigned to a server, so that one largest core instance and one smallest core instance can be assigned to the same server, achieving the purpose of server load balancing and preventing the problem of unstable operation caused by deploying multiple large core instances in the server.
[0043] Furthermore, based on the principle of gradually filling the at least one first allocation server, this embodiment performs server allocation for the remaining core instances of a certain type in the first core classification set, which can maximize the resource utilization rate of the server and avoid the problem of server resource waste.
[0044] Embodiment 2
[0045] Figure 3 The following shows a schematic flowchart of another service migration method provided by an embodiment of the present invention, as Figure 3 shown, which specifically includes the following steps:
[0046] Step S201: Determine whether there is only one type of core instance in the first core classification set. When there is only one type of core instance in the first core classification set, execute step S104. When there are at least two types of core instances in the first core classification set, execute step S202;
[0047] It should be noted that the execution process of step S104 in this embodiment is the same as that of step S104 in the above Embodiment 1, and will not be elaborated here.
[0048] Step S202: Determine whether the largest core instance in the first core classification set is the same as the largest core instance in the initial core classification set. When the largest core instance in the first core classification set is the same as the largest core instance in the initial core classification set, execute step S203. When the largest core instance in the first core classification set is different from the largest core instance in the initial core classification set, execute step S204;
[0049] It should be noted that when the number of the largest core instances in the initial core classification set is greater than the number of the smallest core instances, after the largest and smallest core instances are paired and assigned to the server in step S103, there are remaining largest core instances, and then the largest core instances in the initial core classification set will enter the first core classification set, making the largest core instance in the first core classification set the same as the largest core instance in the initial core classification set.
[0050] When the maximum number of core instances in the initial core classification set is less than or equal to the minimum number of core instances, after the maximum and minimum core instances are paired and assigned to servers in step S103, there is no remaining maximum core instance, and then the second-largest core instance in the initial core classification set enters the first core classification set and becomes the largest core instance in the first core classification set, so that the largest core instance in the first core classification set is different from the largest core instance in the initial core classification set.
[0051] Step S203: Pair and assign the largest core instance and the smallest core instance in the first core classification set to servers to obtain at least one second assigned server and an updated first core classification set.
[0052] It should be noted that the pairing process in this step is the same as that in step S102 of Embodiment 1, so it will not be elaborated here.
[0053] After the largest and smallest core instances in the first core classification set are paired and assigned to servers, the core instances of the assigned servers are removed to obtain an updated first core classification set. Determine whether there are core instances in the updated first core classification set. When there are no core instances, the current server migration plan can be obtained; if there are core instances, based on the remaining core capacity of the at least one first assigned server and the at least one second assigned server, and in principle of gradually filling the at least one first assigned server and the at least one second assigned server, select matching core instances from the first core classification set and assign them to the at least one first assigned server or / and the at least one second assigned server, so as to obtain the current server migration plan.
[0054] The service migration plan obtained in this step includes the number of first assigned servers, the number of second assigned servers, and the service names assigned to each first assigned server and each second assigned server.
[0055] Step S204: Based on the remaining core capacity of the at least one first assigned server, select matching core instances from the first core classification set and assign them to the at least one first assigned server in principle of gradually filling the at least one first assigned server.
[0056] It should be noted that when all the core instances in the first core classification set have been assigned, and there are still unfilled servers in the at least one first assigned server, the current server migration plan is obtained; and the server migration plan obtained in this step includes the number of first assigned servers and the service names assigned to each first assigned server.
[0057] Step S205: When the at least first allocation server is full and there are still core instances in the first core classification set, pair and allocate all the core instances in the updated first core classification set based on the rated core capacity of the server to obtain at least one third allocation server.
[0058] It should be noted that the service migration plan obtained in this step includes the number of first allocation servers, the number of second allocation servers, the number of third allocation servers, and the service names allocated to each first allocation server, each second allocation server, and each third allocation server.
[0059] It should be noted that this embodiment is based on the principle of gradually filling the at least one first allocation server and / or the at least one second allocation server, and at the same time taking into account the principle of decentralized deployment of the largest core instances, and then allocating servers to the remaining various core instances in the first core classification set, which can not only maximize the resource utilization rate of the servers, but also improve the running stability of each allocated server.
[0060] Embodiment III
[0061] As Figure 4 shown, in this embodiment, when the service portrait further includes mutual exclusion information, after obtaining the service migration plan, the method further includes:
[0062] Step S301: According to the mutual exclusion information in each service portrait, determine whether there are mutually exclusive services in the current allocation server;
[0063] Step S302: If there are mutually exclusive services in the current allocation server, obtain the smallest core service among the mutually exclusive services;
[0064] Step S303: According to the core number of the smallest core service, obtain the target core service from the allocation servers that have not adjusted the mutual exclusion relationship;
[0065] Step S304: Replace the smallest core service with the target core service to obtain the optimized migration plan of the current allocation server.
[0066] It should be noted that the resource pool to be migrated includes multiple services, and there are association or mutual exclusion relationships between each service. The association relationship means that two or more services must be deployed together, and the mutual exclusion relationship means that two or more services cannot be deployed together. Since in the first and second embodiments, in order to reduce resource waste, the services in the resource pool are all randomly allocated, and in order to ensure the normal operation of the services, in this embodiment, adjustments are made to each allocated service through the mutual exclusion information in the server portrait. Since the movement between the minimum core numbers has the least impact on the adjustment of the allocated servers, in this embodiment, the service with the minimum core number in the services with mutual exclusion relationships is swapped with the services with the same core number in other unadjusted allocated servers, so as to ensure that there are no mutually exclusive services in the current server. If the current allocated server has been adjusted based on the mutual exclusion information, then when making mutual relationship adjustments to the next allocated service, the corresponding core services are not selected from the allocated servers that have been adjusted.
[0067] In another embodiment, when the service portrait further includes peak hours, after obtaining the service migration plan, the method further includes: judging whether there are services with the same peak hours in the current allocated server according to the peak hours in each service portrait; if there are services with the same peak hours in the current allocated server, obtaining the service with the minimum core number among the services with the same peak hours; obtaining the target core service from the unadjusted allocated servers according to the core number and peak hours of the service with the minimum core number; replacing the service with the minimum core number with the target core service to obtain the optimized migration plan of the current allocated server.
[0068] It should be noted that in this embodiment, off-peak deployment is carried out according to the peak hours of each service, so that two services with the same peak hours are not deployed on the same server, further improving the operation stability of the server.
[0069] Furthermore, in this embodiment, the allocated servers can also be optimized and adjusted through judgment conditions such as the deployment ports of each service, whether the maximum number of instances of the allocated servers is met, and whether the association relationship is met, so as to obtain the optimal service migration plan.
[0070] Service capacity is one of the important guarantees for the stable operation of services. The cost pressure generated by service capacity guarantee also needs to be emphasized and concerned. While taking into account the cost pressure, it is necessary to ensure the healthy operation of services, and having the capabilities of contingency plans, loss prevention, and rapid recovery is a technical problem that operation and maintenance personnel need to overcome. This embodiment can achieve a balance between cost and stability, truly achieve on-demand allocation and on-demand use, and ensure the health of service capacity while guaranteeing costs. By using the utilization time curves of resources such as the CPU and memory of the service, combined with the dependency portrait of the service itself, the resource portrait and consumption pattern of the service are generated, such as what time periods are peaks and what time periods are valleys every day. Then, combined with the intelligent scheduling algorithm, the optimal distribution of the service and the adjustment strategy suitable for the current situation are output. Then, through automatic scaling, the scheduling algorithm is implemented for adjustment, so as to achieve the optimal distribution with the lowest cost and meet the requirements of healthy capacity.
[0071] In a second aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining a service portrait of each service to be migrated; wherein, the service portrait includes a service name, the number of cores, and the number of instances; classifying all services to be migrated according to the number of cores in the service portrait to obtain an initial core classification set; pairing the largest core instance and the smallest core instance in the initial core classification set to allocate servers, obtaining at least one first allocated server and a first core classification set; if there is only one type of core instance in the first core classification set, according to the remaining core capacity of the at least one first allocated server, allocating the core instances in the first core classification set to the corresponding first allocated servers to obtain a service migration plan; the server migration plan includes the number of first allocated servers and the service names allocated to each first allocated server.
[0072] In a third aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a service portrait of each service to be migrated; wherein, the service portrait includes a service name, the number of cores, and the number of instances; classifying all services to be migrated according to the number of cores in the service portrait to obtain an initial core classification set; pairing the largest core instance and the smallest core instance in the initial core classification set to allocate servers, obtaining at least one first allocated server and a first core classification set; if there is only one type of core instance in the first core classification set, according to the remaining core capacity of the at least one first allocated server, allocating the core instances in the first core classification set to the corresponding first allocated servers to obtain a service migration plan; the server migration plan includes the number of first allocated servers and the service names allocated to each first allocated server.
[0073] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0074] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
Claims
1. A service migration method, characterized in that, the method includes: Obtain the service portraits of each service to be migrated; wherein, the service portrait includes the service name, the number of cores, and the number of instances; Classify all services to be migrated according to the number of cores in the service portrait to obtain an initial core classification set; Pair the maximum core instance and the minimum core instance in the initial core classification set and allocate servers to obtain at least one first allocated server and a first core classification set; If there is only one type of core instance in the first core classification set, allocate the core instances in the first core classification set to the corresponding first allocated servers according to the remaining core capacity of the at least one first allocated server to obtain a service migration plan; the server migration plan includes the number of first allocated servers and the service names allocated to each first allocated server; When the at least one first allocated server is full and there are still core instances in the first core classification set, use the first core classification set after removing the core instances of the allocated servers as the updated first core classification set, and pair and allocate all the core instances in the updated first core classification set based on the rated core capacity of the server to obtain at least one third allocated server; Pairing the maximum core instance and the minimum core instance in the initial core classification set and allocating servers to obtain at least one first allocated server and a first core classification set includes: Pair one maximum core instance and one minimum core instance, and allocate a first allocated server to each pair to obtain at least one first allocated server; Use the initial core classification set after removing the core instances of the allocated servers as the first core classification set.
2. The service migration method according to claim 1, characterized in that, if the number of instances of the maximum core instance in the initial core classification set is less than the number of instances of the minimum core instance, after allocating a first allocated server to each pair to obtain at least one first allocated server, the method further includes: Allocate the remaining minimum core instances in the initial core classification set to the at least one first allocated server according to the remaining core capacity of the at least one first allocated server.
3. The service migration method according to claim 1, characterized in that, if there are at least two types of core instances in the first core classification set, the method further includes: If the maximum core instance in the first core classification set is the same as the maximum core instance in the initial core classification set, pair the maximum core instance and the minimum core instance in the first core classification set and allocate servers to obtain at least one second allocated server; Remove the core instances of the allocated servers from the first core classification set to obtain an updated first core classification set. When there are no core instances in the updated first core classification set, obtain a server migration plan including the number of first allocated servers, the number of second allocated servers, and the service names allocated to each first allocated server and each second allocated server.
4. The service migration method according to claim 3, wherein, when there are at least two core instances in the first core classification set, the method further includes: when the largest core instance in the first core classification set is different from the largest core instance in the initial core classification set, based on the remaining core capacity of the at least one first allocation server, matching core instances are selected from the first core classification set and allocated to the at least one first allocation server on the principle of gradually filling the at least one first allocation server.
5. The service migration method according to any one of claims 1-4, wherein, when the service portrait further includes mutually exclusive information, after obtaining the service migration plan, the method further includes: judging whether there are mutually exclusive services in the current allocation server according to the mutually exclusive information in each service portrait; when there are mutually exclusive services in the current allocation server, obtaining the smallest core service among the mutually exclusive services; obtaining a target core service from the allocation servers that have not undergone mutually exclusive relationship adjustment according to the core number of the smallest core service; replacing the smallest core service with the target core service to obtain an optimized migration plan for the current allocation server.
6. The service migration method according to any one of claims 1-4, wherein, when the service portrait further includes peak hours, after obtaining the service migration plan, the method further includes: judging whether there are services with the same peak hours in the current allocation server according to the peak hours in each service portrait; when there are services with the same peak hours in the current allocation server, obtaining the smallest core service among the services with the same peak hours; obtaining a target core service from the allocation servers that have not undergone peak hour adjustment according to the core number and peak hours of the smallest core service; replacing the smallest core service with the target core service to obtain an optimized migration plan for the current allocation server.
7. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method, system and / or apparatus for the scheduling of a plurality of operating system tasks
CN109522101A
Application operation optimization control method and related product
CN110825524A