File data sharing method and apparatus for host system, and medium, program product and terminal

By deploying virtual machines on the host system and using virtual file device drivers to convert file access instructions into operation sequences, the compatibility and efficiency issues between the client system and the host system are resolved, enabling efficient file sharing and data transfer.

WO2026123162A1PCT designated stage Publication Date: 2026-06-18VERISILICON MICROELECTRONICS (SHANGHAI) CO LTD +1

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
VERISILICON MICROELECTRONICS (SHANGHAI) CO LTD
Filing Date
2024-12-09
Publication Date
2026-06-18

AI Technical Summary

Technical Problem

The lack of compatibility between client and host systems, inefficient network switching, and the technical complexity and high implementation cost of semi-virtualization solutions all present challenges.

Method used

A virtual machine is deployed on the host system, and a guest operating system is deployed in the virtual machine. File access instructions are converted into access operation sequences through virtual file device drivers. File sharing operations are performed between the virtual file device and the host system, avoiding dependence on traditional file systems.

🎯Benefits of technology

It enables efficient file access in the absence of a network, enhances the file sharing capability between the virtual system and the host system, breaks through the dependence on network protocols, and improves data transmission performance and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024137831_18062026_PF_FP_ABST
    Figure CN2024137831_18062026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a file data sharing method and apparatus for a host system, and a medium, a program product and a terminal. By means of a virtual file device in a client system, efficient access to a file in a host system is provided for an upper-layer software module. This device interacts with a driver by means of a register interface, and a register describes various pieces of information related to an access operation, wherein the pieces of information comprise an operation type and operands of the access operation. After receiving a file access request, the client system uses corresponding APIs to convert the request into a specific access operation sequence for the virtual file device, such that the client system can execute a program on the basis of requirements to access the file in the host system. Therefore, efficient access to a file in an environment lacking a conventional file system is realized, especially on a virtual device which lacks network support, and the dependence on conventional network protocols is overcome, thereby significantly improving the performance and efficiency of data transmission, and ensuring smooth file access in a network-free environment.
Need to check novelty before this filing date? Find Prior Art

Description

Host system file data sharing methods, devices, media, program products and terminals Technical Field

[0001] This application relates to the field of virtual machine technology, and in particular to a method, apparatus, medium, program product and terminal for sharing file data on a host system. Background Technology

[0002] A client system refers to user-specific applications and services running in a virtual environment or cloud computing platform, which typically need to interact with its host system—the infrastructure of a physical or virtual machine. The primary purpose of this data exchange is to ensure that the client system can access necessary resources, share files, or synchronize information, thereby improving overall operational efficiency. Currently, file data exchange technologies between client and host systems include the use of virtual file systems and network communication.

[0003] However, the lack of comprehensive system support or compatibility in some client systems makes it difficult to apply these technologies in relevant environments. Furthermore, when exchanging data using network communication, network bandwidth limitations and latency can lead to inefficient data exchange, impacting client system performance. On the other hand, solutions exist for establishing data channels through paravirtualization to improve file access efficiency between client and host systems. However, the technical complexity of this approach presents challenges in practice. Paravirtualization typically requires deep customization at the underlying abstraction layer, often necessitating modifications to the operating system. This results in high implementation costs, long implementation times, and stringent technical support requirements for development and maintenance. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a method, apparatus, medium, program product and terminal for sharing file data between a host system, in order to solve the problems of lack of compatibility between the client system and the host system, low network exchange efficiency, and the technical complexity and high implementation cost of the semi-virtualization scheme.

[0005] To achieve the above and other related objectives, a first aspect of this application provides a method for sharing file data in a host system. The data sharing method includes: deploying a virtual machine in a host system and deploying a guest operating system in the virtual machine; upon receiving a file access instruction, the guest operating system converts the file access instruction into an access operation sequence through a virtual file device driver in the guest operating system, and writes the access operation sequence into a virtual file device in the virtual machine; the virtual machine performs a corresponding file sharing operation on a host file in the host system based on the access operation sequence in the virtual file device.

