Virtual machine construction method and device based on virtual cloud platform
By building virtual machines on virtual cloud platforms and using virtual technology and remote control, the process of building a data transmission security platform is simplified, the cumbersome problems of equipment and software installation in the existing technology are solved, and virtual machine creation is achieved quickly and conveniently. and use.
Patent Information
- Application Number
- CN202410841390.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-27
AI Technical Summary
When building a platform for testing and analyzing data transmission security, the existing technology requires two devices and a cumbersome software installation process, which consumes a lot of manpower and material resources and is inconvenient to operate.
Adopt a virtual machine construction method based on the virtual cloud platform, use virtual technology and remote control, use a pre-built virtual machine creation platform, select the creation type, perform virtual machine cloning, initialization and daemon startup, and use programs and system commands to achieve remote control , simplify operations and reduce investment in manpower and material resources.
It enables the rapid establishment of an experimental environment on one device, reduces operational difficulty and time investment, improves user experience, simplifies the process of creating and using virtual machines, and is suitable for learning and practical operations.
Smart Images

Figure CN118409829B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital virtual technology, and in particular to a method and device for building a virtual machine based on a virtual cloud platform. Background Art
[0002] In the digital age, with the rapid development of computer science and network technology, we have fully entered a convenient and global information age. In work and life, a large amount of information is stored on various media through computers every day. It is very important to ensure information security. Passwords have become an indispensable part of daily life and work. From using CMOS passwords at startup to entering user passwords when logging into Windows, to setting document passwords when editing Word documents, these passwords provide users with necessary security protection.
[0003] With the widespread use of passwords, people have begun to realize the importance of password encryption and decryption. In order to better protect information security, a group of experts who focus on the study of encryption and decryption algorithms have emerged. Learning passwords and the process of data transmission is very important now. Most people who are trained in the password security industry learn from written theories, especially for data transmission security. Most of the learning remains on paper. If you want to build a platform that can be used to test data transmission security or analyze what algorithms are used in data transmission, it is extremely cumbersome and troublesome. First, two devices are required to build the transmission carrier, followed by software installation, etc. This is a waste of manpower and material resources. If virtual technology is used to realize the construction of data transmission, it is also necessary to import the image and install the software every time, which is very time-consuming and difficult to operate.
[0004] In view of this, the present invention provides a method and device for building a virtual machine based on a virtual cloud platform based on virtual technology to solve the above technical problems. Summary of the invention
[0005] The present invention provides a method and device for building a virtual machine based on a virtual cloud platform based on virtual technology. The experimental environment is built by combining virtual technology and remote control, which is used to solve the construction problems of complex environments such as data transmission. It can be built with one key on one device, reducing the waste of manpower and material resources, and achieving the convenience of building at any time.
[0006] The present invention provides a method for building a virtual machine based on a virtual cloud platform, the method comprising:
[0007] On the pre-built virtual machine creation platform, select the creation type;
[0008] Perform virtual machine cloning on the target virtual machine according to the creation type;
[0009] Creating files based on the cloned virtual machine, and cloning the created files to obtain cloned files;
[0010] Initializing the cloned virtual machine according to the clone file to obtain an initial virtual machine;
[0011] Start the daemon process based on the initial virtual machine and obtain the virtual machine information;
[0012] The initial virtual machine is optimized according to the virtual machine information and the clone file.
[0013] In some embodiments, obtaining virtual machine information further includes:
[0014] The virtual machine information and the clone file are entered into the virtual machine creation cloud platform.
[0015] In some embodiments, virtual machine cloning specifically includes:
[0016] Select the creation type;
[0017] Create a working directory after making sure that the name of the created type does not conflict with the pre-existing name;
[0018] Clone the virtual machine based on the working directory;
[0019] Start the virtual machine and obtain the MAC address;
[0020] Complete some information entry based on the MAC address and the cloned virtual machine.
[0021] In some embodiments, the virtual machine initialization specifically includes:
[0022] Start the virtual machine, run the script in the system and start the daemon process;
[0023] After running the script in the system, operate the virtual machine and enter the return state;
[0024] After starting the daemon process, it obtains system operation information and enters the return state. At the same time, the daemon process stands by and waits for subsequent instructions.
[0025] In some embodiments, the creation type is selected, specifically including:
[0026] In response to the operation instruction, a target virtual machine type is created among multiple types of virtual machines on the virtual machine creation platform.
[0027] In some embodiments, when data is modified on a virtual machine, a daemon process is started, specifically including:
[0028] Establish communication with the daemon process through the http link and send modification instructions;
[0029] After receiving the modification instruction, the daemon process identifies the intention of the instruction and converts the intention into actual operation to control the system instruction to modify the target data of the virtual machine.
[0030] The present invention also provides a virtual machine building device based on a virtual cloud platform, the device comprising:
[0031] A type creation module is used to select a creation type on a pre-built virtual machine creation platform;
[0032] A virtual machine cloning module, used for cloning the target virtual machine according to the creation type;
[0033] A file cloning module, used to create files based on the cloned virtual machine, and clone the created files to obtain cloned files;
[0034] A virtual machine initialization module, used to initialize the cloned virtual machine according to the clone file to obtain an initial virtual machine;
[0035] A daemon process startup module is used to start the daemon process based on the initial virtual machine and obtain virtual machine information;
[0036] The data optimization module is used to optimize the initial virtual machine according to the virtual machine information and the clone file.
[0037] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the program.
[0038] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method described above when executed by a processor.
[0039] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method described above is implemented.
[0040] The virtual machine building method and device based on the virtual cloud platform provided by the present invention select a creation type on a pre-built virtual machine creation platform; clone a target virtual machine according to the creation type; create files based on the cloned virtual machine, and clone the created files to obtain clone files; initialize the cloned virtual machine according to the clone files to obtain an initial virtual machine; start a daemon process based on the initial virtual machine and obtain virtual machine information; and optimize the initial virtual machine according to the virtual machine information and the clone files.
[0041] The method and device provided by the present invention utilize virtual machine technology to achieve the purpose of remotely controlling virtual machines by using programs together with system commands and system scripts. At the same time, users can create virtual machines at any time, select the desired type and click to create a virtual machine, and transmit the creation information to the back-end program through the network as a medium. The program will open a thread in the background to create it. Users do not need to manually download and import images to complete virtual machine creation, and there is no cumbersome operation such as setting a series of parameters. The required virtual machine instance can be quickly obtained, which greatly simplifies the operation and improves the user experience. The virtual machine is controlled through a visual interface, which reduces the difficulty of operation and makes the creation and use of virtual machines simple. In this way, the data transmission platform is built, and the time and manpower and material resources investment are reduced. The purpose of quickly building a platform used for actual operations such as learning algorithms is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is one of the flow charts of the method for building a virtual machine based on a virtual cloud platform provided by the present invention;
[0044] Figure 2 This is the second flow chart of the method for building a virtual machine based on a virtual cloud platform provided by the present invention;
[0045] Figure 3 This is the third flow chart of the method for building a virtual machine based on a virtual cloud platform provided by the present invention;
[0046] Figure 4 This is the fourth flow chart of the method for building a virtual machine based on a virtual cloud platform provided by the present invention;
[0047] Figure 5 This is the fifth flow chart of the method for building a virtual machine based on a virtual cloud platform provided by the present invention;
[0048] Figure 6 It is a structural block diagram of a virtual machine building device based on a virtual cloud platform provided by the present invention;
[0049] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In a specific embodiment, Figure 1 As shown, the virtual machine building method based on the virtual cloud platform provided by the present invention includes the following steps:
[0052] S110: Selecting a creation type on a pre-built virtual machine creation platform;
[0053] S120: Clone the target virtual machine according to the creation type;
[0054] S130: Creating a file based on the cloned virtual machine, and cloning the created file to obtain a cloned file;
[0055] S140: Initializing the cloned virtual machine according to the clone file to obtain an initial virtual machine;
[0056] S150: starting a daemon process based on the initial virtual machine and obtaining virtual machine information;
[0057] S160: Optimizing the initial virtual machine according to the virtual machine information and the clone file.
[0058] That is to say, generally speaking, Figure 2 As shown, the method includes the main steps of virtual machine type selection and creation, virtual machine cloning, virtual machine initialization, and daemon process running.
[0059] In some embodiments, obtaining virtual machine information further includes:
[0060] The virtual machine information and the clone file are entered into the virtual machine creation cloud platform.
[0061] In step S110, the creation type is selected, including:
[0062] In response to the operation instruction, a target virtual machine type is created among multiple types of virtual machines on the virtual machine creation platform.
[0063] Specifically, when selecting and creating a virtual machine, the user first selects the type of virtual machine to be used in the platform for creation. There are many types of virtual machines, and you only need to select one to create. Click Create and then transmit information through the network. The notification background will find the corresponding type of virtual machine for operation according to the type. A virtual machine card will be added to the page, and the status will be displayed as the virtual machine is being created to enhance user perception. The virtual machine being created is as follows: Figure 3 As shown, at the same time, a thread will be opened in the background to perform a series of operations for virtual machine creation.
[0064] In step S120, Figure 4 As shown in the figure, virtual machine cloning specifically includes the following steps:
[0065] Select the creation type;
[0066] Create a working directory after making sure that the name of the created type does not conflict with the pre-existing name;
[0067] Clone the virtual machine based on the working directory;
[0068] Start the virtual machine and obtain the MAC address;
[0069] Complete some information entry based on the MAC address and the cloned virtual machine.
[0070] Specifically, when cloning a virtual machine, when the backend receives the creation command, it will make a judgment to determine what kind of system to create and how to create the system. After reading the type of system to be created, it will perform operations by finding the corresponding files. The first step is to query the working directory through system instructions to prevent the problem of overwriting caused by duplicate virtual machine files. The second step is to create a new folder in the working directory through system instructions as a placeholder. This folder will be the main working directory of the user's newly created virtual machine. The third step is to copy the virtual machine file through system commands. The advantage of this is that it allows the user to perform any operation on the new virtual machine without changing the existing default virtual machine without affecting the default virtual machine. After the first three steps, the new virtual machine is created. Next, use the system command to start the virtual machine, obtain the mac address of the virtual machine to identify the virtual machine, and then enter some information of the virtual machine. The virtual machine cloning is completed. The specific steps are as follows Figure 4 shown.
[0071] In step S140, the virtual machine initialization specifically includes:
[0072] Start the virtual machine, run the script in the system and start the daemon process;
[0073] After running the script in the system, operate the virtual machine and enter the return state;
[0074] After starting the daemon process, it obtains system operation information and enters the return state. At the same time, the daemon process stands by and waits for subsequent instructions.
[0075] Specifically, when the virtual machine is initialized, the virtual machine will be started after the cloning of the virtual machine is completed. After the virtual machine is started, the initialization operation will begin. A series of complex operations will be performed through the script in the virtual machine. The first step will be to start the daemon process in the virtual machine. The daemon process will use instructions to obtain basic information such as the IP address and MAC address of the virtual machine. Later, the daemon process will communicate with the main service and pass the internal information of the virtual machine to the operation end. The back end will obtain the information passed by the daemon process and use the MAC address as an identifier to find the corresponding location for storage, which is convenient for subsequent operations on the virtual machine itself. When the information is transmitted to the control end, the daemon process will suspend and wait for the subsequent user to perform the next operation on the virtual machine before running. The second step is for the script in the system to start executing and perform initialization operations on the virtual machine, such as starting the corresponding function, configuring parameters, etc. The configured information is transmitted back to the control end together with the system IP address, etc. for processing. The steps are as follows Figure 5 shown.
[0076] In step S150, when modifying data on the virtual machine, the daemon process is started, which specifically includes:
[0077] Establish communication with the daemon process through the http link and send modification instructions;
[0078] After receiving the modification instruction, the daemon process identifies the intention of the instruction and converts the intention into actual operation to control the system instruction to modify the target data of the virtual machine.
[0079] In the daemon process, when the next step is ready, the daemon process will start. The daemon process is one of the cores of this product, which has many embedded instructions. The daemon process assists the initialization of the virtual machine and enters the standby state. After the initialization is completed, the user controls the virtual machine through the daemon process. For example, to modify the IP address of the virtual machine, first establish communication with the daemon process through the http link and send instructions. After receiving the instructions, the daemon process will recognize the intention of the instructions and transform the intention into actual operations to control the system instructions to modify the IP of the virtual machine, and the same is true for operations such as changing the password.
[0080] In the above specific implementation manner, the virtual machine building method based on the virtual cloud platform provided by the present invention selects a creation type on a pre-built virtual machine creation platform; clones the target virtual machine according to the creation type; creates files based on the cloned virtual machine, and clones the created files to obtain clone files; initializes the cloned virtual machine according to the clone files to obtain an initial virtual machine; starts a daemon process based on the initial virtual machine and obtains virtual machine information; and optimizes the initial virtual machine according to the virtual machine information and the clone file.
[0081] The method provided by the present invention utilizes virtual machine technology to achieve the purpose of remotely controlling virtual machines by using programs together with system commands and system scripts. At the same time, users can create virtual machines at any time, select the desired type and click to create a virtual machine, and transmit the creation information to the back-end program through the network as a medium. The program will open a thread in the background to create it. Users do not need to manually download and import images to complete virtual machine creation, and there is no cumbersome operation such as setting a series of parameters. The required virtual machine instance can be quickly obtained, which greatly simplifies the operation and improves the user experience. The virtual machine is controlled through a visual interface, which reduces the difficulty of operation and makes the creation and use of virtual machines simple. In this way, the data transmission platform is built, and the time is reduced. The investment of manpower and material resources is reduced. The purpose of quickly building a platform used for actual operations such as learning algorithms is achieved.
[0082] In addition to the above method, the present invention also provides a virtual machine building device based on a virtual cloud platform, such as Figure 6 As shown, the device comprises:
[0083] A type creation module 610 is used to select a creation type on a pre-built virtual machine creation platform;
[0084] A virtual machine cloning module 620, configured to clone the target virtual machine according to the creation type;
[0085] A file cloning module 630 is used to create a file based on the cloned virtual machine and clone the created file to obtain a cloned file;
[0086] A virtual machine initialization module 640 is used to initialize the cloned virtual machine according to the clone file to obtain an initial virtual machine;
[0087] A daemon process startup module 650 is used to start the daemon process based on the initial virtual machine and obtain virtual machine information;
[0088] The data optimization module 660 is used to optimize the initial virtual machine according to the virtual machine information and the clone file.
[0089] In some embodiments, obtaining virtual machine information further includes:
[0090] The virtual machine information and the clone file are entered into the virtual machine creation cloud platform.
[0091] In some embodiments, virtual machine cloning specifically includes:
[0092] Select the creation type;
[0093] Create a working directory after making sure that the name of the created type does not conflict with the pre-existing name;
[0094] Clone the virtual machine based on the working directory;
[0095] Start the virtual machine and obtain the MAC address;
[0096] Complete some information entry based on the MAC address and the cloned virtual machine.
[0097] In some embodiments, the virtual machine initialization specifically includes:
[0098] Start the virtual machine, run the script in the system and start the daemon process;
[0099] After running the script in the system, operate the virtual machine and enter the return state;
[0100] After starting the daemon process, it obtains system operation information and enters the return state. At the same time, the daemon process stands by and waits for subsequent instructions.
[0101] In some embodiments, the creation type is selected, specifically including:
[0102] In response to the operation instruction, a target virtual machine type is created among multiple types of virtual machines on the virtual machine creation platform.
[0103] In some embodiments, when data is modified on a virtual machine, a daemon process is started, specifically including:
[0104] Establish communication with the daemon process through the http link and send modification instructions;
[0105] After receiving the modification instruction, the daemon process identifies the intention of the instruction and converts the intention into actual operation to control the system instruction to modify the target data of the virtual machine.
[0106] In the above-mentioned specific implementation manner, the virtual machine building device based on the virtual cloud platform provided by the present invention selects a creation type on a pre-built virtual machine creation platform; clones the target virtual machine according to the creation type; creates files based on the cloned virtual machine, and clones the created files to obtain clone files; initializes the cloned virtual machine according to the clone files to obtain an initial virtual machine; starts a daemon process based on the initial virtual machine and obtains virtual machine information; and optimizes the initial virtual machine according to the virtual machine information and the clone file.
[0107] The device provided by the present invention utilizes virtual machine technology to achieve the purpose of remotely controlling virtual machines by using programs together with system commands and system scripts. At the same time, users can create virtual machines at any time, select the desired type and click to create a virtual machine, and transmit the creation information to the back-end program through the network as a medium. The program will open a thread in the background to create it. Users do not need to manually download and import images to complete virtual machine creation, and there is no cumbersome operation such as setting a series of parameters. The required virtual machine instance can be quickly obtained, which greatly simplifies the operation and improves the user experience. The virtual machine is controlled through a visual interface, which reduces the difficulty of operation and makes the creation and use of virtual machines simple. In this way, the data transmission platform is built, and the time is reduced. The investment of manpower and material resources is reduced. The purpose of quickly building a platform used for actual operations such as learning algorithms is achieved.
[0108] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the above method.
[0109] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0110] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the above method.
[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for building a virtual machine based on a virtual cloud platform, characterized in that: The method comprises: On the pre-built virtual machine creation platform, select the creation type; Perform virtual machine cloning on the target virtual machine according to the creation type; Creating a file based on the cloned virtual machine, and cloning the created file to obtain a cloned file; Initializing the cloned virtual machine according to the clone file to obtain an initial virtual machine; Start the daemon process based on the initial virtual machine and obtain the virtual machine information; Optimizing the initial virtual machine according to the virtual machine information and the clone file; Virtual machine cloning specifically includes: Select the creation type; Create a working directory after making sure that the name of the created type does not conflict with the pre-existing name; Clone the virtual machine based on the working directory; Start the virtual machine and obtain the MAC address; Complete some information entry based on the MAC address and the cloned virtual machine; The virtual machine initialization specifically includes: Start the virtual machine, run the script in the system and start the daemon process; After running the script in the system, operate the virtual machine and enter the return state; After starting the daemon process, it obtains system operation information and enters the return state. At the same time, the daemon process is on standby and waits for subsequent instructions; When modifying data on a virtual machine, the daemon process is started, including: Establish communication with the daemon process through the http link and send modification instructions; After receiving the modification instruction, the daemon process identifies the intention of the instruction and converts the intention into actual operation to control the system instruction to modify the target data of the virtual machine.
2. The method for building a virtual machine based on a virtual cloud platform according to claim 1, characterized in that: Get virtual machine information, and then include: The virtual machine information and the clone file are entered into the cloud platform where the virtual machine is created.
3. The method for building a virtual machine based on a virtual cloud platform according to claim 1, characterized in that: Select the creation type, including: In response to the operation instruction, a target virtual machine type is created among multiple types of virtual machines on the virtual machine creation platform.
4. A virtual machine building device based on a virtual cloud platform, used to implement the method according to any one of claims 1 to 3, characterized in that: The device comprises: A type creation module is used to select a creation type on a pre-built virtual machine creation platform; A virtual machine cloning module, used for cloning the target virtual machine according to the creation type; A file cloning module, used to create files based on the cloned virtual machine, and clone the created files to obtain cloned files; A virtual machine initialization module, used to initialize the cloned virtual machine according to the clone file to obtain an initial virtual machine; A daemon process startup module is used to start the daemon process based on the initial virtual machine and obtain virtual machine information; The data optimization module is used to optimize the initial virtual machine according to the virtual machine information and the clone file.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
