IP Library Granted Patent US 11,243,792
Granted Patent B2
US 11,243,792 · App. 15/921,929 · Granted Feb 8, 2022

Image file conversion method and apparatus

Inventors: Guang Zhang (Xi'an, CN); Sibiao Luo (Beijing, CN); Wanqing Hu (Xi'an, CN); Lin Gao (Xi'an, CN); Jing Lin (Xi'an, CN)
Assignee: Huawei Technologies Co., Ltd.
G06F9/45558G06F3/0647G06F8/447G06F8/52G06F8/63G06F16/1794G06F2009/4557G06F2009/45562G06F2009/45579
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,243,792
App. No.
15/921,929
Granted
Feb 8, 2022
Kind
B2
Abstract

An image file conversion method includes: obtaining an original image file of a virtual machine on an original platform; detecting whether the original image file has a first file characteristic and a second file characteristic that are corresponding to a target platform, wherein the first file characteristic comprises a target driver used when the virtual machine runs on the target platform, and the second file characteristic comprises a target file format supported by the target platform; and changing, in response to detecting that the original image file does not have at least one of the first file characteristic or the second file characteristic, the original image file by calling a predetermined interface, to obtain a target image file of the virtual machine on the target platform, wherein the target image file has the first file characteristic and the second file characteristic.

Claims (48)

1. An image file conversion method, wherein the method comprises:

obtaining an original image file of a virtual machine on an original platform;

detecting, automatically without user input, that the original image file does not have at least a first file characteristic of first and second file characteristics that are corresponding to a target platform, wherein the first file characteristic comprises a target driver used when the virtual machine runs on the target platform, and the second file characteristic comprises a target file format supported by the target platform; and

directly changing the original image file, in response to the detecting that the original image file does not have at least the first file characteristic, by calling a predetermined interface without starting the original image file as a virtual machine before the change, to obtain a target image file of the virtual machine on the target platform, wherein the target image file has the first file characteristic and the second file characteristic,

wherein directly changing the original image file by calling the predetermined interface comprises:

in response to detecting that the original image file does not have the first file characteristic, replacing an original driver in the original image file with the target driver by calling a first predetermined interface,

wherein replacing the original drive includes:

deleting the original driver in a driver directory by calling the first predetermined interface; and

writing the target driver into the driver directory.

2. The method according to claim 1 , wherein the replacing the original driver in the original image file with the target driver comprises:

determining a driver directory in the original image file according to an operating system type of an operating system in the original image file, wherein the driver directory is a default directory in which a driver of an operating system of the operating system type is located; and

replacing the original driver in the driver directory with the target driver by calling the first predetermined interface.

3. The method according to claim 1 , including detecting that the original image file does not have the first file characteristic corresponding to the target platform, wherein the detecting that the original image file does not have the first file characteristic corresponding to the target platform comprises:

accessing the original image file by calling a first predetermined interface, to determine an operating system type of an operating system in the original image file;

determining the target driver corresponding to both the operating system type and the target platform;

detecting whether an original driver in the original image file is different from the target driver; and

in response to detecting that the original driver is different from the target driver, determining that the original image file does not have the first file characteristic.

4. The method according to claim 1 , wherein the changing the original image file by calling the predetermined interface further comprises:

in response to detecting that the original image file does not have the second file characteristic, changing an original file format of the original image file to the target file format by calling a second predetermined interface.

5. The method according to claim 4 , wherein the detecting that the original image file does not have the second file characteristic corresponding to the target platform comprises:

determining the target file format supported by the target platform;

detecting whether the original file format is different from the target file format; and

in response to detecting that the original file format is different from the target file format, determining that the original image file does not have the second file characteristic.

6. The method according to claim 1 , wherein the obtaining the original image file of the virtual machine on the original platform comprises:

obtaining the original image file from an image repository, wherein the image repository is configured to store an image file uploaded by a user.

7. A conversion server, wherein the conversion server comprises a processor and a memory connected to the processor, wherein the memory is configured to store one or more instructions, and the instructions are configured to be executed by the processor;

the processor is configured to obtain an original image file of a virtual machine on an original platform;

the processor is further configured to detect, automatically without user input, whether the original image file has a first file characteristic and a second file characteristic that are corresponding to a target platform, wherein the first file characteristic comprises a target driver used when the virtual machine runs on the target platform, and the second file characteristic comprises a target file format supported by the target platform; and

the processor is further configured to: in response to detecting that the original image file does not have at least the first file characteristic, directly change the original image file by calling a predetermined interface without starting the original image file as a virtual machine before the change, to obtain a target image file of the virtual machine on the target platform, wherein the target image file has the first file characteristic and the second file characteristic, wherein the processor is further configured to:

in response to detecting that the original image file does not have the first file characteristic, replace an original driver in the original image file with the target driver by calling a first predetermined interface, wherein replacing the original drive includes:

deleting the original driver in a driver directory by calling the first predetermined interface; and

writing the target driver into the driver directory.

8. The conversion server according to claim 7 , wherein the processor is further configured to:

determine a driver directory in the original image file according to an operating system type of an operating system in the original image file, wherein the driver directory is a default directory in which a driver of an operating system of the operating system type is located; and

replace the original driver in the driver directory with the target driver by calling the first predetermined interface.

9. The conversion server according to claim 7 , wherein the processor is further configured to:

access the original image file by calling a first predetermined interface, to determine an operating system type of an operating system in the original image file;

determine the target driver corresponding to both the operating system type and the target platform;

detect whether an original driver in the original image file is different from the target driver; and

in response to detecting that the original driver is different from the target driver, determine that the original image file does not have the first file characteristic.

10. The conversion server according to claim 7 , wherein the processor is further configured to:

in response to detecting that the original image file does not have the second file characteristic, change an original file format of the original image file to the target file format by calling a second predetermined interface.

11. The conversion server according to claim 10 , wherein the processor is further configured to:

determine the target file format supported by the target platform;

detect whether the original file format is different from the target file format; and

in response to detecting that the original file format is different from the target file format, determine that the original image file does not have the second file characteristic.

12. The conversion server according to claim 7 , wherein

the processor is further configured to obtain the original image file from an image repository, wherein the image repository is configured to store an image file uploaded by a user.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 1, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
Reel/Frame 059267/0088 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 25, 2018
From: ZHANG, GUANG; LUO, SIBIAO; HU, WANQING; GAO, LIN; LIN, JING
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 045344/0814 →
Continuity (2)
Continuation PCTCN2016106262 · Nov 17, 2016
Related Publication 20180203719A1 · Jul 19, 2018