[0006] In some embodiments of the first aspect of this application, the process of deploying a virtual machine in a host system and deploying a guest operating system in the virtual machine further includes the following steps: the host system deploys a virtual file device into the virtual machine and installs a virtual file device driver in the guest operating system.

[0007] In some embodiments of the first aspect of this application, the process by which the guest operating system writes the access operation sequence into the virtual machine includes: the guest operating system sending the access operation sequence to the virtual file device and storing it in the register of the virtual file device through the register interface of the virtual file device.

[0008] In some embodiments of the first aspect of this application, after the access operation sequence is written into the virtual file device in the virtual machine, the following operations are performed: the virtual file device identifies the access operation sequence stored in the register to extract the access type of the host system; the virtual file device calls the corresponding API through a predefined protocol according to the identified host system access type to establish a connection with the host system.

[0009] In some embodiments of the first aspect of this application, the access type includes one or more of the following: fetch operation, write operation, append operation, delete operation, permission modification operation, move operation, and rename operation.

[0010] In some embodiments of the first aspect of this application, the process by which the guest operating system converts a file access instruction into an access operation sequence after receiving a file access instruction includes: converting the file access instruction into an access operation sequence that matches the host system through a file access API within the virtual file device driver.

[0011] In some embodiments of the first aspect of this application, the process of converting the file access instruction into an access operation sequence matching the host system includes: parsing the file access instruction to generate an access type, file path, and data block size; structuring the access type, file path, and data block size to generate a structured instruction; sending the structured instruction to the file access API inside the virtual file device driver to generate operation commands for multiple sub-operations; and generating the access operation sequence based on the operation commands for the multiple sub-operations.

[0012] In some embodiments of the first aspect of this application, before the initial file sharing operation between the guest operating system and the host system, the virtual file device performing a file sharing operation on a target file in the host system further includes the following steps: the virtual file device obtains a handle file from the host system and sends the handle file to the guest operating system; the guest operating system performs subsequent file sharing operations with the host system based on the handle file.

[0013] In some embodiments of the first aspect of this application, a handle file is an identifier used to identify and manage the target file.

[0014] In some embodiments of the first aspect of this application, the process of deploying a virtual machine in a host system and deploying a guest operating system in the virtual machine includes: installing a virtualization platform in the host system, creating the virtual machine in the virtualization platform and configuring resources; and deploying a guest operating system in the virtual machine using an ISO image.

[0015] In some embodiments of the first aspect of this application, the virtualization platform includes any one of the following: KVM, VMware, VirtualBox.

[0016] To achieve the above and other related objectives, a second aspect of this application provides a host system file data sharing apparatus, the apparatus comprising: a guest operating system: configured to, upon receiving a file access instruction, convert the file access instruction into an access operation sequence and write the access operation sequence into a virtual machine; a virtual machine: configured to perform corresponding file sharing operations on host files in the host system based on the access operation sequence; and a host system: configured to deploy the virtual machine and deploy the guest operating system within the virtual machine.

[0017] To achieve the above and other related objectives, a third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the host system file data sharing method.

[0018] To achieve the above and other related objectives, a fourth aspect of this application provides a computer program product including computer program code, which, when executed on a computer, enables the computer to implement the host system file data sharing method.

[0019] To achieve the above and other related objectives, a fifth aspect of this application provides an electronic terminal, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the host system file data sharing method.

[0020] As described above, the host system file data sharing method, apparatus, medium, program product, and terminal of this application have the following beneficial effects: Firstly, this invention successfully achieves file access in environments lacking file systems, enabling users to access files on the host system from systems without traditional file systems. Secondly, this application also provides an efficient file access method, improving the performance and efficiency of virtual systems accessing host files, especially suitable for virtual devices in environments without networks. Finally, it overcomes the dependence of existing methods on network protocols, achieving direct access from the guest operating system to the host system through key information, eliminating the limitations of slow speed and data copying / moving in traditional methods. This application significantly improves the file sharing capability between the virtual system and the host system. Attached Figure Description

[0021] Figure 1 shows a flowchart of the host system file data sharing method in an embodiment of this application.

[0022] Figure 2 shows a schematic diagram of an embodiment of the host system file data sharing device of this application.

