Compatibility method and device of virtual machine, computer equipment and storage medium

By obtaining and blocking differential function items in processor version information, generating and applying masking codes, the compatibility of virtual machines in different processor version environments is solved, and the compatibility between virtual machines and processors and server clusters is improved. stability.

CN119248416APending Publication Date: 2025-01-03SUGON INFORMATION IND +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411164774.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Existing virtual machines have poor compatibility problems in server clusters, especially when different versions of processors exist, which affect the working applications of the server cluster.

Method used

By obtaining the hardware information of the server cluster, blocking the differential function items in the processor version information, generating a mask code, and overwriting the function items to be blocked, ensuring that the virtual machine and the target server's hardware information are compatible, so as to be in different versions of the processor environment Implement compatibility.

Benefits of technology

Improves the compatibility between virtual machines and processors, enables virtual machines to run normally in the server cluster, supports vMotion online migration and DRS automatic load optimization, and enhances the adaptability between processors and virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248416A_ABST
    Figure CN119248416A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine compatibility method and device, computer equipment and a storage medium. The method comprises the steps of obtaining hardware information of each server in a server cluster, performing shielding processing on a processing function item in the hardware information of a target server to obtain processed hardware information, and configuring a virtual machine on the target server according to the processed hardware information; wherein the processed hardware information is compatible with the configuration of the virtual machine. According to the known hardware information of the server, the processing function item in the hardware information of the target server is shielded, so that the hardware information in the target server is compatible with the virtual machine, and therefore, when processors of different versions exist in a server cluster, the processors of all the versions can be compatible with the virtual machine, and the compatibility between the processors of all the versions and the virtual machine is improved. And the compatibility of the processor and the virtual machine is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a virtual machine compatibility method, apparatus, computer equipment and storage medium. Background Art

[0002] A virtual machine is a computer system that is implemented through software simulation and has complete hardware system functions. A virtual machine system needs to be built through a virtualization platform system. For example, VMware vSphere is a commonly used virtualization platform system with high stability.

[0003] However, processor-related hardware devices of computer devices are constantly being upgraded and updated, and there are different versions of processors in the server cluster. It is necessary for the virtual machine to be compatible with different versions of processors. However, the virtual machines in the related technology have poor compatibility problems, which affects the working applications of the server cluster. Summary of the invention

[0004] Based on this, it is necessary to provide a virtual machine compatibility method, apparatus, computer device and storage medium that can improve the compatibility of virtual machines in response to the above technical problems.

[0005] In a first aspect, the present application provides a virtual machine compatibility method, which is applied to a target server in a server cluster, and the method includes:

[0006] Get the hardware information of each server in the server cluster;

[0007] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0008] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0009] In one embodiment, the hardware information includes processor version information and processing function items, and the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information, including:

[0010] Obtaining processing function items of compatible servers according to processor version information of each server;

[0011] According to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information.

[0012] In one embodiment, according to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information, including:

[0013] Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded;

[0014] The function items to be shielded in the processor on the target server are shielded to obtain the processed hardware information.

[0015] In one embodiment, shielding processing is performed on the function items to be shielded in the processor on the target server to obtain the processed hardware information, including:

[0016] Processing the function code corresponding to the function item to be shielded according to the preset shielding code generation rule to generate a target shielding code for the target server;

[0017] The target mask code is used to cover the function item to be masked, and the hardware information including the covered function code is obtained.

[0018] In one embodiment, obtaining the processing function items of the compatible servers according to the processor version information of each server includes:

[0019] Determine whether the server cluster is a server cluster of a single processor version according to the processor version information of each server;

[0020] If the server cluster is a server cluster of a single processor version, obtaining processing function items of compatible servers according to the processor of the target version;

[0021] If the server cluster is not a server cluster of a single processor version, the processing function items of the compatible servers are determined according to the version information of each server in the server cluster.

[0022] In one embodiment, determining the processing function items of the compatible servers according to the version information of each server in the server cluster includes:

[0023] Determine compatible servers in the server cluster according to version information of each server in the server cluster;

[0024] Get the processing function items corresponding to the processor on the compatible server.

[0025] In one embodiment, the compatible server is a plurality of servers, and obtaining the processing function items corresponding to the processors on the compatible servers includes:

[0026] Obtaining a processing function item corresponding to a processor on any server among multiple servers;

