Instance scaling method and apparatus, and device, storage medium and program product

By determining the target capacity and configuration in the processing unit, the flexibility of instance scaling is achieved, solving the problem of insufficient or excessive capacity in the prior art and improving the dynamic adjustment of processing capacity.

WO2026037014A1PCT designated stage Publication Date: 2026-02-19CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/107381
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-13
Filing Date
2025-07-07
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

In existing technologies, when scaling up or down instances, the processing unit capacity is either insufficient or excessive, resulting in poor flexibility in scaling up or down.

Method used

By determining the target processing unit and its capacity in at least one processing unit, and scaling up or down the target instance according to the target capacity, flexible configuration and migration of the capacity of some processing units are supported.

Benefits of technology

It improves the flexibility of instance scaling, dynamically increases or decreases processing capacity, and avoids wasting processing unit capacity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025107381_19022026_PF_FP_ABST
    Figure CN2025107381_19022026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure are an instance scaling method and apparatus, and a device, a storage medium and a program product. The method is applied to a computing device, wherein the computing device is physically connected to at least one processing unit. The method comprises: acquiring a scaling request for a target instance; on the basis of the scaling request, determining at least one target processing unit from among at least one processing unit, and determining a target capacity of each target processing unit, wherein the target capacity is less than or equal to a rated capacity of a processing unit; and on the basis of the target capacity of each target processing unit, performing scaling processing on the target instance on the at least one target processing unit. By means of the technical solution of the present disclosure, the flexibility of scaling a target instance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Instance scaling method, device, equipment, storage medium and program product

[0001] The present disclosure claims priority to Chinese Patent Application No. 202411113111.3, filed on August 13, 2024, with the Chinese Patent Office, entitled "Instance scaling method, device, equipment, storage medium and program product", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD

[0002] The present disclosure relates to the field of computers, and particularly relates to an instance scaling method, device, equipment, storage medium and program product. BACKGROUND

[0003] In a device cluster, a processing unit can be configured for each instance (for example, a server or a virtual machine) to make the instance have processing capability. The processing capability can be represented by the processing unit capacity. The processing unit can be a graphics processing unit (GPU), a tensor processing unit (TPU), a video processing unit (VPU), etc.

[0004] In the related art, for any instance, at least one processing unit is usually configured for the instance. The at least one processing unit is a processing unit of the same type. When scaling the instance, one processing unit is usually added or removed for the instance. For example, if the target instance is a server, one GPU can be added to the server when scaling up.

[0005] However, in the above manner, if the processing unit capacity required when scaling up the instance is less than one processing unit, the instance still needs to be scaled up by one processing unit, and part of the processing unit capacity is wasted. When scaling down the instance, if the processing unit capacity to be removed is less than one processing unit, the instance cannot be scaled down by one processing unit.

[0006] As can be seen from the above, the flexibility of scaling up / down the target instance in the related art is poor. SUMMARY

[0007] The aspects of the present disclosure provide an instance scaling method, device, equipment, storage medium and program product to solve the problem of poor flexibility of scaling up / down the target instance.

[0008] In a first aspect, the embodiments of the present disclosure provide an instance scaling method, applied to a computing device, the computing device being physically connected with at least one processing unit, and the method comprises:

[0009] obtaining a scaling request of a target instance;

[0010] determining at least one target processing unit and a target capacity in each target processing unit according to the scaling request, the target capacity being less than or equal to a rated capacity of the processing unit;

[0011] performing scaling processing on the target instance according to the target capacity in each target processing unit on the at least one target processing unit.

[0012] In a possible implementation, the scaling request comprises at least one processing unit information and a scaling application capacity corresponding to each processing unit information, the at least one processing unit information comprising a target processing unit type and / or a target processing unit identifier;

[0013] determining at least one target processing unit and a target capacity in each target processing unit according to the scaling request, comprises:

[0014] for any one processing unit information, determining a target processing unit according to the processing unit information and the scaling application capacity corresponding to the processing unit information in the at least one processing unit;

[0015] determining a target capacity in the target processing unit according to the scaling application capacity corresponding to the processing unit information.

[0016] In a possible implementation, determining a target processing unit according to the processing unit information and the scaling application capacity corresponding to the processing unit information in the at least one processing unit, comprises:

[0017] if the processing unit information is the target processing unit identifier, determining a first target processing unit corresponding to the target processing unit identifier;

[0018] determining the target processing unit according to a remaining capacity of the first target processing unit and the scaling application capacity corresponding to the target processing unit identifier in the at least one processing unit.

[0019] In a possible implementation, determining the target processing unit according to the remaining capacity of the first target processing unit and the scaling application capacity corresponding to the target processing unit identifier in the at least one processing unit, comprises:

[0020] If the remaining capacity of the first target processing unit is greater than or equal to the expansion application capacity corresponding to the target processing unit identifier, the first target processing unit is determined as the target processing unit.

[0021] If the remaining capacity of the first target processing unit is less than the expansion application capacity corresponding to the target processing unit identifier, a second target processing unit of the same type as the first target processing unit is determined in the at least one processing unit, and the second target processing unit is determined as the target processing unit, the remaining capacity of the second target processing unit being greater than the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0022] In a possible implementation, the target capacity is determined in the target processing unit according to the expansion / reduction application capacity corresponding to the processing unit information, including:

[0023] If the target processing unit is the first target processing unit, the target capacity is determined in the first target processing unit according to the expansion / reduction application capacity corresponding to the target processing unit identifier.

[0024] If the target processing unit is the second target processing unit, the target capacity is determined in the second target processing unit according to the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0025] In a possible implementation, the target processing unit is determined in the at least one processing unit according to the processing unit information and the reduction application capacity corresponding to the processing unit information, including:

[0026] If the processing unit information is the target processing unit identifier, the first target processing unit corresponding to the target processing unit identifier is determined.

[0027] The used capacity and the allocated capacity of the target instance in the first target processing unit are obtained.

[0028] The allocated capacity of the target instance in the first target processing unit after reduction is determined according to the allocated capacity and the reduction application capacity.

[0029] If the allocated capacity after reduction is greater than or equal to the used capacity of the target instance in the first target processing unit, the first target processing unit is determined as the target processing unit.

[0030] In a possible implementation, the at least one processing unit includes the bound processing unit and the unbound processing unit corresponding to the target instance; the target processing unit is determined in the at least one processing unit according to the processing unit information and the scaling request capacity corresponding to the processing unit information, including:

[0031] If the processing unit information is the target processing unit type and the scaling request capacity corresponding to the processing unit information is the scaling request capacity, the target processing unit is determined in the unbound processing unit according to the target processing unit type and the scaling request capacity, and the type of the target processing unit is the target processing unit type.

[0032] In a possible implementation, the target processing unit is determined in the unbound processing unit according to the target processing unit type and the scaling request capacity, including:

[0033] At least one candidate processing unit is determined in the unbound processing unit according to the target processing unit type, and the type of the candidate processing unit is the target processing unit type;

[0034] The remaining capacity of each candidate processing unit in the at least one candidate processing unit is determined.

[0035] If there is a target candidate processing unit with a remaining capacity greater than or equal to the scaling request capacity in the at least one candidate processing unit, the target candidate processing unit is determined as the target processing unit.

[0036] In a possible implementation, the target instance is scaled in the at least one target processing unit according to the target capacity in each target processing unit, including:

[0037] If the target processing unit is the first target processing unit, the target instance is scaled in the first target processing unit according to the target capacity in the first target processing unit.

[0038] If the target processing unit is the second target processing unit, the instance data of the target instance in the first target processing unit is migrated to the second target processing unit, the second target processing unit and the target instance are bound, and the target instance is scaled according to the target capacity in the second target processing unit.

[0039] In a possible implementation, the target instance is scaled in the at least one target processing unit according to the target capacity in each target processing unit, including:

[0040] binding processing of the target processing unit and the target instance;

[0041] scaling processing of the target instance on the target processing unit according to a target capacity in the target processing unit.

[0042] In a possible implementation, the method further includes:

[0043] obtaining processing unit configuration information corresponding to the target instance in response to an obtaining processing unit configuration information instruction sent by the target instance;

[0044] determining at least one third target processing unit in the at least one processing unit according to the processing unit configuration information;

[0045] binding the at least one third target processing unit to the target instance.

[0046] In a possible implementation, the processing unit configuration information includes at least one capacity threshold corresponding to each processing unit type, and determining at least one third target processing unit in the at least one processing unit according to the processing unit configuration information includes:

[0047] for any one processing unit type, determining at least one third target processing unit in the at least one processing unit according to at least one capacity threshold corresponding to the processing unit type, and a remaining capacity of the third target processing unit is greater than or equal to the capacity threshold.

[0048] In a possible implementation, binding the at least one third target processing unit to the target instance includes:

[0049] for any one third target processing unit, obtaining processing unit information of the third target processing unit;

[0050] sending the processing unit information to the target instance to bind the third target processing unit to the target instance.

[0051] In a possible implementation, the method further includes:

[0052] receiving a creating context instruction sent by the target instance, and the creating context instruction includes an identifier of a target bound processing unit, the identifier of the target bound processing unit being used to indicate the target bound processing unit;

[0053] creating a target context of the target bound processing unit;

[0054] generating a virtual context of the target bound processing unit according to a target context of the target bound processing unit;

[0055] sending the virtual context of the target bound processing unit to the target instance.

[0056] In a possible implementation, the method further includes:

[0057] receiving a capacity application request sent by the target instance, the capacity application request including an application capacity, an identifier of the target bound processing unit and a virtual context, the capacity application request being used to apply the application capacity in the target bound processing unit for the target instance, the identifier of the target bound processing unit being used to indicate the target bound processing unit;

[0058] obtaining used capacity information corresponding to the target instance;

[0059] determining a target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit and the application capacity;

[0060] allocating the target used capacity to the target instance.

[0061] In a possible implementation, the used capacity information includes at least one bound processing unit, and used capacity and a capacity threshold corresponding to each bound processing unit;

[0062] determining a target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit and the application capacity, includes:

[0063] determining a target used capacity and a target capacity threshold corresponding to the target bound processing unit in the used capacity information;

[0064] if a sum of the target used capacity and the application capacity is less than or equal to the target capacity threshold, determining the target used capacity in the target bound processing unit according to the virtual context of the target bound processing unit and the application capacity.

[0065] In a possible implementation, allocating the target used capacity to the target instance includes:

[0066] obtaining a target address corresponding to the target used capacity;

[0067] determining a virtual address corresponding to the target used capacity according to the target address corresponding to the target used capacity;

[0068] allocating the target usage capacity to the target instance according to the virtual address corresponding to the target capacity.

[0069] In a possible implementation, the method further includes:

[0070] receiving a task processing request sent by the target instance, the task processing request including a target task, and a virtual address and a virtual context corresponding to each of the at least one bound processing unit;

[0071] invoking the at least one bound processing unit to perform computation processing on the target task according to the virtual address and the virtual context corresponding to each of the at least one bound processing unit.

[0072] In a possible implementation, for any one bound processing unit, invoking the bound processing unit to perform computation processing on the target task according to the first virtual address and the first virtual context corresponding to the bound processing unit includes:

[0073] obtaining, in a preset storage space, an address mapping relationship and a context mapping relationship corresponding to the bound processing unit;

[0074] determining, in the address mapping relationship, a first target address corresponding to the first virtual address according to the first virtual address;

[0075] determining, in the context mapping relationship, a first target context corresponding to the first virtual context according to the first virtual context;

[0076] invoking the bound processing unit to perform computation processing on the target task according to the first target address and the first target context.

[0077] In a possible implementation, before obtaining, in a preset storage space, an address mapping relationship and a context mapping relationship corresponding to the bound processing unit, the method further includes:

[0078] generating the address mapping relationship according to the first target address corresponding to the bound processing unit and the first virtual address corresponding to the bound processing unit, the address mapping relationship including the first target address and the first virtual address;

[0079] generating the context mapping relationship according to the first target context corresponding to the bound processing unit and the first virtual context corresponding to the bound processing unit, the context mapping relationship including the first target context and the first virtual context;

[0080] store the address mapping relationship and the context mapping relationship in a preset storage space.

[0081] In a possible implementation, the method further includes:

[0082] receiving used capacity information of a to-be-migrated instance sent by a source computing device, the to-be-migrated instance being a virtual machine, and the first instance device where the to-be-migrated instance is located corresponding to the source computing device;

[0083] determining at least one fourth target processing unit in the at least one processing unit according to the used capacity information of the to-be-migrated instance, a residual capacity of the fourth target processing unit being greater than a capacity threshold corresponding to a bound processing unit in the used capacity information;

[0084] for any one fourth target processing unit, determining a second target address and a second target context corresponding to the fourth target processing unit according to the used capacity information of the to-be-migrated instance;

[0085] after the to-be-migrated instance is migrated from the first instance device to a second instance device, determining a target address mapping relationship and a target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit, and binding the at least one fourth target processing unit to the to-be-migrated instance, the second instance device corresponding to the computing device.

[0086] In a possible implementation, for any one fourth target processing unit, determining a target address mapping relationship and a target context mapping relationship according to the second target address and the second target context corresponding to the fourth target processing unit includes:

[0087] obtaining an initial address mapping relationship and an initial context mapping relationship of a bound processing unit corresponding to the fourth target processing unit;

[0088] updating the initial address mapping relationship according to the second target address to obtain a target address mapping relationship;

[0089] updating the initial context mapping relationship according to the second target context to obtain a target context mapping relationship.

[0090] In a possible implementation, updating the initial address mapping relationship according to the second target address to obtain a target address mapping relationship includes:

[0091] determining an initial target address and an initial virtual address in the initial address mapping relationship;

[0092] updating the initial target address as the second target address to obtain the target address mapping relationship, the target address mapping relationship including the initial virtual address and the second target address.

[0093] In a possible implementation, the initial context mapping relationship is updated according to the second target context to obtain a target context mapping relationship, including:

[0094] In the initial context mapping relationship, an initial target context and an initial virtual context are determined.

[0095] The initial target context is updated as the second target context to obtain the target context mapping relationship, the target context mapping relationship including the initial virtual context and the second target context.

[0096] In a possible implementation, the method further includes:

[0097] receiving a configuration instruction sent by a management device, the configuration instruction being used to instruct the computing device to configure a processing unit corresponding to the target instance;

[0098] configuring the processing unit corresponding to the target instance according to the configuration instruction, and generating processing unit configuration information corresponding to the target instance.

[0099] In a second aspect, the embodiments of the present disclosure provide an instance scaling device, applied to a computing device, the computing device being physically connected with at least one processing unit, and the device including an obtaining module, a determining module and a scaling module, wherein:

[0100] The obtaining module is configured to obtain a scaling request of a target instance.

[0101] The determining module is configured to determine at least one target processing unit and a target capacity in each target processing unit according to the scaling request, the target capacity being less than or equal to a rated capacity of the processing unit.

[0102] The scaling module is configured to perform scaling processing on the target instance according to the target capacity in each target processing unit on the at least one target processing unit.

[0103] In a possible implementation, the scaling request includes at least one processing unit information and a scaling application capacity corresponding to each processing unit information, the at least one processing unit information including a target processing unit type and / or a target processing unit identifier; and the determining module is specifically configured to:

[0104] determining, according to the processing unit information and the expansion or contraction application capacity corresponding to the processing unit information, a target processing unit in the at least one processing unit;

[0105] determining, according to the expansion or contraction application capacity corresponding to the processing unit information, a target capacity in the target processing unit.

[0106] In a possible implementation, the determining module is specifically configured to:

[0107] if the processing unit information is the target processing unit identifier, determining a first target processing unit corresponding to the target processing unit identifier;

[0108] determining, according to the remaining capacity of the first target processing unit and the expansion application capacity corresponding to the target processing unit identifier, the target processing unit in the at least one processing unit.

[0109] In a possible implementation, the determining module is specifically configured to:

[0110] if the remaining capacity of the first target processing unit is greater than or equal to the expansion application capacity corresponding to the target processing unit identifier, determining the first target processing unit as the target processing unit;