[0023] Figure 3 shows a schematic diagram of the structure of an embodiment of the electronic terminal of this application. Detailed Implementation

[0024] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0025] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:

[0026] <1> An executable program is a set of instructions that can run on a specific computer hardware system to perform a specific function. Executable programs are generally written in machine language or intermediate language, and after being compiled or interpreted, they can be directly loaded and executed by the operating system to implement applications, services, or system tasks.

[0027] <2> Driver: A special type of executable program responsible for controlling and managing the operation of computer hardware devices. Drivers act as an intermediary between the operating system and the hardware, allowing the operating system to communicate with each piece of hardware through a standardized interface, thereby ensuring the proper functioning and performance of the hardware.

[0028] <3> Devices: These are hardware components controlled by electromagnetic signals or other physical phenomena, possessing specific functions and uses. These devices can be input devices (such as keyboards and mice), output devices (such as monitors and printers), or storage devices (such as hard drives and flash drives).

[0029] <4> Virtualization: A technology that optimizes and manages a computer system's access to hardware resources through a software abstraction layer. Virtualization technology enables multiple operating systems to run in parallel on the same hardware platform, making full use of computing resources and improving hardware utilization and flexibility.

[0030] <5> Full virtualization is a virtualization technology in which the guest operating system runs in a virtual machine, completely independent of the underlying hardware and its abstraction layer. This approach provides a complete virtual hardware environment, allowing the guest operating system to run without modification, thus ensuring compatibility with multiple operating systems.

[0031] <6> Paravirtualization is a virtualization method in which the guest operating system is isolated from the underlying hardware and its abstraction layer within a virtual machine. In this mode, the guest operating system needs to be modified to work efficiently with the virtualization layer, thereby achieving better performance and resource utilization.

[0032] <7> Virtual devices: A program or component that simulates or emulates the functionality of physical hardware. These virtual devices provide interfaces and behaviors similar to real devices, allowing applications to interact with them transparently without needing to know the details of their underlying physical implementation.

[0033] <8> Registers: A high-efficiency storage unit, typically located inside the central processing unit (CPU), used for exchanging information, instructions, or status data. Registers can speed up data processing because they have higher access speeds than other types of storage, such as random access memory (RAM).

[0034] <9> In computers, a file refers to a collection of data stored in a specific format, usually organized using a directory structure. Files can contain various data types such as text, images, audio, and video, and can be accessed and managed by applications or users.

[0035] <10> Virtual files are collections of data that exist on specific virtual devices and can be accessed by users or applications through this virtual layer. Virtual files are typically not directly associated with the underlying physical storage, providing a flexible data management approach.

[0036] <11> A virtual system is a composite system consisting of a set of virtual devices and executable programs running on them. Virtual systems can run independently, have independent resource management and operating environments, and allow multiple systems to run in parallel on the same physical hardware.

[0037] <12> Guest system: refers to a virtual system that includes virtual machines and the guest virtual operating system and other software modules running on them. The guest system runs in the environment provided by the host system and can utilize the host system's hardware resources and services.

[0038] <13> Host system: A computer system containing physical hardware and the host operating system and other software modules running on it, providing the resources and environment required for the client virtual system to operate. The host system is responsible for managing the allocation and scheduling of virtual resources to ensure the effective operation of the client system.

[0039] <14> Guest virtual operating system: refers to an operating system created using virtualization technology, running on a guest system and operating within the environment provided by the host system, capable of utilizing the host system's hardware resources and services. The host system is the infrastructure, the actual physical machine or operating system that provides resources. A virtual machine is a virtualized environment created on a host system; each virtual machine can run an independent operating system. The guest operating system is the operating system running on the virtual machine. The guest system refers to the applications and services running within the guest operating system.

[0040] To facilitate understanding of the embodiments of this application, a detailed description will first be provided with reference to FIG1. ​​FIG1 shows a schematic flowchart of a host system file data sharing method according to an embodiment of the present invention. The host system file data sharing method in this embodiment mainly includes the following steps:

[0041] Step S11: Deploy a virtual machine on the host system and deploy a guest operating system in the virtual machine.

