A file version control method and system in a virtual machine under a network isolation environment
By adding QGA module and Git distributed version control module to the virtual machine, the secure and efficient management of files in the virtual machine is achieved, the security risks and practical problems of file version control in the network isolation environment are solved, and the management of network shooting ranges is improved ability.
Patent Information
- Application Number
- CN202210270712.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In a network isolation environment, it is difficult for the existing technology to achieve efficient management and version control of files in virtual machines, and there are security risks. Attackers may use virtual targets to attack cloud platforms.
Set up user instruction processing modules on cloud platform control nodes, set up QGA monitoring agent modules on each computing node, set up QGA modules and file monitoring agent modules in the virtual machine, establish connections through local Unix Socket and serial ports, and use Git distributed version control modules to use Git Manage the historical version information of the file to realize full-cycle management and version control of the file.
It improves the security and availability of file version control in the virtual machine, avoids the security risks of network and out-of-band writes, provides flexible and efficient file management and control, and improves the practicality and security of the network shooting range.
Smart Images

Figure CN114721771B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system, computer equipment and storage medium for controlling file versions in a virtual machine under a network isolation environment. Background Art
[0002] As an important scientific device in the field of network security, the network range can provide means to support the observation, measurement and analysis of cyberspace behavior in a safe and controllable environment. It can also provide a flexible and reconfigurable integrated hardware and software platform for the test and evaluation of network attack and defense behavior, the test and verification of network attack and defense tools, and the technical and tactical training assessment of professionals. The mainstream technical solution of the current network range is to realize the rapid construction of the network attack and defense training environment based on the virtual resource orchestration capability of the cloud computing platform. In the cloud computing environment, virtualization technology is usually used to logically divide the physical server into multiple logical hosts or virtual hosts to achieve efficient sharing of physical resources. At the same time, in order to avoid interference between multi-tenant services and resources, the cloud computing environment also needs to provide a secure isolation mechanism between virtual hosts and between virtual machines and physical hosts. Taking network isolation as an example, the cloud platform usually includes management network, tenant network, storage network and external network during planning. The networks are physically isolated or VLAN isolated; tunnels such as vxlan or GRE are usually used between tenants to achieve secure isolation of each subnet. During the use of the network target range, operation and maintenance managers or training planners need to edit and manage the files inside the virtual target, such as data collection rule configuration files, Flag files, etc. However, operation and maintenance managers and training planners work on the management network of the cloud platform, while the network for data transmission of the target belongs to the tenant network. The two types of networks are physically isolated and cannot communicate. Therefore, the commonly used network-based file version control system cannot meet the management needs of managers or planners for files inside the target.
[0003] The existing feasible solutions for realizing file management and version control in virtual machines under network isolation environments include using guestfs components to directly access and modify virtual machine disks on the host machine, and complete out-of-band operations such as writing, reading, and modifying target files. However, this method is limited in its usage scenarios on the one hand - it is impossible to write files when the virtual machine is turned on, and on the other hand, it is not very practical - there is a certain probability of failure when reading files out of band; temporarily adding a network interface to the virtual machine, when the user has file management needs and needs to read and write target files in the virtual machine, temporarily adding a flat type network to the virtual machine to provide it with management network communication, thereby realizing file management and version control in the virtual machine based on the management network. This method directly connects the virtual machine to the management network where the host machine is located, which poses a great security risk when conducting network attack and defense training. Attackers may use the controlled virtual targets to attack the cloud platform itself. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for file version control in a virtual machine in a network isolation environment, which can improve the security of file version control in the virtual machine in response to the above technical problems.
[0005] A method for controlling file versions in a virtual machine under a network isolation environment, the method comprising:
[0006] A user instruction processing module is set on the cloud platform control node, a QGA monitoring agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine;
[0007] The user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA monitoring agent module of the computing node;
[0008] The QGA monitoring agent module establishes a connection through the local Unix Socket and the serial port in the virtual machine, and interacts with the QGA module and the user command processing module to complete command reception and command parsing, and issue functional commands;
[0009] The QGA module responds to the function instructions issued by the QGA monitoring agent module to perform related operations and obtain the modified file version; the related operations include file distribution, file modification and file push;
[0010] The file monitoring agent module monitors the file content modification in real time according to the modified file version, and writes the file modification status into the status file in the fixed directory of the disk;
[0011] The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file;
[0012] The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
[0013] In one embodiment, the file operation instructions include file issuing instructions, file modifying instructions and file pushing instructions.
[0014] In one of the embodiments, when the administrator's file operation instruction is a file issuing instruction, instruction parameters are set and the file issuing instruction is issued to the user instruction processing module;
[0015] The user command processing module interacts with the cloud platform control center to obtain the address of the computing node where the target virtual machine is located, and forwards the user command to the QGA monitoring agent module of the corresponding computing node;
[0016] The QGA listening agent module initiates a file pull request to the Git distributed version control module and pulls the target file that meets the version requirements to the local computer;
[0017] The QGA monitoring agent module and the user instruction processing module establish a QGA channel in the target virtual machine specified in the file delivery instruction, and write the local target file into the specified directory of the target virtual machine;
[0018] When all computing nodes have completed the above operations, the file is successfully delivered.
[0019] In one embodiment, the instruction parameter settings include the target file to be sent and its version number, a list of target virtual machines to receive the file, and a directory in the virtual machine where the target file is written.
[0020] In one of the embodiments, when the administrator's file operation instruction is a file modification instruction, the user instruction processing module executes the file modification in the virtual machine and saves it;
[0021] The file monitoring agent in the virtual machine monitors the file hash value in real time. When a file modification is detected, the file modification status is written to a status file in a fixed directory on the local disk of the virtual machine.
[0022] The QGA listening agent module on the computing node regularly establishes a channel with the QGA module in the virtual machine and polls the status file content;
[0023] If the content of the status file indicates that the target file has been modified, a channel is established with the QGA module in the target virtual machine to read the modified file to the local computing node, and the file modification status, modification time, modification user and other information are written into the information file;
[0024] If the content of the status file indicates that the target file has not been modified, no operation is performed and the process waits for the next poll.
[0025] In one embodiment, when the administrator's file operation instruction is a file push instruction, a query request is initiated to the user instruction processing module; the query request is to query the target files and their modification information stored on all computing nodes;
[0026] The administrator selects the target file to be pushed, interacts with the QGA listening agent module of the computing node through the user command processing module, and issues a file push command;
[0027] The QGA listening agent module of the computing node initiates a file push request and pushes the target file to the Git distributed version control module;
[0028] The Git distributed version control module receives file push requests and completes the storage of target files, and performs subsequent version tracking and management.
[0029] In one of the embodiments, the file push request includes the target file itself, the target file name, the version number, the modification event, and the modification user.
[0030] A file version control system in a virtual machine under a network isolation environment, the system comprising: a cloud platform control node, a computing node, a virtual machine and a Git distributed version control module; a user instruction processing module is set on the cloud platform control node; a QGA monitoring agent module is set on the computing node; a QGA module and a file monitoring agent module are set in the virtual machine;
[0031] The user instruction processing module receives the administrator's file operation instructions and sends the file operation instructions to the QGA listening agent module of the computing node; the file operation instructions include file sending instructions, file modification instructions and file push instructions;
[0032] The QGA monitoring agent module establishes a connection with the QGA module and the user command processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user command processing module, complete command reception and command parsing, and issue function commands;
[0033] The QGA module responds to the function instructions issued by the QGA monitoring agent module to perform related operations and obtain the modified file version; the related operations include file distribution, file modification and file push;
[0034] The file monitoring agent module monitors the file content modification in real time according to the modified file version, and writes the file modification status into the status file in the fixed directory of the disk;
[0035] The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file;
[0036] The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
[0037] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0038] A user instruction processing module is set on the cloud platform control node, a QGA monitoring agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine;
[0039] The user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA monitoring agent module of the computing node;
[0040] The QGA monitoring agent module establishes a connection with the QGA module and the user command processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user command processing module, complete command reception and command parsing, and issue function commands;
[0041] The QGA module responds to the function instructions issued by the QGA monitoring agent module to perform related operations and obtain the modified file version; the related operations include file distribution, file modification and file push;
[0042] The file monitoring agent module monitors the file content modification in real time according to the modified file version, and writes the file modification status into the status file in the fixed directory of the disk;
[0043] The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file;
[0044] The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
[0045] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0046] A user instruction processing module is set on the cloud platform control node, a QGA monitoring agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine;
[0047] The user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA monitoring agent module of the computing node;
[0048] The QGA monitoring agent module establishes a connection with the QGA module and the user command processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user command processing module, complete command reception and command parsing, and issue function commands;
[0049] The QGA module responds to the function instructions issued by the QGA monitoring agent module to perform related operations and obtain the modified file version; the related operations include file distribution, file modification and file push;
[0050] The file monitoring agent module monitors the file content modification in real time according to the modified file version, and writes the file modification status into the status file in the fixed directory of the disk;
[0051] The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file;
[0052] The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
[0053] The above-mentioned method, system, computer device and storage medium for file version control in a virtual machine under a network isolation environment include setting a user instruction processing module on the cloud platform control node, setting a QGA listening agent module on each computing node in the cloud platform, and setting a QGA module and a file monitoring agent module in the virtual machine; the user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA listening agent module of the computing node; the QGA listening agent module receives the file operation instruction of the administrator through the local Unix The socket establishes a connection with the serial port in the virtual machine to interact with the QGA module and the user instruction processing module, completes instruction reception and instruction parsing, and issues functional instructions; the QGA module responds to the functional instructions issued by the QGA listening agent module to perform related operations and obtain the modified file version; related operations include file issuance, file modification and file push; the file monitoring agent module monitors the file content modification in real time according to the modified file version, and writes the file modification status to the status file in a fixed directory on the disk; the QGA listening agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version to the target file according to the content of the status file; the Git distributed version control module is used to manage all historical version information of the target file and manage and version control the entire cycle of the target file. The present invention realizes data interaction between a host machine and a virtual machine by adding a QGA module to a virtual machine and establishing a connection through a local Unix Socket and a serial port in the virtual machine using a QGA listening proxy module. This data interaction mode does not rely on network and disk out-of-band writing, avoids possible security risks, and improves the availability of data interaction between the host machine and the virtual machine. By using a Git distributed version control module and a user instruction processing module, the administrator can perform version control and management on files in the virtual machine in the network range, providing flexible and efficient file management and control for the development of network attack and defense training, and improving the practicality and security of the network range. The design principle of the present invention is reliable, the structure is simple, and it is applicable to the management of files in virtual machines in all network ranges based on private cloud platforms, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a flow chart of a method for controlling file versions in a virtual machine in a network isolation environment in one embodiment;
[0055] Figure 2 A schematic diagram of a process of sending files to a virtual machine in a network isolation environment in an embodiment;
[0056] Figure 3 A schematic diagram of a process of modifying files in a virtual machine in a network isolation environment in an embodiment;
[0057] Figure 4 A schematic diagram of a process of pushing files in a virtual machine in a network isolation environment in another embodiment;
[0058] Figure 5 It is a structural block diagram of a file version control system in a virtual machine in a network isolation environment in one embodiment;
[0059] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In one embodiment, Figure 1 As shown, a method for controlling file versions in a virtual machine in a network isolation environment is provided, comprising the following steps:
[0062] Step 102, a user instruction processing module is set on the cloud platform control node, a QGA monitoring agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine.
[0063] The QGA module includes QGA, which is Qemu Guest Agent, a daemon running inside the virtual machine.
[0064] Step 104: the user instruction processing module receives the file operation instruction from the administrator, and sends the file operation instruction to the QGA monitoring agent module of the computing node.
[0065] Step 106, the QGA monitoring agent module establishes a connection with the QGA module and the user instruction processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user instruction processing module, completes instruction reception and instruction parsing, and issues functional instructions.
[0066] Step 108, the QGA module responds to the function instruction issued by the QGA monitoring agent module to perform related operations to obtain a modified file version; the related operations include file distribution, file modification and file push.
[0067] Step 110, the file monitoring agent module monitors the modification of the file content in real time according to the modified file version, and writes the modification status of the file into a status file in a fixed directory on the disk.
[0068] Step 112: The QGA monitoring proxy module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file.
[0069] The QGA listening agent module regularly establishes a channel with the QGA module in the virtual machine and polls the status file content; if the content of the status file indicates that the target file has been modified, it establishes a channel with the QGA module in the target virtual machine, reads the modified file to the local computing node, writes it to the target file, and writes the file modification status, modification time, modification user and other information to the information file; if the content of the status file indicates that the target file has not been modified, no operation is performed and waits for the next polling. The target file refers to the file in the virtual machine managed by the user.
[0070] Step 114, the Git distributed version control module is used to manage all historical version information of the target file and perform full-cycle management and version control on the target file.
[0071] In the above-mentioned file version control method in a virtual machine under a network isolation environment, a user instruction processing module is set on the cloud platform control node, a QGA listening agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine; the user instruction processing module receives the file operation instruction of the administrator, and sends the file operation instruction to the QGA listening agent module of the computing node; the QGA listening agent module establishes a connection with the QGA module and the user instruction processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user instruction processing module, completes instruction reception and instruction parsing, and issues functional instructions; the QGA module responds to the functional instructions issued by the QGA listening agent module to perform related operations and obtain the modified file version; the related operations include file issuance, file modification and file push; the file monitoring agent module monitors the modification of the file content in real time according to the modified file version, and writes the modification status of the file into the status file under the fixed directory of the disk; the QGA listening agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file; the Git distributed version control module is used to manage all historical version information of the target file and manage and version control the target file throughout its cycle. The present invention realizes data interaction between a host machine and a virtual machine by adding a QGA module to a virtual machine and establishing a connection through a local Unix Socket and a serial port in the virtual machine using a QGA listening proxy module. This data interaction mode does not rely on network and disk out-of-band writing, avoids possible security risks, and improves the availability of data interaction between the host machine and the virtual machine. By using a Git distributed version control module and a user instruction processing module, the administrator can perform version control and management on files in the virtual machine in the network range, providing flexible and efficient file management and control for the development of network attack and defense training, and improving the practicality and security of the network range. The design principle of the present invention is reliable, the structure is simple, and it is applicable to the management of files in virtual machines in all network ranges based on private cloud platforms, and has broad application prospects.
[0072] In one embodiment, the file operation instructions include file issuing instructions, file modifying instructions and file pushing instructions.
[0073] In one of the embodiments, when the administrator's file operation instruction is a file issuing instruction, instruction parameters are set and the file issuing instruction is issued to the user instruction processing module;
[0074] The user command processing module interacts with the cloud platform control center to obtain the address of the computing node where the target virtual machine is located, and forwards the user command to the QGA monitoring agent module of the corresponding computing node;
[0075] The QGA listening agent module initiates a file pull request to the Git distributed version control module and pulls the target file that meets the version requirements to the local computer;
[0076] The QGA monitoring agent module and the user instruction processing module establish a QGA channel in the target virtual machine specified in the file delivery instruction, and write the local target file into the specified directory of the target virtual machine;
[0077] When all computing nodes have completed the above operations, the file is successfully delivered.
[0078] like Figure 2 The figure shows the process of sending files to a virtual machine in a network isolation environment, which includes the following steps:
[0079] 1. The administrator user sends a file distribution request, first specifying the target file to be distributed and its version number, the target virtual machine list to receive the file, and the directory where the target file is written in the virtual machine. Using the above information as parameters, the file distribution instruction is issued to the user instruction processing module;
[0080] 2. The user command is issued to the computing node. After receiving the administrator's request, the user command processing module interacts with the cloud platform control center to obtain the address of the computing node where the target virtual machine is located, and forwards the user command to the QGA monitoring agent module of the corresponding computing node;
[0081] 3. The computing node pulls the target file to the local computer. The QGA monitoring agent module initiates a file pull request to the Git distributed version control module and pulls the target file that meets its version requirements to the local computer.
[0082] 4. The target file is written into the specified directory in the virtual machine. The QGA module in the virtual machine establishes a channel with the QGA module in the target virtual machine specified by the user in the instruction, and writes the target file retrieved by the QGA monitoring agent module into the specified directory of the target virtual machine.
[0083] 5. When all computing nodes have completed the above operations, the file is successfully sent.
[0084] In one embodiment, the instruction parameter settings include the target file to be sent and its version number, a list of target virtual machines to receive the file, and a directory in the virtual machine where the target file is written.
[0085] In one of the embodiments, when the administrator's file operation instruction is a file modification instruction, the user instruction processing module executes the file modification in the virtual machine and saves it;
[0086] The file monitoring agent in the virtual machine monitors the file hash value in real time. When a file modification is detected, the file modification status is written to a status file in a fixed directory on the local disk of the virtual machine.
[0087] The QGA listening agent module on the computing node regularly establishes a channel with the QGA module in the virtual machine and polls the status file content;
[0088] If the content of the status file indicates that the target file has been modified, a channel is established with the QGA module in the target virtual machine to read the modified file to the local computing node, and the file modification status, modification time, modification user and other information are written into the information file;
[0089] If the content of the status file indicates that the target file has not been modified, no operation is performed and the process waits for the next poll.
[0090] like Figure 3 The following is the file modification response process in a virtual machine under a network isolation environment:
[0091] 1. The virtual machine user saves and modifies the file. The user modifies the file in the virtual machine and saves it.
[0092] 2. The agent monitors and records the file modification status. The file monitoring agent in the virtual machine monitors the file hash value in real time. When a file modification is detected, the file modification status is written to a status file in a fixed directory on the local disk of the virtual machine.
[0093] 3. The QGA listening agent polls the status file. The QGA listening agent on the computing node regularly establishes a channel with the QGA modules in all virtual machines hosted on it, and polls all virtual machines to read the content of the above status file to determine whether the target file has been modified;
[0094] 4. If the content of the status file indicates that the target file has been modified, a channel is established with the QGA in the target virtual machine to read the modified file to the local computing node, and the file modification status, modification time, modification user and other information are written to the information file;
[0095] 5. If the content of the status file indicates that the target file has not been modified, no operation is performed and the next polling is waited for.
[0096] In one embodiment, when the administrator's file operation instruction is a file push instruction, a query request is initiated to the user instruction processing module; the query request is to query the target files and their modification information stored on all computing nodes;
[0097] The administrator selects the target file to be pushed, interacts with the QGA listening agent module of the computing node through the user command processing module, and issues a file push command;
[0098] The QGA listening agent module of the computing node initiates a file push request and pushes the target file to the Git distributed version control module;
[0099] The Git distributed version control module receives file push requests and completes the storage of target files, and performs subsequent version tracking and management.
[0100] like Figure 4 As shown, when the administrator user wants to fix the version of the modified target file and store it in the version management system, a file push operation is performed. The method includes the following steps:
[0101] 1. The administrator queries the target file information. The administrator user initiates a query to the user instruction processing module, requests the target files and their modification information stored on all computing nodes, and generates a target file list for the next step of selection;
[0102] 2. The administrator sends a file push request. The administrator selects the target file to be pushed in the list, interacts with the QGA listening agent module of the computing node through the user instruction processing module, and issues a file push instruction;
[0103] 3. The QGA listening agent initiates file push. The QGA listening agent module of the computing node Git distributed version control module initiates a file push request. The request parameters include the target file itself, the target file name, version number, modification event, modification user and other information, and pushes the target file to the Git distributed version control module;
[0104] 4. The Git distributed version control module completes the reception and storage of target files, and performs subsequent version tracking and management.
[0105] In one of the embodiments, the file push request includes the target file itself, the target file name, the version number, the modification event, and the modification user.
[0106] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0107] In one embodiment, Figure 5 As shown, a file version control system in a virtual machine in a network isolation environment, the system includes: a cloud platform control node, a computing node, a virtual machine and a Git distributed version control module; a user instruction processing module is set on the cloud platform control node; a QGA listening agent module is set on the computing node; a QGA module and a file monitoring agent module are set in the virtual machine;
[0108] The user instruction processing module receives the administrator's file operation instructions and sends the file operation instructions to the QGA listening agent module of the computing node; the file operation instructions include file sending instructions, file modification instructions and file push instructions;
[0109] The QGA monitoring agent module establishes a connection with the QGA module and the user command processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user command processing module, complete command reception and command parsing, and issue function commands;
[0110] The QGA module responds to the function instructions issued by the QGA monitoring agent module to perform related operations and obtain the modified file version; the related operations include file distribution, file modification and file push;
[0111] The file monitoring agent module monitors the modification of the file content in real time according to the modified file version, and writes the modification status of the file into the status file in the fixed directory of the disk;
[0112] The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file;
[0113] The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
[0114] For the specific definition of the file version control system in a virtual machine under a network isolation environment, please refer to the definition of the file version control method in a virtual machine under a network isolation environment mentioned above, which will not be repeated here. Each module in the file version control system in a virtual machine under the above-mentioned network isolation environment can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0115] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for controlling file versions in a virtual machine under a network isolation environment is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0116] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0117] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0118] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0119] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0120] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0121] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for controlling file versions in a virtual machine under a network isolation environment. It is characterized in that The method comprises: A user instruction processing module is set on the cloud platform control node, a QGA monitoring agent module is set on each computing node in the cloud platform, and a QGA module and a file monitoring agent module are set in the virtual machine; The user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA monitoring agent module of the computing node; The QGA monitoring agent module establishes a connection with the local Unix Socket and the serial port in the virtual machine, interacts with the QGA module and the user command processing module, completes command reception and command parsing, and issues functional commands; The QGA module responds to the function instruction issued by the QGA monitoring agent module to perform related operations to obtain the modified file version; the related operations include file distribution, file modification and file push; The file monitoring agent module monitors the modification of the file content in real time according to the modified file version, and writes the modification status of the file into the status file in the fixed directory of the disk; The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file; The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
2. The method according to claim 1, It is characterized in that The file operation instructions include file issuing instructions, file modifying instructions and file pushing instructions.
3. The method according to claim 2, It is characterized in that The method further comprises: When the file operation instruction of the administrator is a file issuing instruction, instruction parameters are set and the file issuing instruction is issued to the user instruction processing module; The user command processing module interacts with the cloud platform control center to obtain the address of the computing node where the target virtual machine is located, and forwards the user command to the QGA monitoring agent module of the corresponding computing node; The QGA listening agent module initiates a file pull request to the Git distributed version control module and pulls the target file that meets the version requirements to the local computer; The QGA monitoring agent module and the user instruction processing module establish a QGA channel in the target virtual machine specified in the file delivery instruction, and write the local target file into the specified directory of the target virtual machine; When all computing nodes have completed the above operations, the file is successfully delivered.
4. The method according to claim 3, It is characterized in that The instruction parameter settings include the target file to be sent and its version number, the target virtual machine list for receiving the file, and the directory in which the target file is written in the virtual machine.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: When the administrator's file operation instruction is a file modification instruction, the user instruction processing module executes the file modification in the virtual machine and saves it; The file monitoring agent in the virtual machine monitors the file hash value in real time. When a file modification is detected, the file modification status is written to a status file in a fixed directory on the local disk of the virtual machine. The QGA monitoring agent module on the computing node regularly establishes a channel with the QGA module in the virtual machine and polls the content of the status file; If the content of the status file indicates that the target file has been modified, a channel is established with the QGA module in the target virtual machine to read the modified file to the local computing node, and the file modification status, modification time, modification user and other information are written into the information file; If the content of the status file indicates that the target file has not been modified, no operation is performed and the process waits for the next poll.
6. The method according to claim 1, It is characterized in that The method further comprises: When the administrator's file operation instruction is a file push instruction, a query request is initiated to the user instruction processing module; the query request is to query the target files and their modification information stored on all computing nodes; The administrator selects the target file to be pushed, interacts with the QGA listening agent module of the computing node through the user instruction processing module, and issues the file pushing instruction; The QGA listening agent module of the computing node initiates a file push request and pushes the target file to the Git distributed version control module; The Git distributed version control module receives the file push request and completes the storage of the target file, and performs subsequent version tracking and management.
7. The method according to claim 6, It is characterized in that The file push request includes the target file itself, the target file name, the version number, the modification event, and the modification user.
8. A file version control system in a virtual machine under a network isolation environment. It is characterized in that The system includes a cloud platform control node, a computing node, a virtual machine and a Git distributed version control module; a user instruction processing module is set on the cloud platform control node; a QGA monitoring agent module is set on the computing node; a QGA module and a file monitoring agent module are set in the virtual machine; The user instruction processing module receives the file operation instruction of the administrator and sends the file operation instruction to the QGA monitoring agent module of the computing node; the file operation instruction includes a file sending instruction, a file modification instruction and a file pushing instruction; The QGA monitoring agent module establishes a connection with the QGA module and the user command processing module through the local Unix Socket and the serial port in the virtual machine to interact with the QGA module and the user command processing module, complete command reception and command parsing, and issue function commands; The QGA module responds to the function instruction issued by the QGA monitoring agent module to perform related operations to obtain the modified file version; the related operations include file distribution, file modification and file push; The file monitoring agent module monitors the modification of the file content in real time according to the modified file version, and writes the modification status of the file into the status file in the fixed directory of the disk; The QGA monitoring agent module establishes a channel with the QGA module in the virtual machine to poll the content of the status file, and writes the modified file version into the target file according to the content of the status file; The Git distributed version control module is used to manage all historical version information of the target file and to manage and version control the target file throughout its entire cycle.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