[0111] if the remaining capacity of the first target processing unit is less than the expansion application capacity corresponding to the target processing unit identifier, determining a second target processing unit of the same type as the first target processing unit in the at least one processing unit, and determining the second target processing unit as the target processing unit, wherein a remaining capacity of the second target processing unit is greater than a sum of the expansion application capacity corresponding to the target processing unit identifier and an allocated capacity of the target instance in the first target processing unit.

[0112] In a possible implementation, the determining module is specifically configured to:

[0113] if the target processing unit is the first target processing unit, determining, according to the expansion or contraction application capacity corresponding to the target processing unit identifier, a target capacity in the first target processing unit;

[0114] if the target processing unit is the second target processing unit, determining, according to a sum of the expansion application capacity corresponding to the target processing unit identifier and an allocated capacity of the target instance in the first target processing unit, a target capacity in the second target processing unit.

[0115] In a possible implementation, the determining module is specifically configured to:

[0116] If the processing unit information is the target processing unit identifier, it is determined that the target processing unit identifier corresponds to a first target processing unit;

[0117] The used capacity and the allocated capacity of the target instance in the first target processing unit are obtained.

[0118] According to the allocated capacity and the capacity application capacity, the allocated capacity of the target instance in the first target processing unit after the capacity application is determined.

[0119] If the allocated capacity after the capacity application is greater than or equal to the used capacity of the target instance in the first target processing unit, the first target processing unit is determined as the target processing unit.

[0120] In a possible implementation, the at least one processing unit includes a bound processing unit and an unbound processing unit corresponding to the target instance; and the determining module is specifically configured to:

[0121] If the processing unit information is a target processing unit type, and the processing unit information corresponds to a capacity application capacity, the target processing unit is determined in the unbound processing unit according to the target processing unit type and the capacity application capacity, and the type of the target processing unit is the target processing unit type.

[0122] In a possible implementation, the determining module is specifically configured to:

[0123] At least one candidate processing unit is determined in the unbound processing unit according to the target processing unit type, and the type of the candidate processing unit is the target processing unit type.

[0124] The residual capacity of each candidate processing unit in the at least one candidate processing unit is determined.

[0125] If there is a target candidate processing unit with a residual capacity greater than or equal to the capacity application capacity in the at least one candidate processing unit, the target candidate processing unit is determined as the target processing unit.

[0126] In a possible implementation, the capacity application module is specifically configured to:

[0127] If the target processing unit is the first target processing unit, the target instance is subjected to the capacity application processing on the first target processing unit according to the target capacity in the first target processing unit.

[0128] If the target processing unit is the second target processing unit, the instance data of the target instance in the first target processing unit is migrated to the second target processing unit, the second target processing unit and the target instance are bound, and the target instance is scaled according to the target capacity of the second target processing unit.

[0129] In a possible implementation, the scaling module is specifically configured to:

[0130] bind the target processing unit and the target instance;

[0131] scale the target instance on the target processing unit according to a target capacity of the target processing unit.

[0132] In a possible implementation, the device further includes a binding module,

[0133] The obtaining module is further configured to, in response to an obtaining processing unit configuration information instruction sent by the target instance, obtain processing unit configuration information corresponding to the target instance.

[0134] The determining module is further configured to, according to the processing unit configuration information, determine at least one third target processing unit from the at least one processing unit.

[0135] The binding module is configured to bind the at least one third target processing unit to the target instance.

[0136] In a possible implementation, the processing unit configuration information includes at least one capacity threshold corresponding to each processing unit type; and the determining module is specifically configured to:

[0137] For any one processing unit type, at least one third target processing unit is determined from the at least one processing unit according to at least one capacity threshold corresponding to the processing unit type, and a remaining capacity of the third target processing unit is greater than or equal to the capacity threshold.

[0138] In a possible implementation, the binding module is specifically configured to:

[0139] For any one third target processing unit, processing unit information of the third target processing unit is obtained.

[0140] The processing unit information is sent to the target instance, so as to bind the third target processing unit to the target instance.

[0141] In a possible implementation, the apparatus further includes a receiving module, a creating module, a generating module, and a sending module, wherein

[0142] The receiving module is configured to receive a creating context instruction sent by the target instance, the creating context instruction including an identifier of a target bound processing unit, the identifier of the target bound processing unit being used to indicate the target bound processing unit;

[0143] The creating module is configured to create a target context of the target bound processing unit;

[0144] The generating module is configured to generate a virtual context of the target bound processing unit according to the target context of the target bound processing unit;

[0145] The sending module is configured to send the virtual context of the target bound processing unit to the target instance.

[0146] In a possible implementation, the apparatus further includes an allocating module,

[0147] The receiving module is further configured to receive a capacity application request sent by the target instance, the capacity application request including an application capacity, an identifier of the target bound processing unit, and a virtual context, the capacity application request being used to apply the application capacity for the target instance in the target bound processing unit, the identifier of the target bound processing unit being used to indicate the target bound processing unit;

[0148] The obtaining module is further configured to obtain used capacity information corresponding to the target instance;

[0149] The determining module is further configured to determine a target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit, and the application capacity;

[0150] The allocating module is configured to allocate the target used capacity to the target instance.

[0151] In a possible implementation, the used capacity information includes at least one bound processing unit, and used capacity and a capacity threshold corresponding to each bound processing unit;

[0152] The determining module is specifically configured to:

[0153] In the used capacity information, determine a target used capacity and a target capacity threshold corresponding to the target bound processing unit;

[0154] If the sum of the target used capacity and the application capacity is less than or equal to the target capacity threshold, the target used capacity is determined in the target bound processing unit according to a virtual context of the target bound processing unit and the application capacity.

[0155] In a possible implementation, the allocation module is specifically configured to:

[0156] obtain a target address corresponding to the target used capacity;

[0157] determine a virtual address corresponding to the target used capacity according to the target address corresponding to the target used capacity;

[0158] allocate the target used capacity to the target instance according to the virtual address corresponding to the target used capacity.

[0159] In a possible implementation, the apparatus further includes an invocation module,

[0160] The receiving module is further configured to receive a task processing request sent by the target instance, the task processing request including a target task, and a virtual address and a virtual context corresponding to each bound processing unit in the at least one bound processing unit;

[0161] The invocation module is configured to invoke the at least one bound processing unit to perform a calculation processing on the target task according to the virtual address and the virtual context corresponding to each bound processing unit in the at least one bound processing unit.

[0162] In a possible implementation, for any one bound processing unit, the invocation module is specifically configured to:

[0163] obtain an address mapping relationship and a context mapping relationship corresponding to the bound processing unit in a preset storage space;

[0164] determine a first target address corresponding to the first virtual address in the address mapping relationship according to the first virtual address;

[0165] determine a first target context corresponding to the first virtual context in the context mapping relationship according to the first virtual context;

[0166] invoke the bound processing unit to perform a calculation processing on the target task according to the first target address and the first target context.

[0167] In a possible implementation, before obtaining the address mapping relationship and the context mapping relationship corresponding to the bound processing unit in the preset storage space, the apparatus further includes a storage module,

[0168] The generating module is further configured to generate the address mapping relationship according to the first target address corresponding to the bound processing unit and the first virtual address corresponding to the bound processing unit, the address mapping relationship comprising the first target address and the first virtual address.

[0169] The generating module is further configured to generate the context mapping relationship according to the first target context corresponding to the bound processing unit and the first virtual context corresponding to the bound processing unit, the context mapping relationship comprising the first target context and the first virtual context.

[0170] The storage module is configured to store the address mapping relationship and the context mapping relationship in a preset storage space.

[0171] In a possible implementation manner,

[0172] The receiving module is further configured to receive used capacity information of a to-be-migrated instance sent by a source computing device, the to-be-migrated instance being a virtual machine, and a first instance device on which the to-be-migrated instance is located corresponding to the source computing device.

[0173] The determining module is further configured to determine at least one fourth target processing unit in the at least one processing unit according to the used capacity information of the to-be-migrated instance, a residual capacity of the fourth target processing unit being greater than a capacity threshold corresponding to a bound processing unit in the used capacity information.

[0174] The determining module is further configured to, for any one fourth target processing unit, determine a second target address and a second target context corresponding to the fourth target processing unit according to the used capacity information of the to-be-migrated instance.

[0175] The determining module is further configured to, after the to-be-migrated instance is migrated from the first instance device to a second instance device, determine each target address mapping relationship and each target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit.

[0176] The binding module is further configured to bind the at least one fourth target processing unit to the to-be-migrated instance, the second instance device corresponding to the computing device.

[0177] In a possible implementation manner, for any one fourth target processing unit, the determining module is specifically configured to:

[0178] obtain an initial address mapping relationship and an initial context mapping relationship of a bound processing unit corresponding to the fourth target processing unit;

[0179] According to the second target address, the initial address mapping relationship is updated to obtain a target address mapping relationship;

[0180] According to the second target context, the initial context mapping relationship is updated to obtain a target context mapping relationship.

[0181] In a possible implementation, the determining module is specifically configured to:

[0182] An initial target address and an initial virtual address are determined in the initial address mapping relationship;

[0183] The initial target address is updated to the second target address to obtain the target address mapping relationship, and the target address mapping relationship includes the initial virtual address and the second target address.

[0184] In a possible implementation, the determining module is specifically configured to:

[0185] An initial target context and an initial virtual context are determined in the initial context mapping relationship;

[0186] The initial target context is updated to the second target context to obtain the target context mapping relationship, and the target context mapping relationship includes the initial virtual context and the second target context.

[0187] In a possible implementation, the apparatus further includes a configuration module,

[0188] The receiving module is further configured to receive a configuration instruction sent by the management device, and the configuration instruction is used to instruct the computing device to configure the processing unit corresponding to the target instance;

[0189] The configuration module is configured to configure the processing unit corresponding to the target instance according to the configuration instruction, and generate processing unit configuration information corresponding to the target instance.

[0190] In a third aspect, an embodiment of the present disclosure provides a computing device, including a memory and a processor;

[0191] The memory stores computer execution instructions;

[0192] The processor executes the computer execution instructions stored in the memory, so that the processor executes the method in any one of the first aspect.

[0193] In a fourth aspect, an embodiment of the present disclosure provides an instance scaling system, and the system includes at least one instance, a computing device and at least one processing unit, wherein

[0194] The at least one instance is communicatively connected to the computing device, and the computing device is physically connected to the at least one processing unit.

[0195] The computing device is configured to perform the method of any one of the first aspect.

[0196] In a fifth aspect, the embodiments of the present disclosure provide a computer readable storage medium, which stores computer execution instructions, and the computer execution instructions are used to implement the method of any one of the first aspect when executed by a processor.

[0197] In a sixth aspect, the embodiments of the present disclosure provide a computer program product, which comprises a computer program, and the computer program is used to implement the method of any one of the first aspect when executed by a processor.

[0198] The embodiments of the present disclosure provide an instance scaling method and device, equipment, storage medium and program product. The computing device can obtain a scaling request of a target instance, and determine at least one target processing unit and a target capacity of each target processing unit in the at least one processing unit according to the scaling request, and then perform scaling processing on the target instance according to the target capacity of each target processing unit in the at least one target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, the target instance is scaled according to the target capacity of each target processing unit, so that the processing capacity of the instance can be dynamically increased or decreased, which improves the flexibility of scaling the target instance compared with the prior art of scaling the target instance according to the entire processing unit. BRIEF DESCRIPTION OF DRAWINGS

[0199] The accompanying drawings, which are included to provide a further understanding of the present disclosure, constitute a part of the present disclosure, and the illustrative embodiments of the present disclosure and their description serve to explain the present disclosure, and do not constitute improper limitations on the present disclosure. In the drawings:

[0200] FIG. 1 is a schematic diagram of an application scenario according to an illustrative embodiment of the present disclosure;

[0201] FIG. 2 is an architecture schematic diagram of multiple instances, a computing device, and at least one processing unit according to an illustrative embodiment of the present disclosure;

[0202] FIG. 3 is a flow schematic diagram of an instance scaling method according to an illustrative embodiment of the present disclosure;

[0203] FIG. 4 is a flow schematic diagram of an instance scaling method according to an illustrative embodiment of the present disclosure;

[0204] FIG. 5 is a flow schematic diagram of an instance scaling method according to an illustrative embodiment of the present disclosure;

[0205] FIG. 6 is a process diagram of an example scaling method according to an example embodiment of the present disclosure;

[0206] FIG. 7 is a process diagram of a processing unit allocation method according to an example embodiment of the present disclosure;

[0207] FIG. 8 is a flow diagram of allocating processing unit capacity to a target instance according to an example embodiment of the present disclosure;

[0208] FIG. 9 is a flow diagram of a processing unit usage method according to an example embodiment of the present disclosure;

[0209] FIG. 10 is a process diagram of an instance migration according to an example embodiment of the present disclosure;

[0210] FIG. 11 is a flow diagram of migrating an instance across computing devices according to an example embodiment of the present disclosure;

[0211] FIG. 12 is a process diagram of migrating an instance across computing devices according to an example embodiment of the present disclosure;

[0212] FIG. 13 is a process diagram of an instance configuration according to an example embodiment of the present disclosure;

[0213] FIG. 14 is a structural diagram of an instance scaling device according to an example embodiment of the present disclosure;

[0214] FIG. 15 is a structural diagram of another instance scaling device according to an example embodiment of the present disclosure;

[0215] FIG. 16 is a structural diagram of a computing device according to an example embodiment of the present disclosure;

[0216] FIG. 17 is a diagram of an instance scaling system according to an example embodiment of the present disclosure. DETAILED DESCRIPTION

[0217] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or refusal.

[0218] In order to make the purposes, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure will be described clearly and completely below in connection with specific embodiments of the present disclosure and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work belong to the scope of protection of the present disclosure.

[0219] Next, in order to facilitate understanding of the technical solutions of the present disclosure, the concepts involved in the present disclosure are first explained.

[0220] 1, GPU: a processing unit for processing image and parallel computing tasks.

[0221] 2, TPU: a processing unit for processing machine learning tasks.

[0222] 3, VPU: a processing unit for processing audio and video related tasks.

[0223] 4, Field-Programmable Gate Array (FPGA): a processing unit for executing computing tasks.

[0224] Next, in order to facilitate understanding of the technical solutions of the present disclosure, the application scenarios of the present disclosure are described in connection with FIG. 1.

[0225] FIG. 1 is a schematic diagram of an application scenario provided by an exemplary embodiment of the present disclosure. Please refer to FIG. 1, which includes a computing device, a plurality of instances and a plurality of processing units. For example, the plurality of instances can be instance 1, instance 2, …, instance n; the plurality of processing units can be processing unit 1, processing unit 2, processing unit 3, …, processing unit m. n and m are integers greater than or equal to 1.

[0226] The types of each processing unit in the plurality of processing units can be the same or different. For example, processing unit 1 and processing unit 2 can be GPUs, and processing unit 3 can be a TPU.

[0227] For any one instance, the computing device can determine a target processing unit in the plurality of processing units according to the scaling request, and determine a target capacity in the target processing unit, and then can perform scaling processing on the instance according to the target capacity of the target processing unit, so that the instance has flexible processing capability. For example, for instance 1, the computing device can determine that the target processing unit is processing unit 1 and processing unit 3 according to the scaling request 1 corresponding to instance 1. The computing device can determine that the target capacity in processing unit 1 is 10GB and the target capacity in processing unit 3 is 20GB. The computing device can dynamically allocate 10GB in processing unit 1 and 20GB in processing unit 3 to instance 1 to increase the processing capability of instance 1. If processing unit 1 is a GPU and processing unit 3 is a TPU, instance 1 can have GPU capability and TPU capability.

[0228] In the related art, for any one instance, at least one processing unit is usually configured for the instance. The at least one processing unit is a same type of processing unit. When scaling is needed for the instance, usually one processing unit is added or one processing unit is reduced for the instance. However, in the above manner, if the processing capability required for scaling the instance is less than the processing capability of one processing unit, the instance still needs to be scaled according to one processing unit, and there is a situation that part of the processing capability is wasted; when the processing capability to be reduced for scaling the instance is less than the processing capability of one processing unit, the instance cannot be reduced by one processing unit for scaling. Therefore, the flexibility of scaling the target instance in the related art is poor.