[0042] In one embodiment of the present invention, the process of deploying a virtual machine on a host system includes: installing a virtualization platform on the host system; creating a virtual machine on the virtualization platform using command-line tools or a graphical interface; and configuring the corresponding central processing unit (CPU), memory, and storage resources. Subsequently, a guest operating system is installed using an ISO image (ISO, International Organization for Standardization). Next, process management tools are installed and configured to monitor applications in the virtual machine. After installation, the process management service is started, and the application is tested to ensure its normal operation. Finally, system logs and application status are monitored regularly, and resources are adjusted as needed to maintain optimal performance and stability. The virtualization platform includes, but is not limited to, KVM (Kernel-based Virtual Machine) virtualization software, VMware virtualization software, and VirtualBox virtualization software. KVM is an open-source virtualization technology that, as part of the Linux kernel, supports multiple operating systems and hardware virtualization extensions. VMware is commercial virtualization software that provides multiple products, including VMware Workstation and vSphere, and has powerful virtual machine management, snapshot, and cloning functions. VirtualBox is an open-source virtualization software with a user-friendly interface and also supports multiple operating systems.

[0043] In one embodiment of the present invention, the solution includes file sharing between a host system and multiple client systems running on it. Through a virtual file device in the client system, the device's driver provides upper-layer software modules with access to files on the host system, thereby enabling resource sharing and management. This architecture optimizes the system's file access efficiency and allows client systems to flexibly utilize the host system's storage resources.

[0044] In one embodiment of the present invention, the process of deploying a virtual machine in a host system and deploying a guest operating system in the virtual machine further includes the following steps: the host system deploys a virtual file device into the virtual machine and installs a virtual file device driver in the guest operating system.

[0045] In this embodiment, the process of deploying a virtual file device to a virtual machine by the host system includes: creating a virtual storage volume in the host system and mapping it to the virtual machine through a virtualization platform; including selecting the target virtual machine in the virtualization management tool, configuring the attributes of the virtual disk, and starting the virtual machine to recognize the new storage volume. The process of installing the virtual file device driver for the guest operating system includes obtaining the appropriate driver inside the virtual machine and installing it through the guest operating system's package management tool or driver installer. After installation, the driver is loaded into the guest operating system, enabling it to recognize and manage the virtual file device. Here, the guest operating system's package management tool refers to the package management tool corresponding to the operating system running inside the virtual machine. For example, if the guest operating system is a Linux system, the corresponding Linux package management tool (such as apt, yum, etc.) is used to install the driver.

[0046] A virtual file device is an abstraction layer that implements file storage and management in a virtual environment, allowing virtual machines to utilize virtual storage resources as if they were accessing a physical file system. The virtual file device driver is responsible for translating operating system file system calls into operations that the virtual file device can understand, thereby enabling effective communication between the virtual machine and virtual storage.

[0047] It is worth noting that the virtual file device and its driver in this invention innovatively connect the host system's storage resources to the virtual machine, thereby enabling file sharing between the guest operating system and the host system. By creating and mapping virtual storage volumes in the virtualization platform, the virtual file device allows the virtual machine to access the host system's storage as if it were a physical file system. Furthermore, the virtual file device driver in the guest operating system is responsible for communicating with the virtual file device, ensuring efficient and smooth data exchange between the virtual machine and the host system. This design significantly enhances the flexibility and scalability of data management in the virtual environment.

[0048] Step S12: After receiving the file access instruction, the guest operating system converts the file access instruction into an access operation sequence through the virtual file device driver in the guest operating system, and writes the access operation sequence into the virtual file device in the virtual machine.

[0049] In one embodiment of the present invention, the virtual file device is accessed via a register interface. The registers record information related to the access operation, including the operation type and operands. The client system's driver provides a set of application programming interfaces (APIs) to translate file access operations into specific operation sequences for the virtual file device. Ultimately, the client system's executable program can use these APIs to access files on the host system as needed.

[0050] In one embodiment of the present invention, the process by which the guest operating system writes the access operation sequence into the virtual machine includes: the guest operating system sending the access operation sequence to the virtual file device and storing it in the register of the virtual file device through the register interface of the virtual file device.