[0027] Alternatively, the processing function item corresponding to the processor on the optimal version server is obtained; the optimal version server is a server with the highest processor version among multiple servers.

[0028] In a second aspect, the present application further provides a compatible device of a virtual machine, including:

[0029] The acquisition module is used to obtain the hardware information of each server in the server cluster;

[0030] A processing module, used for shielding the processing function items in the hardware information of the target server to obtain the processed hardware information;

[0031] The configuration module is used to configure the virtual machine on the target server according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0033] Get the hardware information of each server in the server cluster;

[0034] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0035] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0037] Get the hardware information of each server in the server cluster;

[0038] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0039] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0040] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0041] Get the hardware information of each server in the server cluster;

[0042] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0043] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0044] The above-mentioned virtual machine compatibility method, device, computer equipment and storage medium obtain the hardware information of each server in the server cluster, shield the processing function items in the hardware information of the target server, obtain the processed hardware information, and then configure the virtual machine on the target server according to the processed hardware information; wherein the processed hardware information is compatible with the configuration of the virtual machine. According to the known hardware information of the server, the processing function items in the hardware information of the target server are shielded, so that the hardware information in the target server is compatible with the virtual machine, so that when there are different versions of processors in the server cluster, each version of the processor can be compatible with the virtual machine, thereby improving the compatibility between the processor and the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0046] FIG1 is an application environment diagram of a compatibility method for a virtual machine in one embodiment;

[0047] FIG2 is a schematic diagram of a flow chart of a compatibility method for a virtual machine in one embodiment;

[0048] FIG3 is a schematic flow chart of a compatibility method for a virtual machine in another embodiment;

[0049] FIG4 is a schematic diagram of a flow chart of a compatibility method for a virtual machine in another embodiment;

[0050] FIG5 is a schematic flow chart of a compatibility method for a virtual machine in another embodiment;

[0051] FIG6 is a schematic flow chart of a compatibility method for a virtual machine in another embodiment;

[0052] FIG7 is a schematic flow chart of a compatibility method for a virtual machine in another embodiment;

[0053] FIG8 is a schematic flow chart of a compatibility method for a virtual machine in another embodiment;

[0054] FIG. 9 is a block diagram of a compatible device of a virtual machine in one embodiment. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0056] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation and may represent the singular or plural. The terms "including", "comprising", "having" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include unlisted steps or units, or may also include other steps or units inherent to these processes, methods, products or devices. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second" and the like involved in this application are only used to distinguish similar objects and do not represent a specific ordering of objects.

[0057] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.

[0058] The compatibility method of a virtual machine provided in an embodiment of the present application can be applied to an application environment as shown in Figure 1. Wherein, the computer device is a target server in a server cluster, and its internal structure diagram can be shown in Figure 1. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Wherein, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Wherein, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store compatible data of the virtual machine. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a compatibility method of a virtual machine is implemented.

[0059] Those skilled in the art will understand that the structure shown in FIG. 1 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0060] In one embodiment, as shown in FIG. 2 , a compatibility method for a virtual machine is provided, which is described by taking the method applied to the target server in FIG. 1 as an example, and includes:

[0061] S201, obtaining hardware information of each server in the server cluster.

[0062] The hardware information of the server may include version information of a processor in the server, and the processor may be a C86 processor; the target server may be any server in the server cluster.

[0063] In an embodiment of the present application, the target server may pre-form a hardware information database of the hardware information of each server in the server cluster, and the target server may obtain the version information of each server in the server cluster by reading the hardware information database in the local storage space; or, the target server may display an input interface to the user, thereby obtaining the hardware information of each server in the server cluster through the input interface; or, the target server may send a query request to each server in the server cluster, and receive the hardware information returned by each server based on the query request.

[0064] S202, shielding processing is performed on the processing function items in the hardware information of the target server to obtain processed hardware information.

[0065] In an embodiment of the present application, the masking code corresponding to the target server is determined based on the processing function items in the hardware information of each server, and the processing function items in the hardware information are masked according to the masking code corresponding to the target server to obtain the processed hardware information.

[0066] Optionally, the hardware information of each server includes compatible hardware information that is compatible with the virtual machine, and the difference between the compatible hardware information and the hardware information of the target server is determined, thereby determining the mask code corresponding to the target server according to the difference, and further, the processing function items in the hardware information of the target server are masked to obtain the processed hardware information.