[0229] To solve the above technical problem, the present disclosure provides an instance scaling method. In the embodiment of the present disclosure, a computing device can be introduced between the instance and the processing unit, and the computing device is connected to at least one processing unit and a plurality of instances. For a target instance, the computing device can determine at least one target processing unit in the at least one processing unit according to the scaling request of the target instance, and determine a target capacity in each target processing unit, and then perform scaling processing on the target instance according to the target capacity in each target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, the processing capability of the instance can be dynamically increased or decreased according to the target capacity in each target processing unit, and compared with the prior art of scaling the target instance according to the entire processing unit, the flexibility of scaling the target instance is improved.

[0230] Next, in order to facilitate understanding of the technical solutions of the present disclosure, first, the architecture between the plurality of instances, the computing device, and the at least one processing unit is described.

[0231] Fig. 2 is a schematic diagram of the architecture of a plurality of instances, a computing device, and at least one processing unit according to an example embodiment of the present disclosure. Referring to Fig. 2, the architecture includes a plurality of instances, a computing device, and at least one processing unit.

[0232] The plurality of instances can be instance 1, instance 2, …, instance n, respectively. By way of example, an instance can be a server or a virtual machine.

[0233] The at least one processing unit can be processing unit 1, processing unit 2, processing unit 3, processing unit 4, …, processing unit m. The at least one processing unit can include at least one of a GPU, a TPU, a VPU, and a FPGA.

[0234] The computing device can be communicatively connected to the plurality of instances. The computing device can be physically connected to the at least one processing unit via a bus.

[0235] As shown in Fig. 2, any one of the instances can be provided with a device proxy client service, and thus the instance can also be referred to as a device proxy client. The computing device can be provided with a device proxy server, and thus the computing device can also be referred to as a device proxy server.

[0236] Any one of the instances can send a request to the computing device via the device proxy client service, and the computing device can receive the request sent by any one of the instances via the device proxy server. Conversely, the computing device can send a request to any one of the instances via the device proxy server, and any one of the instances can receive the request sent by the computing device via the device proxy client service.

[0237] Since the computing device is physically connected to the at least one processing unit via the bus, the computing device can support running the at least one processing unit. Since running any one of the processing units requires a corresponding driver of the processing unit, the computing device can be installed with the drivers corresponding to the processing units of the at least one processing unit. As shown in Fig. 2, the computing device can be installed with driver 1 corresponding to processing unit 1, driver 2 corresponding to processing unit 2, driver 3 corresponding to processing unit 3, driver 4 corresponding to processing unit 4, …, and driver m corresponding to processing unit m.

[0238] The computing device can start any one of the drivers via the device proxy server to run the processing unit corresponding to the driver.

[0239] It is emphasized that any one of the instances can use the at least one processing unit. Any one of the processing units can also support a plurality of instances. For example, instance 1 can use 10 GB of processing unit 1 and 5 GB of processing unit 2, and instance 2 can use 20 GB of processing unit 1. Processing unit 1 can support instance 1 and instance 2.

[0240] The technical solutions shown in the disclosure will be described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination. For the same or similar content, it will not be repeated in different embodiments.

[0241] The execution subject of the embodiments of the disclosure can be a computing device or an instance scaling device arranged in the computing device. The instance scaling device can be implemented by software or by a combination of software and hardware. The instance scaling device can be a processor in the computing device. The computing device can be a device that integrates processing units. For ease of understanding, the execution subject is taken as the computing device in the following description.

[0242] FIG. 3 is a flowchart of an instance scaling method according to an exemplary embodiment of the disclosure. As shown in FIG. 3, the method can include the following steps.

[0243] S301, obtaining a scaling request of a target instance.

[0244] The target instance can be any one of a plurality of instances connected by the computing device. The target instance can be a virtual machine or a server.

[0245] The scaling request can include at least one processing unit information and a scaling application capacity corresponding to each processing unit information. The at least one processing unit information can include a target processing unit type and / or a target processing unit identifier.

[0246] The target processing unit type can be any one of the following: GPU type, TPU type, VPU type, and FPGA type.

[0247] The target processing unit identifier can be used to indicate a first target processing unit. For example, if the first target processing unit is processing unit 1, the target processing unit identifier can be G001.

[0248] It should be noted that the target processing unit type and the target processing unit identifier can not be the same target processing unit. For example, the target processing unit type can be TPU type, and the target processing unit identifier G001 can be used to represent processing unit 1, and the type of processing unit 1 can be GPU type.

[0249] The scaling application capacity can be less than or equal to the rated capacity of the processing unit. For example, if the processing unit is a GPU, and the rated capacity of one GPU is 40 GB, the scaling application capacity can be less than or equal to 40 GB. If the processing unit is a TPU, and the rated capacity of one TPU is 64 GB, the scaling application capacity can be less than or equal to 64 GB.

[0250] The management device can be provided with a cloud management platform. A user can log in to the cloud management platform in the management device, and send a target instance scaling request to the computing device through the cloud management platform, so that the computing device obtains the target instance scaling request.

[0251] For example, if the target instance is instance 1, the user can log in to the cloud management platform and send instance 1 scaling request 1 to the computing device through the cloud management platform. The scaling request 1 can include processing unit information 1 and the corresponding expansion application capacity of 10GB, processing unit information 2 and the corresponding expansion application capacity of 20GB. Wherein, the processing unit information 1 is the target processing unit identifier G001, and the processing unit information 2 is the TPU type.

[0252] S302, according to the scaling request, determining at least one target processing unit in at least one processing unit, and target capacity in each target processing unit.

[0253] The at least one processing unit can include at least one of the following processing units: GPU, TPU, VPU, FPGA.

[0254] The target capacity can be less than or equal to the rated capacity of the processing unit.

[0255] Since the scaling request includes at least one processing unit information and the corresponding expansion application capacity of each processing unit information, in an optional embodiment, at least one target processing unit in at least one processing unit and target capacity in each target processing unit can be determined according to the scaling request in the following way: for any one processing unit information, according to the processing unit information and the corresponding expansion application capacity of the processing unit information, determine the target processing unit in at least one processing unit; according to the corresponding expansion application capacity of the processing unit information, determine the target capacity in the target processing unit.

[0256] For example, if the processing unit information 1 is the target processing unit identifier G001, since the target processing unit identifier G001 is used to represent the processing unit 1, the computing device can determine the processing unit 1 in at least one processing unit according to the target processing unit identifier G001, and determine the target expansion capacity of 10GB in the processing unit 1 according to the corresponding expansion application capacity of 10GB of the processing unit information 1;

[0257] If the processing unit information 2 is the TPU type, and the corresponding expansion application capacity of the processing unit information 2 is 20GB, if the processing unit 3 is TPU and the remaining capacity is greater than 20GB, the processing unit 3 can be determined as the target processing unit, and the target expansion capacity of 20GB is determined in the processing unit 3.

[0258] S303, according to the target capacity in each target processing unit, performing capacity expansion and contraction processing on the target instance on at least one target processing unit.

[0259] For example, if there are two target processing units, processing unit 1 and processing unit 2, the target expansion capacity in processing unit 1 is 10GB, and the target expansion capacity in processing unit 3 is 20GB, then 10GB in processing unit 1 can be allocated to instance 1, and 20GB in processing unit 3 can be allocated to instance 1 to perform capacity expansion processing on instance 1.

[0260] It should be noted that in the present disclosure, the target instance is expanded and contracted, which is to expand and contract the allocated capacity corresponding to the target instance. The allocated capacity is the capacity allocated to the target instance according to the corresponding capacity threshold in the target processing unit, but the target instance does not necessarily use all the allocated capacity; the used capacity is the capacity actually used by the target instance.

[0261] For example, if the capacity threshold 1 corresponding to instance 1 is 20GB, then the allocated capacity 1 corresponding to instance 1 can be determined according to the capacity threshold 1. However, in the allocated capacity 1 of 20GB, the used capacity of instance 1 can be 15GB.

[0262] In the embodiment of the present disclosure, the computing device can obtain the capacity expansion and contraction request of the target instance, and determine at least one target processing unit and the target capacity in each target processing unit in at least one processing unit according to the capacity expansion and contraction request. Then, according to the target capacity in each target processing unit, the target instance can be expanded and contracted on at least one target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, and the at least one target processing unit can be different types of processing units, the target instance is expanded and contracted according to the target capacity in each target processing unit, which not only makes the processing capacity of the instance dynamic, but also makes the instance dynamically have different types of processing capacity. Compared with the prior art, the processing unit is expanded and contracted according to the entire processing unit, and the type of the processing unit is single, which improves the flexibility of expanding and contracting the target instance.

[0263] Next, based on the embodiment shown in FIG. 3, the instance expansion method is further described in combination with FIG. 4; the instance contraction method is described in combination with FIG. 5.

[0264] FIG. 4 is a flowchart of an instance expansion method according to an example embodiment of the present disclosure. Please refer to FIG. 4, the method can include:

[0265] S401, obtaining a capacity expansion request of a target instance, the capacity expansion request including at least one processing unit information and an expansion application capacity corresponding to each processing unit information.

[0266] In the capacity expansion scenario, the at least one processing unit information can include a target processing unit type and / or a target processing unit identifier.

[0267] The capacity expansion application capacity can be less than or equal to the rated capacity of the processing unit.

[0268] Optionally, the user can log in to the cloud management platform in the management device, and send a capacity expansion request of the target instance to the computing device through the cloud management platform, so that the computing device acquires the capacity expansion request of the target instance.

[0269] For example, if the target instance is instance 1, the user can log in to the cloud management platform and send a capacity expansion request 1 of instance 1 to the computing device through the cloud management platform. The capacity expansion request 1 can include processing unit information 1 and a corresponding capacity expansion application capacity of 10 GB, and processing unit information 2 and a corresponding capacity expansion application capacity of 20 GB. The processing unit information 1 is a target processing unit identifier G001, and the processing unit information 2 is a TPU type.

[0270] S402, if the processing unit information is a target processing unit type, determining a target processing unit from the unbound processing units according to the target processing unit type and the capacity expansion application capacity.

[0271] The at least one processing unit can include a bound processing unit corresponding to the target instance and an unbound processing unit corresponding to the target instance.

[0272] The bound processing unit refers to a processing unit that has been bound to the target instance. The bound processing unit can support the target instance; the unbound processing unit refers to a processing unit that has not been bound to the target instance, and the unbound processing unit does not support the target instance.

[0273] For example, as shown in FIG. 2, in the m processing units, the bound processing units corresponding to instance 1 can include processing unit 1 and processing unit 2, and the unbound processing units corresponding to instance 1 can include processing unit 3, processing unit 4, processing unit 5, …, and processing unit m.

[0274] Since in the capacity expansion scenario, the processing unit information is information used to apply for capacity expansion for the target instance, when the processing unit information is a target processing unit type, it means that the processing unit corresponding to the target processing unit type has not been bound to the target instance, and the target instance does not know which target processing unit will be determined (if it has been bound, the processing unit information in the capacity expansion request sent by the target instance is a target processing unit identifier). Therefore, in this case, the computing device can determine at least one target processing unit from the unbound processing units according to the target processing unit type and the capacity expansion application capacity. The type of the target processing unit is the target processing unit type.

[0275] In an optional embodiment, at least one target processing unit is determined from the unassigned processing units according to the target processing unit type and the expansion application capacity: at least one candidate processing unit is determined from the unassigned processing units according to the target processing unit type; the residual capacity of each candidate processing unit in the at least one candidate processing unit is determined; if there is a target candidate processing unit in the at least one candidate processing unit whose residual capacity is greater than or equal to the expansion application capacity, the target candidate processing unit is determined as the target processing unit.

[0276] Since the unbound processing unit corresponding to the target instance includes at least one type of processing unit, the computing device can determine at least one candidate processing unit from the unbound processing unit according to the target processing unit type, and the type of the candidate processing unit is the target processing unit type.

[0277] For example, if the unbound processing unit corresponding to instance 1 includes processing unit 3, processing unit 4, processing unit 5, …, processing unit m, and processing unit 3 and processing unit 4 are TPU, if processing unit information 2 is TPU type, the computing device can determine processing unit 3 and processing unit 4 as candidate processing units from the unbound processing unit corresponding to instance 1 according to the TPU type. The computing device can determine the residual capacity of processing unit 3 and processing unit 4, assuming that the residual capacity of processing unit 3 is 30GB and the residual capacity of processing unit 4 is 10GB, if the expansion application capacity is 20GB, since the residual capacity of processing unit 3 is 30GB which is greater than the expansion application capacity 20GB, and the residual capacity of processing unit 4 is 10GB which is less than the expansion application capacity 20GB, the computing device can determine processing unit 3 as the target processing unit.

[0278] S403, determine a target capacity in the target processing unit according to the expansion application capacity corresponding to the processing unit information.

[0279] In the expansion scenario, the target capacity is the capacity used for expansion. Since the target capacity is determined according to the expansion application capacity, the target capacity is the same size as the expansion application capacity, which is less than or equal to the rated capacity of the processing unit.

[0280] For example, for processing unit information 2, if the expansion application capacity corresponding to processing unit information 2 is 20GB, the computing device can determine 20GB target capacity for expansion in processing unit 3 according to the expansion application capacity 20GB corresponding to processing unit information 2.

[0281] S404, binding processing is performed on the target processing unit and the target instance, and expansion processing is performed on the target instance in the target processing unit according to the target capacity in the target processing unit.

[0282] Since the target processing unit is determined in the unbound processing unit corresponding to the target instance when the processing unit information is the target processing unit type, the target processing unit has not been bound with the target instance, and thus the target processing unit and the target instance can be bound.

[0283] Optionally, the computing device can send the identification of the target processing unit to the target instance to bind the target processing unit to the target instance.

[0284] For example, if the target processing unit is processing unit 3, the computing device can send the identification of processing unit 3 to instance 1 to bind processing unit 3 to instance 1. The computing device can allocate the 20 GB target capacity in processing unit 3 to instance 1 according to the 20 GB target capacity in processing unit 3 to achieve the capacity expansion of instance 1.

[0285] S405, if the processing unit information is the target processing unit identification, determining the first target processing unit corresponding to the target processing unit identification.

[0286] In the case that the processing unit information is the target processing unit identification, the target processing unit corresponding to the target processing unit identification is in the bound processing unit corresponding to the target instance (because if not bound, the target instance does not know the target processing unit identification), and thus the computing device can determine the first target processing unit corresponding to the target processing unit identification in the bound processing unit according to the target processing unit identification. The identification of the first target processing unit is the target processing unit identification.

[0287] For example, if the processing unit information 1 is the target processing unit identification G001, if the target instance is instance 1, and the bound processing units corresponding to instance 1 include processing unit 1 and processing unit 2, the computing device can determine the first target processing unit as processing unit 1 in the bound processing units corresponding to instance 1 according to the target processing unit identification G001.

[0288] S406, determining whether the remaining capacity of the first target processing unit is greater than or equal to the capacity expansion application capacity corresponding to the target processing unit identification.

[0289] If yes, step S407 is executed, and if no, step S410 is executed.

[0290] For example, if the capacity expansion application capacity corresponding to the target processing unit identification G001 is 10 GB, the first target processing unit is processing unit 1, and if the remaining capacity of processing unit 1 is 15 GB, the remaining capacity of processing unit 1 is greater than the capacity expansion application capacity 10 GB, and thus step S407 can be executed; if the remaining capacity of processing unit 1 is 5 GB, the remaining capacity of processing unit 1 is less than the capacity expansion application capacity 10 GB, and thus step S410 can be executed.

[0291] S407, determine the first target processing unit as the target processing unit.

[0292] For example, if the first target processing unit is processing unit 1, the processing unit 1 can be determined as the target processing unit.

[0293] S408, determine the target capacity in the first target processing unit according to the corresponding expansion application capacity of the target processing unit identifier.

[0294] For example, if the corresponding expansion application capacity of the target processing unit identifier G001 is 10 GB, and the first target processing unit is processing unit 1, the computing device can determine 10 GB target capacity for expansion in processing unit 1 according to the expansion application capacity 10 GB.

[0295] S409, expand the target instance on the first target processing unit according to the target capacity in the first target processing unit.

[0296] For example, if the first target processing unit is processing unit 1, the computing device can allocate the 10 GB target capacity in processing unit 1 to instance 1 according to the target capacity 10 GB in processing unit 1, to achieve the expansion of instance 1.