[0051] In this embodiment, when the guest operating system starts, the virtual file device is initialized and registered with the guest operating system through a driver file. At this time, the register interface of the virtual file device is recognized by the system. The guest operating system generates a series of file access operations according to the application's needs, including reading, writing, and deleting. These operations are serialized into an access operation sequence for batch processing. The guest operating system uses the register interface of the virtual file device to send the prepared access operation sequence to the virtual file device. The received access operation sequence is stored in the register of the virtual file device. The register is a memory unit used to temporarily store operation commands to support subsequent operation execution. The virtual file device extracts the access operation sequence from the register and executes the corresponding operation through interaction with the host system. The virtual file device converts these operations into instructions that the host system can understand and sends them to the host storage. Finally, after the file sharing operation is completed, the virtual file device feeds back the operation result to the guest operating system, including success or failure, and the data returned by the operation. This information is transmitted back to the guest operating system through the register interface for further processing.

[0052] In one embodiment of the present invention, the process by which the guest operating system converts a file access instruction into an access operation sequence after receiving a file access instruction includes: converting the file access instruction into an access operation sequence that matches the host system through a file access API inside the virtual file device driver.

[0053] In this embodiment, the guest operating system first receives a file access instruction from the application, such as reading the file "example.txt". This instruction contains detailed information, such as the operation type (read), the file path ( / data / example.txt), and the requested data block size (4096 bytes). Subsequently, the guest operating system passes this instruction to the file access API (e.g., an API named VFS_ReadFile) within the virtual file device driver for processing. Upon receiving the instruction, the API first parses the operation type, identifying it as a read operation; then, it parses the file path in the instruction to locate the storage location of the target file " / data / example.txt". After determining the file path, the VFS_ReadFile API subdivides the read operation into multiple sub-operations based on the requested block size. For example, if the target file size is 12288 bytes, the API divides the read request into three sub-operations: READ / data / example.txt 04096, READ / data / example.txt 40964096, and READ / data / example.txt 81924096, until the file is completely read. Each operation instruction specifies the starting position of the read and the amount of data to be read. After completing the above operations, the VFS_ReadFile API returns the generated access operation sequence to the guest operating system in a predefined structure (such as an array or linked list) for subsequent calls, thereby achieving effective communication and data interaction with the host system.

[0054] Step S13: The virtual machine performs corresponding file sharing operations on the host files in the host system based on the access operation sequence in the virtual file device.

[0055] In one embodiment of the present invention, after the access operation sequence is written into the virtual file device in the virtual machine, the following operations are performed: the virtual file device identifies the access operation sequence stored in the register to extract the access type of the host system; the virtual file device calls the corresponding API through a predefined protocol according to the identified host system access type to establish a connection with the host system.

[0056] In this embodiment, the virtual file device register is used to temporarily store these access operation sequences. Each file operation initiated by the guest operating system corresponds to a specific record, such as the operation type, target file, and operation timestamp. This data is written into the register for future processing. Once the operation sequence is recorded in the virtual file device register, the virtual file device can extract the access type by parsing and analyzing these records. This typically involves analyzing the stored data format, such as JavaScript Object Notation (JSON), Extensible Markup Language (XML), or other structures, to obtain the operation type (read, write, etc.), file path, and other relevant parameters. The identification process relies on data processing algorithms to detect the access patterns stored in the register. The system will apply pattern recognition or data analysis techniques to confirm file access behavior by analyzing historical operation records. Preferably, if the records show that the same file has been read multiple times, the system will mark that file as a frequently accessed file. The operation types in the access operation sequence include, but are not limited to: read operations, write operations, append operations, delete operations, permission modification operations, move or rename operations, etc.

[0057] In one embodiment of the present invention, before the initial file sharing operation between the guest operating system and the host system, the virtual file device performs a file sharing operation on a target file in the host system, which further includes the following steps: the virtual file device obtains a handle file from the host system and sends the handle file to the guest operating system; the guest operating system performs subsequent file sharing operations with the host system based on the handle file.