[0067] S203, configuring the virtual machine on the target server according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0068] In the embodiment of the present application, the processed hardware information is compatible with the configuration of the virtual machine, and the virtual machine on the target server is configured according to the processed hardware information. After the configuration is completed, the virtual machine is run so that the hardware information of all servers in the server cluster is compatible with the configuration of the virtual machine. Furthermore, since the hardware information of the servers in the server cluster is compatible with the configuration of the virtual machine, the virtual machine can perform vMotion online migration and DRS automatic load optimization within the cluster.

[0069] Optionally, each server confirms whether there is a change at intervals of a preset time period. If there is a newly generated or newly migrated virtual machine, the newly generated or newly migrated virtual machine is configured according to the processed hardware information.

[0070] In the above-mentioned virtual machine compatibility method, the hardware information of each server in the server cluster is obtained, and the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information, so as to configure the virtual machine on the target server according to the processed hardware information; wherein the processed hardware information is compatible with the configuration of the virtual machine. According to the known hardware information of the server, the processing function items in the hardware information of the target server are shielded so that the hardware information in the target server is compatible with the virtual machine, so that when there are different versions of processors in the server cluster, each version of the processor can be compatible with the virtual machine, thereby improving the compatibility between the processor and the virtual machine.

[0071] In one embodiment, an implementation of the above S202 is provided, where the hardware information includes processor version information and processing function items. As shown in FIG3 , the above “shielding the processing function items in the hardware information of the target server to obtain processed hardware information” includes:

[0072] S301, obtaining processing function items of compatible servers according to processor version information of each server.

[0073] In an embodiment of the present application, a server cluster may include multiple versions of processors, and there are differences in the processing function items corresponding to the processors of different versions. The processing function items corresponding to the processors of lower versions may be processors that are compatible with the virtual machine. Exemplarily, the version information of the processor of the server may include 1, 2, 3, 4, 5, and 6, wherein the server with version information 1 is a compatible server, thereby obtaining the processing function items of the server with version information 1. Specifically, after determining the compatible processor version information, the target server may determine the processing function items of the server with processor version information 1 in the hardware information of each server in the server cluster as the processing function items of the compatible server.

[0074] S302, shielding the processing function items in the hardware information of the target server according to the processing function items of the compatible server and the processing function items of the target server to obtain processed hardware information.

[0075] Optionally, a processing function list of all processing function items is pre-stored in the target server. The target server can determine the processing function items that are incompatible with the virtual machine based on the processing function items and the processing function items of the compatible server, thereby determining whether the processing function items of the target server include processing function items that are incompatible with the virtual machine. If included, the processing function items incompatible with the virtual machine are shielded to obtain processed hardware information; if not included, the original processing function items are used as the processed hardware information.

[0076] In the above-mentioned application embodiment, the processing function items of the compatible server are known processing function items that are compatible with the virtual machine. According to the processing function items of the compatible server, the processing function items in the hardware information of the target server are shielded, thereby ensuring the availability of the processed hardware information, thereby improving the compatibility of the processor and the virtual machine.

[0077] In one embodiment, an implementation of the above S302 is provided, as shown in FIG4 , wherein the above “shielding the processing function items in the hardware information of the target server according to the processing function items of the compatible server and the processing function items of the target server to obtain the processed hardware information” includes:

[0078] S401: Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded.

[0079] In the embodiment of the present application, the processing function items of the compatible server and the processing function items of the target server are compared to determine the processing function items with differences between the two, and the processing function items with differences are determined as function items to be shielded. Exemplarily, if the processing function items of the compatible server include function item 1, function item 2, and function item 3, and the processing function items of the target server include function item 1, function item 2, function item 3, function item 4, and function item 5, then function item 4 and function item 5 are determined to be function items to be shielded.

[0080] S402, performing shielding processing on the to-be-shielded function items in the processor on the target server to obtain processed hardware information.

[0081] In the embodiment of the present application, the function item to be shielded can be overwritten, deleted, replaced, etc., so as to render the function item to be shielded invalid. For example, the function item to be shielded can be replaced with a known processing function item compatible with the virtual machine; or the binary code corresponding to the function item to be shielded can be removed from the target server.