[0297] S410, determine a second target processing unit of the same type as the first target processing unit in at least one processing unit, and determine the second target processing unit as the target processing unit.

[0298] If the remaining capacity of the first target processing unit is less than the corresponding expansion application capacity of the target processing unit identifier, it means that the first target processing unit cannot meet the expansion requirement, and the computing device can determine the type of the first target processing unit, and determine the second target processing unit in at least one processing unit according to the type of the first target processing unit.

[0299] Since the at least one processing unit includes the unbound processing unit corresponding to the target instance, the computing device can determine the second target processing unit in the unbound processing unit according to the type of the first target processing unit.

[0300] Since the first target processing unit is the bound processing unit corresponding to the target instance, there is allocated capacity corresponding to the target instance in the first target processing unit, and when the second target processing unit is determined again to replace the first target processing unit because the first target processing unit cannot meet the expansion requirement, the total allocated capacity corresponding to the target instance cannot be less, so the remaining capacity of the second target processing unit needs to be greater than the sum of the corresponding expansion application capacity of the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0301] For example, if the first target processing unit is processing unit 1, the type of processing unit 1 is GPU type, and if the unbound processing units corresponding to instance 1 include processing unit 3, processing unit 4, processing unit 5, …, processing unit m, the computing device can determine the processing units of GPU type in the unbound processing units. It is assumed that the computing device can determine that the processing units of GPU type in the unbound processing units include processing unit 5 and processing unit 6. If the expansion application capacity corresponding to the target processing unit identifier G001 is 10 GB, the allocated capacity of instance 1 in the first target processing unit is 10 GB, and it is assumed that the computing device can determine that the remaining capacity of processing unit 5 is 25 GB and the remaining capacity of processing unit 6 is 15 GB, since the remaining capacity of processing unit 5 is 25 GB, which is greater than the sum of the expansion application capacity 10 GB and the allocated capacity 10 GB, processing unit 5 can be determined as the target processing unit.

[0302] S411, determine the target capacity in the second target processing unit according to the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0303] In this case, the target capacity includes the allocated capacity of the target instance in the first target processing unit and the expansion capacity.

[0304] For example, if the second target processing unit is processing unit 5, and the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit is 20 GB, the computing device can determine a target capacity of 20 GB in processing unit 5.

[0305] S412, migrate the instance data of the target instance in the first target processing unit to the second target processing unit.

[0306] During the running of the target instance, the first target processing unit stores the instance data of the target instance, and if the second target processing unit is used to replace the first target processing unit, the instance data of the target instance in the first target processing unit needs to be migrated to the second target processing unit.

[0307] For example, if the first target processing unit is processing unit 1 and the second target processing unit is processing unit 5, the computing device can determine the instance data corresponding to instance 1 in processing unit 1, and migrate the instance data to processing unit 5.

[0308] S413, bind the second target processing unit and the target instance, and perform expansion processing on the target instance according to the target capacity in the second target processing unit.

[0309] Since the second target processing unit is determined in the unbound processing unit corresponding to the target instance, the second target processing unit has not been bound with the target instance, and thus the second target processing unit and the target instance can be bound.

[0310] Optionally, the computing device can send the identification of the second target processing unit to the target instance to bind the second target processing unit to the target instance.

[0311] For example, if the second target processing unit is processing unit 5, the computing device can send the identification of processing unit 5 to instance 1 to bind processing unit 5 to instance 1. According to the target capacity of 20 GB in processing unit 5, the computing device can allocate the 20 GB target capacity in processing unit 5 to instance 1 to realize the expansion of instance 1.

[0312] Optionally, since the first target processing unit is replaced by the second target processing unit, the computing device has also migrated the instance data of the target instance in the first target processing unit to the second target processing unit, and thus the computing device can also perform unbinding processing on the target instance and the first target processing unit to make the target instance release the first target processing unit, facilitate other instances to use the first target processing unit, and improve the utilization rate of the first target processing unit.

[0313] In the embodiments of the present disclosure, the computing device can obtain an expansion request of a target instance, the expansion request comprising at least one processing unit information and an expansion application capacity corresponding to each processing unit information. If the processing unit information is a target processing unit type, the computing device can determine a target processing unit in the unbound processing unit according to the target processing unit type and the expansion application capacity, and determine a target capacity in the target processing unit according to the expansion application capacity corresponding to the processing unit information, and then perform binding processing on the target processing unit and the target instance, and perform expansion processing on the target instance on the target processing unit according to the target capacity in the target processing unit. If the processing unit information is a target processing unit identifier, the computing device can determine a first target processing unit corresponding to the target processing unit identifier, and determine whether the remaining capacity of the first target processing unit is greater than or equal to the expansion application capacity corresponding to the target processing unit identifier. If yes, the first target processing unit is determined as the target processing unit, and a target capacity in the first target processing unit is determined according to the expansion application capacity corresponding to the target processing unit identifier, and then expansion processing is performed on the target instance on the first target processing unit according to the target capacity in the first target processing unit; if not, a second target processing unit of the same type as the first target processing unit is determined in the at least one processing unit, and the second target processing unit is determined as the target processing unit, and then a target capacity in the second target processing unit is determined according to the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit. The computing device can migrate instance data of the target instance in the first target processing unit to the second target processing unit, perform binding processing on the second target processing unit and the target instance, and perform expansion processing on the target instance according to the target capacity in the second target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, and the at least one target processing unit can be a processing unit of different types, the target instance is expanded according to the target capacity in each target processing unit, which not only dynamically increases the processing capacity of the instance, but also enables the instance to dynamically have different types of processing capacity, thereby improving the flexibility of expanding the target instance compared with the prior art in which the target instance is expanded according to the entire processing unit and the type of the processing unit is single.

[0314] FIG. 5 is a flow diagram of an instance scaling-in method provided by an embodiment of the present disclosure. Referring to FIG. 5, the method can comprise:

[0315] S501, obtaining a scaling-in request of a target instance, the scaling-in request comprising at least one processing unit information and a scaling application capacity corresponding to each processing unit information.

[0316] In the capacity reduction scenario, the at least one processing unit information can include at least one target processing unit identifier. The target processing unit identifier can be used to indicate the first target processing unit.

[0317] The capacity reduction application capacity can be less than or equal to the rated capacity of the processing unit.

[0318] Optionally, the user can log in to the cloud management platform in the management device, and send a capacity reduction request of the target instance to the computing device through the cloud management platform, so that the computing device obtains the capacity reduction request of the target instance.

[0319] For example, if the target instance is instance 1, the user can log in to the cloud management platform and send a capacity reduction request 1 of instance 1 to the computing device through the cloud management platform. The capacity reduction request 1 can include processing unit information 1 and the corresponding capacity reduction application capacity is 5GB. The processing unit information 1 is a target processing unit identifier G001.

[0320] S502, for any one processing unit information, if the processing unit information is a target processing unit identifier, determine the first target processing unit corresponding to the target processing unit identifier.

[0321] The at least one processing unit can include a bound processing unit and an unbound processing unit corresponding to the target instance.

[0322] Since in the capacity reduction scenario, the computing device can determine the first target processing unit corresponding to the target processing unit identifier according to the target processing unit identifier.

[0323] For example, if the processing unit information 1 is the target processing unit identifier G001, the computing device can determine the processing unit corresponding to the target processing unit identifier G001 in the bound processing unit corresponding to instance 1 according to the target processing unit identifier G001.

[0324] S503, obtain the used capacity and the allocated capacity of the target instance in the first target processing unit.

[0325] Optionally, the computing device can store the used capacity and the allocated capacity of the target instance in each bound processing unit. Since the first target processing unit is a bound processing unit corresponding to the target instance, the computing device can obtain the used capacity and the allocated capacity of the target instance in the first target processing unit.

[0326] For example, the computing device can obtain that the used capacity of instance 1 in processing unit 1 is 10GB, and the allocated capacity is 15GB.

[0327] S504, determine the allocated capacity of the target instance in the first target processing unit after capacity reduction according to the allocated capacity and the capacity reduction application capacity.

[0328] The computing device can subtract the capacity of the scaling-in application from the allocated capacity to obtain the allocated capacity of the target instance after scaling-in in the first target processing unit.

[0329] For example, if the allocated capacity of instance 1 in processing unit 1 is 15 GB and the capacity of the scaling-in application is 5 GB, the computing device can determine that the allocated capacity of instance 1 in processing unit 1 after scaling-in is 10 GB.

[0330] S505, determine whether the allocated capacity after scaling-in is greater than or equal to the used capacity of the target instance in the first target processing unit.

[0331] If yes, it means that the allocated capacity after scaling-in can meet the used capacity of the target instance in the target processing unit, step S506 is executed; if no, it means that the allocated capacity after scaling-in cannot meet the used capacity of the target instance in the target processing unit, in order not to affect the running of the target instance, scaling-in processing cannot be performed, and therefore the computing device can return a scaling-in failure notification to the target instance.

[0332] S506, determine the first target processing unit as the target processing unit.

[0333] S507, determine the target capacity in the target processing unit according to the capacity of the scaling-in application corresponding to the processing unit information.

[0334] In the scaling-in scenario, the target capacity can be the capacity for scaling-in.

[0335] Since the target capacity is determined according to the capacity of the scaling-in application, the target capacity is the same size as the capacity of the scaling-in application, and is less than or equal to the rated capacity of the processing unit.

[0336] For example, for processing unit information 1, if the capacity of the scaling-in application corresponding to processing unit information 1 is 5 GB, the computing device can determine 5 GB of target capacity for scaling-in in processing unit 1 according to the capacity of the scaling-in application corresponding to processing unit information 1, which is 5 GB.

[0337] S508, perform scaling-in processing on the target instance in at least one target processing unit according to the target capacity in each target processing unit.

[0338] Optionally, for any target processing unit, the computing device can determine the allocated capacity corresponding to the target instance in the target processing unit. The computing device can recover the target capacity from the allocated capacity to achieve scaling-in processing on the target instance in the target processing unit.

[0339] For example, if the allocated capacity corresponding to instance 1 in processing unit 1 is 30 GB, and the target capacity in processing unit 1 is 5 GB, the computing device can reclaim 5 GB of the target capacity from the allocated capacity 30 GB corresponding to instance 1 in processing unit 1, to downsize the allocated capacity of instance 1 in processing unit 1 from 30 GB to 25 GB.

[0340] In the embodiments of the present disclosure, the computing device can obtain a downsize request of the target instance, the downsize request comprising at least one processing unit information and a downsize application capacity corresponding to each processing unit information. For any one processing unit information, if the processing unit information is a target processing unit identifier, the computing device can determine a first target processing unit corresponding to the target processing unit identifier, and obtain the used capacity and the allocated capacity of the target instance in the first target processing unit, and then determine the allocated capacity of the target instance in the first target processing unit after downsizing according to the allocated capacity and the downsize application capacity. The computing device can determine whether the allocated capacity after downsizing is greater than or equal to the used capacity of the target instance in the first target processing unit. If yes, the first target processing unit can be determined as the target processing unit. The computing device can determine a target capacity in the target processing unit according to the downsize application capacity corresponding to the processing unit information, and perform downsizing processing on the target instance on at least one target processing unit according to the target capacity in each target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, and the at least one target processing unit can be different types of processing units, downsizing the target instance according to the target capacity in each target processing unit can dynamically reduce the processing capacity of the instance, and improve the flexibility of downsizing the target instance compared with the prior art of downsizing the target instance according to the entire processing unit.

[0341] Next, on the basis of any of the above embodiments, the instance expansion and downsizing process is further described in combination with FIG. 6.

[0342] FIG. 6 is a process schematic diagram of an instance expansion and downsizing method provided in an exemplary embodiment of the present disclosure. Please refer to FIG. 6, which comprises a management device, a computing device, three instances and seven processing units. For example, the three instances can be instance 1, instance 2 and instance 3, and the seven processing units can be GPU1, GPU2, GPU3, VPU1, VPU2, TPU1 and TPU2.

[0343] The cloud management platform can be provided in the management device. The user can log in to the cloud management platform in the management device, and send an expansion and downsizing request of a target instance to the computing device through the cloud management platform.

[0344] For any instance, the instance can be installed with an application (Application, APP), a proxy client service, and a high-speed network component. The proxy client service can provide an interface of a high-performance computing platform.

[0345] The computing device can include a central processing unit (CPU) and a high-speed network component. Based on the CPU, an operating system can be run. Based on the operating system, a proxy service and a driver corresponding to each processing unit of the at least one processing unit can be run.

[0346] The proxy service can have a request forwarding function, a configuration function, and a logical judgment function.

[0347] The high-speed network component can use a peripheral component interconnect express (PCIe) protocol, or a network transmission protocol, etc. The instance communicates with the computing device through the high-speed network component, which can improve the communication efficiency.

[0348] Next, taking the expansion of instance 1 as an example, the instance expansion process is further described.

[0349] The user can log in to the cloud management platform in the management device, and send an expansion and contraction request 1 of instance 1 to the computing device through the cloud management platform. The expansion and contraction request 1 can include processing unit information 1 and the corresponding contraction application capacity of 10GB, processing unit information 2 and the corresponding expansion application capacity of 20GB. Among them, the processing unit information 1 is the target processing unit identifier G001, and the processing unit information 2 is the TPU type.

[0350] The computing device can call the proxy service and receive the expansion request sent by instance 1 through the high-speed network component 0.

[0351] For the processing unit information 1, the computing device can determine the GPU1 corresponding to the target processing unit identifier G001 in the at least one processing unit according to the processing unit information 1 and the contraction application capacity of 10GB corresponding to the processing unit information 1 through the proxy service, and determine the 10GB target capacity for contraction in the GPU1 according to the contraction application capacity of 10GB.

[0352] For the processing unit information 2, the computing device can determine a target processing unit in the at least one processing unit according to the processing unit information 2 and the expansion application capacity 20 GB corresponding to the processing unit information 2 through the proxy service. Assuming that the remaining capacity of the TPU1 is greater than the expansion application capacity 20 GB, the TPU1 can be determined as the target processing unit corresponding to the processing unit information 2. The computing device can determine the 20 GB target capacity for expansion in the TPU1 according to the expansion application capacity 20 GB.

[0353] The computing device can perform the scaling-in processing on the instance 1 according to the 10 GB target capacity for scaling-in in the GPU1, and perform the scaling-out processing on the instance 1 according to the 20 GB target capacity for scaling-out in the TPU1.

[0354] In the embodiments of the present disclosure, the computing device can obtain a scaling request of a target instance, and determine at least one target processing unit and a target capacity in each target processing unit in the at least one target processing unit according to the scaling request. Then, the computing device can perform scaling processing on the target instance according to the target capacity in each target processing unit in the at least one target processing unit. Since the target capacity can be less than the rated capacity of the processing unit, and the at least one target processing unit can be different types of processing units, the scaling of the target instance according to the target capacity in each target processing unit not only makes the processing capacity of the instance dynamically increase or decrease, but also makes the instance dynamically have different types of processing capacity. Compared with the prior art in which the scaling of the target instance is performed according to the entire processing unit and the type of the processing unit is single, the flexibility of the scaling of the target instance is improved.

[0355] Optionally, the computing device can store processing unit configuration information corresponding to the target instance. The processing unit configuration information can include at least one processing unit type and at least one capacity threshold corresponding to each processing unit type.

[0356] In actual work, when the target instance is closed, the processing unit bound to the target instance can be released, so that the processing unit can be allocated to other instances, so that the processing unit is not idle, and the utilization rate of the processing unit is improved. In view of this, each time the target instance is started, the computing device can allocate a target processing unit to the target instance again according to the processing unit configuration information. In order to distinguish from the target processing unit, the first target processing unit and the second target processing unit in the above scaling process, the target processing unit allocated to the target instance again when the instance is started is referred to as a “third target processing unit”.

[0357] Next, the process of allocating the third target processing unit when the instance is started will be described in combination with FIG. 7.

[0358] FIG. 7 is a process diagram of a processing unit allocation method according to an example embodiment of the present disclosure. Referring to FIG. 7, the method can include:

[0359] S701, in response to the obtaining processing unit configuration information instruction sent by the target instance, obtaining the processing unit configuration information corresponding to the target instance.