[0058] In this embodiment, before the initial file sharing operation between the guest operating system and the host system, the virtual file device performs the following steps to ensure successful file sharing: First, the virtual file device obtains a handle file of the target file from the host system. This handle file is an identifier used to represent and manage the file. Next, the virtual file device sends the obtained handle file to the guest operating system. After receiving the handle file, the guest operating system uses it to perform subsequent file sharing operations with the host system. This mechanism ensures that the guest operating system can correctly access and manipulate the target file in the host system, while maintaining the effectiveness and reliability of the file sharing process.

[0059] A handle file is a unique identifier assigned to a file by the operating system when it is opened. This identifier is used to track and manage operations associated with that file, such as reading, writing, or closing it. By using this handle, direct interaction with the underlying storage device can be avoided; instead, instructions are sent to the operating system through the handle to indirectly complete file operations. This not only simplifies the file operation process but also ensures effective resource management and protection, preventing file misuse or conflicts.

[0060] It should be noted that, in the embodiments of this application, the words "exemplary" or "for example" indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0061] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0062] Figure 2 is a schematic block diagram of a host system file data sharing device 200 provided in an embodiment of this application. As shown in Figure 2, the system includes a guest operating system 201, a virtual machine 202, and a host system 203.

[0063] Guest operating system 201: After receiving a file access instruction, it converts the file access instruction into an access operation sequence and writes the access operation sequence into the virtual machine;

[0064] Virtual machine 202: Used to perform corresponding file sharing operations on host files in the host system based on the access operation sequence;

[0065] Host system 203: Used to deploy the virtual machine and deploy a guest operating system in the virtual machine.

[0066] It should be understood that the specific process of each module performing the above-mentioned steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.

[0067] It should also be understood that the module division in the embodiments of this application is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0068] Figure 3 is a schematic block diagram of an electronic terminal provided in an embodiment of this application. As shown in Figure 3, the electronic terminal includes at least one processor 301, a memory 302, at least one network interface 303, and a user interface 305. The various components in the device are coupled together via a bus system 304. It is understood that the bus system 304 is used to implement communication between these components. In addition to a data bus, the bus system 304 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as a bus system in Figure 3.

[0069] The user interface 305 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.

[0070] It is understood that memory 302 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.

[0071] In this embodiment of the invention, the memory 302 is used to store various types of data to support the operation of the electronic terminal 300. Examples of this data include: any executable program for operation on the electronic terminal 300, such as the operating system 3021 and application programs 3022; the operating system 3021 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. The application program 3022 may contain various applications, such as a media player, browser, etc., for implementing various application services. The host system file data sharing method provided in this embodiment of the invention can be included in the application program 3022.

[0072] The methods disclosed in the above embodiments of the present invention can be applied to processor 301, or implemented by processor 301. Processor 301 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 301 or by instructions in the form of software. The processor 301 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 301 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 301 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.

[0073] In an exemplary embodiment, the electronic terminal 300 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to perform the aforementioned method.

[0074] According to the method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to execute the host system file data sharing method of any of the embodiments shown above.

[0075] According to the method provided in the embodiments of this application, this application also provides a computer-readable storage medium storing program code, which, when run on a computer, causes the computer to execute the host system file data sharing method of any of the embodiments shown above.

[0076] As used in this specification, the terms "component," "module," "system," etc., are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process and / or an execution thread, and components may be located on a single computer and / or distributed among two or more computers. Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).

[0077] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0078] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0079] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0080] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0082] In the above embodiments, the functions of each functional unit can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. A computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs, DVDs), or semiconductor media (e.g., solid-state drives, SSDs, etc.).

[0083] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0085] In summary, this application provides a method, apparatus, medium, program product, and terminal for sharing file data within a host system. This invention provides a method for improving the efficiency of file data sharing within a host system by providing upper-layer software modules with efficient access to host system files through a virtual file device in the client system. This device interacts with the driver through a register interface. The register describes various information related to the access operation, including the operation type and its operands. When the client system receives a file access request, it uses the corresponding API to convert the request into a specific access operation sequence for the virtual file device, enabling the client system to execute programs and access host system files as needed. This achieves efficient file access in environments lacking traditional file systems, especially on virtual devices without network support. It breaks through the dependence on traditional network protocols, significantly improving data transmission performance and efficiency, and ensuring smooth file access in network-free environments. Therefore, this application effectively overcomes the various shortcomings of existing technologies and has high industrial applicability.