[0082] In the above application embodiment, the function items to be shielded are determined by comparing the processing function items of the compatible server and the processing function items of the target server. The determination process is relatively simple, and the determined function items to be shielded are highly accurate, while avoiding consuming a large amount of processing resources of the target server.

[0083] In one embodiment, an implementation of the above S402 is provided, as shown in FIG5 , wherein the above “masking the to-be-masked function item in the processor on the target server to obtain the processed hardware information” includes:

[0084] S501, processing the function code corresponding to the function item to be masked according to a preset mask code generation rule to generate a target mask code for the target server.

[0085] The function code may be a binary value, and the target mask code may also be a binary value.

[0086] In the embodiment of the present application, the valid position in the function code corresponding to the function item to be shielded can be determined first, the valid position can be a position that is not 1 in the binary value, and the target shield code can be to replace the number in the valid position with a preset character, and the numbers in other positions are the same as the corresponding positions of the function item to be shielded. Exemplarily, if the function code corresponding to the function item to be shielded is 1001, there are 2 valid positions in the function code, and according to the preset generation logic and valid positions, the target shield code of the target server can be generated as X00X.

[0087] Optionally, the preset rule may include a correspondence between each function code and a mask code, so that a target mask code of the target server is determined from multiple mask codes according to the correspondence and the function code corresponding to the function item to be masked.

[0088] S502, overwriting the function item to be masked with the target masking code to obtain hardware information including the overwritten function code.

[0089] In an embodiment of the present application, the target masking code is overwritten on the function code of the function item to be masked, that is, the target masking code is superimposed on the function code of the function item to be masked, so that the function item to be masked is invalidated, and the overwritten processing function item is obtained, and the processed hardware information is formed by the processed processing function item.

[0090] In the above-mentioned application embodiment, the function code corresponding to the function item to be masked is processed according to the preset mask code generation rule, so as to quickly obtain the target mask code of the target server, and overwrite the target mask code on the basis of the original function code, so that the processing function item of the target server can be compatible with the virtual machine without changing the original processing function item of the processor.

[0091] In one embodiment, an implementation of the above S301 is provided, as shown in FIG6 , wherein the above “obtaining processing function items of compatible servers according to processor version information of each server” includes:

[0092] S601: Determine, based on the processor version information of each server, whether the server cluster is a server cluster of a single processor version.

[0093] In an embodiment of the present application, it is determined whether the processor version information of each server is the same. If they are the same, the server cluster is determined to be a server cluster of a single processor version; if there are different processor version information, the server cluster is determined to be a server cluster of mixed processor versions.

[0094] S602: If the server cluster is a server cluster of a single processor version, a processing function item of a compatible server is obtained according to a processor of a target version.

[0095] In an embodiment of the present application, if the server cluster is a server cluster of a single processor version, the current processor version of the server cluster can be used as the target version, and the processor function items corresponding to the processing of the target version can be determined as the processing function items of the compatible server; alternatively, the target version can be a lower version, and the lower version is a processor version with an existing mask code.

[0096] S603: If the server cluster is not a server cluster of a single processor version, determine the processing function items of the compatible servers according to the version information of each server in the server cluster.

[0097] In the embodiment of the present application, if the server cluster is not a server cluster of a single processor version, the highest version information in the server cluster is determined, and illustratively, if the version information in the server cluster includes 2, 3, 4, and 5, the highest version information is 5. Further, the mask code between the processors corresponding to any two version information from the highest version information to version information 1 is determined, so that the virtual machines corresponding to any two versions of the processors can perform vMotion online migration and DRS automatic load optimization.

[0098] In the above application embodiment, the processing function items of compatible servers are determined according to the processor version information of each server, which reduces the shielding scope of the processing function items, thereby improving the efficiency of determining the target shielding code, and the target shielding code has a higher matching degree with the server cluster.

[0099] In one embodiment, an implementation of the above S603 is provided, as shown in FIG7 , wherein the above “determining the processing function items of the compatible servers according to the version information of each server in the server cluster” includes:

[0100] S701: Determine compatible servers in the server cluster according to version information of each server in the server cluster.

[0101] In an embodiment of the present application, the target server may pre-store the compatible version information of the virtual machine, or the target server may obtain the compatible version information of the virtual machine input by the user through an interactive interface. Further, the target server determines the compatible servers in the server cluster based on the compatible version information of the virtual machine and the version information of each server in the server cluster.