[0360] Optionally, the obtaining processing unit configuration information instruction can be sent to the computing device when the target instance is started. The computing device can obtain the processing unit configuration information corresponding to the target instance in response to the obtaining processing unit configuration information instruction.

[0361] The processing unit configuration information can include at least one processing unit type and at least one capacity threshold corresponding to each processing unit type.

[0362] For example, if the target instance is instance 1, the computing device can obtain the processing unit configuration information 1 corresponding to instance 1 in response to the processing unit configuration information instruction sent by instance 1. It is assumed that the processing unit configuration information 1 can be as shown in Table 1:

[0363] Table 1

[0364] S702, determining at least one third target processing unit in the at least one processing unit according to the processing unit configuration information.

[0365] Since the computing device is connected to the at least one processing unit, for any one processing unit type, the computing device can determine at least one third target processing unit in the at least one processing unit according to at least one capacity threshold corresponding to the processing unit type. The remaining capacity of the third target processing unit can be greater than or equal to the capacity threshold.

[0366] For example, if the processing units included in the at least one processing unit and the remaining capacity of each processing unit are as shown in Table 2:

[0367] Table 2

[0368] Table 2 (continued)

[0369] If the processing unit configuration information is as shown in Table 1, for the GPU type, the computing device can determine GPU1 as the third target processing unit in the at least one processing unit according to the capacity threshold 10GB; and can determine GPU3 as the third target processing unit according to the capacity threshold 15GB. For the TPU type, the computing device can determine TPU3 as the third target processing unit according to the capacity threshold 20GB.

[0370] S703, bind at least one third target processing unit to the target instance.

[0371] Optionally, the at least one third target processing unit can be bound to the target instance by: for any one third target processing unit, obtaining processing unit information of the third target processing unit; and sending the processing unit information to the target instance to bind the third target processing unit to the target instance.

[0372] Optionally, the processing unit information can be an identifier of the third target processing unit.

[0373] Optionally, the processing unit information of each processing unit in the at least one processing unit can be stored in the computing device, and the third target processing unit is in the at least one processing unit, so the computing device can obtain the processing unit information of the third target processing unit.

[0374] For example, if there are three third target processing units, GPU1, GPU3, and TPU3, the computing device can obtain the processing unit information 1 as the identifier G001 of GPU1, the processing unit information 2 as the identifier G002 of GPU3, and the processing unit information 3 as the identifier T003 of TPU3. The computing device can send the three processing unit information to the target instance to bind GPU1, GPU3, and TPU3 to the instance 1.

[0375] In the embodiments of the present disclosure, the computing device can obtain the processing unit configuration information corresponding to the target instance in response to the obtaining processing unit configuration information instruction sent by the target instance, and determine at least one third target processing unit in the at least one processing unit according to the processing unit configuration information, and then bind the at least one third target processing unit to the target instance. Since the computing device can allocate at least one processing unit to the target instance according to the processing unit configuration information corresponding to the target instance each time the target instance is started, the processing unit bound to the target instance can be released when the target instance is last closed, so that the processing unit can be allocated to other instances, the processing unit is not idle, and the utilization rate of the processing unit is improved.

[0376] Optionally, after the third target processing unit is bound to the target instance according to the processing unit configuration information when the instance is started, the third target processing unit becomes the bound processing unit corresponding to the target instance. The target instance can also send a context creation instruction to the computing device to obtain the context of the target bound processing unit.

[0377] In an optional embodiment, the computing device can receive a create context instruction sent by the target instance; create a target context of the target bound processing unit; generate a virtual context of the target bound processing unit according to the target context of the target bound processing unit; and send the virtual context of the target bound processing unit to the target instance.

[0378] The create context instruction can comprise an identifier of the target bound processing unit, and the identifier of the target bound processing unit is used to indicate the target bound processing unit.

[0379] The target context can be used to describe a state of the target processing unit and an operation performed by the target processing unit.

[0380] For example, if the target instance is instance 1, the instance 1 can send a create context instruction to the computing device. The create context instruction can comprise an identifier G001 of GPU1, and the computing device can create a target context of GPU1 in response to the create context instruction. The computing device can generate a virtual context of GPU1 according to the target context of GPU1 and send the virtual context of GPU1 to the instance 1.

[0381] Since the computing device sends the virtual context of the target bound processing unit to the target instance, the user will not know the target context of the target bound processing unit, which realizes hiding the target context and improves the confidentiality and security of the target bound processing unit.

[0382] Optionally, the target instance can also send a capacity threshold query request to the computing device through the proxy client service. The capacity threshold query request can comprise a target processing unit type or a target processing unit identifier.

[0383] If the capacity threshold query request comprises the target processing unit type, the computing device can determine a capacity threshold corresponding to the target processing unit type in the processing unit configuration information of the target instance according to the target processing unit type after receiving the capacity threshold query request. If the capacity threshold query request comprises the target processing unit identifier, the computing device can determine a capacity threshold corresponding to the target processing unit identifier in the processing unit configuration information of the target instance according to the target processing unit identifier after receiving the capacity threshold query request. The computing device can send the capacity threshold to the target instance through the proxy service.

[0384] Through the above embodiment of FIG. 7, when the target instance is started, the third target processing unit is bound to the target instance, but the processing unit capacity of the third target processing unit has not been allocated to the target instance, thus after the third target processing unit is bound to the target instance, the target instance can send a capacity application request to apply for the processing unit capacity in the target bound processing unit. Next, the process of allocating the processing unit capacity to the target instance is described in combination with FIG. 8.

[0385] FIG. 8 is a flowchart of a process of allocating a processing unit capacity to a target instance according to an example embodiment of the present disclosure. Referring to FIG. 8, the method can include:

[0386] S801, receiving a capacity application request sent by a target instance.

[0387] The capacity application request includes an application capacity, an identifier of a target bound processing unit, and a virtual context. The capacity application request can be used to request the application capacity in the target bound processing unit for the target instance.

[0388] The application capacity can be used to represent the processing unit capacity to be allocated to the target instance. Alternatively, the application capacity can be represented by a capacity value. If the target bound processing unit is a GPU, the application capacity can be represented by an application memory value.

[0389] The identifier of the target bound processing unit is used to indicate the target bound processing unit.

[0390] The computing device can receive the capacity application request sent by the target instance through a target interface. For any type of processing unit, the processing unit has a corresponding interface. For example, if the processing unit is a GPU, a GPU interface can be corresponded; if the processing unit is a TPU, a TPU interface can be corresponded.

[0391] The target interface refers to an interface used to send or receive various requests corresponding to the processing unit. For example, if the capacity application request is used to apply for the processing unit capacity in GPU1, the target interface can be a GPU interface.

[0392] For example, the computing device can receive the capacity application request sent by instance 1 through the target interface. The capacity application request can include an application capacity of 3GB, an identifier G001 of GPU1, and a virtual context of GPU1.

[0393] S802, obtaining used capacity information corresponding to the target instance.

[0394] Optionally, the used capacity information corresponding to each instance can be stored in the computing device. For any one instance, the used capacity information can include at least one bound processing unit, and the used capacity and the capacity threshold corresponding to each bound processing unit.

[0395] The computing device can obtain the used capacity information corresponding to the target instance. For example, if the target instance is instance 1, the computing device can obtain the used capacity information corresponding to instance 1, assuming that the used capacity information corresponding to instance 1 can be as shown in Table 3:

[0396] Table 3

[0397] S803, according to the used capacity information, the virtual context of the target bound processing unit, and the application capacity, determining the target used capacity in the target bound processing unit.

[0398] Optionally, the target used capacity in the target bound processing unit can be determined according to the used capacity information, the virtual context of the target bound processing unit, and the application capacity in the following manner: in the used capacity information, determining the target used capacity and the target capacity threshold corresponding to the target bound processing unit; if the sum of the target used capacity and the application capacity is less than or equal to the target capacity threshold, determining the target used capacity in the target bound processing unit according to the virtual context of the target bound processing unit and the application capacity.

[0399] The target used capacity refers to the used capacity of the target instance in the target bound processing unit. The target capacity threshold refers to the capacity threshold corresponding to the target instance in the target bound processing unit.

[0400] For example, if the used capacity information of instance 1 is as shown in Table 3, if the target bound processing unit is GPU1, the computing device can obtain the target used capacity corresponding to GPU1 as 5GB, and the target capacity threshold as 10GB. If the application capacity is 3GB, since the sum of the application capacity 3GB and the target used capacity 5GB is less than the target capacity threshold 10GB, the computing device can determine the target used capacity of 3GB in GPU1 according to the virtual context of GPU1 and the application capacity 3GB.

[0401] S804, allocating the target used capacity to the target instance.

[0402] Optionally, the target used capacity can be allocated to the target instance in the following manner: obtaining the target address corresponding to the target used capacity; determining the virtual address corresponding to the target used capacity according to the target address corresponding to the target used capacity; and allocating the target used capacity to the target instance according to the virtual address corresponding to the target capacity.

[0403] Optionally, the target address can be a start address of the target used capacity in the target bound processing unit.

[0404] For example, the computing device can obtain a target address corresponding to the 3GB target used capacity in GPU1, and generate a virtual address corresponding to the 3GB target used capacity according to the target address, and then can send the virtual address to instance 1 to allocate the 3GB target used capacity to instance 1.

[0405] It should be noted that if the sum of the target used capacity and the application capacity is greater than the target capacity threshold, the computing device can send a notification of application failure to the target instance.

[0406] In the embodiment of the present disclosure, the computing device can receive the capacity application request sent by the target instance, and obtain the used capacity information corresponding to the target instance. The computing device can determine the target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit, and the application capacity, and allocate the target used capacity to the target instance. Since the computing device can allocate the application capacity to the target instance on demand according to the capacity application request of the target instance, the granularity of allocating the processing unit capacity to the target instance is refined, and the flexibility of allocating the processing unit capacity to the target instance is improved.

[0407] After the target instance is allocated with the third target processing unit by the above-mentioned embodiment of FIG. 6, and the target used capacity is allocated to the target instance in the target bound processing unit by the above-mentioned embodiment of FIG. 8, the target instance can use the processing unit for task processing. Next, the process of using the processing unit by the target instance will be described in combination with FIG. 9.

[0408] FIG. 9 is a flowchart of a processing unit usage method provided by an exemplary embodiment of the present disclosure. Referring to FIG. 9, the method can include:

[0409] S901, receiving a task processing request sent by a target instance.

[0410] The task processing request can include a target task, and a virtual address and a virtual context corresponding to each bound processing unit in the at least one bound processing unit.

[0411] The bound processing unit is a bound processing unit corresponding to the target instance in the at least one processing unit.

[0412] For any one bound processing unit, the virtual address corresponding to the bound processing unit is the virtual address of the target used capacity in the bound processing unit.

[0413] The target instance can send a task processing request to the computing device through the proxy client service via the high-speed network component. The computing device can receive the task processing request sent by the target instance through the proxy service via the high-speed network component.

[0414] For example, if the target instance is instance 1, the corresponding bound processing units include GPU1, GPU3 and TPU3, instance 1 can call the proxy client service to send a task processing request to the computing device through the high-speed network component, and the computing device can call the proxy service to receive the task processing request through the high-speed network component. The task processing request can include a target task, a virtual address 1 and a virtual context 1 corresponding to GPU1, and a virtual address 3 and a virtual context 3 corresponding to GPU3.

[0415] S902, according to at least one bound processing unit, the corresponding virtual address and virtual context of each bound processing unit, calling at least one bound processing unit to perform computing processing on the target task.

[0416] For any one bound processing unit, the bound processing unit can be called to perform computing processing on the target task in the following manner: obtaining the address mapping relationship and the context mapping relationship corresponding to the bound processing unit in the preset storage space; determining a first target address corresponding to the first virtual address in the address mapping relationship according to the first virtual address; determining a first target context corresponding to the first virtual context in the context mapping relationship according to the first virtual context; and calling the bound processing unit to perform computing processing on the target task according to the first target address and the first target context.

[0417] The preset storage space can store a plurality of address mapping relationships and a plurality of context mapping relationships. Optionally, the preset storage space can be located in the computing device, or can be located in a storage device, and the storage device can be communicatively or physically connected to the computing device.

[0418] Since the target instance can correspond to at least one bound processing unit, the computing device can obtain at least one address mapping relationship and at least one context mapping relationship corresponding to the target instance in the preset storage space. For any one bound processing unit, the computing device can determine the address mapping relationship corresponding to the bound processing unit in the at least one address mapping relationship, and can determine the context mapping relationship corresponding to the bound processing unit in the at least one context mapping relationship.

[0419] The address mapping relationship corresponding to the bound processing unit can include a first virtual address and a first target address corresponding to the bound processing unit; and the context mapping relationship corresponding to the bound processing unit can include a first virtual context and a first target context corresponding to the bound processing unit.

[0420] For any one of the bound processing units, the computing device can determine, according to the first virtual address corresponding to the bound processing unit, the first target address corresponding to the bound processing unit in the address mapping relationship corresponding to the bound processing unit; and the computing device can determine, according to the first virtual context corresponding to the bound processing unit, the first target context corresponding to the bound processing unit in the context mapping relationship corresponding to the bound processing unit.

[0421] Optionally, for any one of the bound processing units, the computing device can call the agent service, and send a target task to the bound processing unit according to the first target address and the first target context corresponding to the bound processing unit, so as to call the bound processing unit to perform computing processing on the target task.

[0422] For example, if the task processing request includes the virtual address 1 and the virtual context 1 corresponding to GPU1, and the virtual address 3 and the virtual context 3 corresponding to GPU3, for GPU1, the computing device can obtain the address mapping relationship 1 and the context mapping relationship 1 corresponding to GPU1 through the agent service in the preset storage space. If GPU1 has the virtual address 1 and the virtual context 1, the computing device can determine the target address 1 in the address mapping relationship 1 according to the virtual address 1 through the agent service; and can determine the target context 1 in the context mapping relationship 1 according to the virtual context 1. The computing device can call GPU1 to process the target task according to the target address 1 and the target context 1; similarly, for GPU3, the computing device can determine the target address 3 in the address mapping relationship 3 according to the virtual address 3 through the agent service; and can determine the target context 3 in the context mapping relationship 3 according to the virtual context 3, and then can call GPU3 to process the target task according to the target address 3 and the target context 3.

[0423] Optionally, before obtaining the address mapping relationship and the context mapping relationship corresponding to the bound processing unit in the preset storage space, the computing device can also generate the address mapping relationship according to the first target address corresponding to the bound processing unit and the first virtual address corresponding to the bound processing unit, the address mapping relationship including the first target address and the first virtual address; generate the context mapping relationship according to the first target context corresponding to the bound processing unit and the first virtual context corresponding to the bound processing unit, the context mapping relationship including the first target context and the first virtual context; and store the address mapping relationship and the context mapping relationship in the preset storage space.

[0424] By storing the address mapping relationship and the context mapping relationship in the preset storage space, it is convenient to use the address mapping relationship and the first context mapping relationship in the use process of the processing unit.

[0425] Since one processing unit can support at least one instance in the technical solution of the present disclosure, the computing device can distribute the task processing request sent by the at least one instance to the same processing unit corresponding to the at least one instance, thereby achieving the fragmented use of the processing unit and improving the utilization rate of the processing unit.

[0426] For example, if GPU1 supports instance 1 and instance 2, the computing device can distribute the task processing request sent by instance 1 and instance 2 to GPU1, so that GPU1 can process the task in instance 1 and the task in instance 2.

[0427] On the other hand, in the technical solution of the present disclosure, the distribution of the task processing request is realized by the computing device, without occupying the CPU resources in the instance, so that the CPU resources in the instance can be fully used for running the instance.

[0428] In the embodiment of the present disclosure, the computing device can receive the task processing request sent by the target instance, and call at least one bound processing unit to perform the computing processing on the target task according to the virtual address and the virtual context corresponding to each bound processing unit in the at least one bound processing unit. Since any one instance can correspond to at least one bound processing unit, the instance can have flexible processing capability by calling the at least one bound processing unit.

