WO2023201638A1 - Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible - Google Patents

Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible Download PDF

Info

Publication number
WO2023201638A1
WO2023201638A1 PCT/CN2022/088239 CN2022088239W WO2023201638A1 WO 2023201638 A1 WO2023201638 A1 WO 2023201638A1 CN 2022088239 W CN2022088239 W CN 2022088239W WO 2023201638 A1 WO2023201638 A1 WO 2023201638A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
storage module
storage space
cloud
module
Prior art date
Application number
PCT/CN2022/088239
Other languages
English (en)
Chinese (zh)
Inventor
裴鸿刚
秦涛
司马云瑞
邵俊骏
张文
葛世飞
虎跃
Original Assignee
宇龙计算机通信科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宇龙计算机通信科技(深圳)有限公司 filed Critical 宇龙计算机通信科技(深圳)有限公司
Priority to PCT/CN2022/088239 priority Critical patent/WO2023201638A1/fr
Publication of WO2023201638A1 publication Critical patent/WO2023201638A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9035Filtering based on additional data, e.g. user or group profiles

Definitions

  • the present application relates to the field of computer technology, and more specifically, to a file operating method, device, computer equipment and readable storage medium.
  • Embodiments of the present application provide a file operation method, device, computer equipment, and readable storage medium, which can improve the storage of files in the computer equipment and enhance the user's experience in using the computer equipment.
  • a file operation method is provided.
  • the operation method is applied to the kernel of the computer device, and the operation method includes: obtaining a relocation command of the file; according to the relocation command, accessing the storage where the file is located in the local storage module of the computer device. space; move the file from the local storage module to the cloud storage module; write the relocation mark of the file in the local storage module; obtain the operation command of the file; access the local storage module of the computer device according to the operation command; check in the local storage module The relocation mark of the file; operate the files in the cloud storage module according to the operation command.
  • the kernel of the computer device can move the files in the local storage module to the cloud storage module, which not only improves the storage capacity of the computer device, but also saves the storage space in the local storage module and ensures local storage.
  • the module has relatively sufficient remaining storage space, which will not cause lag in the computer equipment and improves the user's experience in using the computer equipment.
  • the computer's kernel can still check the file's relocation mark in the local storage module according to the unified operation command, and further implement operations on the files in the cloud storage module.
  • the entire technical solution can maintain the native user space of the computer device, does not involve native service changes in the user space, and avoids the need to distinguish the location of files in the user space, thus improving the user experience of the computer device.
  • relocating the file from the local storage module to the cloud storage module includes: encapsulating the file data of the file into a network data packet, and sending the network data packet to the cloud storage module; releasing the file in the local storage module The storage space where the file data is located.
  • network protocols such as HTTP protocols
  • the files are The file data is encapsulated into network data packets and sent to the cloud storage module, which can reduce the frequency of switching between user space and kernel space, thereby improving the access speed of the computer device to the cloud storage module.
  • the local storage module includes: bitmap storage space, file inode storage space and block storage space; wherein, releasing the storage space where the file data of the file is located in the local storage module includes: in the file inode In the storage space, the pointer pointing to the block storage space of the file is truncated to zero; in the bitmap storage space, the bitmap identifier corresponding to the block storage space of the file is set to the target value to release the file data location of the file. of storage space.
  • writing the relocation mark of the file in the local storage module includes: writing the relocation mark of the file in the inode storage space of the file.
  • the relocation mark of the file may be stored in the inode storage space of the file.
  • this technical solution is relatively simple to implement and has high reliability. It can release the original space of the local storage module and does not occupy other spaces of the local storage module.
  • the kernel can also easily check the relocation mark stored in the inode storage space according to the user's operation command, which is beneficial to the user's subsequent operations on the file.
  • the operation method further includes: retaining part of the original metadata of the file in the inode storage space of the file.
  • the original metadata of part of the file is retained in the inode storage space of the file, which can facilitate the subsequent kernel to perform more accurate operations on the file based on the original metadata without generating errors.
  • the file processing performance of the computer device can be improved, thereby improving the user's experience of using the computer device.
  • the local storage module includes: bitmap storage space, file inode storage space and block storage space; wherein, releasing the storage space where the file data of the file in the local storage module is located includes: in the bitmap storage In the space, set the bitmap identifier corresponding to the inode storage space of the file and the bitmap identifier corresponding to the block storage space to the target value to release the storage space where the file data of the file is located.
  • writing the relocation mark of the file in the local storage module includes: creating a new file in the local storage module, the file name of the new file is the same as the file name of the file, and/or, the new file's The file path is the same as the file path of the file; the relocation mark of the file is written in the inode storage space or block storage space of the new file.
  • the operation method further includes: writing the original metainformation data of part of the file in the inode storage space of the new file, where the original metainformation data is Meta information data of the file before file data migration.
  • a new file with the same file name and/or file path as the original file is created in the local storage module.
  • the kernel can operate according to the user's operation command.
  • the file name and/or file path is used to access the storage space where the new file is located in the local storage module to check the relocation mark in the storage space and perform subsequent operations based on the relocation mark to improve the user's experience in using computer equipment.
  • obtaining the file relocation command includes: obtaining the file relocation command sent by the filtering module, where the filtering module is located in the user space of the computer device, and the files are filtered by the filtering module in the local storage module.
  • a filtering module is provided in the user space of the computer device.
  • the filtering module does not need to occupy valuable kernel space, and the filtering module can regularly or irregularly filter files in the local storage module.
  • the computer device can automatically relocate the files in the local storage module without requiring user intervention at all to ensure that the local storage module has sufficient storage space, allowing the user to have a better experience using the computer device. .
  • the screening module is a neural network module.
  • the neural network module can play a good screening role in the files in the local storage module according to specific needs.
  • the files include: files whose access frequency is less than a preset frequency, and/or files whose file size is less than a preset size.
  • files whose access frequency is less than the preset frequency and/or files whose file size is less than the preset size are moved to the cloud storage module will not affect the user's ability to access files with higher access frequency in the local storage module.
  • File access can also greatly increase the remaining storage space of the local storage module to further enhance the user's experience in using computer equipment.
  • the local storage module includes: the index node inode storage space of the file, and the inode storage space is used to store meta information data and relocation tags of the file; wherein, according to the operation command, the local storage module of the computer device is accessed, Including: according to the operation command, access the inode storage space of the file in the local storage module.
  • the kernel can normally access the local storage module according to the file operation command, and the file operation processing will not fail due to the relocation of the file data causing the kernel to be unable to access the local storage module according to the file operation command.
  • the local storage module includes: a file's inode storage space and a block storage space.
  • the file's inode storage space is used to store meta information data of the file
  • the file's block storage space is used to store relocation markers; where , according to the operation command, access the local storage module of the computer device, including: according to the operation command, access the inode storage space of the file in the local storage module to read the meta information data of the file; according to the meta information data, access the block storage space of the file.
  • the block storage space of the file can also be used to store the relocation mark. And even if the file data of the file has been moved to the cloud storage module, the inode storage space and blcok storage space of the file are still retained in the local storage module, and the metadata of the file is stored in the inode storage space. Therefore, the kernel can normally access the file according to the operation command, and the file operation processing will not fail due to the relocation of the file data causing the kernel to be unable to access the local storage module according to the file operation command.
  • the kernel has a file structure corresponding to the file; operating the file in the cloud storage module according to the operation command includes: according to the operation command, calling the cloud operation function corresponding to the operation command, where the cloud operation function Includes a pointer to the file structure; encapsulates the file information in the file structure into a request command network data packet according to the pointer to the file structure; sends the request command network data packet to the cloud storage module to operate the cloud storage module files in .
  • the interaction between the kernel and the cloud storage module is realized using the file information in the file structure and the call of the cloud operation function.
  • the implementation method is highly reliable and has little impact on the native kernel system.
  • network protocols such as the HTTP protocol, are implemented in the core of the computer device, and the The file information in the file structure is encapsulated into request command network data packets, which can reduce the frequency of switching between user space and kernel space, thereby improving the access speed from computer equipment to cloud storage modules.
  • the kernel also has a file operation structure corresponding to the file.
  • the operation method Before calling the cloud operation function corresponding to the operation command according to the operation command, the operation method also includes: converting the operation function in the file operation structure Set as a cloud operation function; according to the operation command, call the cloud operation function corresponding to the operation command, including: according to the operation command, in the file structure, call the cloud operation function corresponding to the operation command.
  • the operation function in the file operation structure corresponding to the file can be set as the cloud operation function, thereby facilitating subsequent calls to the cloud operation function.
  • Operate files in the cloud storage module This implementation has high reliability and has little impact on the native kernel system.
  • the operation command includes: a read command
  • the cloud operation function includes: a cloud read function
  • the cloud read function includes: a pointer to the file structure and a pointer to the cache of the computer device; wherein, according to the cloud operation
  • the function encapsulates the file information in the file structure into a request command network data packet, and sends the request command network data packet to the cloud storage module to operate the files in the cloud storage module, including: according to the file structure pointed to in the cloud read function
  • the pointer encapsulates the file information in the file structure into a read request network data packet; sends the read request network data packet to the cloud storage module; receives the file network data packet sent by the cloud storage module; parses the file network data packet to Read the file data of the file.
  • the kernel can directly read the file data stored in the cloud storage module, and does not need to cooperate with the user space and kernel space to read the data in the cloud storage module. . Therefore, through the technical solution of this embodiment, the frequency of switching between user space and kernel space can be reduced, thereby increasing the access speed of the computer device to the cloud storage module, thereby increasing the reading speed of file data in the cloud storage module to improve User experience with computer equipment.
  • parsing the file network data packet to read the file data of the file includes: parsing the file network data packet to obtain the file data of the file; and according to the pointer to the cache of the computer device in the cloud read function. , store the file data in the cache to read the file data.
  • the kernel can directly store the file data stored in the cloud storage module into the cache of the computer device to read the file data to the user without downloading the file data to the local storage module.
  • file data can be read from the local storage module. Therefore, through the technical solution of this embodiment, on the one hand, it can save the storage space in the local storage module, on the other hand, it can also further improve the speed at which users read file data from the cloud storage module, so as to further improve the user's ability to use the computer. Device usage experience.
  • the operation command includes: a delete command
  • the cloud operation function includes: a cloud delete function
  • the cloud delete function includes: a pointer to the file structure
  • the file structure is The file information is encapsulated into a request command network data packet, and the request command network data packet is sent to the cloud storage module to operate the files in the cloud storage module, including: according to the pointer to the file structure in the cloud delete function, the file structure is The file information is encapsulated into a deletion request network data packet; the deletion request network data packet is sent to the cloud storage module to delete the file data of the file in the cloud storage module.
  • the kernel can directly delete the file data stored in the cloud storage module, and does not need to cooperate with the user space and the kernel space to delete the data in the cloud storage module.
  • the frequency of switching between user space and kernel space can be reduced, thereby increasing the access speed of computer equipment to the cloud storage module, thereby increasing the deletion speed of file data in the cloud storage module, so as to improve the user's access to the cloud storage module.
  • a second aspect provides a file operating device, including: a processor and a memory, the memory is used to store a program, and the processor is used to call and run the program from the memory to execute the first aspect or any of the possible methods in the first aspect. How to operate files in the embodiment.
  • a computer device including: a file operating device as provided in the second aspect.
  • a fourth aspect provides a computer-readable storage medium, including a computer program.
  • the computer program When the computer program is run on a computer, it causes the computer to perform the file operation method as in the first aspect or any possible implementation of the first aspect. .
  • Figure 1 is a schematic frame diagram of a computer device provided by an embodiment of the present application.
  • Figure 2 is another schematic frame diagram of a computer device provided by an embodiment of the present application.
  • Figure 3 is a schematic flow chart of a file operation method provided by an embodiment of the present application.
  • Figure 4 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 5 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 6 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 7 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 8 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 9 is a schematic flow chart of another file operation method provided by an embodiment of the present application.
  • Figure 10 is a schematic flow chart of another file operation method provided by an embodiment of the present application.
  • Figure 11 is a schematic flow chart of another file operation method provided by the embodiment of the present application.
  • Figure 12 is a schematic structural block diagram of a file operating device provided by an embodiment of the present application.
  • Figure 13 is a schematic frame diagram of another computer device provided by an embodiment of the present application.
  • Figure 14 is a schematic structural block diagram of a file operating device provided by an embodiment of the present application.
  • Figure 15 is a schematic frame diagram of another computer device provided by an embodiment of the present application.
  • Figure 16 is a schematic structural block diagram of another file operating device provided by an embodiment of the present application.
  • Figure 17 is a schematic structural block diagram of another file operating device provided by an embodiment of the present application.
  • the file operation method provided by the embodiment of the present application can be applied to computer equipment.
  • the computer device is a handheld device such as a smartphone, or a terminal device such as a personal computer, which is not particularly limited in this application.
  • the execution subject of the file operation method provided by the embodiment of the present application may be a computer device, or a functional module in the computer device.
  • Figure 1 shows a schematic framework diagram of a computer device 1 provided by an embodiment of the present application.
  • the computer device 1 includes: a hardware layer 10 , an operating system layer 20 running on the hardware layer 10 , and an application layer 30 running on the operating system layer 20 .
  • the hardware layer 10 includes hardware such as processors, memory, and external storage.
  • the operating system layer 20 is any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system or Windows operating system, etc.
  • the application layer 30 includes application programs such as browsers, address books, word processing software, and instant messaging software.
  • the operating system layer 20 includes a kernel (Kernel) 201, which is the core of the operating system layer 20 and is responsible for managing the system's processes, memory, device drivers, files, network systems, etc., and determines the performance and stability of the system.
  • the kernel 201 is a bridge connecting the application layer 30 and the hardware layer 10 .
  • Figure 2 shows another schematic frame diagram of the computer device 1 provided by the embodiment of the present application.
  • the application program (Application, APP) 301 is a computer program in the application layer 30. It is located in the user space (User Space) of the computer device 1 and can be used and designed by the user.
  • User Space User Space
  • the kernel 201 in the operating system layer 20 is located in the kernel space (Kernel Space) of the computer device 1 .
  • the kernel 201 is independent of user-level applications.
  • the kernel 201 has access to protected memory space and has full access to underlying hardware devices.
  • the operating system layer 20 generally forces user processes not to directly operate the kernel 201.
  • the kernel 201 may include: a system call interface (System Call Interface, SCI) 210, a memory management unit (Memory Management Unit, MMU) 220, a process management program 230, and a virtual file system (Virtual File).
  • SCI System Call Interface
  • MMU memory Management Unit
  • MMU memory Management Unit
  • VFS Virtual File System
  • File System, FS file system
  • DDR Device Driver
  • the system call interface (SCI) 210 provides an interface for user space to access the kernel space.
  • SCI system call interface
  • the memory management unit (MMU) 220 is used to control data interaction between the memory and the processor in the computer device 1 . Specifically, the MMU 220 receives a memory access request from the processor and controls access to the memory based on the memory access request.
  • the process management program 230 is a program that manages multiple processes in the operating system.
  • the process management program 230 can be used to implement various functions such as process scheduling, interrupt processing, signal/process priority, context switching, process status management, and progress memory management.
  • the virtual file system (VFS) 240 is an intermediate processing system between the file system (FS) 250 and the system call interface (SCI) 210.
  • the computer device 1 can support multiple different types of file systems.
  • the FS 250 can include: EXT2, EXT3, EXT4, F2FS, rootfs, proc and other types of file systems. .
  • VFS 240 hides the specific details of the hardware of different file systems, separates file system operations from the specific hardware implementation of different file systems, and provides a unified interface for all devices.
  • Device driver 260 is one of the main parts of kernel 201.
  • the device driver 260 actually controls the interaction between the operating system layer 20 and the hardware layer 10 .
  • the device driver 260 is also used to complete specific operation details related to the hardware devices in the hardware layer 10.
  • the device driver 260 is related to the control chip of the hardware device.
  • the kernel 201 in the operating system layer 20 and the application program in the application layer 30 are both software modules in the computer device 1, which are specifically implemented as computer programs (or also called computer programs). code).
  • the hardware layer 10 of the computer device 1 needs to include at least one processor 110 .
  • the hardware layer 10 may also include memories such as a memory 120 and an external memory 130.
  • the function of the processor 110 is mainly to interpret instructions of the computer program and process data in the computer program.
  • the instructions of the computer program and the data in the computer program can be stored in the memory 120 and/or the external memory 130 of the computer device 1 .
  • the processor 110 may be an integrated circuit chip with signal processing capabilities.
  • the processor 110 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or a field programmable gate array. , FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • the general-purpose processor is a microprocessor or the like.
  • the processor 110 is a central processing unit (CPU).
  • Each processor 110 includes at least one processing unit.
  • this processing unit is also called a core and is the most important component of the processor. All calculations, receiving commands, storing commands, and processing data of the processor 110 are performed by the core.
  • each processor 110 also includes a cache, which is a buffer for data exchange. When the processing unit wants to read data, it will first search the required data from the cache. If it is found, it will be executed directly. If it is not found, it will be searched from the memory. Since cache runs much faster than memory, the purpose of the cache is to help the processing unit run faster.
  • the memory 120 is also called main memory, and is used to temporarily store operation data in the processor 110 and data exchanged with the external memory 130 . There is a fast data reading and writing speed between the memory 120 and the processor 110 .
  • the memory 120 can provide running space for processes in the computer device 1.
  • the memory 120 stores computer programs for generating processes. After the computer program is run by the processor 110 to generate a process, the processor 110 allocates corresponding storage space for the process in the memory 120 .
  • the memory 120 stores data generated during the running of the process, such as intermediate data, process data, etc., in the storage space corresponding to the above-mentioned process.
  • the memory 120 may be a volatile memory.
  • the volatile memory may be random access memory (Random Access Memory, RAM).
  • RAM Random Access Memory
  • many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), and the like.
  • the external memory 130 can also be called auxiliary memory, which refers to the memory in the computer device 1 except the memory 120 and cache.
  • the external memory 130 can be a memory that can still save data after power is turned off.
  • the external memory 130 can have a relatively large capacity and can store file data such as pictures, videos, text, and application programs in the computer device 1 to meet the user's needs.
  • the external storage 130 can be a non-volatile memory, a magnetic disk, an optical disk, a U disk (also called a USB flash disk) or a Secure Digital Memory Card (SD Card) etc.
  • the non-volatile memory may include at least one of the following memories: read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory ( Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) and flash memory (FLASH).
  • the disk can be a hard disk (Hard Disk) or a floppy disk (Soft Disk).
  • the hard disk can include: solid state drive (Solid State Drive, SSD), hybrid hard drive (Hybrid Hard Drive, HHD) and mechanical hard drive (Hard Disk Drive, HDD) and so on.
  • the computer device 1 in the embodiment of the application includes various software modules or hardware modules in computer systems in the prior art.
  • the computer device 1 also includes: communication devices, sensor devices, peripheral devices with various functions, and so on.
  • the storage space of the memory 120 mainly affects the running speed of the computer device 1. Therefore, the memory 120 can also be called "operation memory”.
  • the storage space of the external memory 130 mainly affects the ability of the computer device 1 to store file data.
  • the storage space of the external memory 130 can be understood as the storage space in the computer device 1 for storing file data.
  • the computer device 1 when the computer device 1 is a mobile phone, its external memory 130 may be a non-volatile memory, such as FLASH and so on.
  • the non-volatile memory is arranged inside the computer device 1. Due to various factors such as manufacturing cost, the storage space of the non-volatile memory has certain limitations. As the use time of mobile phones increases, more and more files are stored in the non-volatile memory. The remaining storage space of the non-volatile memory is insufficient, which will cause the phone to freeze, thus affecting the user's use of the phone. experience.
  • the computer device 1 may also be other types of devices, and the external memory 130 may also be other types of memories. Regardless of the type of memory, as the usage time increases, it will face insufficient storage space, resulting in a poor user experience with the computer device 1 .
  • embodiments of the present application provide a file operation method, which can solve the problem of insufficient storage space of the computer device and poor user experience.
  • FIG. 3 shows a schematic flow chart of a file operation method 300 provided by an embodiment of the present application.
  • the operating method 300 is applied to the kernel of the computer device.
  • the core may include core 201 shown in Figure 1 and/or Figure 2 above.
  • the operation method 300 may include the following steps.
  • S320 According to the relocation command, access the storage space where the file is located in the local storage module.
  • each of the above operation steps is executed by the kernel of the operating system in the computer device.
  • step S310 the kernel of the computer device obtains a relocation command of a certain file from the user space.
  • the relocation command can be used to instruct the file in the local storage module to be relocated to the cloud storage module.
  • the local storage module is a hardware module used to store files in the computer device.
  • the local storage module may be the external memory 130 in the embodiment shown in Figure 2 above.
  • the local storage module includes but is not limited to at least one of the following storage modules: non-volatile memory, disk , CD, USB flash drive or secure digital card.
  • the file used for relocation can be any file stored in the local storage module, or the file can also be a specific file stored in the local storage module.
  • the files used for relocation can be used to store different types of information, such as source programs or executable programs, digital or text data, photos, music, videos, etc.
  • the embodiment of this application does not limit the specific type of file.
  • the files used for relocation may include: files whose access frequency is less than a preset frequency, and/or files whose file size is less than a preset size.
  • files whose access frequency is less than the preset frequency, and/or files whose file size is less than the preset size, to the cloud storage module will not affect the user's access to files with higher access frequency in the local storage module. , and can also greatly increase the remaining storage space of the local storage module to further enhance the user's experience in using computer equipment.
  • the file relocation command may include: file information of the file, such as: file name and/or file path, etc.
  • the kernel accesses the storage space of the file in the local storage module based on the file information in the relocation command.
  • the storage space where the file is located includes: the storage space where metadata is located and the storage space where user data is located.
  • the user data of the file is also the real data of the file.
  • the user data of the file is also called the file data of the file.
  • the kernel accessing the storage space where the file in the local storage module is located can specifically be understood as accessing the storage space where the file data of the file in the local storage module is located.
  • the kernel may be used to migrate the file data of the file from the local storage module to the cloud storage module. Specifically, during this process, the file data of the file is copied to the cloud storage module, and the storage space storing the file data of the file in the local storage module is released, that is, the storage space originally storing the file data of the file can be used later. Store other data, such as file data that stores other files.
  • the cloud storage module is a network storage tool that can be connected and accessed by computer equipment through the network.
  • the cloud storage module can be a network disk or a cloud disk (Cloud Disk).
  • the cloud storage module has a large storage space, which can greatly expand the storage capacity of computer equipment and improve users' experience in using computer equipment.
  • the data transmission speed between computer equipment and cloud storage modules will become faster and faster, and file relocation between the local storage module of computer equipment and cloud storage modules will The speed will also be greatly improved without affecting users' access and use of files.
  • step S340 the kernel writes a relocation mark of the file in the local storage module.
  • the relocation mark is used to identify that the file data of the file has been relocated to the cloud storage module.
  • the user if the user needs to operate the file data of the file, he can first check the relocation mark of the file in the local storage module, and based on the check result of the relocation mark, the file in the cloud storage module Perform operations.
  • the kernel of the computer device can move the files in the local storage module to the cloud storage module, which not only improves the storage capacity of the computer device, but also saves the storage space in the local storage module and ensures local storage.
  • the module has relatively sufficient remaining storage space, which will not cause lag in the computer equipment and improves the user's experience in using the computer equipment.
  • the kernel after the kernel moves the file data of the file to the cloud storage module, the kernel also writes the file's relocation mark in the local storage module, so that when the user subsequently operates the file, the computer device can still operate according to the user's request.
  • the operation command accesses the local storage module, and performs normal operations on the files stored in the cloud storage module according to the relocation mark in the local storage module to further enhance the user's experience of using the computer device.
  • the file relocation command may not come from the user's operation, but may be automatically generated by the computer device itself.
  • a filtering module is provided in the user space of the computer device, and the files that are moved to the cloud storage module are filtered in the local storage module by the filtering module.
  • the filtering module is used to send the relocation command of the file to the kernel, so that the kernel obtains the relocation command of the file.
  • the filtering module can regularly or irregularly scan multiple files in the local storage module to continuously filter out files that need to be relocated, so that the local storage module always retains relatively sufficient storage space.
  • the screening module can be an Artificial Intelligence (AI) module, which can screen multiple files in the local storage module according to certain rules to obtain files that are more suitable for relocation to the cloud storage module.
  • AI Artificial Intelligence
  • the filtering module can be a neural network (Neural Networks) module, which can perform a good filtering effect on files in the local storage module according to specific requirements.
  • a filtering module is provided in the user space of the computer device.
  • the filtering module does not need to occupy valuable kernel space, and the filtering module can regularly or irregularly filter files in the local storage module.
  • the computer device can automatically relocate the files in the local storage module without requiring user intervention at all to ensure that the local storage module has sufficient storage space, allowing the user to have a better experience using the computer device. .
  • the above step S330 may include: encapsulating the file data of the file into a network data packet, sending the network data packet to the cloud storage module, and releasing the location of the file data of the file in the local storage module. of storage space.
  • the kernel can encapsulate the file data of the file into a network data packet according to the network protocol, and send the network data packet to the cloud storage module through the network.
  • the network protocol includes but is not limited to Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP).
  • the kernel After the kernel sends the network data packet to the cloud storage module, the kernel can identify the storage space that originally stored the file data of the file as available space to release the storage space.
  • network protocols such as HTTP protocols
  • HTTP protocols are implemented in the kernel of the computer device, and the files are The file data is encapsulated into network data packets and sent to the cloud storage module, which can reduce the frequency of switching between user space and kernel space, thereby improving the access speed of the computer device to the cloud storage module.
  • HTTP protocol can also be greatly compatible with existing cloud storage module products.
  • the local storage module includes: bitmap storage space, file index node (inode) storage space and block (block) storage space.
  • the inode space of the file is used to store the metadata of the file
  • the block storage space of the file is used to store the file data of the file
  • the bitmap storage space is used to record the usage of inode storage space of multiple files in the local storage module and Block storage space usage.
  • FIG. 4 shows a schematic flow chart of a file operation method 400 provided by an embodiment of the present application.
  • the operation method 400 may include the following steps.
  • S431 Encapsulate the file data of the file into a network data packet, and send the network data packet to the cloud storage module.
  • S433 In the bitmap storage space, set the bitmap identifier corresponding to the block storage space of the file to the target value to release the storage space where the file data of the file is located.
  • Step S410 and step S420 please refer to the related technical solutions of step S310 and step S320 in the embodiment described above.
  • Steps S431 to S432 may be an implementation manner of step S330 in the above-described embodiment.
  • Step S440 may be an implementation of step S340 in the above-described embodiment.
  • step S431 the file data of the file in the local storage module can be copied to the cloud storage module.
  • steps S432 to S433 the storage space originally used to store file data in the local storage module, that is, the block storage space of the file, can be released.
  • step S432 in the inode storage space of the file, a pointer to the block storage space of the file is stored.
  • the truncation function can be used to truncate the pointer to zero, or the pointer can be set to null.
  • the kernel will not obtain the wrong storage address of the file data based on this pointer.
  • bitmap identifier corresponding to the block storage space of the file is set to a target value, and the target value is used to indicate that the block storage space is free space.
  • step S440 since the block storage space of the file has been released, the relocation mark of the file is appropriately placed in the inode storage space of the file.
  • the inode storage space of the file in addition to storing the metadata of the file, the inode storage space of the file is also used to store the relocation mark of the file.
  • the block storage space can be realized effective release.
  • the file's relocation mark can be stored in the file's inode storage space.
  • this technical solution is relatively simple to implement and has high reliability. It can release the original space of the local storage module and does not occupy other spaces of the local storage module.
  • the kernel can also easily check the relocation mark stored in the inode storage space according to the user's operation command, which is beneficial to the user's subsequent operations on the file.
  • the operation method 400 may also include the following steps.
  • Part of the original metadata of the file is retained in the inode storage space of the file, where the original metadata is the metadata of the file before the file data is migrated.
  • all original metadata except the pointer to the block storage space of the file may be retained in the inode storage space of the file.
  • other parts of the original metadata other than the pointer to the block storage space of the file can be retained in the inode storage space of the file, such as: the number of bytes of the file, file reading and writing , execution permissions, etc.
  • the original metadata of part of the file is retained in the inode storage space of the file, which can facilitate the subsequent kernel to perform more accurate operations on the file based on the original metadata without generating errors.
  • the file processing performance of the computer device can be improved, thereby improving the user's experience of using the computer device.
  • the embodiment of the present application can also implement the relocation of file data and the writing of relocation marks in other ways.
  • the inode storage space of a file when the inode storage space of a file is insufficient, after releasing the original block storage space of the file, a new block storage space can be allocated for the file, and the relocation mark can be written into the new block storage space.
  • the new block storage space is smaller.
  • the new block storage space is one block storage space, thereby minimizing the size of the storage space occupied by the relocation mark in the local storage module.
  • the pointer pointing to the original block storage space in the file's inode storage space can be modified to point to the new block storage space.
  • the kernel can access the inode storage space of the file according to the user's operation command, and then access the new block storage space according to the pointer in the inode storage space, and check in the new block storage space.
  • the relocation mark of the file can be written in the local storage module, and the relocation mark occupies a small storage space, and can also save the storage space of the local storage module. storage.
  • Figure 5 shows a schematic flow chart of a file operation method 500 provided by an embodiment of the present application.
  • S531 Encapsulate the file data of the file into a network data packet, and send the network data packet to the cloud storage module.
  • S532 In the bitmap storage space, set the bitmap identifier corresponding to the inode storage space of the file and the bitmap identifier corresponding to the block storage space to the target value to release the storage space where the file data of the file is located.
  • S541 Create a new file in the local storage module.
  • the file name of the new file is the same as the file name of the file
  • the file path of the new file is the same as the file path of the file.
  • S542 Write the relocation mark of the file in the inode storage space or block storage space of the new file.
  • Steps S531 to S532 may be an implementation manner of step S330 in the above-described embodiment.
  • Steps S541 to S542 may be an implementation manner of step S340 in the above-described embodiment.
  • step S531 the file data of the file in the local storage module can be copied to the cloud storage module.
  • step S532 the storage space originally used to store the file data of the file (i.e., the block storage space of the file) in the local storage module can be released, and the storage space originally used to store the metadata of the file (i.e., the inode storage space of the file) can be released. ).
  • bitmap identifiers corresponding to the inode storage space and block storage space of the file are set to target values.
  • the target value is used to indicate that the inode storage space and block storage space are free spaces. .
  • a new file can be created in the local storage module.
  • the new file's The file name is the same as the file name of the file, and/or, the file path of the new file is the same as the file path of the file.
  • the kernel can access the storage space where the new file is located in the local storage module based on the file name and/or file path in the user's operation command.
  • the kernel will allocate a new inode storage space for the new file.
  • the size of the new inode storage space can be designed to be smaller.
  • the new inode storage space can be an inode. storage space to save the storage space occupied by new files in the local storage module.
  • the file's relocation mark can be written to the inode storage space of the new file.
  • the kernel can access the inode storage space of the new file in the local storage module based on the file name and/or file path in the user's operation command, and then check the relocation mark in the inode storage space.
  • the kernel can also allocate new block storage space for the new file.
  • the size of the new block storage space can also be designed. Smaller, for example: the new block storage space can be one block storage space.
  • the file's relocation mark can be written to the block storage space of the new file.
  • the kernel can access the inode storage space and block storage space of the new file in the local storage module based on the file name and/or file path in the user's operation command, and then check the relocation in the block storage space. mark.
  • the inode storage space and block storage space of the file can be effectively released.
  • This technical solution is also relatively simple to implement and has high reliability.
  • a new file with the same file name and/or file path as the original file is created in the local storage module.
  • the kernel can use the file name and/or file path in the user's operation command to path, access the storage space where the new file is located in the local storage module, check the relocation mark in the storage space, and perform subsequent operations based on the relocation mark to improve the user's experience in using computer equipment.
  • the operation method 500 may also include the following steps.
  • Part of the original metadata of the file is written in the inode storage space of the new file, where the original metadata is the metadata of the file before the file data is migrated.
  • all original metadata except the pointer to the block storage space of the file may be retained in the inode storage space of the new file.
  • other parts of the original metadata except the pointer to the block storage space of the file can be retained in the inode storage space of the new file, such as: the number of bytes of the file, the read of the file, Write, execute permissions, etc.
  • the original metadata of part of the file is retained in the inode storage space of the new file, which can facilitate the subsequent kernel to perform more accurate operations on the file based on the original metadata without generating errors.
  • the file processing performance of the computer device can be improved, thereby improving the user's experience of using the computer device.
  • the operation method for the kernel of the computer device to move files from the local storage module to the cloud storage module is introduced.
  • the kernel's operation method for this file during subsequent operations will be described.
  • the operation methods described in the following embodiments may be combined with the aforementioned operation methods 300 to 500.
  • the operation methods described in the following embodiments may be performed after the foregoing operation methods 300 to 500.
  • FIG. 6 shows a schematic flow chart of a file operation method 600 provided by an embodiment of the present application.
  • the operation method 600 is also applied to the kernel of the computer device.
  • the core may include core 201 shown in Figure 1 and/or Figure 2 above.
  • the file operation method 600 includes the following steps.
  • S640 Operate the file based on the inspection result of the relocation mark and the operation command.
  • step S610 the kernel of the computer device obtains the operation command of the file from the user space.
  • the operation command of the file may be an operation command formed by an application program in the user space according to the user's operation.
  • the operation commands of the file may include: read command, delete command, open command, etc.
  • the operation command of the file in order to implement operations on a file, in addition to indicating the operation type, may also include: file information used to indicate the file.
  • the file information may include: file name, file path, etc.
  • step S620 the kernel can access the local storage module of the computer device according to the file information in the operation command.
  • the kernel accesses the storage space used to store the file in the local storage module based on the file information in the operation command. For example, access the inode space used to store the metadata of the file in the local storage module, or the block space pointed to by the pointer in the metadata.
  • steps S630 to S640 the relocation mark of the file is checked in the local storage module. And operate the file according to the check result of the relocation mark and the operation command of the file.
  • the file data of the file is actually stored in the cloud storage module.
  • the file in the cloud storage module can be operated according to the operation command of the file.
  • the computer kernel can still check the relocation mark of the file in the local storage module according to the unified operation command, and further implement the relocation mark in the cloud storage module.
  • File operations. The entire technical solution can maintain the native user space of the computer device, does not involve native service changes in the user space, and avoids the need to distinguish the location of files in the user space, thus improving the user experience of the computer device.
  • the local storage module includes: an index node (inode) storage space of the file, and the inode storage space is used to store metadata of the file and a relocation mark.
  • index node inode
  • the local storage module may include: inode storage spaces for multiple files, each inode storage space has a corresponding inode number, and in each inode storage space, the corresponding file is stored. metadata.
  • the inode storage space where different files are located can be accessed according to the inode numbers corresponding to different files.
  • the metadata of the file includes at least one of the following information data: the number of bytes of the file, the identity of the file owner (User ID), the group ID of the file (Group ID), the read, write, and execution of the file. Permissions, file timestamp, number of links.
  • the inode storage space of the file can also be used to store relocation markers.
  • the relocation mark of the file is written into the inode storage space corresponding to the file.
  • FIG. 7 shows a schematic flow chart of a file operation method 700 provided by an embodiment of the present application.
  • the operation method 700 may include the following steps.
  • S740 Operate files in the cloud storage module according to the operation command.
  • step S710 please refer to the relevant description of step S610 in the above embodiment, which will not be described again here.
  • steps S720 to S740 are respectively an implementation manner of the above steps S620 to S640.
  • the file operation command may include file information indicating the file, such as file name or file path.
  • the kernel can access the inode storage space of the file in the local storage module based on the file information in the operation command.
  • steps S730 to S740 if a relocation mark is stored in the inode storage space, the file data indicating the file is stored in the cloud storage module, and the kernel operates the file in the cloud storage module according to the file operation command.
  • the kernel can normally access the local storage module according to the file operation command, and the file operation processing will not fail due to the relocation of the file data causing the kernel to be unable to access the local storage module according to the file operation command.
  • the relocation mark of the file is stored in the inode storage space of the file.
  • the local storage module includes: the index node (inode) storage space and block storage of the file. Space, the inode storage space is used to store file metadata, and the block storage space is used to store relocation markers.
  • the metadata stored in the inode storage space includes at least one of the following information data: the number of bytes of the file, the identity of the file owner (User ID), and the group ID of the file (Group ID) , the read, write, and execute permissions of the file, the timestamp of the file, the number of links, and the pointer to the block storage space.
  • FIG. 8 shows a schematic flow chart of a file operation method 800 provided by an embodiment of the present application.
  • the operation method 800 also applies to the kernel of the computer device.
  • the operation method 800 may include the following steps.
  • step S810 please refer to the relevant description of step S610 in the above embodiment, which will not be described again here.
  • this step S821 to step S822 is an implementation manner of the above step S620.
  • This step S830 to step S840 are respectively an implementation manner of the above step S630 to step S640.
  • the operation command of the file may include file information indicating the file
  • the kernel may access the inode storage space of the file in the local storage module based on the file information in the operation command.
  • the metainformation data in the inode storage space includes the storage location of the file data, that is, the location of the block storage space. According to the location of the block storage space, the block storage space of the file can be accessed.
  • steps S830 to S840 if a relocation mark is stored in the block storage space, the file data indicating the file is stored in the cloud storage module, and the kernel operates the file in the cloud storage module according to the file operation command.
  • the block storage space of the file can also be used to store the relocation mark. And even if the file data of the file has been moved to the cloud storage module, the inode storage space and blcok storage space of the file are still retained in the local storage module, and the metadata of the file is stored in the inode storage space. Therefore, the kernel can normally access the file according to the operation command, and the file operation processing will not fail due to the relocation of the file data causing the kernel to be unable to access the local storage module according to the file operation command.
  • the kernel after the file is opened by kernel execution, the kernel has a file structure (struct file) corresponding to the file, and the file structure includes file information of the file, such as: file permissions , file location, file access mode, etc.
  • FIG. 9 shows a schematic flow chart of a file operation method 900 provided by an embodiment of the present application.
  • the operation method 900 may be an implementation of step S840 or step S740 in the above embodiment.
  • the operation method 900 may include the following steps.
  • S930 Send the request command network data packet to the cloud storage module to operate the files in the cloud storage module.
  • the operation command may indicate the operation type.
  • the kernel calls the cloud operation function of the same type as the operation command. For example, when the operation command is a read command, the kernel calls the cloud read function corresponding to the read command.
  • step S920 the file information in the file structure can be obtained according to the pointer to the file structure in the cloud operation function. According to the file information, the corresponding file data can be found in the cloud storage module.
  • the file information pointed to in the cloud operation function can be encapsulated into a request command network data packet according to the network protocol.
  • the network protocol includes but is not limited to Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP).
  • HTTP Hyper Text Transfer Protocol
  • the cloud operation function is a cloud read function
  • the file information carried in the cloud read function can be encapsulated into a read request network packet.
  • step S930 the request command network data packet is sent to the cloud storage module through the wireless network.
  • the cloud storage module can operate the files in the cloud storage module according to the relevant information carried in the request command network data packet.
  • the file information in the file structure and the call of the cloud operation function are used to realize the interaction between the kernel and the cloud storage module.
  • the implementation method is highly reliable and has little impact on the native kernel system.
  • network protocols such as HTTP protocols
  • Encapsulating the file information in the file structure into request command network data packets can reduce the frequency of switching between user space and kernel space, thereby improving the access speed from computer equipment to cloud storage modules.
  • the use of HTTP protocol can also be greatly compatible with existing cloud storage module products, such as network disks or cloud disks.
  • the kernel in addition to the file structure, also has a file operation structure.
  • the file structure may also include: a pointer to a file operation structure, where the file operation structure includes: file operation functions.
  • the operation method 900 may further include: setting the operation function in the file operation structure as the cloud operation function.
  • step S910 can be specifically implemented as follows: according to the operation command, in the file operation structure, the cloud operation function corresponding to the operation command is called.
  • the operation function in the file operation structure corresponding to the file can be set as the cloud operation function, thereby facilitating subsequent calls to the cloud operation function.
  • Operate files in the cloud storage module This implementation has high reliability and has little impact on the native kernel system.
  • the above-mentioned process of setting the operation function in the file operation structure as the cloud operation function can be executed during the opening process of the file by the kernel.
  • the operation commands include: open command.
  • the kernel first opens the file according to the open command, and creates a file structure (struct file) corresponding to the file in the kernel. Then according to the pointer to the file operation structure in the file structure, the operation function in the file operation structure is set as the cloud operation function.
  • the kernel can access the storage space used to store the file in the local storage module according to the file information (file name and file path) in the open command to store the file in the storage Check the relocation mark in the space.
  • the kernel After the kernel opens the file according to the open command, the kernel returns the file descriptor (fd) corresponding to the file structure (struct file) in the kernel to the upper user space.
  • the user space operation command includes the file descriptor (fd) of the file, and the kernel will use the file structure corresponding to the file descriptor (fd). The body performs the corresponding operations on the file.
  • Figure 9 illustrates the kernel's method of operating files in the cloud storage module.
  • Figure 10 and 11 illustrates the kernel's method of reading and deleting files in the cloud storage module respectively.
  • Figure 10 shows a schematic flow chart of a file operation method 1000 provided by an embodiment of the present application.
  • the above-mentioned operation command includes: a read command
  • the above-mentioned cloud operation function includes: a cloud read function, wherein the cloud read function includes a pointer to a file structure and a pointer to a cache of the computer device.
  • the operation method 1000 may include the following steps.
  • S1020 Encapsulate the file information in the file structure into a read request network data packet.
  • S1030 Send the read request network data packet to the cloud storage module.
  • S1040 Receive the file network data packet sent by the cloud storage module.
  • S1050 Parse the file network data packet to obtain the file data of the file.
  • S1060 According to the pointer to the cache of the computer device in the cloud read function, store the file data in the cache to read out the file data.
  • the specific form of the read (read) command may be a read (read) function.
  • the read function carries a file descriptor (fd), and the file Descriptors have corresponding file structures.
  • the file structure has a pointer to a file operation structure, and the file operation structure has a plurality of different types of cloud operation functions.
  • the kernel calls the cloud read function in the file operation structure that is the same type as the read command. Further, the kernel reads the file data in the cloud storage module according to the cloud read function.
  • the kernel is configured to encapsulate the file information in the file structure into a read request network data packet, for example, a read request network data packet based on the HTTP protocol.
  • the cloud storage module can package the file data stored therein into a file network data packet according to the read request network data packet, and then send it back to the computer device through the network.
  • the kernel of the computer device parses the file network data packet to obtain the file data, and stores the file data in the cache of the computer device to read the file data to the user.
  • the cloud read function includes a pointer to the cache of the computer device, and the kernel stores the file data obtained from the cloud storage module in the cache based on the pointer.
  • the cloud read function may also include information related to the reading method, for example, each time to Information such as the size and offset of the file data stored in the cache.
  • the kernel can directly read the file data stored in the cloud storage module, and does not require the cooperation of user space and kernel space to read the data in the cloud storage module. Therefore, through the technical solution of this embodiment, the frequency of switching between user space and kernel space can be reduced, thereby increasing the access speed of the computer device to the cloud storage module, thereby increasing the reading speed of file data in the cloud storage module to improve User experience with computer equipment.
  • the kernel can directly store the file data stored in the cloud storage module into the cache of the computer device to read the file data to the user. There is no need to download the file data to the local storage module in order to read it from the local storage module. Read file data. Therefore, through the technical solutions of the embodiments of the present application, on the one hand, the storage space in the local storage module can be saved, and on the other hand, the speed at which users can read file data from the cloud storage module can be further improved, so as to further improve the user's access to file data. Experience using computer equipment.
  • Figure 11 shows a schematic flow chart of a file operation method 1100 provided by an embodiment of the present application.
  • the operation command includes a delete command
  • the cloud operation function includes a cloud delete function, where the cloud delete function includes a pointer to a file structure.
  • the operation method 1100 may include the following steps.
  • S1120 Based on the pointer to the file structure in the cloud delete function, encapsulate the file information in the file structure into a delete request network data packet.
  • S1130 Send the deletion request network data packet to the cloud storage module to delete the file data of the file in the cloud storage module.
  • step S1110 when the operation command includes: a delete command, its specific form may be a delete function.
  • the delete function carries a file descriptor (fd), and the file descriptor has a corresponding File pointer, which points to the file structure.
  • the file structure has a pointer to a file operation structure, and the file operation structure has a plurality of different types of cloud operation functions.
  • the kernel calls the cloud delete function in the file operation structure that is of the same type as the delete command. Further, the kernel deletes the file data in the cloud storage module according to the cloud deletion function.
  • the kernel is configured to encapsulate the file information in the file structure into a deletion request network data packet, for example, a deletion request network data packet based on the HTTP protocol.
  • the cloud storage module can delete the file data in the deletion request network data packet according to the deletion request network data packet.
  • the kernel can directly delete the file data stored in the cloud storage module, and does not require the cooperation of the user space and the kernel space to delete the data in the cloud storage module.
  • the frequency of switching between user space and kernel space can be reduced, thereby increasing the access speed of computer equipment to the cloud storage module, thereby increasing the deletion speed of file data in the cloud storage module, and further improving the user's access to the cloud storage module.
  • Figure 12 shows a schematic structural block diagram of a file operating device 1200 provided by an embodiment of the present application.
  • the operating device 1200 is located in the core of the computer device.
  • the operating device 1200 is located in the core 201 in the embodiment shown in FIG. 1 and/or FIG. 2 above.
  • the operating device 1200 includes: a first acquisition module 1210 and a relocation module 1220.
  • the first acquisition module 1210 is used to: acquire the relocation command of the file.
  • the relocation module 1220 is used to: access the storage space where the file is located in the local storage module according to the relocation command; relocate the file from the local storage module to the cloud storage module; and write the relocation mark of the file in the local storage module.
  • the relocation module 1220 is used to: encapsulate the file data of the file into network data packets, and send the network data packets to the cloud storage module; and release the storage space where the file data of the file is located in the local storage module.
  • the local storage module includes: bitmap storage space, file inode storage space and block storage space.
  • the relocation module 1220 is used to: in the inode storage space of the file, truncate the pointer pointing to the block storage space of the file to zero; in the bitmap storage space, truncate the pointer corresponding to the block storage space of the file to zero.
  • the bitmap flag is set to the target value to free up storage space where the file's file data resides.
  • a relocation mark of the file is written in the inode storage space of the file.
  • the relocation module 1220 is also configured to: retain the original metainformation data of part of the file in the inode storage space of the file, where the original metainformation data is the metainformation of the file before the file data is relocated. data.
  • the local storage module includes: bitmap storage space, file inode storage space and block storage space.
  • the relocation module 1220 is used to: in the bitmap storage space, set the bitmap identifier corresponding to the inode storage space of the file and the bitmap identifier corresponding to the block storage space to the target value to release the file data of the file. The storage space where it is located.
  • the relocation module 1220 is configured to: create a new file in the local storage module, the file name of the new file is the same as the file name of the file, and/or the file path of the new file is the same as the file name of the file. The path is the same; and the relocation mark of the file is written in the inode storage space or block storage space of the new file.
  • the relocation module 1220 is also configured to: write the original metainformation data of part of the file in the inode storage space of the new file, where the original metainformation data is the file data of the file before relocation. Meta information data.
  • the first acquisition module 1210 is used to: acquire the relocation command of the file sent by the filtering module, where the filtering module is located in the user space of the computer device, and the filtering module is used to retrieve multiple files in the local storage module. Filter to get files.
  • the above filtering module is a neural network module.
  • the files moved to the cloud storage module include: files whose access frequency is less than a preset frequency, and/or files whose file size is less than a preset size.
  • FIG. 13 shows a schematic structural diagram of the computer device 1300 where the operating device 1200 is located.
  • the computer device 1300 may include an application program 1301 and a kernel 1302 , where the application program 1301 is located in the user space of the computer device 1300 and the kernel 1302 is located in the kernel space of the computer device 1300 .
  • the computer device 1300 may also be configured with a local storage module 1305 and a cloud storage module 1304.
  • the local storage module 1305 can be the external storage 130 in the embodiment shown in FIG. 2
  • the cloud storage module 1304 includes but is not limited to a cloud disk or a network disk.
  • the kernel 1302 of the computer device 1300 includes each module in the operating device 1200 of the above embodiment, that is, the first acquisition module 1210 and the relocation module 1220.
  • the relocation module 1220 may include a relocation program 1221, which can call the local file system (FS) 1222 and the cloud file system 1224.
  • FS local file system
  • the relocation program 1231 calls the local file system (FS) 1222, and through the cooperation of the local file system (FS) 1222 and the device driver 1223, the file in the local storage module 1303 can be read.
  • the local file system 1222 and device driver 1223 may be the same as the file system 250 and device driver 260 shown in FIG. 2 above.
  • relevant descriptions of the local file system 1222 and the device driver 1223 can be found in technical solutions in related technologies, and will not be described again here.
  • the relocation program 1231 calls the cloud file system 1224, and through the cooperation of the cloud file system 1224 and the network protocol layer 1225, the file data read from the local storage module 1305 can be sent to the cloud storage module 1304.
  • the cloud file system 1224 can call a variety of different cloud operation functions
  • the network protocol layer 1225 can encapsulate data according to the network protocol and send the encapsulated data to the cloud storage module 1304.
  • Figure 14 shows a schematic structural block diagram of another file operating device 1400 provided by an embodiment of the present application.
  • the operating device 1400 is located in the core of the computer device.
  • the operating device 1400 is located in the core 201 in the embodiment shown in FIG. 1 and/or FIG. 2 above.
  • the operating device 1400 includes: a second acquisition module 1410, a checking module 1420 and an operating module 1430.
  • the second acquisition module 1410 is used to acquire the operation command of the file.
  • the checking module 1420 is used to access the local storage module of the computer device according to the operation command, and check the relocation mark of the file in the local storage module, where the relocation mark is used to indicate whether the file is moved from the local storage module to the cloud storage module.
  • the operation module 1430 is used to operate the file according to the check result of the relocation mark and the operation command.
  • the local storage module includes: an index node (inode) storage space of the file, and the inode storage space is used to store the metadata of the file and the relocation mark.
  • the checking module 1420 is configured to: access the inode storage space of the file in the local storage module according to the operation command, and check the relocation mark of the file in the inode storage space of the file.
  • the local storage module includes: file inode storage space and block storage space.
  • the file inode storage space is used to store file metadata
  • the file block storage space is used to store relocation markers.
  • the checking module 1420 is used to: according to the operation command, access the inode storage space of the file in the local storage module to read the metadata of the file; according to the metadata, access the block storage space of the file and store it in the block of the file. Check the file's relocation mark in the space.
  • the kernel has a file structure corresponding to the file; the operation module 1430 is used to: according to the operation command, call the cloud operation function corresponding to the operation command, wherein the cloud operation function includes a pointer to the file structure. Pointer; according to the pointer to the file structure, encapsulate the file information used to indicate the file in the file structure into a request command network data packet; send the request command network data packet to the cloud storage module to operate the file in the cloud storage module .
  • the kernel also has a file operation structure corresponding to the file.
  • the checking module 1420 is also used to: set the operation function in the file operation structure as a cloud operation function; the operation module 1430 is used to set the operation function according to the operation command. , in the file structure, call the cloud operation function corresponding to the operation command.
  • the operation command includes: a read command
  • the cloud operation function includes: a cloud read function.
  • the cloud read function includes: a pointer to the file structure and a pointer to the cache of the computer device; the operation module 1430 is used to: according to the cloud
  • the pointer to the file structure in the read function encapsulates the file information in the file structure into a read request network data packet; sends the read request network data packet to the cloud storage module; receives the file network data packet sent by the cloud storage module; File network packets are parsed to read out the file's file data.
  • the operation module 1430 is configured to: parse the file network data packet to obtain the file data of the file; store the file data in the cloud read function according to the pointer to the cache of the computer device. cache to read file data.
  • the operation command includes: a delete command
  • the cloud operation function includes: a cloud delete function
  • the cloud delete function includes: a pointer to the file structure
  • the operation module 1430 is used to: point to the file structure according to the cloud delete function
  • the pointer encapsulates the file information in the file structure into a deletion request network data packet; sends the deletion request network data packet to the cloud storage module to delete the file data of the file in the cloud storage module.
  • FIG. 15 shows a schematic frame diagram of the computer device 1500 where the operating device 1400 is located.
  • the computer device 1500 may include an application program 1501 and a kernel 1502 , where the application program 1501 is located in the user space of the computer device 1500 and the kernel 1502 is located in the kernel space of the computer device 1500 .
  • the computer device 1500 can also be configured with a local storage module 1503 and a cloud storage module 1504.
  • the local storage module 1503 can be the external storage 130 in the embodiment shown in Figure 2
  • the cloud storage module 1504 includes but is not limited to a cloud disk or a network disk.
  • the kernel 1502 of the computer device 1500 includes each module in the operating device 1400 of the above embodiment, that is, the second acquisition module 1410, the checking module 1420, and the operating module 1430.
  • the second acquisition module 1410 is different from the first acquisition module 1210 shown in FIG. 13 above.
  • the second acquisition module 1410 may include a system call interface (SCI) 1411 and a virtual file system (VFS) 1412.
  • SCI system call interface
  • VFS virtual file system
  • the SCI 1411 and VFS 1412 may be the same as the SCI 210 and VFS 240 shown in Figure 2 above.
  • the relevant descriptions of the SCI 1411 and VFS 1412 can be found in the technical solutions in related technologies, and will not be described in detail here.
  • the check module 1420 may include an interface adapted to the VFS 1412, and the VFS 1412 may call the check module 1420 by calling the interface, so that the check module 1420 checks the relocation mark of the file in the local storage module 1503.
  • the operation module 1430 may include an operation program 1431 that can call a local file system (FS) 1432 and a cloud file system 1434.
  • FS local file system
  • the operating program 1431 calls the local file system (FS) 1432, and through the cooperation of the local file system (FS) 1432 and the device driver 1433, operations on the files in the local storage module 1503 can be performed.
  • the local file system 1432 and device driver 1433 may be the same as the file system 250 and device driver 260 shown in FIG. 2 above.
  • relevant descriptions of the local file system 1432 and the device driver 1433 can be found in technical solutions in related technologies, and will not be described again here.
  • the cloud file system 1434 is called by the operating program 1431, and through the cooperation of the cloud file system 1434 and the network protocol layer 1435, operations on files in the cloud storage module 1504 can be performed.
  • the cloud file system 1434 can call a variety of different cloud operation functions, and the network protocol layer 1435 can encapsulate data according to network protocols. Through the cloud file system 1434 and the network protocol layer 1435, effective interaction of file data in the cloud storage module 1504 can be achieved.
  • the local file system 1432 may be the same system as the local file system 1222 shown in Figure 13, similarly.
  • the cloud file system 1434 may be the same system as the cloud file system 1224 shown in FIG. 13 .
  • the device driver 1433 in the embodiment of the present application can be the same driver as the device driver 1223 shown in Figure 13
  • the network protocol layer 1435 can be the same protocol layer as the network protocol layer 1225 shown in Figure 13.
  • FIG. 13 and FIG. 15 are only illustrative and not limiting.
  • the computer device 1300 and/or the computer device 1500 may also include other functional modules in related technologies.
  • the kernel of the computer device 1300 and/or the computer device 1500 may also include: a memory management unit 220 and a process management program 230 as shown in FIG. 2 .
  • the hardware layer of the computer device 1300 and/or the computer device 1500 further includes: the processor 110 and the memory 120 as shown in FIG. 2 .
  • Figure 16 shows a schematic structural block diagram of another file operating device 1600 provided by the embodiment of the present application. Specifically, the operating device 1600 is also located in the core of the computer device.
  • the operating device 1600 may simultaneously include multiple functional modules in the above-mentioned operating device 1200 and the operating device 1400, that is, the operating device 1600 may simultaneously include the above-mentioned first acquisition module 1210, relocation module 1220, and second acquisition module 1410. , inspection module 1420 and operation module 1430.
  • Figure 17 shows a schematic structural block diagram of another file operating device 1700 provided by the embodiment of the present application.
  • the operating device 1700 includes: at least one processor 1710 and a memory 1720.
  • the memory 1720 is used to store the program.
  • the at least one processor 1710 is used to call and run the program from the memory 1720 to perform any of the above.
  • An embodiment provides a file operation method.
  • An embodiment of the present application also provides a computer device, which may include the file operating device provided in any of the above embodiments.
  • the computer device includes but is not limited to a terminal device, such as a mobile phone, a personal computer, etc.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on a computer device, it causes the computer device to perform the file operations provided in any of the above embodiments. method.
  • Embodiments of the present application also provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to execute the file operation method provided in any of the above embodiments.
  • An embodiment of the present application also provides a chip.
  • the chip includes a processor and a data interface.
  • the processor reads instructions stored in the memory through the data interface to execute the file operation method provided in any of the above embodiments. .
  • the chip can be a central processing unit (CPU), a microcontroller unit (Micro Controller Unit, MCU), a microprocessor (Micro Processing Unit, MPU), a digital signal processor (DSP), a system on a chip (System On Chip (SoC), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or programmable logic device (programmable logic device, PLD).
  • CPU central processing unit
  • MCU microcontroller unit
  • MPU Micro Processing Unit
  • DSP digital signal processor
  • SoC System On Chip
  • SoC System On Chip
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • PLD programmable logic device
  • the number of processors is not limited.
  • the processor is a general-purpose processor, and optionally, the general-purpose processor can be implemented by hardware or by software.
  • the processor is a logic circuit, integrated circuit, etc.; when implemented by software, the processor is a general processor that is implemented by reading the software code stored in the memory, which is integrated in the processor. In the processor, it is located outside the processor and exists independently.
  • the above embodiments are implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-described embodiments are implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer is a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in or transmitted from one computer-readable storage medium to another, e.g., from a website, computer, server, or data center. Wired (such as infrared, wireless, microwave, etc.) transmission to another website, computer, server or data center.
  • the computer-readable storage medium is any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more sets of available media.
  • the available media are magnetic media (eg, floppy disks, hard disks, tapes), optical media (eg, DVD), or semiconductor media, such as solid state drives.
  • At least one refers to one or more, and “plurality” refers to two or more.
  • At least one of the following” or similar expressions refers to any combination of these items, including any combination of single items (items) or plural items (items).
  • at least one of a, b, or c means: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c are single or multiple.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be used in the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the device embodiments described above are only illustrative.
  • the division of modules is only a logical function division.
  • Another point is that the coupling or direct coupling or communication connection between each other shown or discussed is the indirect coupling or communication connection through some interfaces, devices or modules, which is electrical, mechanical or other forms.
  • each functional module in each embodiment of the present application can be integrated into a processing device.
  • each module physically exists alone, or two or more modules are integrated into one module.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (either a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other various media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Les modes de réalisation de la présente demande concernent un procédé et un appareil de fonctionnement de fichier, un dispositif informatique et un support de stockage lisible par ordinateur. Le procédé de fonctionnement est appliqué au noyau d'un dispositif informatique, et consiste à : obtenir une commande de déplacement liée à un fichier ; accéder, selon la commande de déplacement, à un espace de stockage dans lequel se trouve le fichier, dans un module de stockage local du dispositif informatique ; déplacer le fichier, du module de stockage local vers un module de stockage en nuage ; et écrire une étiquette de déplacement du fichier dans le module de stockage local, l'étiquette de déplacement étant utilisée pour permettre au noyau d'exécuter une opération ultérieure sur le fichier. Au moyen de la solution technique, le noyau du dispositif informatique peut déplacer le fichier, du module de stockage local vers le module de stockage en nuage ; ainsi, l'espace de stockage dans le module de stockage local est économisé et la capacité de stockage du dispositif informatique est améliorée, ce qui assure que le module de stockage local a suffisamment d'espace de stockage restant, permet d'éviter de provoquer des saccades du dispositif informatique et améliore ainsi l'expérience d'utilisateur sur le dispositif informatique.
PCT/CN2022/088239 2022-04-21 2022-04-21 Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible WO2023201638A1 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/088239 WO2023201638A1 (fr) 2022-04-21 2022-04-21 Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/088239 WO2023201638A1 (fr) 2022-04-21 2022-04-21 Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible

Publications (1)

Publication Number Publication Date
WO2023201638A1 true WO2023201638A1 (fr) 2023-10-26

Family

ID=88418817

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088239 WO2023201638A1 (fr) 2022-04-21 2022-04-21 Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible

Country Status (1)

Country Link
WO (1) WO2023201638A1 (fr)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102870098A (zh) * 2010-05-27 2013-01-09 株式会社日立制作所 经由通信网络向远程文件服务器传送文件的本地文件服务器及具有该文件服务器的存储系统
CN103077243A (zh) * 2013-01-16 2013-05-01 北京数码视讯科技股份有限公司 文件系统访问的处理方法及系统
CN106933872A (zh) * 2015-12-30 2017-07-07 阿里巴巴集团控股有限公司 一种通过传统文件系统接口访问云存储服务的方法及装置
US20200401336A1 (en) * 2019-06-20 2020-12-24 International Business Machines Corporation Dynamic api allocation based on data-tagging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102870098A (zh) * 2010-05-27 2013-01-09 株式会社日立制作所 经由通信网络向远程文件服务器传送文件的本地文件服务器及具有该文件服务器的存储系统
CN103077243A (zh) * 2013-01-16 2013-05-01 北京数码视讯科技股份有限公司 文件系统访问的处理方法及系统
CN106933872A (zh) * 2015-12-30 2017-07-07 阿里巴巴集团控股有限公司 一种通过传统文件系统接口访问云存储服务的方法及装置
US20200401336A1 (en) * 2019-06-20 2020-12-24 International Business Machines Corporation Dynamic api allocation based on data-tagging

Similar Documents

Publication Publication Date Title
EP3138010B1 (fr) Systeme et methode pour comparaisons de signature optimisees et replication de donnees
CN104995895B (zh) 兼容扩展卸载令牌大小
WO2016180055A1 (fr) Procédé, dispositif et système de stockage et de lecture de données
CN109885577B (zh) 数据处理方法、装置、终端及存储介质
CN104216801A (zh) 一种面向虚拟化环境的数据复制方法及系统
CN113032099B (zh) 云计算节点、文件管理方法及装置
US11960920B2 (en) Asynchronous input and output for snapshots of virtual machines
CN114296646A (zh) 基于io业务的缓存方法、装置、服务器和存储介质
WO2021226822A1 (fr) Procédé et appareil d'écriture de journal, dispositif électronique et support de stockage
WO2021018052A1 (fr) Procédé et appareil de récupération de mémoire
WO2023201638A1 (fr) Procédé et appareil de fonctionnement de fichier, dispositif informatique et support de stockage lisible
WO2023201650A1 (fr) Procédé et appareil de traitement de fichier, dispositif informatique et support de stockage lisible
WO2023201653A1 (fr) Procédé et appareil de traitement de fichier, dispositif informatique et support de stockage lisible
CN114936189A (zh) 应用程序的操作方法、装置、计算机设备和可读存储介质
CN115563075B (zh) 基于微内核的虚拟文件系统实现方法
CN115268797B (zh) 一种通过WebDav实现系统与对象存储通信的方法
WO2023071043A1 (fr) Procédé et appareil de compatibilité d'agrégation de fichiers, dispositif informatique et support de stockage
CN114817154A (zh) 共享文件的操作方法、装置、计算机设备和共享文件系统
JP4150854B2 (ja) ストレージエリアネットワーク上の共有ディスク装置へのアクセスシステム及びそのクライアント
WO2018028321A1 (fr) Procédé et appareil de gestion de dispositif de stockage externe virtuel, et terminal
WO2023201648A1 (fr) Appareil d'exploitation de fichiers, dispositif informatique et dispositif d'exploitation
CN109960460B (zh) 一种分布式存储系统
CN105786590B (zh) 虚拟环境中逻辑卷的管理方法及系统
WO2024066904A1 (fr) Procédé de création de conteneur, système et noeud
WO2024051654A1 (fr) Procédé de traitement de fichier et dispositif électronique

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22937875

Country of ref document: EP

Kind code of ref document: A1