[0102] Exemplarily, the compatible version information of the virtual machine may include 1, 2, and 3, and the version information of each server in the server cluster may include 2, 3, 4, and 5. Then the compatible servers in the server cluster are servers with version information of 2 or 3.

[0103] S702: Obtain a processing function item corresponding to a processor on a compatible server.

[0104] Optionally, if the compatible server is a plurality of servers, the processing function items corresponding to the processors on all compatible servers may be obtained. For example, if the compatible server is a server with version information of 2 or 3, the processing function items corresponding to the processors on the server with version information of 2 are obtained, and the processing function items corresponding to the processors on the server with version information of 3 are obtained. If the compatible server is a single server, the processing function items corresponding to the processors on the compatible server are obtained.

[0105] As an optional implementation, the compatible server is a plurality of servers, and the above “obtaining the processing function item corresponding to the processor on the compatible server” includes: obtaining the processing function item corresponding to the processor on any of the plurality of servers. Exemplarily, if the compatible server is a server with version information 2 or 3, then the processing function item corresponding to the processor on the server with version information 2 is obtained, or the processing function item corresponding to the processor on the server with version information 3 is obtained.

[0106] As another optional implementation, the compatible server is a plurality of servers, and the above “obtaining the processing function items corresponding to the processors on the compatible servers” includes: obtaining the processing function items corresponding to the processors on the optimal version server; the optimal version server is the server with the highest processor version among the plurality of servers. Exemplarily, if the compatible server is a server with version information of 2 or 3, the optimal version server with version information of 3 is the server with the optimal version, and the processing function items corresponding to the processors on the server with version information of 3 are obtained.

[0107] In the above application embodiment, compatible servers in the server cluster are determined based on the version information of each server in the server cluster, and the processing function items corresponding to the processors on the compatible servers are more accurately determined, thereby improving the compatibility of the target mask code and the target server.

[0108] In one embodiment, a complete virtual machine compatibility method is also provided, as shown in FIG8 , including:

[0109] S1, obtain the hardware information of each server in the server cluster.

[0110] S2, according to the processor version information of each server, determine whether the server cluster is a server cluster of a single processor version; if so, execute S3; if not, execute S4.

[0111] S3, obtaining processing function items of compatible servers according to the target version of the processor.

[0112] S4, obtaining a processing function item corresponding to a processor on any server among the multiple servers; or obtaining a processing function item corresponding to a processor on an optimal version server; the optimal version server is a server with the highest processor version among the multiple servers.

[0113] S5, obtaining a processing function item corresponding to the processor on the compatible server.

[0114] S6, determining the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded.

[0115] S7, processing the function code corresponding to the function item to be masked according to a preset mask code generation rule to generate a target mask code for the target server.

[0116] S8, overwriting the function item to be masked with the target mask code to obtain hardware information including the overwritten function code.

[0117] S9, configuring the virtual machine on the target server according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0118] In the above-mentioned virtual machine compatibility method, the hardware information of each server in the server cluster is obtained, and the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information, so as to configure the virtual machine on the target server according to the processed hardware information; wherein the processed hardware information is compatible with the configuration of the virtual machine. According to the known hardware information of the server, the processing function items in the hardware information of the target server are shielded so that the hardware information in the target server is compatible with the virtual machine, so that when there are different versions of processors in the server cluster, each version of the processor can be compatible with the virtual machine, thereby improving the compatibility between the processor and the virtual machine.

[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0120] Based on the same inventive concept, the embodiment of the present application also provides a virtual machine compatible device for implementing the virtual machine compatible method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the compatible device of one or more virtual machines provided below can refer to the limitations of the virtual machine compatible method above, and will not be repeated here.

[0121] In one embodiment, as shown in FIG9 , a compatible device for a virtual machine is provided, comprising: an acquisition module 10, a processing module 11 and a configuration module 12, wherein:

[0122] The acquisition module 10 is used to acquire the hardware information of each server in the server cluster.

[0123] The processing module 11 is used to shield the processing function items in the hardware information of the target server to obtain the processed hardware information.

[0124] The configuration module 12 is used to configure the virtual machine on the target server according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0125] In one embodiment, the processing module 11 includes: an acquisition unit and a processing unit, wherein:

[0126] The acquisition unit is used to acquire the processing function items of the compatible servers according to the processor version information of each server.