[0429] In actual work, if the instance is a virtual machine, the instance can be migrated, and the at least one processing unit corresponding to the instance can be changed along with the migration. Alternatively, the migration of the instance can include two cases, case 1: the first instance device before the migration of the instance and the second instance device after the migration of the instance correspond to the same computing device; case 2: the first instance device before the migration of the instance and the second instance device after the migration of the instance correspond to different computing devices. Hereinafter, case 1 is described in combination with FIG. 10, and case 2 is described in combination with FIGS. 11-12.

[0430] FIG. 10 is a process schematic diagram of instance migration provided by an exemplary embodiment of the present disclosure. Please refer to FIG. 10, if the instance to be migrated is instance 1, instance 1 is a virtual machine, the first instance device before the migration of instance 1 is server 1, the second instance device after the migration of instance 1 is server 2, and server 1 and server 2 correspond to the same computing device.

[0431] In this case, the instance 1 is migrated from the server 1 to the server 2, and the internal state of the instance 1 can be migrated from the server 1 to the server 2. Alternatively, the plurality of files corresponding to the instance 1 can be determined in the memory corresponding to the instance 1 in the server 1, and the state data corresponding to the instance 1 can be determined in the register corresponding to the CPU, and then the plurality of files and the state data can be migrated to the server 2, so as to migrate the instance 1 from the server 1 to the server 2.

[0432] Since the server 1 and the server 2 correspond to the same computing device, the at least one processing unit connected to the computing device does not change, so after the instance 1 is migrated to the server 2, the at least one bound processing unit corresponding to the instance 1 is still in the at least one processing unit connected to the computing device, so the at least one bound processing unit corresponding to the instance 1 does not need to be changed.

[0433] For example, if the at least one processing unit corresponding to the instance 1 includes GPU1, GPU3 and TPU3 before migration, after the instance 1 is migrated, the at least one processing unit corresponding to the instance 1 still includes GPU1, GPU3 and TPU3, and does not need to be changed.

[0434] When the instance 1 calls the corresponding at least one bound processing unit, the computing device can still perform steps S901-S902 in the embodiment of FIG. 9 to realize that the instance 1 calls the corresponding at least one processing unit, which will not be described here.

[0435] In the embodiments of the present disclosure, when it is necessary to migrate a virtual machine instance, the virtual machine instance can be migrated from a first instance device to a second instance device, without being limited by the bound processing unit and without changing the bound processing unit, thereby improving the convenience of migrating the virtual machine instance.

[0436] FIG. 11 is a flowchart of migrating an instance across computing devices according to an example embodiment of the present disclosure. Referring to FIG. 11, the method can include:

[0437] S1101, receiving used capacity information of a to-be-migrated instance sent by a source computing device.

[0438] The source computing device refers to a computing device corresponding to a first instance device where the to-be-migrated instance is located before migration.

[0439] The first instance device is a device running the to-be-migrated instance. Alternatively, the to-be-migrated instance can be a virtual machine, and the first instance device can be a server.

[0440] When the to-be-migrated instance is located in the first instance device, the source computing device stores the used capacity information of the to-be-migrated instance, since the first instance device corresponds to the source computing device.

[0441] The source computing device can send used capacity information of the instance to be migrated to the computing device, so that the computing device obtains the used capacity information of the instance to be migrated.

[0442] For example, if the instance to be migrated is instance 2, if the used capacity information corresponding to instance 2 is as shown in Table 4:

[0443] Table 4

[0444] The source computing device can send the used capacity information of instance 2 to the computing device, and the computing device can obtain the used capacity information of instance 2.

[0445] S1102, determining at least one fourth target processing unit in at least one processing unit according to the used capacity information of the instance to be migrated.

[0446] Since the used capacity information includes at least one bound processing unit corresponding to the instance to be migrated, and the used capacity and capacity threshold corresponding to each bound processing unit, the computing device can determine at least one fourth target processing unit in at least one processing unit according to the capacity threshold corresponding to each bound processing unit.

[0447] The at least one fourth target processing unit corresponds to the at least one bound processing unit one by one. For any one fourth target processing unit, the fourth target processing unit and the corresponding bound processing unit are of the same type. The remaining capacity of the fourth target processing unit is greater than the capacity threshold corresponding to the corresponding bound processing unit.

[0448] For example, if the used capacity information corresponding to instance 2 is as shown in Table 4, if the processing units included in the at least one processing unit corresponding to the computing device and the remaining capacity of each processing unit are as shown in Table 5:

[0449] Table 5

[0450] The computing device can determine, according to the capacity threshold 20GB of GPU4 in the used capacity information, that the fourth target processing unit 1 is GPU7 in at least one processing unit; can determine, according to the capacity threshold 25GB of GPU5 in the used capacity information, that the fourth target processing unit 2 is GPU8 in at least one processing unit; can determine, according to the capacity threshold 18GB of VPU3 in the used capacity information, that the fourth target processing unit 3 is VPU6 in at least one processing unit.

[0451] S1103, for any one fourth target processing unit, determining a second target address and a second target context corresponding to the fourth target processing unit according to the used capacity information of the instance to be migrated.

[0452] Since the used capacity information of the to-be-migrated instance includes the used capacity corresponding to each bound processing unit, for any one fourth target processing unit, the computing device can determine, in the corresponding fourth target processing unit, a target to-be-allocated capacity and a second target address corresponding to the target to-be-allocated capacity according to the used capacity corresponding to the bound processing unit. The target to-be-allocated capacity has the same size as the used capacity.

[0453] The computing device can determine, as the second target address corresponding to the target to-be-allocated capacity in the fourth target processing unit, the second target address corresponding to the fourth target processing unit.

[0454] For example, for the fourth target processing unit 1 (i.e., GPU 7), the computing device can determine, in the GPU 7, a target to-be-allocated capacity 1 of 12 GB according to the used capacity 12 GB corresponding to the GPU 4, and determine a second target address 1 corresponding to the target to-be-allocated capacity 1, and then the computing device can determine the second target address 1 as the second target address corresponding to the GPU 7. Similarly, for the fourth target processing unit 2 (i.e., GPU 8), the computing device can determine, in the GPU 8, a target to-be-allocated capacity 2 of 15 GB according to the used capacity 15 GB corresponding to the GPU 5, and determine a second target address 2 corresponding to the target to-be-allocated capacity 2, and then the computing device can determine the second target address 2 as the second target address corresponding to the GPU 8. For the fourth target processing unit 3 (i.e., VPU 6), the computing device can determine, in the VPU 6, a target to-be-allocated capacity 3 of 18 GB according to the used capacity 18 GB corresponding to the VPU 3, and determine a second target address 3 corresponding to the target to-be-allocated capacity 2, and then the computing device can determine the second target address 3 as the second target address corresponding to the VPU 6.

[0455] For any one fourth target processing unit, the computing device can determine a second target context of the fourth target processing unit.

[0456] For example, the computing device can determine a second target context 1 of the GPU 7, a second target context 2 of the GPU 8, and a second target context 3 of the VPU 6.

[0457] S1104, after the to-be-migrated instance is migrated from the first instance device to the second instance device, determining each target address mapping relationship and each target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit, and binding at least one fourth target processing unit to the to-be-migrated instance.

[0458] The second instance device is an instance device corresponding to the computing device. For example, the second instance device can be a server.

[0459] When the to-be-migrated instance is located in the first instance device, since the to-be-migrated instance corresponds to at least one bound processing unit, and the first instance device corresponds to the source computing device, the source computing device stores at least one initial address mapping relationship and at least one initial context mapping relationship corresponding to the to-be-migrated instance, the at least one initial address mapping relationship and the at least one initial context mapping relationship are corresponding to each bound processing unit in the at least one bound processing unit corresponding to the to-be-migrated instance.

[0460] When the to-be-migrated instance is migrated from the first instance device to the second instance device, since the second instance device corresponds to the computing device, the computing device does not have the initial address mapping relationship and the initial context mapping relationship corresponding to the to-be-migrated instance, and thus the computing device needs to obtain the at least one initial address mapping relationship and the at least one initial context mapping relationship corresponding to the to-be-migrated instance.

[0461] The source computing device can send the at least one initial address mapping relationship and the at least one initial context mapping relationship corresponding to the to-be-migrated instance to the computing device. The computing device receives the at least one initial address mapping relationship and the at least one initial context mapping relationship.

[0462] Optionally, for any one fourth target processing unit, the target address mapping relationship and the target context mapping relationship can be determined according to the second target address and the second target context corresponding to the fourth target processing unit by: obtaining the initial address mapping relationship and the initial context mapping relationship of the bound processing unit corresponding to the fourth target processing unit; updating the initial address mapping relationship according to the second target address to obtain the target address mapping relationship; and updating the initial context mapping relationship according to the second target context to obtain the target context mapping relationship.

[0463] Since the at least one bound processing unit corresponding to the to-be-migrated instance is in the at least one processing unit corresponding to the source computing device before the to-be-migrated instance is migrated, and the at least one fourth target processing unit corresponding to the to-be-migrated instance needs to be changed to the at least one processing unit corresponding to the computing device after the to-be-migrated instance is migrated, the computing device needs to update the at least one initial address mapping relationship and the at least one initial context mapping relationship corresponding to the to-be-migrated instance, and change the at least one bound processing unit corresponding to the to-be-migrated instance to the at least one fourth target processing unit.

[0464] Any one initial address mapping relationship can include an initial target address and an initial virtual address; and any one initial context mapping relationship can include an initial target context and an initial virtual context.

[0465] Since the at least one initial address mapping relationship corresponding to the to-be-migrated instance includes initial address mapping relationships corresponding to each bound processing unit corresponding to the to-be-migrated instance, and similarly, the at least one initial context mapping relationship corresponding to the to-be-migrated instance includes initial context mapping relationships corresponding to each bound processing unit corresponding to the to-be-migrated instance, therefore, for any one fourth target processing unit, the computing device can obtain the initial address mapping relationship and the initial context mapping relationship of the bound processing unit corresponding to the fourth target processing unit, and update the initial address mapping relationship according to the second target address to obtain a target address mapping relationship, and update the initial context mapping relationship according to the second target context to obtain a target context mapping relationship.

[0466] Optionally, the computing device can determine an initial target address and an initial virtual address in the initial address mapping relationship, and update the initial target address to the second target address to obtain the target address mapping relationship. The target address mapping relationship includes the initial virtual address and the second target address.

[0467] Optionally, the computing device can determine an initial target context and an initial virtual context in the initial context mapping relationship, and update the initial target context to the second target context to obtain the target context mapping relationship. The target context mapping relationship includes the initial virtual context and the second target context.

[0468] For example, as in the above example, the bound processing units corresponding to the to-be-migrated instance include GPU4, GPU5 and VPU3, and it is assumed that the initial address mapping relationships and the initial context mapping relationships of the three bound processing units are as shown in Table 6:

[0469] Table 6

[0470] For example, for the fourth target processing unit 1 (i.e., GPU 7), the computing device can determine a target to-be-allocated capacity 1 of 12 GB in GPU 7 according to the used capacity 12 GB of GPU 4 corresponding, and determine a second target address 1 corresponding to the target to-be-allocated capacity 1, and then the computing device can determine the second target address 1 as the second target address corresponding to GPU 7; similarly, for the fourth target processing unit 2 (i.e., GPU 8), the computing device can determine a target to-be-allocated capacity 2 of 15 GB in GPU 8 according to the used capacity 15 GB of GPU 5 corresponding, and determine a second target address 2 corresponding to the target to-be-allocated capacity 2, and then the computing device can determine the second target address 2 as the second target address corresponding to GPU 8; for the fourth target processing unit 3 (i.e., VPU 6), the computing device can determine a target to-be-allocated capacity 3 of 18 GB in VPU 6 according to the used capacity 18 GB of VPU 3 corresponding, and determine a second target address 3 corresponding to the target to-be-allocated capacity 2, and then the computing device can determine the second target address 3 as the second target address corresponding to VPU 6.

[0471] Since the fourth target processing unit 1 (i.e., GPU 7) corresponds to the bound processing unit GPU 4, the fourth target processing unit 2 (i.e., GPU 8) corresponds to the bound processing unit GPU 5, and the fourth target processing unit 3 (i.e., VPU 6) corresponds to the bound processing unit VPU 3 among the three fourth target processing units corresponding to the to-be-migrated instance, the computing device can update the initial address mapping relationship of the corresponding bound processing unit according to the second target address of each fourth target processing unit, and update the initial context mapping relationship of the corresponding bound processing unit according to the second target context of each fourth target processing unit, to obtain the target address mapping relationship and the target context mapping relationship corresponding to each fourth target processing unit as shown in Table 7.

[0472] Table 7

[0473] After determining the target address mapping relationship and the target context mapping relationship corresponding to each fourth target processing unit, the computing device can store the target address mapping relationship and the target context mapping relationship corresponding to each fourth target processing unit through the proxy service.

[0474] The computing device can send the identifier of each fourth target processing unit to the to-be-migrated instance to bind at least one fourth target processing unit to the to-be-migrated instance.

[0475] For example, the computing device can send the identifier G007 of GUP 7, the identifier G008 of GPU 8, and the identifier V006 of VPU 6 to the to-be-migrated instance through the proxy service to bind GUP 7, GPU 8, and VPU 6 to the to-be-migrated instance.

[0476] In the embodiments of the present disclosure, the computing device can receive the used capacity information of the to-be-migrated instance sent by the source computing device, and determine at least one fourth target processing unit in the at least one processing unit according to the used capacity information of the to-be-migrated instance. For any one fourth target processing unit, the computing device can determine the second target address and the second target context corresponding to the fourth target processing unit according to the used capacity information of the to-be-migrated instance. After the to-be-migrated instance is migrated from the first instance device to the second instance device, the computing device can determine the target address mapping relationship and the target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit, and bind at least one fourth target processing unit to the to-be-migrated instance. In the related technology, when the instance is a virtual machine and the processing unit is a GPU, the virtual machine instance with the GPU cannot support live migration, but in the embodiments of the present disclosure, the GPU is connected to the computing device as a processing unit and can be called by the virtual machine instance, but there is no GPU in the virtual machine instance, so the technical solution provided by the present disclosure can support live migration of the virtual machine instance.

[0477] Next, based on the embodiments shown in FIG. 11, the method of migrating the instance across the computing devices is further described by specific examples in combination with FIG. 12.

[0478] FIG. 12 is a process schematic diagram of migrating an instance across computing devices according to an example embodiment of the present disclosure. Please refer to FIG. 12, which includes server 1, server 3, a source computing device, and a computing device.

[0479] The server 1 corresponds to the computing device. The at least one processing unit corresponding to the computing device includes GPU 6, GPU 7, GPU 8, VPU 6, VPU 7, and so on.

[0480] The server 3 corresponds to the source computing device. The processing units corresponding to the source computing device include GPU 4, GPU 5, VPU 3, VPU 4, VPU 5, TPU 3, and so on.

[0481] If the to-be-migrated instance is virtual machine 1, before migration, the first instance device where the virtual machine 1 is located is server 3; after migration, the second instance device where the virtual machine 1 is located is server 1.

[0482] When the virtual machine 1 is in the server 3, it is assumed that the three bound processing units corresponding to the virtual machine 1 are GPU 4, GPU 5, and VPU 3, and the used capacity information is as shown in Table 4. The source computing device stores the initial address mapping relationship 4 and the initial context mapping relationship 4 corresponding to GPU 4, the initial address mapping relationship 5 and the initial context mapping relationship 5 corresponding to GPU 5, and the initial address mapping relationship 3 and the initial context mapping relationship 3 corresponding to VPU 3, which are specifically shown in Table 6.

[0483] When the virtual machine 1 is migrated from the server 3 to the server 1, since there is no 3 initial address mapping relationships and 3 initial context mapping relationships corresponding to the virtual machine 1 in the computing device, the source computing device can send the 3 initial address mapping relationships and the 3 initial context mapping relationships to the computing device.

[0484] The computing device can determine, by the proxy service (not shown in the figure), 3 fourth target processing units in at least one processing unit corresponding to the computing device, assuming that the computing device can determine that the 3 fourth target processing units are respectively the GPU 7, the GPU 8 and the VPU 6, the computing device can determine the second target address and the second target context corresponding to the GPU 7, the GPU 8 and the VPU 6 respectively, and update the 3 initial address mapping relationships and the 3 initial context mapping relationships to obtain the target address mapping relationship 4 and the target context mapping relationship 4 corresponding to the GPU 7, the target address mapping relationship 5 and the target context mapping relationship 5 corresponding to the GPU 8, and the target address mapping relationship 3 and the target context mapping relationship 3 corresponding to the VPU 6, as shown in Table 7. The computing device can store each target address mapping relationship and each target context mapping relationship in a preset storage space.

