Application migration method and device of server
By obtaining and translating the difference in the instruction set of the central processor, the operation error problem caused by the difference in the instruction set between different server architectures is solved, and efficient application migration is achieved and migration efficiency is improved.
Patent Information
- Application Number
- CN202510537506.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-27
AI Technical Summary
When migrating applications between servers with different central processor architectures, there are instructions set differences, resulting in application operation errors and the application needs to be recompiled, which is inefficient.
By obtaining the difference between the central processor instruction set of the first server and the second server, the difference instructions are translated and converted so that it can simulate the instruction set of the first server on the second server, thereby eliminating the need for recompiling the application.
It realizes efficient migration of applications between servers of different central processor architectures, avoids operational errors caused by instruction set differences, and improves migration efficiency.
Smart Images

Figure CN120045290A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to application migration between servers. Background Art
[0002] In the related art, for different servers in the same server cluster, when performing application migration between servers, since the architectures of the central processing units (CPUs) between different servers may be different, the instruction sets between CPUs with different architectures may be quite different. As a result, when the application runs using the instruction set of the target server after the application migration, problems such as incorrect application operation may occur. Therefore, when performing application migration between servers with different CPU architectures, the application needs to be recompiled before migration, which takes a relatively long time, thereby resulting in low efficiency of application migration. Therefore, there is a problem of low efficiency in application migration.
[0003] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] This application provides a method and device for application migration of a server to at least solve the problem of low efficiency in application migration in the related art.
[0005] This application provides a method for application migration of a server, including: obtaining an application program deployed on a first server in a server cluster, where the first server uses a first central processing unit (CPU) instruction set, and the first CPU instruction set is a set of basic commands used by the CPU of the first server to interact with and execute upper-layer application programs; in response to an application migration request of the application program, obtaining a second CPU instruction set used by a second server in the server cluster, where the application migration request is used to request to migrate and deploy the application program to the second server, and the second CPU instruction set is a set of basic commands used by the CPU of the second server to interact with and execute upper-layer application programs; obtaining a first instruction that has a difference between the first CPU instruction set and the second CPU instruction set; performing translation conversion on the first instruction to obtain a second instruction, where the second instruction is used to simulate an instruction in the first CPU instruction set; and when the application program is migrated and deployed to the second server and the first instruction needs to be called when the application program runs, calling the second instruction.
[0006] The present application also provides an application migration device for a server, including: a first acquisition unit, configured to acquire an application program deployed on a first server in a server cluster, wherein the first server uses a first central processing unit instruction set, and the first central processing unit instruction set is a set of basic commands used by the central processing unit of the first server to interact with and execute upper-layer application programs; a second acquisition unit, configured to, in response to an application migration request of the application program, acquire a second central processing unit instruction set used by a second server in the server cluster, wherein the application migration request is used to request to migrate and deploy the application program to the second server, and the second central processing unit instruction set is a set of basic commands used by the central processing unit of the second server to interact with and execute upper-layer application programs; a third acquisition unit, configured to acquire a first instruction in which there is a difference between the first central processing unit instruction set and the second central processing unit instruction set; a translation unit, configured to perform translation conversion on the first instruction to obtain a second instruction, wherein the second instruction is used to simulate an instruction in the first central processing unit instruction set; and a call unit, configured to, when the application program is migrated and deployed to the second server and the application program needs to call the first instruction during operation, call the second instruction.
[0007] The present application also provides an electronic device, including: a memory, configured to store a computer program; and a processor, configured to implement the steps of any one of the above application migration methods for a server when executing the computer program.
[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of any one of the above application migration methods for a server.
[0009] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the above application migration methods for a server.
[0010] Through this application, an application deployed on a first server in a server cluster is obtained, and the first server uses a first central processing unit (CPU) instruction set. Further, a second CPU instruction set used by a second server in the server cluster is obtained. Then, a first instruction with a difference between the first CPU instruction set and the second CPU instruction set is obtained. Subsequently, the first instruction is translated into a second instruction, and the second instruction can simulate the instruction in the first CPU instruction set. When the application migrates to the second server and the first instruction needs to be called, the second instruction obtained by translating the first instruction can be called to achieve the same effect as the first instruction, thus eliminating the need to recompile the application before application migration. Therefore, the problem of low efficiency in application migration can be solved, and the efficiency of application migration can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] To more clearly illustrate the embodiments of the present application, the accompanying drawings required for use in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 is a schematic diagram of the application environment of a method for migrating an application of a server according to an embodiment of the present application;
[0013] Figure 2 is a schematic diagram of a method for migrating an application of a server according to an embodiment of the present application;
[0014] Figure 3 is a schematic diagram of a method for migrating an application of a server according to an embodiment of the present application;
[0015] Figure 4 is a schematic diagram of a method for migrating an application of a server according to an embodiment of the present application;
[0016] Figure 5 is a schematic diagram of a method for migrating an application of a server according to an embodiment of the present application;
[0017] Figure 6 is a schematic diagram of a method for migrating an application of a server according to an embodiment of the present application;
[0018] Figure 7 is a block diagram of the structure of an apparatus for migrating an application of a server according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0020] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and not to describe a specific order or sequence.
[0021] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] The method embodiments provided in the embodiments of the present application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 is a hardware structure block diagram of a server device for a cloud platform cloud host scheduling method according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above server device. For example, the server device may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.
[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the scheduling method of the cloud host of the cloud platform in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0025] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the application migration method of the server depends, the specific application environment architecture or specific hardware architecture is described herein.
[0026] Embodiments of the present application provide an application migration method for a server. Combined with the execution process of the application migration method of the server, the method is described in detail. Figure 2 is a flowchart of the application migration method of the server implemented according to the present application, as Figure 2 shown, and the process includes the following steps:
[0027] S202, obtain the application program deployed on the first server in the server cluster, where the first server uses a first central processing unit instruction set, and the first central processing unit instruction set is a set of basic commands used by the central processing unit of the first server to interact with and execute upper-layer application programs;
[0028] S204, in response to the application migration request of the application program, obtain the second central processing unit instruction set used by the second server in the server cluster, where the application migration request is used to request to migrate and deploy the application program to the second server, and the second central processing unit instruction set is a set of basic commands used by the central processing unit of the second server to interact with and execute upper-layer application programs;
[0029] S206, obtain a first instruction that has a difference between a first central processing unit (CPU) instruction set and a second CPU instruction set;
[0030] S208, perform translation and conversion on the first instruction to obtain a second instruction, where the second instruction is used to simulate an instruction in the first CPU instruction set;
[0031] S210, when the application migration and deployment is on the second server and the application needs to call the first instruction during operation, call the second instruction.
[0032] In an alternative embodiment, the server cluster may, but is not limited to, be a system composed of multiple servers connected through a network, and may, but is not limited to, be used to provide cloud computing services with high availability, high performance, and scalability.
[0033] In an alternative embodiment, the first server and the second server may, but are not limited to, refer to any two servers in the server cluster. The first server and the second server may have the same architecture or different architectures.
[0034] In an alternative embodiment, the first CPU instruction set may, but is not limited to, refer to the instruction set on which the application running on the central processing unit (CPU) of the first server depends.
[0035] In an alternative embodiment, an instruction may, but is not limited to, be the basic operation unit for the CPU to execute a specific task. Different CPU architectures or models may use different instructions to achieve the same function.
[0036] In an alternative embodiment, the second CPU instruction set may, but is not limited to, refer to the instruction set on which the application running on the central processing unit of the second server depends.
[0037] In an alternative embodiment, the application migration request may, but is not limited to, be understood as a business requirement for requesting to migrate an application deployed on a certain server to another server to achieve purposes such as resource optimization, load balancing, or failover.
[0038] In an alternative embodiment, the first instruction may, but is not limited to, refer to the instruction called when the application on the first server is running.
[0039] In an alternative embodiment, the second instruction may, but is not limited to, refer to the instruction that needs to be called when the second server is running the migrated application.
[0040] In an alternative embodiment, applications running on a first server in a server cluster are first identified, and these applications need to call the first central processing unit (CPU) instruction set of the first server during execution.
[0041] Furthermore, application migration requests typically come from the system operation and maintenance or scheduling management level and are used to migrate applications from the first server to the second server to handle situations such as changes in resource requirements, server maintenance, or failover. When the system receives an application migration request, it obtains the second CPU instruction set used by a geothermal server different from the first server in the server cluster.
[0042] Then, the system needs to compare the CPU instruction sets of the first server and the second server, identify the first instructions that the application depends on when executing on the first server but do not exist in the CPU instruction set of the second server, and the first instructions can be but are not limited to instructions that are not supported by the second server or do not exist in the central processing unit instruction set of the second server.
[0043] Next, the system translates the first instructions into instructions that can find functionally equivalent or similar instructions in the central processing unit instruction set of the second server to ensure that the migrated application can run properly on the second server.
[0044] Finally, after the migration is completed, when the application runs on the second server, the system will automatically call the translated second instructions instead of the first instructions in the original first server CPU instruction set, thus achieving a smooth migration of the application.
[0045] It should be noted that by adding an instruction adaptation layer in the cloud computing system, the instruction set differences in heterogeneous CPU environments can be effectively addressed, enabling business applications to run on different CPU platforms without recompilation, improving the application migration efficiency and deployment flexibility.
[0046] Through the embodiments of the present application, by obtaining the applications deployed on the first server in the server cluster, and the first server uses the first central processing unit instruction set. Furthermore, obtain the second CPU instruction set used by the second server in the server cluster. Then obtain the first instructions with differences between the first central processing unit instruction set and the second central processing unit instruction set. Then translate and convert the first instructions into second instructions, and the second instructions can simulate the instructions in the first central processing unit instruction set. When the application migrates to the second server and needs to call the first instructions, the second instructions translated and converted from the first instructions can be called to achieve the same effect as the first instructions, thus achieving the technical purpose of not having to recompile the application before application migration, and further achieving the technical effect of improving the application migration efficiency.
[0047] As an alternative solution, the first instruction is translated and converted to obtain a second instruction, including:
[0048] The first instruction is translated and converted according to the instruction function of the first instruction to obtain a second instruction.
[0049] It should be noted that after identifying the central processing unit instruction set difference between the first server and the second server, that is, the first instruction, it is first necessary to understand the function completed by the first instruction, and find an instruction in the second CPU instruction set of the second server that can achieve the same or similar function. By understanding the function of the first instruction, the most suitable alternative instruction can be found in the second CPU instruction set of the second server, realizing the equivalent migration of the instruction, avoiding application execution errors and performance losses caused by the instruction set difference, and further improving the stability of the second server when running the migrated application program.
[0050] Through the embodiments of the present application, the first instruction is translated and converted according to the instruction function of the first instruction to obtain a second instruction. By understanding the function of the first instruction, the most suitable alternative instruction can be found in the CPU instruction set of the second server, thereby achieving the equivalent migration of the instruction, avoiding the technical problems of application execution errors and performance losses caused by the instruction set difference, and further realizing the technical effect of improving the stability of the second server when running the migrated application program.
[0051] As an alternative solution, the first instruction is translated and converted according to the instruction function of the first instruction to obtain a second instruction, including:
[0052] At least one third instruction is determined from the first central processing unit instruction set, where at least one third instruction is used to simulate the instruction function of the first instruction, and the second instruction includes at least one third instruction.
[0053] In an alternative embodiment, the third instruction may but is not limited to be selected by the system from the first central processing unit instruction set during the process of implementing instruction function simulation, and can individually or in combination achieve the same or similar function as the first instruction. Due to the instruction set difference of different CPU architectures, the third instruction may be one or more, and can but is not limited to achieve the purpose of function simulation by being used in combination.
[0054] It should be noted that by selecting and combining the third instruction from the first central processing unit instruction set, the function of the first instruction can be flexibly simulated, solving the problem that the instruction sets of the target CPU architectures are not fully compatible, enabling the migration of application programs between servers with different CPU architectures in business applications without large-scale code modification or recompilation, simplifying the migration process, and improving the migration efficiency.
[0055] For further illustration, assume that there is an instruction of "lifting a bucket and pouring water" in the central processing unit instruction set of the first server, and there is an instruction of "lifting a bucket, pouring water, and watering" in the central processing unit instruction set of the second server. By combining "lifting a bucket" and "pouring water", a function similar to the "watering" function can be obtained. Then, the first instruction of the central processing unit instruction set of the first server and the central processing unit instruction set of the second server is "watering", and the first instruction "watering" is translated and converted into a second instruction. The second instruction includes "lifting a bucket and pouring water", and the third instruction can be "lifting a bucket", "pouring water", or "lifting a bucket and pouring water".
[0056] Through the embodiments of the present application, at least one third instruction is determined from the first central processing unit instruction set, where at least one third instruction is used to simulate the instruction function of the first instruction, and the second instruction includes at least one third instruction. By selecting and combining the third instructions from the second central processing unit instruction set, the technical purpose of enabling the application to migrate between servers with different CPU architectures without large-scale code modification or recompilation is achieved, thus simplifying the migration process, and further achieving the technical effect of improving the migration efficiency.
[0057] As an optional solution, according to the instruction function of the first instruction, translating and converting the first instruction to obtain a second instruction, including:
[0058] In the case where there is no instruction in the first central processing unit instruction set that can simulate the instruction function of the first instruction, translating and converting the first instruction to obtain a fourth instruction, where the fourth instruction is used to call an application programming interface to execute the instruction function of the first instruction.
[0059] In an optional embodiment, the fourth instruction can be, but is not limited to, an instruction obtained by translating and converting the first instruction in the case where it cannot be directly simulated by an instruction in the second central processing unit instruction set, and the function of the first instruction can be implemented by calling a program interface (API), but is not limited to this.
[0060] It should be noted that when performing application equivalent migration, if there is no instruction in the second CPU instruction set that can directly simulate the function of the first instruction, the system will use the API call method to replace the execution of the first instruction, and at the same time translate and convert the first instruction into a fourth instruction that can call the API interface. Even if the second CPU instruction set lacks an instruction that can directly simulate the function of the first instruction, the application can still implement the function of the first instruction by calling the API, reducing the compatibility problems caused by the instruction set differences, and further improving the stability of the second server when running the migrated application.
[0061] In the embodiments of the present application, in the case where there is no instruction in the first central processing unit instruction set that can simulate the instruction function of the first instruction, the first instruction is translated and converted to obtain a fourth instruction, where the fourth instruction is used to call an application programming interface to execute the instruction function of the first instruction. By translating the first instruction into the fourth instruction, the technical purpose of reducing compatibility problems caused by instruction set differences is achieved, and further the technical effect of improving the stability of the second server when running the migrated application is realized.
[0062] As an alternative solution, according to the instruction function of the first instruction, the first instruction is translated and converted to obtain a second instruction, including:
[0063] When the instruction function of the first instruction meets the valid function condition, the first instruction is translated and converted to obtain a second instruction;
[0064] As an alternative solution, the method further includes:
[0065] When the instruction function of the first instruction does not meet the valid function condition, the first instruction is deleted from the second central processing unit instruction set or hidden from the second central processing unit instruction set.
[0066] In an alternative embodiment, the valid function condition may but is not limited to measuring the importance or security of the function run by the first instruction. When the valid function condition is met, the function generated by calling the first instruction can be regarded as valid or secure.
[0067] In an alternative embodiment, the instruction deletion or hiding may but is not limited to the case where the instruction function of the first instruction does not meet the valid function condition, and the system deletes or hides it from the second CPU instruction set of the second server, which means that the second server will no longer attempt to call the instruction when executing the migrated application program.
[0068] It should be noted that if the first instruction meets the function valid condition, it is normally translated and converted into a second instruction. If the first instruction does not meet the valid condition function, it means that the function effect generated after calling the first instruction has little impact or a large potential safety hazard on the migrated application program. Therefore, if the first instruction does not meet the valid function condition, the first instruction is deleted or hidden to reduce the impact of instructions that do not meet the valid function condition on application migration, and further improve the efficiency of application migration.
[0069] In the embodiments of the present application, when the instruction function of the first instruction meets the valid function condition, the first instruction is translated and converted to obtain a second instruction; when the instruction function of the first instruction does not meet the valid function condition, the first instruction is deleted from the second central processing unit instruction set or hidden from the second central processing unit instruction set. By determining whether the first instruction meets the function valid condition, the technical purpose of reducing the impact of instructions that do not meet the valid function condition on application migration is achieved, and thus the technical effect of improving the efficiency of application migration is realized.
[0070] As an optional solution, when the application migration deployment is on the second server and the first instruction needs to be called during the operation of the application, before calling the second instruction, the method further includes:
[0071] S1-1, in response to the application migration request of the application, shielding the differences between the first central processing unit instruction set and the second central processing unit instruction set for the application;
[0072] S1-2, migrating and deploying the application with the differences shielded to the second server.
[0073] In an optional embodiment, the instruction difference set shielding can be, but is not limited to, understood as creating an abstraction layer for the application through technical means, enabling the application to ignore the differences between the source architecture and the target architecture instruction sets when running on different CPU architectures, and realizing the smooth cross-architecture migration of the application.
[0074] In an optional embodiment, after receiving the application migration request, the system creates an intermediate layer and uses instruction virtualization technology to shield the differences between the first central processing unit instruction set and the second central instruction set for the application.
[0075] Furthermore, after shielding the differences between the first central processing unit instruction set and the second central instruction set, the system migrates the application from the first server to the second server and deploys it on the target server.
[0076] It should be noted that by shielding the differences between the first central processing unit instruction set and the second central processing unit instruction set for the application, it is achieved that even if the central processing unit architectures of the first server and the second server are different, the instruction set differences caused by the architecture differences can be ignored, ensuring the migration of the application, and thus improving the migration efficiency of the application.
[0077] In an embodiment of the present application, S1-1: In response to an application migration request of an application, differences between a first central processing unit (CPU) instruction set and a second CPU instruction set are masked for the application; and the application after masking the differences is migrated and deployed to a second server. By masking the differences between the first CPU instruction set and the second CPU instruction set for the application, the technical purpose of being able to ignore the instruction set differences caused by different architectures is achieved, ensuring the migration of the application, and thus the technical effect of improving the migration efficiency of the application is realized.
[0078] As an optional solution, masking the differences between the first CPU instruction set and the second CPU instruction set for the application includes:
[0079] S2-1: Obtain the instruction intersection between the first CPU instruction set and the second CPU instruction set;
[0080] S2-2: Obtain the feature intersection between the CPU of the first server and the CPU of the second server;
[0081] S2-3: Based on the instruction intersection and the feature intersection, construct a virtual feature resource pool, where the virtual feature resource pool contains the features and instructions required for the application to run;
[0082] S2-4: Through instruction virtualization technology, present the features and instructions in the virtual feature resource pool to the application.
[0083] In an optional embodiment, the instruction intersection may but is not limited to being a set of instructions common to two CPU instruction sets, and these instructions may but are not limited to having the same or similar functions on different CPU architectures.
[0084] In an optional embodiment, the feature intersection may but is not limited to being a set of features common to two CPU architectures, and may but is not limited to including features such as hardware virtualization support, multi-thread processing ability, cache structure, etc. These features may but are not limited to be used for the running environment and performance of the application on different CPUs.
[0085] In an optional embodiment, the virtual feature resource pool may but is not limited to being a resource pool constructed based on the instruction intersection and the feature intersection, containing the features and instructions required for the application to run, and providing an abstract running environment for the application.
[0086] In an optional embodiment, the instruction virtualization technology may but is not limited to being a technology for abstracting and converting instructions and features, and may but is not limited to being used to enable the application to access instructions and features equivalent to the source architecture function when running on different CPU architectures without code modification or recompilation.
[0087] In an alternative embodiment, first, common instructions are identified from the first central processing unit (CPU) instruction set corresponding to the first server and the CPU instruction set corresponding to the second server. Based on the identified common instructions, an instruction intersection between the first CPU instruction set and the second CPU instruction set is obtained.
[0088] Furthermore, common characteristics are obtained from the CPUs of the first server and the second server. Based on the obtained common characteristics, a characteristic intersection between the CPU of the first server and the CPU of the second server is obtained.
[0089] Next, based on the obtained instruction intersection and characteristic intersection, the system constructs a virtual characteristic resource pool, which contains the characteristics and instructions required for the application to run.
[0090] Finally, through instruction virtualization technology, the system presents the instructions and characteristics in the virtual characteristic resource pool to the application. This means that when the application is running, a unified set of instructions and characteristics is presented to the application, and it will not perceive the differences in the actual CPU architectures. Therefore, even after the application is migrated, it can still run normally.
[0091] It should be noted that by constructing the virtual characteristic resource pool, even on different CPU architectures, it is possible to provide the application with functionally equivalent instructions and similar characteristics, solving the application compatibility problem caused by the differences in instruction sets and characteristics between different CPU architectures, and improving the stability of the application when running on servers with different central processing unit architectures. In addition, through instruction virtualization technology, when the application runs on CPUs with different architectures, there is no need for additional code modification or recompilation, simplifying the migration process and improving the migration efficiency.
[0092] Through the embodiments of the present application, an instruction intersection between the first CPU instruction set and the second CPU instruction set is obtained; a characteristic intersection between the CPU of the first server and the CPU of the second server is obtained; based on the instruction intersection and the characteristic intersection, a virtual characteristic resource pool is constructed, where the virtual characteristic resource pool contains the characteristics and instructions required for the application to run; through instruction virtualization technology, the characteristics and instructions in the virtual characteristic resource pool are presented to the application. By constructing the virtual characteristic resource pool and instruction virtualization technology, the technical purpose of being able to provide the application with functionally equivalent instructions and similar characteristics even on different CPU architectures, and enabling the application to run on CPUs with different architectures without additional code modification or recompilation, simplifying the migration process, is achieved, and thus the technical effect of improving the stability and migration efficiency of the application when running on servers with different central processing unit architectures is realized.
[0093] As an alternative, before obtaining the application deployed on the first server in the server cluster, the method further includes:
[0094] S3-1, obtaining the multi-dimensional performance data of each central processing unit (CPU) of different architecture types under the same configuration;
[0095] S3-2, using the multi-dimensional performance data to obtain the processor performance vector of each central processing unit, where each element in the processor performance vector represents the performance score of the central processing unit under different evaluation dimensions;
[0096] S3-3, constructing a resource pool for the server cluster according to the processor performance vector, where the resource pool is a virtual resource set that uniformly manages and schedules the central processing unit resources of all servers in the server cluster.
[0097] In an alternative embodiment, the multi-dimensional performance data can be, but is not limited to, a data set obtained by evaluating the CPU under multiple performance test dimensions, and can include, but is not limited to, computing power, memory access speed, parallel processing ability, energy consumption performance, etc., and can be used to comprehensively reflect the comprehensive performance of the CPU.
[0098] In an alternative embodiment, the processor performance vector can be, but is not limited to, formed based on the multi-dimensional performance data, and can be, but is not limited to, a data structure for describing the performance characteristics of the CPU. Each element in the vector represents the score of the CPU under a certain performance test dimension. In vector form, performance comparison and analysis can be conveniently performed, improving the analysis efficiency of performance.
[0099] In an alternative embodiment, it is first necessary to obtain the multi-dimensional performance data of CPUs of different architecture types under the same hardware configuration, which can be, but is not limited to, completed by a variety of different standard performance test tools to ensure the objectivity of the data.
[0100] Furthermore, based on the obtained multi-dimensional performance data, the system calculates the processor performance vector of each CPU. Each element in the vector represents the score of the CPU under a certain performance test dimension, and can comprehensively characterize the performance characteristics of the central processing unit.
[0101] Finally, the system constructs a virtual resource pool for the server cluster according to the constructed processor performance vector. The virtual resource pool uniformly manages and schedules the CPU resources of all servers in the cluster. Through the comparison and analysis of the performance vectors, the reasonable allocation of CPU resources of different architectures is ensured to meet the equivalent migration dynamic resource requirements of business applications.
[0102] It should be noted that by constructing a virtual resource pool based on the processor performance vector, the system can accurately evaluate the performance of CPUs with different architectures, achieve efficient resource scheduling, and reduce resource waste. Moreover, based on the resource scheduling technology of the virtual resource pool, it is possible to achieve equivalent migration of business applications among different CPU architecture types. Even in servers with significant architectural differences, applications can obtain the same computing power, thus enhancing the running stability of application programs in different servers.
[0103] Through the embodiments of this application, multi-dimensional performance data of each central processing unit (CPU) with different architecture types under the same configuration are obtained; using the multi-dimensional performance data, the processor performance vector of each central processing unit is obtained, where each element in the processor performance vector represents the performance score of the central processing unit under different evaluation dimensions; according to the processor performance vector, a resource pool of the server cluster is constructed, where the resource pool is a virtual resource set that uniformly manages and schedules the central processing unit resources of all servers in the server cluster. By constructing a virtual resource pool based on the processor performance vector and the resource scheduling technology of the virtual resource pool, the technical purpose of being able to achieve equivalent migration of business applications among different CPU architecture types is achieved. Even in servers with significant architectural differences, applications can obtain the same computing power, and thus the technical effect of enhancing the running stability of application programs in different servers is realized.
[0104] As an optional solution, constructing a resource pool of the server cluster according to the processor performance vector includes at least one of the following:
[0105] S4-1, calculating the first norm and the second norm of the processor performance vector to quantify the overall computing power of the central processing unit, where the first norm is the sum of the absolute values of all elements in the processor performance vector, and the second norm is the square root of the sum of the squares of all elements in the processor performance vector;
[0106] S4-2, calculating the distance between at least two processor performance vectors to obtain at least two central processing units that meet the condition of similar computing power;
[0107] S4-3, classifying each central processing unit according to the computing power characteristics corresponding to the processor performance vector.
[0108] In an optional embodiment, the first norm can be, but is not limited to, one of the common methods for measuring the size of a vector, can be, but is not limited to, the sum of the absolute values of all elements in the vector, and can be, but is not limited to, used to quantify the total weighted computing power of the central processing unit.
[0109] In an optional embodiment, the second norm can be, but is not limited to, the square root of the sum of the squares of all elements in the vector.
[0110] In an alternative embodiment, the computing power similarity condition may, but is not limited to, refer to the situation where when the computing power difference between central processing units (CPUs) of different architectures is within a certain threshold, it can be considered that these CPUs of different architectures have similar computing capabilities.
[0111] In an alternative embodiment, the computing power characteristics may, but are not limited to, refer to the performance of a central processing unit in different performance dimensions such as computing speed, memory bandwidth, read / write rate, etc., and can be used to describe, but are not limited to, the comprehensive performance of the central processing unit.
[0112] In an alternative embodiment, first, by calculating the first norm and the second norm of the processor performance vector, the overall computing power of each central processing unit can be quantified.
[0113] Furthermore, by calculating the distance between at least two processor performance vectors, when calculating the distance, it may, but is not limited to, be performed by methods such as Euclidean distance, Manhattan distance, etc., to obtain central processing units with similar computing power.
[0114] Finally, according to the computing power characteristics corresponding to the processor performance vector, the central processing units are classified to facilitate the management and scheduling of the same type of central processing units in the resource pool.
[0115] It should be noted that by calculating the first norm and the second norm, not only can the overall computing power of each central processing unit be quantified, but also its comprehensive performance in multi-dimensional performance can be evaluated. Based on the calculation of computing power similarity, the system can identify central processing units with similar performance, and since central processing units with similar computing power can be regarded as a resource group for unified management and scheduling, the resource utilization rate is improved. And the classification based on computing power characteristics further refines the management of central processing units in the resource pool, enabling the system to select the most suitable central processing unit resources for allocation according to specific task requirements, achieving the efficient utilization of resources.
[0116] Through the embodiments of the present application, the first norm and the second norm of the processor performance vector are calculated to quantify the overall computing power of the central processing unit, where the first norm is the sum of the absolute values of all elements in the processor performance vector, and the second norm is the square root of the sum of the squares of all elements in the processor performance vector; the distance between at least two processor performance vectors is calculated to obtain at least two central processing units that meet the computing power similarity condition; and each central processing unit is classified according to the computing power characteristics corresponding to the processor performance vector. By calculating the first norm and the second norm, the technical purpose of being able to quantify the overall computing power of each central processing unit is achieved, and further the technical effect of realizing the efficient utilization of resources is achieved.
[0117] As an alternative solution, after constructing the resource pool of the server cluster according to the processor performance vector, the method further includes:
[0118] S5-1, configure a first quantity of central processing unit (CPU) resources for a business application running on a first server;
[0119] S5-2, calculate the CPU computing power value of the first server under the configuration of the first quantity of CPU resources through a resource pool;
[0120] S5-3, obtain a second quantity of CPU resources that need to be configured for the business application on a second server according to the CPU computing power value;
[0121] S5-4, configure the second quantity of CPU resources for the business application on the second server.
[0122] In an alternative embodiment, the CPU resources may include, but are not limited to, the number of CPU cores and frequency modulation conditions, etc.
[0123] In an alternative embodiment, a CPU core may be, but is not limited to, an independent processing unit in a central processing unit (CPU), which can execute multiple tasks or threads simultaneously. Each core contains complete computing resources, such as an arithmetic logic unit, a control unit, registers, and a cache, and can run instructions and process data independently.
[0124] In an alternative embodiment, the frequency modulation condition may be, but is not limited to, a frequency dynamic adjustment mechanism of the CPU, which may include, but is not limited to, dynamic voltage adjustment and frequency adjustment, and may include, but is not limited to, parameters such as performance state, energy efficiency state, and frequency step.
[0125] In an alternative embodiment, first configure a first quantity of CPU resources for a system process running on a first server in a server cluster.
[0126] Further, calculate the CPU computing power value of the first server under the configuration of the first quantity of CPU resources through the resource pool and the processor performance vector of the CPU of the server.
[0127] Next, based on the calculated CPU computing power value, further calculate the second quantity of CPU resources required to provide equivalent processing capabilities for the same system process on the second server.
[0128] Finally, configure the second quantity of CPU resources for the system process on the second server according to the calculated second quantity of CPU resources required to provide equivalent processing capabilities for the same system process on the second server.
[0129] It should be noted that by configuring the same amount of CPU resources for system processes, the system can ensure that the same process running on different servers has similar processing speeds and efficiencies. At the same time, the construction of the resource pool and the calculation of the computing power value provide tools for quantifying the processing capabilities of different servers, enabling the system to dynamically adjust the configured amount of CPU resources according to actual needs, achieving performance consistency and efficient resource utilization when different servers process the same system process.
[0130] Through the embodiments of the present application, configure the first amount of CPU resources for the business application running on the first server; through the resource pool, calculate the CPU computing power value of the first server under the configuration of the first amount of CPU resources; according to the CPU computing power value, obtain the second amount of CPU resources that need to be configured for the business application on the second server; on the second server, configure the second amount of CPU resources for the business application. By configuring the same amount of CPU resources for system processes, the technical purpose of enabling the system to dynamically adjust the configured amount of CPU resources according to actual needs is achieved, and thus the technical effect of achieving performance consistency and efficient resource utilization when different servers process the same system process is realized.
[0131] As an optional solution, after translating and converting the first instruction to obtain the second instruction, the method further includes:
[0132] Apply the second instruction to the hardware simulation environment of the second server for simulation testing to obtain simulation test results.
[0133] In an optional embodiment, the hardware simulation environment can be, but is not limited to, a virtual environment constructed on the second server that can simulate the CPU architecture characteristics of the first server. Through the hardware simulation environment, the running effect of application instructions on the target architecture can be tested, and the compatibility and performance impact of the instructions can be evaluated.
[0134] In an optional embodiment, the simulation test results can be, but are not limited to, the test data and conclusions regarding instruction compatibility, security, performance impact, etc. obtained after testing specific application instructions through the hardware simulation environment.
[0135] It should be noted that during the application of equivalent migration, the system applies the second instruction obtained by translating and converting the first instruction on the first server to the hardware simulation environment of the second server, which can be used but not limited to testing the compatibility and running effect of the instruction on the central processing unit architecture of the second server. After the test, the running result of the second instruction in the hardware simulation environment of the second server is obtained as the test result. The test result includes information such as the compatibility, execution efficiency, and resource occupancy of the instruction, improving the acquisition efficiency of the running result of the second instruction on the application program of the second server after the application program is migrated to the second server.
[0136] Through the embodiments of the present application, the second instruction is applied to the hardware simulation environment of the second server for simulation testing to obtain a simulation test result. Through the instruction simulation test of the hardware simulation environment, the technical purpose of being able to evaluate the compatibility of the second instruction on the target CPU architecture is achieved, and further the technical effect of improving the acquisition efficiency of the running result of the second instruction on the application program of the second server after the application program is migrated to the second server is realized.
[0137] As an optional solution, applying the second instruction to the hardware simulation environment of the second server for simulation testing to obtain a simulation test result includes:
[0138] Applying the second instruction to the hardware simulation environment to simulate the behavior of the second instruction under boundary conditions to obtain a simulation test result.
[0139] In an optional embodiment, the boundary conditions can include but are not limited to conditions such as data overflow, extreme value input, and abnormal interruption.
[0140] It should be noted that through the instruction simulation test under boundary conditions, the system can evaluate the compatibility and stability of the instruction on the target CPU architecture, and timely identify and handle potential problems under boundary conditions. In addition, the boundary condition test not only focuses on the compatibility and stability of the instruction, but also can evaluate the impact of the second instruction on the architecture performance of the central processing unit of the second server, improving the stability when the second server executes the second instruction.
[0141] Through the embodiments of the present application, through the instruction simulation test under boundary conditions, the technical purpose of being able to evaluate the impact of the second instruction on the architecture performance of the central processing unit of the second server is achieved, and further the technical effect of improving the stability when the second server executes the second instruction is realized.
[0142] As an optional solution, when the application program is migrated and deployed to the second server and the first instruction needs to be called during the running of the application program, during the process of calling the second instruction, the method further includes:
[0143] When an abnormal running event triggered during the running of the application is obtained, an alarm message is displayed, where the alarm message is used to prompt that the application runs abnormally and the call status of the second instruction.
[0144] In an alternative embodiment, the abnormal running event can be, but is not limited to, situations such as running failure or performance abnormality of the application during running due to various error reasons.
[0145] In an alternative embodiment, the alarm message can be, but is not limited to, a warning message used to prompt the abnormal running state of the application and the specific reason, and can be, but is not limited to, used to prompt that the application runs abnormally and the call status of the second instruction.
[0146] It should be noted that during the running of the application, the system obtains the abnormal running event triggered by the application in real time. Once the abnormal event occurs, the alarm message is immediately displayed to prompt that the application runs abnormally, and the call status of the second instruction related to the abnormal event is reported, so as to timely feedback the abnormality of the application and the specific abnormal matters, thereby improving the repair efficiency of the application abnormality.
[0147] Through the embodiments of the present application, when an abnormal running event triggered during the running of the application is obtained, an alarm message is displayed, where the alarm message is used to prompt that the application runs abnormally and the call status of the second instruction. By timely displaying the alarm message after the application runs abnormally, the technical purpose of feedbacking the abnormality of the application and the specific abnormal matters is achieved, and thus the technical effect of improving the repair efficiency of the application abnormality is realized.
[0148] As an alternative solution, after displaying the alarm message, the method further includes:
[0149] In response to the application rollback request, the data of the application is restored to the original state on the first server.
[0150] In an alternative embodiment, the application rollback request can be, but is not limited to, restoring the application state to the original state on the first server.
[0151] It should be noted that after receiving the abnormal running event triggered during the running of the application and displaying the alarm message, by issuing the application rollback request, the system will roll back the application to the original state, and at the same time restore the data of the application to the original state on the first server, preventing the running errors from causing security risks to the application software and improving the security of the application during running after migration.
[0152] In the embodiments of the present application, in response to an application rollback request, the data of the application is restored to the original state on the first server. By rolling back the application to the original state and restoring the data to the original state on the first server, the technical purpose of preventing security risks in the application software caused by runtime errors is achieved, and the technical effect of improving the security of the application during runtime after migration is realized.
[0153] As an alternative solution, during the process of invoking the second instruction, the method further includes:
[0154] S6-1, obtaining the real-time behavior information of the application;
[0155] S6-2, obtaining the historical behavior information of the application on the first server;
[0156] S6-3, verifying the second instruction by combining the historical behavior information and the real-time behavior information.
[0157] In an alternative embodiment, the historical behavior information may but is not limited to refer to the real-time running state and performance data of the business application in the environment of the second server, and may but is not limited to include CPU occupancy rate, memory usage, instruction call frequency and duration, etc.
[0158] In an alternative embodiment, the historical behavior information may but is not limited to refer to the running state and performance data of the business application in the environment of the first server, and may but is not limited to include information such as CPU occupancy, memory usage, and instruction call conditions during normal operation before migration.
[0159] It should be noted that the system first obtains the real-time behavior information of the business application on the target server, including CPU occupancy, memory usage, instruction call frequency and duration, etc. Subsequently, the system obtains the historical behavior information of the business application on the source server as a standard for verifying the consistency and compatibility of the instruction behavior. Finally, the system compares and analyzes the historical behavior information with the real-time behavior information to verify the second instruction, ensuring the correctness and behavior consistency of the instruction on the target architecture. By combining historical and real-time behavior information for instruction verification, the system can evaluate the compatibility and behavior consistency of the instruction on the CPU architecture of the second server, timely discover and handle potential performance degradation or abnormal behavior, and improve the stability of the application when running between servers with different architectures.
[0160] Through the embodiments of the present application, obtain the real-time behavior information of the application; obtain the historical behavior information of the application on the first server; combine the historical behavior information and the real-time behavior information to verify the second instruction. By combining the historical and real-time behavior information for instruction verification, the technical purpose of being able to evaluate the compatibility and behavior consistency of the instruction on the CPU architecture of the second server is achieved, and potential performance degradation or abnormal behavior can be discovered and processed in a timely manner, thereby realizing the technical effect of improving the running stability of the application between servers with different architectures.
[0161] As an alternative solution, perform translation conversion on the first instruction to obtain the second instruction, including:
[0162] Perform dynamic binary translation on the first instruction to obtain the second instruction.
[0163] In an alternative embodiment, dynamic binary translation can be, but is not limited to, a technology that converts the binary code of the central processing unit architecture of the first server into the binary code of the central processing unit architecture of the second server during program execution.
[0164] It should be noted that through the dynamic binary translation technology, not only the compatibility problem of instructions on different central processing unit architectures is solved, but also the equivalent conversion of instruction functions and performance is achieved. Business applications can run smoothly on the target server without code rewriting or compilation, greatly improving the migration efficiency and running success rate.
[0165] In addition, the dynamic binary translation technology can also handle the instruction compatibility problems between multiple different architectures, providing flexible migration support for applications, and reducing the operation and maintenance costs and business interruption risks caused by architecture differences.
[0166] Through the embodiments of the present application, perform dynamic binary translation on the first instruction to obtain the second instruction. Through the dynamic binary translation technology, the technical purpose of enabling the application program to run smoothly on the second server without code rewriting or compilation is achieved, and the technical effect of improving the migration efficiency and running success rate is realized.
[0167] As an alternative solution, apply the above application migration method for servers in the application migration scenario of heterogeneous CPU servers.
[0168] In an alternative embodiment, this embodiment proposes a cross-core scheduling computing power migration method. Aiming at the problem that business applications need to be recompiled based on different instruction sets on different CPU chip servers, this embodiment selects and invokes CPU instructions with the same function for business applications on different CPU platforms through the method of instruction pass-through and simulation, so that business applications can switch to different CPU platforms with the same CPU computing power without recompilation.
[0169] Meanwhile, based on the CPU computing power vector database in this embodiment, comparable CPU computing power data is realized. Based on this data, the number of CPU cores allocated to the business application system when running on different CPU platforms is flexibly adjusted, achieving the equivalent migration of the business application system.
[0170] It should be noted that the basic idea of this embodiment is as follows:
[0171] 1) Instruction pass-through and simulation method for heterogeneous processor application migration: Construct a CPU feature resource pool based on the intersection of CPU features to achieve instruction pass-through; perform online migration based on instruction translation, capture CPU instructions supported by the source host but not supported by the target host, and translate and convert the virtual machine code to achieve instruction simulation;
[0172] 2) Construct a standard computing power measurement method for heterogeneous processors: Use standard evaluation tools to calculate the real multi-dimensional performance data of mainstream domestic and foreign CPUs under the same memory, hard disk, and network configurations, and form a vector database;
[0173] 3) Equivalent computing power elastic scaling method for heterogeneous processors. Based on the standard computing power vector database, ensure that the CPU computing power actually obtained by the business application system before and after migration is the same.
[0174] In an optional embodiment, this embodiment proposes an application equivalent migration method and device for cross-heterogeneous CPU servers, adding an instruction adaptation layer compatible with multiple CPU architectures in the cloud computing system. When the business application system migrates between different CPU platforms, the instruction adaptation layer can not only pass through and call the same CPU instructions, but also call instructions with similar functions between different CPU architectures, enabling the upper-layer user services to migrate across CPU platforms without recompilation. At the same time, based on the standard CPU computing power vector database, flexibly adjust the number of CPU cores allocated to the application system before and after migration to achieve the equivalent migration of the application system.
[0175] For further illustration, the overall scheme is as Figure 3 shown. CPU (Central Processing Unit) platform A obtains that 4 CPUs are required to run the application through vector evaluation by the standard CPU computing power vector database. After the application migrates to CPU platform B through the migration pipeline, it is obtained through the standard CPU computing power vector database that 2 CPUs are required to run the application. Among them, when migrating through the migration pipeline, there are two processes of instruction inheritance and instruction simulation, and there is also a CPU feature resource pool, in which there are instruction set 1, instruction set 2, instruction set 3, instruction set 4, and instruction set 5.
[0176] It should be noted that there are obvious differences in instruction sets among CPUs of different models. Even for the same feature, the designs and implementations of different manufacturers are different. Taking the support for hardware virtualization feature as an example, the x86 architecture has implemented technologies such as VT and SVM, while the ARM architecture has implemented technologies such as VE and VHE, thus exposing different CPU instruction sets outward, resulting in instruction access exception problems after the user business system migrates across CPUs.
[0177] To solve this problem, this embodiment proposes an application migration method between heterogeneous processors. First, this embodiment constructs a CPU feature resource pool based on the intersection of CPU features, and presents the same CPU features to the application system through instruction virtualization technologies such as CPUID, shielding the differences between different CPUs and realizing the online migration of the application system.
[0178] Secondly, this embodiment proposes an online migration method based on instruction translation. After the memory state of the application system is copied during hot migration and before the virtual machine is launched at the target end, the application system code is translated and converted. All code segments are identified from the application system memory, and CPU instructions supported by the source host but not supported by the target host are captured and translated and converted online.
[0179] For further illustration, optionally, as Figure 4 shown, there are 4 applications, and each application has 4 CPUs (central processing units). Through instruction inheritance and instruction simulation, the application can achieve online translation and conversion between different instruction sets, such as instruction set 1, instruction set 2, instruction set 3, instruction set 4, and instruction set 5.
[0180] In an optional embodiment, this embodiment proposes a standard computing power measurement scheme for heterogeneous processors, and the problems to be solved are as follows:
[0181] Since the computing capabilities of processors with different architectures are different, even if the same application uses the same specification of resource encapsulation, there are differences in performance when running in a heterogeneous environment. The main problem faced by the one-cloud multi-core system is the multi-source heterogeneity of CPUs. ARM and x86 architecture processors from multiple manufacturers are different in terms of instruction sets, core numbers, production processes, etc., so there are also differences in performance.
[0182] In this embodiment, a standard computing power vector database for heterogeneous processors is established. Using standard evaluation tools such as CoreMark, Stream, 7-Zip, GeekBench, Linpack, and SPEC CPU, the real multi-dimensional performance data of mainstream CPUs at home and abroad, such as Intel, AMD, Ampere, Feiteng, Kunpeng, and Haiguang, are calculated under the same configurations of memory, hard disk, and network, forming CPU performance vectors. Each element of the vector represents the performance score of the CPU under a certain standard evaluation tool. Based on this vector database, a series of innovative works can be carried out, such as evaluating the computing power value of the CPU by calculating vector length calculation methods such as L1 and L2 norms, calculating the computing power similarity of different CPU models by search methods such as k-NN, and classifying different CPU models based on computing power characteristics by classification methods such as SVM.
[0183] For further illustration, optionally, as Figure 5 shown, CPU (Central Processing Unit) Model A, CPU Model B, CPU Model C, CPU Model D, and CPU Model E analyze and construct a standard CPU vector database through Standard Evaluation Tool 1, Standard Evaluation Tool 2, Standard Evaluation Tool 3, Standard Evaluation Tool 4, Standard Evaluation Tool 5, and Standard Evaluation Tool 6, and the standard CPU vector database includes computing power vectors a, b, c, d, and e.
[0184] It should be noted that due to differences in CPU processes, manufacturing processes, designs, etc., there are significant performance gaps among CPUs of different manufacturers and models. When a business application migrates from a high-performance Type A CPU platform to a low-performance Type B CPU platform, even if the CPU resources occupied by the business application on the surface are the same before and after, its actual performance may also drop significantly.
[0185] To solve this problem, this embodiment proposes a CPU equivalent computing power elastic scaling technology for heterogeneous processors. Based on the standard computing power vector database, when a business application migrates from a Type A CPU platform to a Type B CPU platform, the instruction adaptation layer first calculates the computing power data required for the business application based on the actual Type A CPU resources (number of cores, frequency modulation situation, etc.) occupied by the business application, and then calculates the required Type B CPU resource situation for this computing power data, so as to achieve equivalent configuration of CPU resources for the business application.
[0186] For further illustration, optionally, as Figure 6 shown, when the application runs on CPU (Central Processing Unit) Platform A, it requires 4 CPUs. After equivalent computing power conversion, it is obtained that the application requires 2 CPUs when running on CPU Platform B. Then, after migrating the application to CPU Platform B through the migration pipeline, 2 CPUs are allocated to the application.
[0187] In an alternative embodiment, an instruction adaptation layer compatible with multiple CPU architectures is added to the cloud computing system. When a business application system migrates between different CPU platforms, the instruction adaptation layer can either transparently transmit and call the same CPU instructions or call instructions with similar functions between different CPU architectures, enabling the upper-layer user services to migrate across CPU platforms without recompilation. Based on the standard CPU computing power vector database, the number of CPU cores allocated to the application system before and after migration is flexibly adjusted to achieve equivalent migration of the application system.
[0188] Through the embodiments of the present application, an instruction adaptation layer compatible with multiple CPU architectures is added to the cloud computing system. When a business application migrates between different CPU platforms, the instruction adaptation layer can either transparently transmit and call the same CPU instructions or call instructions with similar functions between different CPU architectures, enabling the upper-layer user services to migrate across CPU platforms without recompilation.
[0189] From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0190] In this embodiment, an application migration device for a server is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation by hardware, or a combination of software and hardware is also possible and contemplated.
[0191] Figure 7 is a structural block diagram of a scheduling device for a cloud host of a cloud platform according to an embodiment of the present application, as Figure 7 shown. This device includes:
[0192] A first acquisition unit 702, configured to acquire an application program deployed on a first server in a server cluster, where the first server uses a first central processing unit instruction set, and the first central processing unit instruction set is a set of basic commands used by the central processing unit of the first server to interact with and execute upper-layer application programs;
[0193] A second acquisition unit 704, configured to, in response to an application migration request of the application program, acquire a second central processing unit instruction set used by a second server in the server cluster, where the application migration request is used to request to migrate and deploy the application program to the second server, and the second central processing unit instruction set is a set of basic commands used by the central processing unit of the second server to interact with and execute upper-layer application programs;
[0194] A third acquisition unit 706, configured to acquire a first instruction with a difference between a first central processing unit instruction set and a second central processing unit instruction set;
[0195] A translation unit 708, configured to perform translation conversion on the first instruction to obtain a second instruction, where the second instruction is used to simulate an instruction in the first central processing unit instruction set;
[0196] An invocation unit 710, configured to invoke the second instruction when the application is migrated and deployed to the second server and the application needs to invoke the first instruction during operation.
[0197] As an optional solution, the translation unit 708 includes: a first translation module, configured to perform translation conversion on the first instruction according to the instruction function of the first instruction to obtain the second instruction.
[0198] As an optional solution, the first translation module includes: a determination sub-module, configured to determine at least one third instruction from the first central processing unit instruction set, where at least one third instruction is used to simulate the instruction function of the first instruction, and the second instruction includes at least one third instruction.
[0199] As an optional solution, the first translation module includes: a first translation sub-module, configured to perform translation conversion on the first instruction to obtain a fourth instruction when there is no instruction in the first central processing unit instruction set that can simulate the instruction function of the first instruction, where the fourth instruction is used to call an application programming interface to execute the instruction function of the first instruction.
[0200] As an optional solution, the first translation module includes: a second translation sub-module, configured to perform translation conversion on the first instruction to obtain the second instruction when the instruction function of the first instruction meets the valid function condition; a deletion sub-module, configured to delete the first instruction from the second central processing unit instruction set or hide the first instruction from the second central processing unit instruction set when the instruction function of the first instruction does not meet the valid function condition.
[0201] As an optional solution, the invocation unit 710 includes: a shielding module, configured to shield the difference between the first central processing unit instruction set and the second central processing unit instruction set for the application in response to an application migration request of the application; a migration module, configured to migrate and deploy the application with the difference shielded to the second server.
[0202] As an alternative solution, the shielding module includes: a first acquisition sub-module, configured to acquire the instruction intersection between the first central processing unit (CPU) instruction set and the second CPU instruction set; a second acquisition sub-module, configured to acquire the feature intersection between the CPUs of the first server and the second server; a construction sub-module, configured to construct a virtual feature resource pool based on the instruction intersection and the feature intersection, where the virtual feature resource pool includes the features and instructions required for the application to run; and a presentation sub-module, configured to present the features and instructions in the virtual feature resource pool to the application through instruction virtualization technology.
[0203] As an alternative solution, the first acquisition unit 702 includes: a first acquisition module, configured to acquire the multi-dimensional performance data of each CPU of different architecture types under the same configuration; a second acquisition module, configured to use the multi-dimensional performance data to acquire the processor performance vector of each CPU, where each element in the processor performance vector represents the performance score of the CPU under different evaluation dimensions; and a construction module, configured to construct a resource pool of the server cluster according to the processor performance vector, where the resource pool is a virtual resource set that uniformly manages and schedules the CPU resources of all servers in the server cluster.
[0204] As an alternative solution, the construction module includes: a first calculation sub-module, configured to calculate the first norm and the second norm of the processor performance vector to quantify the overall computing power of the CPU, where the first norm is the sum of the absolute values of all elements in the processor performance vector, and the second norm is the square root of the sum of the squares of all elements in the processor performance vector; a second calculation sub-module, configured to calculate the distance between at least two processor performance vectors to obtain at least two CPUs that meet the computing power similarity condition; and a classification sub-module, configured to classify each CPU according to the computing power characteristics corresponding to the processor performance vector.
[0205] As an alternative solution, the construction module includes: a first configuration sub-module, configured to configure a first number of CPU resources for the business application running on the first server; a third calculation sub-module, configured to calculate the CPU computing power value of the first server under the configuration of the first number of CPU resources through the resource pool; a third acquisition sub-module, configured to acquire the second number of CPU resources that need to be configured for the business application on the second server according to the CPU computing power value; and a second configuration sub-module, configured to configure the second number of CPU resources for the business application on the second server.
[0206] As an alternative solution, the translation unit 708 includes: a test module, configured to apply the second instruction to the hardware simulation environment of the second server for simulation testing to obtain a simulation test result.
[0207] As an alternative solution, the test module includes: a test sub-module for applying the second instruction to a hardware simulation environment to simulate and test the behavior of the second instruction under boundary conditions and obtain a simulation test result.
[0208] As an alternative solution, the calling unit 710 includes: a display module for displaying an alarm message when an abnormal running event triggered during the running of the application is obtained, where the alarm message is used to prompt that the application runs abnormally and the calling status of the second instruction.
[0209] As an alternative solution, the display module includes: a recovery sub-module for restoring the data of the application to the original state on the first server in response to an application rollback request.
[0210] As an alternative solution, the calling unit 710 includes: a third acquisition module for acquiring real-time behavior information of the application; a fourth acquisition module for acquiring historical behavior information of the application on the first server; and a verification module for verifying the second instruction by combining the historical behavior information and the real-time behavior information.
[0211] As an alternative solution, the translation unit 708 includes: a second translation module for performing dynamic binary translation on the first instruction to obtain the second instruction.
[0212] For the description of the features in the corresponding embodiments of the application migration device of the server, reference can be made to the relevant description in the corresponding embodiments of the application migration method of the server, which will not be elaborated here one by one.
[0213] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned embodiments of the application migration method of the server.
[0214] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above-mentioned embodiments of the application migration method of the server when running.
[0215] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0216] An embodiment of the present application also provides a computer program product. The computer program product includes a computer program which, when executed by a processor, implements the steps in any of the above-described method embodiments for application migration of a server.
[0217] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps in any of the above-described method embodiments for application migration of a server.
[0218] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0219] The above has introduced in detail a method and apparatus for application migration of a server provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A method for migrating an application of a server, characterized in that: include: Obtaining an application deployed on a first server in a server cluster, wherein the first server uses a first central processing unit instruction set, which is a basic command set used by a central processing unit of the first server to interact with and execute an upper-layer application; In response to an application migration request of the application, obtaining a second central processing unit instruction set used by a second server in the server cluster, wherein the application migration request is used to request the application to be migrated and deployed to the second server, and the second central processing unit instruction set is a basic command set used by a central processing unit of the second server to interact with and execute an upper-layer application; Acquire a first instruction that has a difference between the first central processing unit instruction set and the second central processing unit instruction set; Translating the first instruction to obtain a second instruction, wherein the second instruction is used to simulate an instruction in an instruction set of the first central processing unit; When the application is migrated and deployed to the second server and the first instruction needs to be called when the application is running, the second instruction is called.
2. The method according to claim 1, characterized in that The translating and converting the first instruction to obtain the second instruction includes: The first instruction is translated and converted according to the instruction function of the first instruction to obtain the second instruction.
3. The method according to claim 2, characterized in that The translating and converting the first instruction according to the instruction function of the first instruction to obtain the second instruction includes: At least one third instruction is determined from the first central processing unit instruction set, wherein the at least one third instruction is used to simulate the instruction function of the first instruction, and the second instruction includes the at least one third instruction.
4. The method according to claim 3, characterized in that The translating and converting the first instruction according to the instruction function of the first instruction to obtain the second instruction includes: In the absence of an instruction in the first CPU instruction set that can simulate the instruction function of the first instruction, the first instruction is translated and converted to obtain a fourth instruction, wherein the fourth instruction is used to call an application program interface to execute the instruction function of the first instruction.
5. The method according to claim 2, characterized in that: The translating and converting the first instruction according to the instruction function of the first instruction to obtain the second instruction includes: translating and converting the first instruction to obtain the second instruction when the instruction function of the first instruction meets the valid function condition; The method further includes: when the instruction function of the first instruction does not meet the valid function condition, deleting the first instruction from the second central processing unit instruction set, or hiding the first instruction from the second central processing unit instruction set.
6. The method according to claim 1, characterized in that When the application is migrated and deployed to the second server, and the first instruction needs to be called when the application is running, before calling the second instruction, the method further includes: In response to an application migration request of the application, shielding the difference between the first central processing unit instruction set and the second central processing unit instruction set for the application; The application program after masking the differences is migrated and deployed to the second server.
7. The method according to claim 6, characterized in that The step of shielding the difference between the first central processing unit instruction set and the second central processing unit instruction set for the application program comprises: Obtaining an instruction intersection between the first central processing unit instruction set and the second central processing unit instruction set; Obtaining a characteristic intersection between a central processing unit of the first server and a central processing unit of the second server; Building a virtual feature resource pool based on the instruction intersection and the feature intersection, wherein the virtual feature resource pool includes features and instructions required for the application to run; The characteristics and instructions in the virtual characteristic resource pool are presented to the application program through instruction virtualization technology.
8. The method according to claim 1, characterized in that Before obtaining the application deployed on the first server in the server cluster, the method further includes: Obtain multi-dimensional performance data of various CPUs of different architecture types under the same configuration; Using the multi-dimensional performance data, obtaining a processor performance vector of each central processing unit, wherein each element in the processor performance vector represents a performance score of the central processing unit under different evaluation dimensions; A resource pool of the server cluster is constructed according to the processor performance vector, wherein the resource pool is a collection of virtual resources for central processing unit resources of all servers in the server cluster to be managed and scheduled in a unified manner.
9. The method according to claim 8, characterized in that The constructing the resource pool of the server cluster according to the processor performance vector includes at least one of the following: Calculating a first norm and a second norm of the processor performance vector to quantify the overall computing power of the central processing unit, wherein the first norm is the sum of the absolute values of all elements in the processor performance vector, and the second norm is the square root of the sum of the squares of all elements in the processor performance vector; Calculating the distance between at least two of the processor performance vectors to obtain at least two of the central processors that meet the computing power similarity condition; The central processing units are classified according to the computing power characteristics corresponding to the processor performance vectors.
10. The method according to claim 8, characterized in that After constructing the resource pool of the server cluster according to the processor performance vector, the method further includes: configuring a first amount of central processing unit resources for a business application running on the first server; Calculating, by means of the resource pool, a CPU computing power value of the first server under the configuration of the first number of CPU resources; According to the CPU computing power value, obtaining a second amount of CPU resources that need to be configured for the business application on the second server; On the second server, the second amount of central processing unit resources is configured for the business application.
11. The method according to claim 1, characterized in that: After translating and converting the first instruction to obtain the second instruction, the method further includes: Apply the second instruction to the hardware simulation environment of the second server, perform a simulation test, and obtain a simulation test result.
12. The method according to claim 11, characterized in that The applying the second instruction to the hardware simulation environment of the second server to perform a simulation test and obtain a simulation test result includes: Apply the second instruction to the hardware simulation environment, simulate and test the behavior of the second instruction under boundary conditions, and obtain a simulation test result.
13. The method according to claim 1, characterized in that When the application is migrated and deployed to the second server, and the first instruction needs to be called when the application is running, in the process of calling the second instruction, the method further includes: In the case of obtaining an abnormal operation event triggered when the application is running, an alarm message is displayed, wherein the alarm message is used to prompt that the application is running abnormally and the calling status of the second instruction.
14. The method according to claim 13, characterized in that After displaying the warning information, the method further includes: In response to an application rollback request, data of the application is restored to an original state on the first server.
15. The method according to any one of claims 1 to 14, characterized in that In the process of calling the second instruction, the method further includes: Obtaining real-time behavior information of the application; Obtaining historical behavior information of the application on the first server; The second instruction is verified in combination with the historical behavior information and the real-time behavior information.
16. The method according to any one of claims 1 to 14, characterized in that The translating and converting the first instruction to obtain the second instruction includes: Dynamically binary translate the first instruction to obtain the second instruction.
17. An application migration device for a server, characterized in that: include: A first acquisition unit is used to acquire an application deployed on a first server in the server cluster, wherein the first server uses a first central processing unit instruction set, which is a basic command set used by a central processing unit of the first server to interact with and execute an upper-layer application; A second acquisition unit is used to obtain a second central processing unit instruction set used by a second server in the server cluster in response to an application migration request of the application, wherein the application migration request is used to request the application to be migrated and deployed to the second server, and the second central processing unit instruction set is a basic command set used by the central processing unit of the second server to interact and execute with an upper-layer application; A third acquiring unit, configured to acquire a first instruction that is different between the first CPU instruction set and the second CPU instruction set; A translation unit, configured to translate and convert the first instruction to obtain a second instruction, wherein the second instruction is configured to simulate an instruction in an instruction set of the first central processing unit; A calling unit is used to call the second instruction when the application is migrated and deployed to the second server and the first instruction needs to be called when the application is running.
18. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the application migration method for a server as claimed in any one of claims 1 to 16 when executing the computer program.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the application migration method of the server according to any one of claims 1 to 16.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the application migration method of the server as claimed in any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
C / C++application migration tool from SPARC platform to K-UX platform
CN104536798A
Device and method for live migration of virtual machines in heterogeneous CPU (central processing unit) server cluster
CN107203414A
Heterogeneous method of virtualization resource pool, readable storage medium and virtualization platform
CN113553143A
Virtual resource migration method and device, electronic equipment and storage medium
CN114020409A
Cross-generation CPU cloud host live migration method, system and device and storage medium
CN116401015A