[0127] The processing unit is used to shield the processing function items in the hardware information of the target server according to the processing function items of the compatible server and the processing function items of the target server to obtain the processed hardware information.

[0128] In one embodiment, the processing unit includes: a determining subunit and a processing subunit, wherein:

[0129] The first determining subunit is used to determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded.

[0130] The processing subunit is used to perform shielding processing on the to-be-shielded function items in the processor on the target server to obtain processed hardware information.

[0131] In one embodiment, the processing subunit is specifically used to process the function code corresponding to the function item to be masked according to a preset mask code generation rule to generate a target mask code for the target server; and overwrite the function item to be masked with the target mask code to obtain hardware information including the overwritten function code.

[0132] In one embodiment, the acquisition unit includes: a second determination subunit, a first acquisition subunit and a second acquisition subunit, wherein:

[0133] The second determining subunit is used to determine whether the server cluster is a server cluster of a single processor version according to the processor version information of each server.

[0134] The first acquisition subunit is used to acquire the processing function items of the compatible servers according to the processor of the target version when the server cluster is a server cluster of a single processor version.

[0135] The second acquisition subunit is used to determine the processing function items of the compatible servers according to the version information of each server in the server cluster when the server cluster is not a server cluster of a single processor version.

[0136] In one embodiment, the second determining subunit is specifically configured to determine compatible servers in the server cluster according to version information of each server in the server cluster; and obtain processing function items corresponding to processors on the compatible servers.

[0137] In one embodiment, the second determination subunit is specifically used to obtain the processing function items corresponding to the processor on any server among multiple servers; or, to obtain the processing function items corresponding to the processor on the optimal version server; the optimal version server is the server with the highest processor version among multiple servers.

[0138] Each module in the compatible device of the above virtual machine can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0139] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0140] Get the hardware information of each server in the server cluster;

[0141] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0142] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0144] Obtaining processing function items of compatible servers according to processor version information of each server;

[0145] According to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information.

[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0147] Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded;

[0148] The function items to be shielded in the processor on the target server are shielded to obtain the processed hardware information.

[0149] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0150] Processing the function code corresponding to the function item to be shielded according to the preset shielding code generation rule to generate a target shielding code for the target server;

[0151] The target mask code is used to cover the function item to be masked, and the hardware information including the covered function code is obtained.

[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0153] Determine whether the server cluster is a server cluster of a single processor version according to the processor version information of each server;

[0154] If the server cluster is a server cluster of a single processor version, obtaining processing function items of compatible servers according to the processor of the target version;

[0155] If the server cluster is not a server cluster of a single processor version, the processing function items of the compatible servers are determined according to the version information of each server in the server cluster.

[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0157] Determine compatible servers in the server cluster according to version information of each server in the server cluster;

[0158] Get the processing function items corresponding to the processor on the compatible server.

[0159] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0160] Obtaining a processing function item corresponding to a processor on any server among multiple servers;

[0161] Alternatively, the processing function item corresponding to the processor on the optimal version server is obtained; the optimal version server is a server with the highest processor version among multiple servers.

[0162] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0163] Get the hardware information of each server in the server cluster;

[0164] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0165] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0167] Obtaining processing function items of compatible servers according to processor version information of each server;

[0168] According to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information.

[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0170] Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded;

[0171] The function items to be shielded in the processor on the target server are shielded to obtain the processed hardware information.

[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0173] Processing the function code corresponding to the function item to be shielded according to the preset shielding code generation rule to generate a target shielding code for the target server;

[0174] The target mask code is used to cover the function item to be masked, and the hardware information including the covered function code is obtained.

[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0176] Determine whether the server cluster is a server cluster of a single processor version according to the processor version information of each server;

[0177] If the server cluster is a server cluster of a single processor version, obtaining processing function items of compatible servers according to the processor of the target version;

[0178] If the server cluster is not a server cluster of a single processor version, the processing function items of the compatible servers are determined according to the version information of each server in the server cluster.

[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0180] Determine compatible servers in the server cluster according to version information of each server in the server cluster;

[0181] Get the processing function items corresponding to the processor on the compatible server.

[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0183] Obtaining a processing function item corresponding to a processor on any server among multiple servers;

[0184] Alternatively, the processing function item corresponding to the processor on the optimal version server is obtained; the optimal version server is a server with the highest processor version among multiple servers.