[0485] The computing device can send, by the proxy service, the identifier G007 of the GUP7, the identifier G008 of the GPU 8, and the identifier V006 of the VPU 6 to the to-be-migrated instance, so as to bind the GUP7, the GPU 8 and the VPU 6 to the to-be-migrated instance.

[0486] In the embodiments of the present disclosure, the computing device can receive the used capacity information of the to-be-migrated instance sent by the source computing device, and determine at least one fourth target processing unit in at least one processing unit according to the used capacity information of the to-be-migrated instance. For any one fourth target processing unit, the computing device can determine the second target address and the second target context corresponding to the fourth target processing unit according to the used capacity information of the to-be-migrated instance. After the to-be-migrated instance is migrated from the first instance device to the second instance device, the computing device can determine each target address mapping relationship and each target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit, and bind at least one fourth target processing unit to the to-be-migrated instance. In the related art, when the instance is a virtual machine and the processing unit is a GPU, the virtual machine instance with the GPU cannot support hot migration, but in the embodiments of the present disclosure, since the GPU is connected to the computing device as a processing unit and can be called by the virtual machine instance, but there is no GPU in the virtual machine instance, therefore the technical solution provided by the present disclosure can support hot migration of the virtual machine instance.

[0487] Optionally, since the agent service is arranged in the computing device, and the computing device can store the processing unit configuration information corresponding to any instance, when it is necessary to configure the processing unit information corresponding to any instance, the cloud management platform can send a configuration instruction to the computing device, so that the computing device configures the processing unit corresponding to any instance according to the configuration instruction through the agent service.

[0488] Next, the instance configuration process is described in combination with FIG. 13.

[0489] FIG. 13 is a process schematic diagram of instance configuration provided by an example embodiment of the present disclosure. Please refer to FIG. 13, which includes a management device, a computing device, a plurality of instances, and at least one processing unit. For example, the plurality of instances can be instance 1, instance 2, …, and instance n; and the at least one processing unit can be processing unit 1, processing unit 2, processing unit 3, …, and processing unit m.

[0490] The computing device can store processing unit information 1 of instance 1, processing unit information 2 of instance 2, …, and processing unit information n of instance n. For example, the processing unit information 1 can be as shown in Table 1.

[0491] The management device can be arranged with a cloud management platform. A user can log in to the cloud management platform in the management device, and configure any instance through the cloud management platform.

[0492] When it is necessary to configure the processing unit corresponding to the target instance, the management device can generate a configuration instruction according to the configuration operation of the user on the processing unit corresponding to the target instance in the cloud management platform, and send the configuration instruction to the computing device. The computing device can receive the configuration instruction sent by the management device, and the configuration instruction can be used to instruct the computing device to configure the processing unit corresponding to the target instance.

[0493] The configuration processing of the target instance can include configuring the processing unit type and the processing unit quantity corresponding to the target instance.

[0494] The computing device can configure the processing unit corresponding to the target instance according to the configuration instruction through the agent service.

[0495] In the embodiment of the present disclosure, the computing device can receive the configuration instruction sent by the management device, and configure the processing unit corresponding to the target instance according to the configuration instruction. Since the cloud management platform can be arranged in the management device, different types of processing units and the capacity threshold (i.e., the processing capacity) corresponding to each type of processing unit can be configured for any instance through the cloud management platform, so that the processing capacity of the instance can be dynamically adjusted, and the instance can have flexible processing capacity.

[0496] FIG. 14 is a structural schematic diagram of an example scaling device provided by an exemplary embodiment of the present disclosure. Referring to FIG. 14, the example scaling device 1400 can include an obtaining module 1401, a determining module 1402, and a scaling module 1403, wherein

[0497] The obtaining module 1401 is configured to obtain a scaling request of a target instance.

[0498] The determining module 1402 is configured to determine, according to the scaling request, at least one target processing unit from the at least one processing unit, and a target capacity in each target processing unit, the target capacity being less than or equal to a rated capacity of the processing unit.

[0499] The scaling module 1403 is configured to perform scaling processing on the target instance according to the target capacity in each target processing unit on the at least one target processing unit.

[0500] The example scaling device provided by the embodiments of the present disclosure can perform the technical solutions shown in the method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0501] In a possible implementation, the scaling request includes at least one processing unit information and a scaling application capacity corresponding to each processing unit information, and the at least one processing unit information includes a target processing unit type and / or a target processing unit identifier; and the determining module 1402 is specifically configured to:

[0502] For any one processing unit information, determine a target processing unit from the at least one processing unit according to the processing unit information and the scaling application capacity corresponding to the processing unit information.

[0503] Determine a target capacity in the target processing unit according to the scaling application capacity corresponding to the processing unit information.

[0504] In a possible implementation, the determining module 1402 is specifically configured to:

[0505] If the processing unit information is the target processing unit identifier, determine a first target processing unit corresponding to the target processing unit identifier.

[0506] Determine the target processing unit from the at least one processing unit according to a remaining capacity of the first target processing unit and a scaling application capacity corresponding to the target processing unit identifier.

[0507] In a possible implementation, the determining module 1402 is specifically configured to:

[0508] If the remaining capacity of the first target processing unit is greater than or equal to the expansion application capacity corresponding to the target processing unit identifier, the first target processing unit is determined as the target processing unit.

[0509] If the remaining capacity of the first target processing unit is less than the expansion application capacity corresponding to the target processing unit identifier, a second target processing unit of the same type as the first target processing unit is determined in the at least one processing unit, and the second target processing unit is determined as the target processing unit, the remaining capacity of the second target processing unit being greater than the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0510] In a possible implementation, the determining module 1402 is specifically configured to:

[0511] If the target processing unit is the first target processing unit, a target capacity is determined in the first target processing unit according to the expansion or contraction application capacity corresponding to the target processing unit identifier.

[0512] If the target processing unit is the second target processing unit, a target capacity is determined in the second target processing unit according to the sum of the expansion application capacity corresponding to the target processing unit identifier and the allocated capacity of the target instance in the first target processing unit.

[0513] In a possible implementation, the determining module 1402 is specifically configured to:

[0514] If the processing unit information is the target processing unit identifier, a first target processing unit corresponding to the target processing unit identifier is determined.

[0515] The used capacity and the allocated capacity of the target instance in the first target processing unit are obtained.

[0516] The allocated capacity of the target instance in the first target processing unit after contraction is determined according to the allocated capacity and the contraction application capacity.

[0517] If the allocated capacity after contraction is greater than or equal to the used capacity of the target instance in the first target processing unit, the first target processing unit is determined as the target processing unit.

[0518] In a possible implementation, the at least one processing unit includes a bound processing unit corresponding to the target instance and an unbound processing unit; and the determining module 1402 is specifically configured to:

[0519] If the processing unit information is a target processing unit type, and the expansion application capacity corresponding to the processing unit information is an expansion application capacity, then according to the target processing unit type and the expansion application capacity, the target processing unit is determined in the unbound processing unit, and the type of the target processing unit is the target processing unit type.

[0520] In a possible implementation, the determining module 1402 is specifically configured to:

[0521] According to the target processing unit type, at least one candidate processing unit is determined in the unbound processing unit, and the type of the candidate processing unit is the target processing unit type;

[0522] The residual capacity of each candidate processing unit in the at least one candidate processing unit is determined.

[0523] If there is a target candidate processing unit in the at least one candidate processing unit, and the residual capacity of the target candidate processing unit is greater than or equal to the expansion application capacity, then the target candidate processing unit is determined as the target processing unit.

[0524] In a possible implementation, the expansion and contraction module 1403 is specifically configured to:

[0525] If the target processing unit is the first target processing unit, then according to the target capacity in the first target processing unit, the target instance is subjected to expansion and contraction processing on the first target processing unit.

[0526] If the target processing unit is the second target processing unit, then the instance data of the target instance in the first target processing unit is migrated to the second target processing unit, the second target processing unit and the target instance are subjected to binding processing, and the target instance is subjected to expansion processing according to the target capacity in the second target processing unit.

[0527] In a possible implementation, the expansion and contraction module 1403 is specifically configured to:

[0528] The target processing unit and the target instance are subjected to binding processing.

[0529] The target instance is subjected to expansion processing on the target processing unit according to the target capacity in the target processing unit.

[0530] The instance expansion and contraction apparatus provided by the embodiments of the present disclosure can perform the technical solutions shown in the method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0531] FIG. 15 is a structural schematic diagram of another example scaling device provided by an example embodiment of the present disclosure. Referring to FIG. 15, on the basis of the embodiment shown in FIG. 14, the example scaling device 1400 can further include a binding module 1404,

[0532] The obtaining module 1401 is further configured to, in response to an obtaining processing unit configuration information instruction sent by the target instance, obtain processing unit configuration information corresponding to the target instance.

[0533] The determining module 1402 is further configured to determine at least one third target processing unit in the at least one processing unit according to the processing unit configuration information.

[0534] The binding module 1404 is configured to bind the at least one third target processing unit to the target instance.

[0535] The example scaling device provided by the embodiments of the present disclosure can execute the technical solutions shown in the method embodiments, and the implementation principles and beneficial effects are similar, which will not be described here in detail.

[0536] In a possible implementation, the processing unit configuration information includes at least one processing unit type and at least one capacity threshold corresponding to each processing unit type, and the determining module 1402 is specifically configured to:

[0537] For any one processing unit type, at least one third target processing unit is determined in the at least one processing unit according to at least one capacity threshold corresponding to the processing unit type, and the remaining capacity of the third target processing unit is greater than or equal to the capacity threshold.

[0538] In a possible implementation, the binding module 1404 is specifically configured to:

[0539] For any one third target processing unit, processing unit information of the third target processing unit is obtained.

[0540] The processing unit information is sent to the target instance to bind the third target processing unit to the target instance.

[0541] In a possible implementation, the example scaling device 1400 can further include a receiving module 1405, a creating module 1406, a generating module 1407, and a sending module 1408, wherein,

[0542] The receiving module 1405 is configured to receive a creating context instruction sent by the target instance, and the creating context instruction includes an identifier of a target bound processing unit, which is used to indicate the target bound processing unit.

[0543] The creating module 1406 is configured to create a target context of the target bound processing unit;

[0544] The generating module 1407 is configured to generate a virtual context of the target bound processing unit according to the target context of the target bound processing unit;

[0545] The sending module 1408 is configured to send the virtual context of the target bound processing unit to the target instance.

[0546] In a possible implementation, the instance scaling device 1400 further includes an allocating module 1409,

[0547] The receiving module 1405 is further configured to receive a capacity application request sent by the target instance, the capacity application request including an application capacity, an identifier and a virtual context of the target bound processing unit, the capacity application request being used to apply the application capacity for the target instance in the target bound processing unit, and the identifier of the target bound processing unit being used to indicate the target bound processing unit;

[0548] The obtaining module 1401 is further configured to obtain used capacity information corresponding to the target instance;

[0549] The determining module 1402 is further configured to determine a target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit, and the application capacity.

[0550] The allocating module 1409 is configured to allocate the target used capacity to the target instance.

[0551] In a possible implementation, the used capacity information includes at least one bound processing unit, and used capacity and a capacity threshold corresponding to each bound processing unit; and the determining module 1402 is specifically configured to:

[0552] In the used capacity information, determine a target used capacity and a target capacity threshold corresponding to the target bound processing unit;

[0553] If the sum of the target used capacity and the application capacity is less than or equal to the target capacity threshold, determine the target used capacity in the target bound processing unit according to the virtual context of the target bound processing unit and the application capacity.

[0554] In a possible implementation, the allocating module 1409 is specifically configured to:

[0555] obtain a target address corresponding to the target usage capacity;

[0556] determine a virtual address corresponding to the target usage capacity according to the target address corresponding to the target usage capacity;

[0557] allocate the target usage capacity to the target instance according to the virtual address corresponding to the target capacity.

[0558] In a possible implementation, the instance scaling device 1400 can further include a calling module 1410,

[0559] The receiving module 1405 is further configured to receive a task processing request sent by the target instance, the task processing request including a target task, and a virtual address and a virtual context corresponding to each of the at least one bound processing unit;

[0560] The calling module 1410 is configured to perform computing processing on the target task by the at least one bound processing unit according to the virtual address and the virtual context corresponding to each of the at least one bound processing unit.

[0561] In a possible implementation, for any one bound processing unit, the calling module 1410 is specifically configured to:

[0562] obtain an address mapping relationship and a context mapping relationship corresponding to the bound processing unit in a preset storage space;

[0563] determine a first target address corresponding to the first virtual address in the address mapping relationship according to the first virtual address;

[0564] determine a first target context corresponding to the first virtual context in the context mapping relationship according to the first virtual context;

[0565] perform computing processing on the target task by the bound processing unit according to the first target address and the first target context.

[0566] In a possible implementation, before obtaining the address mapping relationship and the context mapping relationship corresponding to the bound processing unit in the preset storage space, the instance scaling device 1400 can further include a storage module 1411,

[0567] The generation module 1407 is further configured to generate the address mapping relationship according to the first target address corresponding to the bound processing unit and the first virtual address corresponding to the bound processing unit, the address mapping relationship including the first target address and the first virtual address.

[0568] The generating module 1407 is further configured to generate the context mapping relationship according to the first target context corresponding to the bound processing unit and the first virtual context corresponding to the bound processing unit, the context mapping relationship including the first target context and the first virtual context.

[0569] The storage module 1411 is configured to store the address mapping relationship and the context mapping relationship in a preset storage space.

[0570] In a possible implementation, the determining module 1402 is specifically configured to:

[0571] The receiving module 1405 is further configured to receive used capacity information of a to-be-migrated instance sent by a source computing device, the to-be-migrated instance being a virtual machine, and a first instance device on which the to-be-migrated instance is located corresponding to the source computing device.

[0572] The determining module 1402 is further configured to determine at least one fourth target processing unit in the at least one processing unit according to the used capacity information of the to-be-migrated instance, a residual capacity of the fourth target processing unit being greater than a capacity threshold corresponding to a bound processing unit in the used capacity information.

[0573] The determining module 1402 is further configured to, for any one fourth target processing unit, determine a second target address and a second target context corresponding to the fourth target processing unit according to the used capacity information of the to-be-migrated instance.

[0574] The determining module 1402 is further configured to, after the to-be-migrated instance is migrated from the first instance device to a second instance device, determine each target address mapping relationship and each target context mapping relationship according to the second target address and the second target context corresponding to each fourth target processing unit.

[0575] The binding module 1404 is further configured to bind the at least one fourth target processing unit to the to-be-migrated instance, the second instance device corresponding to the computing device.

[0576] In a possible implementation, for any one fourth target processing unit, the determining module 1402 is specifically configured to:

[0577] obtain an initial address mapping relationship and an initial context mapping relationship of a bound processing unit corresponding to the fourth target processing unit;

[0578] update the initial address mapping relationship according to the second target address to obtain a target address mapping relationship;

[0579] According to the second target context, the initial context mapping relationship is updated to obtain a target context mapping relationship;

[0580] According to the target address mapping relationship and the target context mapping relationship, the fourth target processing unit is bound to the instance to be migrated.

[0581] In a possible implementation, the determining module 1402 is specifically configured to:

[0582] An initial target address and an initial virtual address are determined in the initial address mapping relationship;

[0583] The initial target address is updated to the second target address to obtain the target address mapping relationship, and the target address mapping relationship includes the initial virtual address and the second target address.

[0584] In a possible implementation, the determining module 1402 is specifically configured to:

[0585] An initial target context and an initial virtual context are determined in the initial context mapping relationship;

[0586] The initial target context is updated to the second target context to obtain the target context mapping relationship, and the target context mapping relationship includes the initial virtual context and the second target context.

[0587] In a possible implementation, the instance scaling device 1400 can further include a configuration module 1412,