[0086] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for sharing file data in a host system, characterized in that, The data sharing method includes: Deploy a virtual machine on the host system, and deploy a guest operating system in the virtual machine; After receiving a file access instruction, the guest operating system converts the file access instruction into an access operation sequence through the virtual file device driver in the guest operating system, and writes the access operation sequence into the virtual file device in the virtual machine. The virtual machine performs corresponding file sharing operations on the host files in the host system based on the access operation sequence in the virtual file device.

2. The host system file data sharing method according to claim 1, characterized in that, The process of deploying a virtual machine on a host system and deploying a guest operating system on the virtual machine further includes the following steps: the host system deploys a virtual file device to the virtual machine and installs the virtual file device driver on the guest operating system.

3. The host system file data sharing method according to claim 2, characterized in that, The process by which the guest operating system writes the access operation sequence into the virtual machine includes: the guest operating system sending the access operation sequence to the virtual file device and storing it in the register of the virtual file device through the register interface of the virtual file device.

4. The host system file data sharing method according to claim 3, characterized in that, After the access operation sequence is written to the virtual file device in the virtual machine, the following operations are also performed: The virtual file device identifies the access operation sequence stored in the register to extract the access type of the host system; The virtual file device establishes a connection with the host system by calling the corresponding API through a predefined protocol based on the identified host system access type.

5. The host system file data sharing method according to claim 4, characterized in that, The access types include one or more of the following: fetch operation, write operation, append operation, delete operation, permission modification operation, move operation, and rename operation.

6. The host system file data sharing method according to claim 2, characterized in that, After receiving a file access instruction, the client operating system converts the file access instruction into an access operation sequence, which includes: converting the file access instruction into an access operation sequence that matches the host system through the file access API inside the virtual file device driver.

7. The host system file data sharing method according to claim 6, characterized in that, The process of translating the file access instructions into a sequence of access operations that matches the host system includes: The file access instructions are parsed to generate the access type, file path, and data block size; The access type, file path, and data block size are structured to generate structured instructions; The structured instructions are sent to the file access API inside the virtual file device driver to generate operation commands for multiple sub-operations; The access operation sequence is generated based on operation commands that include multiple sub-operations.

8. The host system file data sharing method according to claim 2, characterized in that, Before the initial file sharing operation between the guest operating system and the host system, the virtual file device performs the following steps to share a target file on the host system: The virtual file device obtains a handle file from the host system and sends the handle file to the guest operating system; The client operating system performs subsequent file sharing operations with the host system based on the handle file.

9. The host system file data sharing method according to claim 8, characterized in that, A handle file is an identifier used to identify and manage the target file.

10. The host system file data sharing method according to claim 1, characterized in that, The process of deploying a virtual machine on a host system and deploying a guest operating system on the virtual machine includes: Install a virtualization platform on the host system, create the virtual machine on the virtualization platform, and configure its resources. Deploy the guest operating system in the virtual machine using an ISO image.

11. The host system file data sharing method according to claim 10, characterized in that, The virtualization platform includes any of the following: KVM, VMware, VirtualBox.

12. A host system file data sharing device, characterized in that, The device includes: Guest operating system: After receiving a file access instruction, it converts the file access instruction into an access operation sequence and writes the access operation sequence into the virtual machine; Virtual machine: Used to perform corresponding file sharing operations on host files in the host system based on the access operation sequence; Host system: Used to deploy the virtual machine and deploy the guest operating system in the virtual machine.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the host system file data sharing method according to any one of claims 1 to 11.

14. A computer program product, characterized in that, The computer program product includes computer program code, which, when run on a computer, enables the computer to implement the host system file data sharing method as described in any one of claims 1 to 11.

15. An electronic terminal, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the host system file data sharing method according to any one of claims 1 to 11.