[0185] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0186] Get the hardware information of each server in the server cluster;

[0187] Shielding the processing function items in the hardware information of the target server to obtain processed hardware information;

[0188] The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

[0189] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0190] Obtaining processing function items of compatible servers according to processor version information of each server;

[0191] According to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain the processed hardware information.

[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0193] Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded;

[0194] The function items to be shielded in the processor on the target server are shielded to obtain the processed hardware information.

[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0196] Processing the function code corresponding to the function item to be shielded according to the preset shielding code generation rule to generate a target shielding code for the target server;

[0197] The target mask code is used to cover the function item to be masked, and the hardware information including the covered function code is obtained.

[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0199] Determine whether the server cluster is a server cluster of a single processor version according to the processor version information of each server;

[0200] If the server cluster is a server cluster of a single processor version, obtaining processing function items of compatible servers according to the processor of the target version;

[0201] If the server cluster is not a server cluster of a single processor version, the processing function items of the compatible servers are determined according to the version information of each server in the server cluster.

[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0203] Determine compatible servers in the server cluster according to version information of each server in the server cluster;

[0204] Get the processing function items corresponding to the processor on the compatible server.

[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0206] Obtaining a processing function item corresponding to a processor on any server among multiple servers;

[0207] Alternatively, the processing function item corresponding to the processor on the optimal version server is obtained; the optimal version server is a server with the highest processor version among multiple servers.

[0208] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0209] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0210] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A virtual machine compatibility method, characterized in that: Applied to a target server in a server cluster, the method comprises: Obtaining hardware information of each server in the server cluster; Shielding the processing function items in the hardware information of the target server to obtain processed hardware information; The virtual machine on the target server is configured according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

2. The method according to claim 1, characterized in that The hardware information includes processor version information and the processing function item, and the processing function item in the hardware information of the target server is shielded to obtain the processed hardware information, including: Acquire processing function items of compatible servers according to the processor version information of each server; According to the processing function items of the compatible server and the processing function items of the target server, the processing function items in the hardware information of the target server are shielded to obtain processed hardware information.

3. The method according to claim 2, characterized in that The shielding process of the processing function items in the hardware information of the target server according to the processing function items of the compatible server and the processing function items of the target server to obtain the processed hardware information includes: Determine the processing function items that are different between the processing function items of the compatible server and the processing function items of the target server as the function items to be shielded; The function items to be shielded in the processor on the target server are shielded to obtain the processed hardware information.

4. The method according to claim 3, characterized in that The shielding process of the to-be-shielded function item in the processor on the target server to obtain the processed hardware information includes: Processing the function code corresponding to the function item to be shielded according to a preset shielding code generation rule to generate a target shielding code for the target server; The target masking code covers the function item to be masked, and the hardware information including the covered function code is obtained.

5. The method according to claim 2, characterized in that: The step of obtaining the processing function items of the compatible servers according to the processor version information of each server includes: Determining whether the server cluster is a server cluster of a single processor version according to the processor version information of each server; If the server cluster is a server cluster of a single processor version, obtaining the processing function item of the compatible server according to the processor of the target version; If the server cluster is not a server cluster of a single processor version, the processing function item of the compatible server is determined according to the version information of each server in the server cluster.

6. The method according to claim 5, characterized in that The determining, according to the version information of each server in the server cluster, the processing function item of the compatible server includes: Determining compatible servers in the server cluster according to version information of each server in the server cluster; Obtain a processing function item corresponding to the processor on the compatible server.

7. The method according to claim 6, characterized in that The compatible server is a plurality of servers, and obtaining the processing function items corresponding to the processors on the compatible servers includes: Obtaining a processing function item corresponding to a processor on any server among the multiple servers; Alternatively, the processing function item corresponding to the processor on the optimal version server is obtained; the optimal version server is a server with the highest processor version among the multiple servers.

8. A compatible device for a virtual machine, characterized in that: The device comprises: The acquisition module is used to obtain the hardware information of each server in the server cluster; A processing module, used for shielding the processing function items in the hardware information of the target server to obtain the processed hardware information; A configuration module is used to configure the virtual machine on the target server according to the processed hardware information; the processed hardware information is compatible with the configuration of the virtual machine.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Firmware control method and device of processor, processor, equipment, storage medium and program product

    CN122331977A