[0588] The receiving module 1405 is further configured to receive a configuration instruction sent by a management device, and the configuration instruction is used to instruct the computing device to configure a processing unit corresponding to the target instance;

[0589] The configuration module 1412 is configured to configure the processing unit corresponding to the target instance according to the configuration instruction, and generate processing unit configuration information corresponding to the target instance.

[0590] The instance scaling device provided by the embodiments of the present disclosure can execute the technical solutions shown in the method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0591] FIG. 16 is a structural schematic diagram of a computing device provided by an exemplary embodiment of the present disclosure. Please refer to FIG. 16, the computing device 1600 can include a processor 1601 and a memory 1602. Exemplarily, the processor 1601, the memory 1602, and each part are connected with each other through a bus 1603.

[0592] The memory 1602 stores computer-executable instructions;

[0593] The processor 1601 executes the computer-executable instructions stored in the memory 1602, so that the processor 1601 performs the method shown in the above method embodiments.

[0594] FIG. 17 is a schematic diagram of an example scaling system provided by an example embodiment of the present disclosure. Referring to FIG. 17, the example scaling system can include at least one instance, a computing device, and at least one processing unit. For example, the at least one instance can be instance 1, instance 2, …, and instance n; and the at least one processing unit can be processing unit 1, processing unit 2, processing unit 3, …, and processing unit m.

[0595] The at least one instance is communicatively connected with the computing device. For example, instance 1, instance 2, …, and instance n can communicate with the computing device.

[0596] Optionally, any one instance can include a proxy client service; and the computing device can include a proxy service.

[0597] The computing device is physically connected with the at least one processing unit. For example, processing unit 1, processing unit 2, processing unit 3, …, and processing unit m can be physically connected with the computing device.

[0598] The computing device is configured to perform the method shown in the above method embodiments.

[0599] The example scaling system provided by the embodiments of the present disclosure can implement the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0600] Correspondingly, the embodiments of the present disclosure provide a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the computer-executable instructions are used to implement the method shown in the above method embodiments.

[0601] Correspondingly, the embodiments of the present disclosure can also provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program can implement the method shown in the above method embodiments.

[0602] Those skilled in the art will appreciate that embodiments of the disclosure can be supplied as a method, a system, or a computer program product. Accordingly, the disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the disclosure can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.

[0603] The disclosure is described in reference to the flowchart and / or block diagrams of the method, apparatus (system) and computer program product according to embodiments of the disclosure. It should be understood that each flow and / or block in the flowchart and / or block diagrams, and a combination of flows and / or blocks in the flowchart and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions, which are executed via the processor of the computer or other programmable data processing apparatus, generate means for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0604] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including instruction means, which implement the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0605] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operational steps are performed on the computer or other programmable data processing apparatus to generate a computer implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide steps for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0606] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0607] The memory can include non-persistent memory in the computer readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory. The memory is an example of computer readable media.

[0608] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0609] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0610] The above description is only an embodiment of the present disclosure and is not intended to limit the present disclosure. The present disclosure can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present disclosure shall be included in the scope of claims of the present disclosure.

Claims

1. An example method of scaling, wherein, Applied to a computing device physically connected with at least one processing unit, the method comprises: obtaining a scaling request of a target instance; determining at least one target processing unit and a target capacity in each target processing unit from the at least one processing unit according to the scaling request, the target capacity being less than or equal to a rated capacity of the processing unit; scaling the target instance on the at least one target processing unit according to the target capacity in each target processing unit.

2. The method of claim 1, wherein, The scaling request comprises at least one processing unit information and a scaling application capacity corresponding to each processing unit information, the at least one processing unit information comprising a target processing unit type and / or a target processing unit identifier; determining at least one target processing unit and a target capacity in each target processing unit from the at least one processing unit according to the scaling request comprises: for any one processing unit information, determining a target processing unit from the at least one processing unit according to the processing unit information and the scaling application capacity corresponding to the processing unit information; determining a target capacity in the target processing unit according to the scaling application capacity corresponding to the processing unit information.

3. The method of claim 2, wherein, Determining a target processing unit from the at least one processing unit according to the processing unit information and the scaling application capacity corresponding to the processing unit information comprises: if the processing unit information is the target processing unit identifier, determining a first target processing unit corresponding to the target processing unit identifier; determining the target processing unit from the at least one processing unit according to a remaining capacity of the first target processing unit and the scaling application capacity corresponding to the target processing unit identifier.

4. The method of claim 3, wherein, Determining the target processing unit from the at least one processing unit according to a remaining capacity of the first target processing unit and the scaling application capacity corresponding to the target processing unit identifier comprises: if the remaining capacity of the first target processing unit is greater than or equal to the scaling application capacity corresponding to the target processing unit identifier, determining the first target processing unit as the target processing unit; if the remaining capacity of the first target processing unit is less than the scaling application capacity corresponding to the target processing unit identifier, determining a second target processing unit of the same type as the first target processing unit from the at least one processing unit, and determining the second target processing unit as the target processing unit, a remaining capacity of the second target processing unit being greater than a sum of the scaling application capacity corresponding to the target processing unit identifier and an already allocated capacity of the target instance in the first target processing unit.

5. The method of claim 4, wherein, Determining a target capacity in the target processing unit according to the scaling application capacity corresponding to the processing unit information comprises: if the target processing unit is the first target processing unit, determining a target capacity in the first target processing unit according to the scaling application capacity corresponding to the target processing unit identifier; If the target processing unit is the second target processing unit, a target capacity in the second target processing unit is determined according to a sum of the corresponding capacity application capacity of the target processing unit and the allocated capacity of the target instance in the first target processing unit.

6. The method of claim 2, wherein, According to the processing unit information and the capacity application capacity corresponding to the processing unit information, a target processing unit is determined in the at least one processing unit, including: If the processing unit information is the target processing unit identifier, a first target processing unit corresponding to the target processing unit identifier is determined. An used capacity and an allocated capacity of the target instance in the first target processing unit are obtained. According to the allocated capacity and the capacity application capacity, an allocated capacity of the target instance in the first target processing unit after capacity reduction is determined. If the allocated capacity after capacity reduction is greater than or equal to the used capacity of the target instance in the first target processing unit, the first target processing unit is determined as the target processing unit.

7. The method of claim 2, wherein, The at least one processing unit includes a bound processing unit and an unbound processing unit corresponding to the target instance; according to the processing unit information and the capacity application capacity corresponding to the processing unit information, a target processing unit is determined in the at least one processing unit, including: If the processing unit information is a target processing unit type and the capacity application capacity corresponding to the processing unit information is a capacity application capacity, the target processing unit is determined in the unbound processing unit according to the target processing unit type and the capacity application capacity, and the type of the target processing unit is the target processing unit type.

8. The method of claim 7, wherein, According to the target processing unit type and the capacity application capacity, the target processing unit is determined in the unbound processing unit, including: According to the target processing unit type, at least one candidate processing unit in the unbound processing unit is determined, and the type of the candidate processing unit is the target processing unit type. Residual capacities of each candidate processing unit in the at least one candidate processing unit are determined. If there is a target candidate processing unit with a residual capacity greater than or equal to the capacity application capacity in the at least one candidate processing unit, the target candidate processing unit is determined as the target processing unit.

9. The method according to any one of claims 4-8, wherein, According to the target capacity in each target processing unit, capacity application processing is performed on the target instance in the at least one target processing unit, including: If the target processing unit is the first target processing unit, capacity application processing is performed on the target instance in the first target processing unit according to the target capacity in the first target processing unit. If the target processing unit is the second target processing unit, instance data of the target instance in the first target processing unit is migrated to the second target processing unit, the second target processing unit and the target instance are bound, and capacity application processing is performed on the target instance according to the target capacity in the second target processing unit.

10. The method of any one of claims 1-9, wherein, According to a target capacity in each target processing unit, performing a capacity expansion processing on the target instance on the at least one target processing unit, comprising: performing a binding processing on the target processing unit and the target instance; According to a target capacity in each target processing unit, performing a capacity expansion processing on the target instance on the at least one target processing unit, comprising:

11. The method of any one of claims 1-10, wherein, The method further comprises: in response to the target instance sending an obtaining processing unit configuration information instruction, obtaining the processing unit configuration information corresponding to the target instance; According to the processing unit configuration information, determining at least one third target processing unit in the at least one processing unit; binding the at least one third target processing unit to the target instance.

12. The method of claim 11, wherein, The processing unit configuration information comprises at least one processing unit type and at least one capacity threshold value corresponding to each processing unit type; according to the processing unit configuration information, determining at least one third target processing unit in the at least one processing unit, comprising: for any one processing unit type, according to the at least one capacity threshold value corresponding to the processing unit type, determining at least one third target processing unit in the at least one processing unit, and the remaining capacity of the third target processing unit is greater than or equal to the capacity threshold value.

13. The method of claim 11 or 12, wherein, Binding the at least one third target processing unit to the target instance, comprising: for any one third target processing unit, obtaining the processing unit information of the third target processing unit; sending the processing unit information to the target instance to bind the third target processing unit to the target instance.

14. The method of any one of claims 1-13, wherein, The method further comprises: receiving a create context instruction sent by the target instance, wherein the create context instruction comprises an identifier of a target bound processing unit, and the identifier of the target bound processing unit is used to indicate the target bound processing unit; creating a target context of the target bound processing unit; generating a virtual context of the target bound processing unit according to the target context of the target bound processing unit; sending the virtual context of the target bound processing unit to the target instance.

15. The method of any one of claims 1-14, wherein, The method further comprises: receiving a capacity application request sent by the target instance, wherein the capacity application request comprises an application capacity, an identifier of a target bound processing unit and a virtual context, and the capacity application request is used to request the application capacity for the target instance in the target bound processing unit, and the identifier of the target bound processing unit is used to indicate the target bound processing unit; obtaining used capacity information corresponding to the target instance; determining a target used capacity in the target bound processing unit according to the used capacity information, the virtual context of the target bound processing unit and the application capacity; allocating the target used capacity to the target instance.

16. The method of claim 15, wherein, The used capacity information comprises at least one bound processing unit, and used capacity and capacity threshold value corresponding to each bound processing unit; According to the used capacity information, the virtual context of the target bound processing unit, and the application capacity, determining a target used capacity in the target bound processing unit, comprising: In the used capacity information, determining a target used capacity corresponding to the target bound processing unit and a target capacity threshold; If the sum of the target used capacity and the application capacity is less than or equal to the target capacity threshold, determining the target used capacity in the target bound processing unit according to the virtual context of the target bound processing unit and the application capacity.

17. The method of claim 15 or 16, wherein, Allocating the target used capacity to the target instance, comprising: Obtaining a target address corresponding to the target used capacity; According to the target address corresponding to the target used capacity, determining a virtual address corresponding to the target used capacity; According to the virtual address corresponding to the target capacity, allocating the target used capacity to the target instance.

18. The method of any one of claims 1-17, wherein, The method further comprises: Receiving a task processing request sent by the target instance, the task processing request comprising a target task, and a virtual address and a virtual context corresponding to each bound processing unit in at least one bound processing unit; According to the virtual address and the virtual context corresponding to each bound processing unit in the at least one bound processing unit, invoking the at least one bound processing unit to perform calculation processing on the target task.

19. The method of claim 18, wherein, For any one bound processing unit; according to a first virtual address and a first virtual context corresponding to the bound processing unit, invoking the bound processing unit to perform calculation processing on the target task, comprising: Obtaining an address mapping relationship and a context mapping relationship corresponding to the bound processing unit in a preset storage space; According to the first virtual address, determining a first target address corresponding to the first virtual address in the address mapping relationship; According to the first virtual context, determining a first target context corresponding to the first virtual context in the context mapping relationship; According to the first target address and the first target context, invoking the bound processing unit to perform calculation processing on the target task.

20. The method of claim 19, wherein, Before obtaining the address mapping relationship and the context mapping relationship corresponding to the bound processing unit in the preset storage space, the method further comprises: According to a first target address corresponding to the bound processing unit, and a first virtual address corresponding to the bound processing unit, generating the address mapping relationship, the address mapping relationship comprising the first target address and the first virtual address; According to a first target context corresponding to the bound processing unit, and a first virtual context corresponding to the bound processing unit, generating the context mapping relationship, the context mapping relationship comprising the first target context and the first virtual context; Storing the address mapping relationship and the context mapping relationship in a preset storage space.

21. The method of any one of claims 1-20, wherein, The method further comprises: Receiving used capacity information of a to-be-migrated instance sent by a source computing device, the to-be-migrated instance being a virtual machine, and a first instance device where the to-be-migrated instance is located corresponding to the source computing device; determining, in the at least one processing unit, at least one fourth target processing unit according to the used capacity information of the instance to be migrated, a residual capacity of the fourth target processing unit being greater than a corresponding capacity threshold of a corresponding bound processing unit in the used capacity information; for any one fourth target processing unit, determining a second target address and a second target context of the fourth target processing unit according to the used capacity information of the instance to be migrated; after the instance to be migrated is migrated from the first instance device to a second instance device, determining a target address mapping relationship and a target context mapping relationship according to the second target address and the second target context of each fourth target processing unit, and binding the at least one fourth target processing unit to the instance to be migrated, the second instance device corresponding to the computing device.

22. The method of claim 21, wherein, For any one fourth target processing unit, determining a target address mapping relationship and a target context mapping relationship according to the second target address and the second target context of the fourth target processing unit, comprising: obtaining an initial address mapping relationship and an initial context mapping relationship of a bound processing unit corresponding to the fourth target processing unit; updating the initial address mapping relationship according to the second target address to obtain a target address mapping relationship; updating the initial context mapping relationship according to the second target context to obtain a target context mapping relationship.

23. The method of claim 22, wherein, According to the second target address, the initial address mapping relationship is updated to obtain a target address mapping relationship, comprising: determining an initial target address and an initial virtual address in the initial address mapping relationship; updating the initial target address to the second target address to obtain the target address mapping relationship, the target address mapping relationship including the initial virtual address and the second target address.

24. The method of claim 22 or 23, wherein, According to the second target context, the initial context mapping relationship is updated to obtain a target context mapping relationship, comprising: determining an initial target context and an initial virtual context in the initial context mapping relationship; updating the initial target context to the second target context to obtain the target context mapping relationship, the target context mapping relationship including the initial virtual context and the second target context.

25. The method of any one of claims 1-24, wherein, The method further comprises: receiving a configuration instruction sent by a management device, the configuration instruction being used to instruct the computing device to configure the processing unit corresponding to the target instance; configuring the processing unit corresponding to the target instance according to the configuration instruction, and generating processing unit configuration information corresponding to the target instance.

26. An example scale device, wherein, Applied to a computing device, the computing device is physically connected with at least one processing unit, and the device comprises an obtaining module, a determining module and a capacity expansion and reduction module, wherein, the obtaining module is used to obtain a capacity expansion and reduction request of a target instance; The determining module is configured to determine at least one target processing unit and a target capacity in each target processing unit according to the capacity expansion request, the target capacity being less than or equal to a rated capacity of the processing unit; The capacity expansion module is configured to perform capacity expansion processing on the target instance on the at least one target processing unit according to the target capacity in each target processing unit.

27. A computing device, wherein, Comprise: At least one processor; And A memory connected with the at least one processor in communication; Wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the computing device to perform the method of any one of claims 1-25.

28. An example scale system, wherein, Comprise: At least one instance, a computing device and at least one processing unit, wherein, The at least one instance is connected with the computing device in communication, and the computing device is physically connected with the at least one processing unit; The computing device is configured to perform the method of any one of claims 1-25.

29. A computer readable storage medium, wherein, The computer readable storage medium stores computer execution instructions, and when the processor executes the computer execution instructions, the method of any one of claims 1-25 is realized.

30. A computer program product comprising a computer program, wherein, The computer program is executed by the processor to realize the method of any one of claims 1-25. The computer program is executed by the processor to realize the method of any one of claims 1-25.

Citation Information

Patent Citations

  • A video memory allocation method and device

    CN109766179A

  • GPU application publishing method and device, storage medium and computer equipment

    CN115373803A

  • Capacity expansion method of computing device and computing device

    CN116661677A

  • Service capacity expansion and contraction method and device, electronic equipment and storage medium

    CN117311900A

  • Storage system with LU-setting function

    US20100082901A1