CN114880290A - Monitoring method and monitoring device of virtual file system and computing equipment - Google Patents

Monitoring method and monitoring device of virtual file system and computing equipment Download PDF

Info

Publication number
CN114880290A
CN114880290A CN202210587872.7A CN202210587872A CN114880290A CN 114880290 A CN114880290 A CN 114880290A CN 202210587872 A CN202210587872 A CN 202210587872A CN 114880290 A CN114880290 A CN 114880290A
Authority
CN
China
Prior art keywords
event
file system
file
module
file operation
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210587872.7A
Other languages
Chinese (zh)
Inventor
王荣
杨武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
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 Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202210587872.7A priority Critical patent/CN114880290A/en
Publication of CN114880290A publication Critical patent/CN114880290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems

Landscapes

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

Abstract

The invention discloses a monitoring method, a monitoring device and a computing device of a virtual file system, wherein the method is executed in an operating system, an operating system kernel comprises the virtual file system, an extended monitoring module and a notification module, a plurality of applications run on the operating system, and the method comprises the following steps: the method comprises the steps that an extension monitoring module obtains all file operation events of a file system from a virtual file system, and a broadcast function is called to send the file operation events to a notification module; the notification module converts the file operation event into a path representation event and broadcasts the path representation event to the plurality of applications. According to the technical scheme of the invention, omission of file operation events can be avoided, and the monitoring range of the file system is wider.

Description

Monitoring method and monitoring device of virtual file system and computing equipment
Technical Field
The present invention relates to the field of file system technologies, and in particular, to a monitoring method and a monitoring apparatus for a virtual file system, and a computing device.
Background
With the continuous development of information technology, a user computer generally stores a large amount of files, and the number of files is rapidly increasing. In the face of massive files, a search tool for searching the files is still very behind, and the problems of low search speed, inaccurate search results and the like exist. The inaccuracy in the search results is generally due to the fact that the file information maintained by the search tool does not correspond to the actual file information in the file system. Therefore, how to synchronize file information between the file system and the search tool is a key for ensuring accurate file search results. Monitoring the virtual file system can achieve monitoring of changes in the file system.
In the prior art, a monitoring scheme for a virtual file system is to use a preload library to monitor call parameters and return values of related functions in glibc, where the related functions include, for example, create, mkdir, rmdir, rename, unlink, and the like. This approach is not kernel-independent, but has an impact on all programs that depend on the glibc library, and has a large security risk. In addition, programs that statically compile libc libraries, programs that do not rely on libc libraries, cannot be monitored.
Another monitoring scheme for the virtual file system is that a kernel module is written, kernel functions are hooked through kprobes, parameters and return values are checked at the function inlet and outlet, and event information is recorded when a file event meeting requirements is found. The disadvantage of this scheme is that kprobes rely on kernel functions, which may cause maintenance problems when the kernel is upgraded, and furthermore, kprobes handlers must run with preemption disabled, which may affect system stability, and not all kernels have kprobes support enabled.
For this reason, a monitoring method of the virtual file system is required to solve the problems in the above-mentioned schemes.
Disclosure of Invention
Therefore, the present invention provides a monitoring method and a monitoring apparatus for a virtual file system, so as to solve or at least alleviate the above problems.
According to an aspect of the present invention, there is provided a method for monitoring a virtual file system, which is executed in an operating system, wherein an operating system kernel includes the virtual file system, an extended monitoring module, and a notification module, and a plurality of applications run on the operating system kernel, the method including the steps of: the method comprises the steps that an extension monitoring module obtains all file operation events of a file system from a virtual file system, and a broadcast function is called to send the file operation events to a notification module; the notification module converts the file operation event into a path representation event and broadcasts the path representation event to the plurality of applications.
Optionally, in the monitoring method for a virtual file system according to the present invention, before the extension monitoring module obtains all file operation events of the file system from the virtual file system, the method includes the steps of: the notification module registers a broadcast event callback function to the extended monitoring module, so that the extended monitoring module calls the broadcast event callback function to send the file operation event to the notification module when acquiring the file operation event.
Optionally, in the monitoring method of the virtual file system according to the present invention, the notifying module includes an event generating module and an event sending module, and the step of converting the file operation event into a path representation event by the notifying module and broadcasting the path representation event to the plurality of applications includes: the event generating module acquires a file path from the file operation event, generates a path representing event based on the file path, calls a file system change function and sends the path representing event to the event sending module; an event sending module broadcasts the path representation event to the plurality of applications.
Optionally, in the monitoring method of the virtual file system according to the present invention, broadcasting the path representation event to the plurality of applications includes: broadcasting the path representation event to the plurality of applications through a Netlink.
Optionally, in the monitoring method of the virtual file system according to the present invention, the file system includes a real file system, a dummy file system, and a network file system.
Optionally, in the monitoring method for a virtual file system according to the present invention, the step of the extended monitoring module obtaining all file operation events of the file system from the virtual file system includes: and the virtual file system receives a file operation event of the application to the file system, and calls a corresponding file operation event function in the extended monitoring module to send the file operation event to the extended monitoring module.
Optionally, in the monitoring method of the virtual file system according to the present invention, the extended monitoring module includes: a fsnotify module; a callback function list adapted to store broadcast event callback functions; the notification module is adapted to call a register _ fs _ event _ handler () function to register a broadcast event callback function with the extended monitoring module, which is adapted to store the broadcast event callback function in a callback function list.
Optionally, in the monitoring method of the virtual file system according to the present invention, the file operation event includes one or more of a file creation event, a file renaming event, a file moving event, a file deletion event, and a link event.
According to an aspect of the present invention, there is provided a monitoring apparatus arranged in an operating system kernel including a virtual file system, on which a plurality of applications run, the apparatus comprising: the system comprises an extension monitoring module, a notification module and a storage module, wherein the extension monitoring module is suitable for acquiring all file operation events of a file system from the virtual file system and calling a broadcast function to send the file operation events to the notification module; and the notification module is suitable for converting the file operation event into a path representation event and broadcasting the path representation event to the plurality of applications.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the monitoring method of the virtual file system as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the monitoring method of a virtual file system as described above.
According to the technical scheme of the invention, the monitoring method of the virtual file system is provided, all file operation events of the whole file system can be acquired from the virtual file system based on the extended monitoring module realized in the kernel, and all the file operation events can be sent to the notification module in a broadcasting manner, so that the notification module can broadcast the file operation events to a plurality of applications of the application layer. Therefore, according to the technical scheme of the invention, the change of the whole file system can be monitored without depending on the kernel characteristic and increasing the monitoring of the file system according to the change of the file system, so that the omission of file operation events is avoided, and the system overhead is saved. In addition, the invention has wider monitoring range on the file system and supports the monitoring on the file change in a pseudo file system and a network file system.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention;
FIG. 2 illustrates a hardware architecture diagram of a computing device 100, according to one embodiment of the invention;
FIG. 3 illustrates a flow diagram of a method 300 for monitoring a virtual file system in accordance with one embodiment of the present invention;
FIG. 4 illustrates a timing diagram of a method 300 for monitoring a virtual file system, according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention.
As shown in fig. 1, computing device 100 includes an operating system, and an application layer disposed above the operating system. The application layer may include one or more applications 110, with the one or more applications 110 running on top of an operating system. It should be noted that the present invention is not limited to the type or number of applications 110.
The operating system may provide a software runtime environment for one or more applications 110 at the application layer. The operating system includes a kernel, and the kernel is responsible for process management, memory management, file management (e.g., file storage space management, directory management, file read-write management), device management (e.g., I/O request, buffer management, driver), and the like.
In the embodiment of the present invention, as shown in fig. 1, the kernel of the operating system includes the virtual file system 130, the extension monitoring module 151, and the notification module 152. The extension monitoring module 151 is in communication connection with the virtual file system 130 and the notification module 152, respectively, so as to establish an association with the virtual file system 130 and the notification module 152.
According to one embodiment of the invention, as shown in fig. 1, a monitoring apparatus 150 and a virtual file system 130 are arranged in an operating system kernel of the computing device 100. The monitoring device 150 is communicatively connected to the virtual file system 130, and the monitoring device 150 monitors the virtual file system 130 to monitor file operation events. Wherein, the monitoring device 150 comprises an extension monitoring module 151, a notification module 152,
in an embodiment of the present invention, the extension monitoring module 151 may obtain all file operation events of the file system from the virtual file system 130, and may call a broadcast function to send the file operation events to the notification module 152.
It should be noted that a Virtual File System (VFS) is a software layer in the Linux kernel, and is used to provide a File System interface for the application 110 in the application layer. The virtual file system VFS allows different file systems to coexist. All file systems in the operating system not only depend on the coexistence of the VFS, but also depend on the VFS to realize the cooperative work.
The application 110 may call the file system interface provided by the virtual file system 130 to operate on files in all file systems. The virtual file system may acquire a file operation event to the file system triggered by the application 110, and perform a corresponding file operation on a file in the file system.
In an embodiment of the present invention, the notification module 152 may convert the file operation event into a path representation event after receiving the file operation event broadcast by the extension monitoring module 151, and broadcast the path representation event to the plurality of applications 110 in the application layer.
In one embodiment, the notification module 152 may broadcast the path representation event to all applications 110 of the application layer via Netlink.
It should be noted that the file system in the present invention includes a real file system, a pseudo file system, and a network file system. That is, according to the extended monitoring module 151 of the present invention, all file operation events of the entire file system including the real file system, the dummy file system, and the network file system may be acquired from the virtual file system 130, and sent to the notification module 152 in a broadcast manner. Therefore, according to the technical scheme of the invention, the monitoring on the file system is not required to be added in advance, and the omission of file operation events can be avoided.
In the embodiment of the present invention, the file operation event may specifically include a file creation event, a file renaming event, a file moving event, a file deletion event, a link event, and the like.
In an embodiment of the present invention, when operating a file in the file system, each application 110 may call a system call function corresponding to a file operation type to communicate with the virtual file system 130 in the kernel, so that the virtual file system obtains a file operation event triggered by the application 110 and performs a corresponding file operation on the file in the corresponding file system. For example, when the application 110 performs a delete operation on a file in the file system, a system call unlink () function may be called to send a file delete event to the virtual file system 130.
The virtual file system 130 executes a corresponding file operation on the file system after receiving a file operation event triggered by each application 110. Subsequently, the virtual file system 130 may call a corresponding file operation event function in the extension monitor module 151 to send the file operation event to the extension monitor module 151. In this way, the extension monitor module 151 is enabled to obtain all file operation events of the file system from the virtual file system 130.
In one embodiment of the invention, the notification module 152 may register the broadcast event callback function with the extended monitoring module 151 during an initialization process during a kernel startup phase. In this way, the extension monitor module 151 may call the broadcast event callback function to send the file operation event to the notification module 152 when the file operation event is acquired from the virtual file system 130.
In one embodiment of the invention, the extension monitor module 151 is generated based on the extension of the fsnotify module. In other words, the extended supervisor module 151 is an extended fsnotify module. Specifically, the extension monitor module 151 includes an fsnotify module, a callback function list (fs _ event _ handles). The callback function list fs _ event _ handles may store a broadcast event callback function.
The notification module 152 may call a register _ fs _ event _ handler () function to register the broadcast event callback function with the extended monitoring module 151. The extended monitoring module 151 may store the registered broadcast event callback function in the callback function list fs _ event _ handles.
In this way, the extension monitoring module 151 sends a file operation event to the notification module 152 by calling a broadcast event callback function saved in the callback function list fs _ event _ handles when acquiring the file operation event of each application 110 to the file system from the virtual file system 130.
In one implementation, the notification module 152 serves as a notification front end of the extension monitor module 151, and may be implemented as a vfsntify module. In other embodiments, the notification module 152 may also be implemented as inotify or fsnotify, and the invention is not limited to the specific implementation of the notification module 152.
In one embodiment of the present invention, as shown in fig. 1, the notification module 152 includes an event generation module and an event transmission module. The notification module 152 may specifically convert the file operation event into a path representation event and broadcast the path representation event to the plurality of applications 110 by:
the event generating module acquires a file path (specifically, an intra-device path of a file and a directory) from the file operation event, and generates a path representing event based on the file path. And then calling a file system change function to send the path representation event to the event sending module.
Further, the path indicating event is broadcast to the plurality of applications 110 of the application layer by the event transmission module through Netlink.
In an embodiment of the present invention, the computing device 100 is adapted to perform the monitoring method 300 of the virtual file system of the present invention. The monitoring method 300 of the virtual file system of the present invention will be described in detail below.
FIG. 2 shows a hardware architecture diagram of the computing device 100, according to one embodiment of the invention.
As shown in fig. 2, computing device 100 may include an input device 20, a processor 21, an output device 22, a memory 23, and at least one communication bus 24. A communication bus 24 is used to enable communication connections between the elements. The memory 23 may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and the memory 23 may store various program instructions for performing various processing functions and implementing the monitoring method of the virtual file system in the embodiment of the present invention.
Alternatively, the processor 21 may be implemented by, for example, a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, and the processor 21 is coupled to the input device 20 and the output device 22 through a wired or wireless connection.
Optionally, the input device 20 may include a variety of input devices, for example, at least one of a user-oriented user interface, a device-oriented device interface, a software programmable interface, a camera, and a sensor. Optionally, the device interface facing the device may be a wired interface for data transmission between devices, or may be a hardware plug-in interface (e.g., a USB interface, a serial port, etc.) for data transmission between devices; optionally, the user-facing user interface may be, for example, a user-facing control key, a voice input device for receiving voice input, and a touch sensing device (e.g., a touch screen with a touch sensing function, a touch pad, etc.) for receiving user touch input; optionally, the programmable interface of the software may be, for example, an entry for a user to edit or modify a program, such as an input pin interface or an input interface of a chip; optionally, the transceiver may be a radio frequency transceiver chip with a communication function, a baseband processing chip, a transceiver antenna, and the like. An audio input device such as a microphone may receive voice data. The output device 22 may include a display, a sound, or other output device.
In an embodiment in accordance with the invention, the computing device 100 is configured to perform a monitoring method 300 of a virtual file system in accordance with the invention. The computing device 100 includes one or more processors, and one or more readable storage media storing program instructions that, when configured to be executed by the one or more processors, cause the computing device to perform a method 300 of monitoring a virtual file system in an embodiment of the invention.
In an embodiment according to the present invention, the operating system of the computing device 100 comprises a plurality of program instructions for executing the monitoring method 300 of the virtual file system of the present invention, and the program instructions may instruct the processor to execute the monitoring method 300 of the virtual file system of the present invention, so that the computing device can implement interception and broadcasting of all file operation events of the whole file system by executing the monitoring method 300 of the virtual file system of the present invention.
FIG. 3 illustrates a flow diagram of a method 300 for monitoring a virtual file system, according to one embodiment of the invention. FIG. 4 illustrates a timing diagram of a method 300 for monitoring a virtual file system, according to one embodiment of the invention. The method 300 is suitable for execution in an operating system of a computing device, such as the computing device 100 described above.
According to one embodiment of the invention, as shown in fig. 1, a monitoring apparatus 150 and a virtual file system 130 are arranged in an operating system kernel of the computing device 100. The monitoring device 150 is communicatively connected to the virtual file system 130, and can monitor the virtual file system 130 to monitor file operation events, so as to monitor changes of files in the actual file system. The monitoring device 150 includes an extension monitoring module 151 and a notification module 152, where the extension monitoring module 151 is communicatively connected to the notification module 152, and the extension monitoring module 151 is communicatively connected to the virtual file system 130. In addition, an application layer is disposed above the operating system, the application layer including one or more applications 110.
The monitoring method 300 of the virtual file system of the present invention is adapted to be executed in a monitoring apparatus 150 disposed in a kernel of an operating system.
As shown in fig. 3 and 4, the method 300 includes steps S310 to S320.
In step S310, the extension monitor module 151 obtains all file operation events of the file system from the virtual file system 130, and calls a broadcast function to send the file operation events to the notification module 152.
It should be noted that the Virtual File System 130 (VFS) is an abstract File System layer constructed on a concrete File System, and is used for providing a uniform File System interface for the application 110 at the application layer, so that the application can access different types of concrete File systems.
The application 110 may call the file system interface provided by the virtual file system 130 to operate on files in all file systems. The virtual file system may acquire a file operation event to the file system triggered by the application 110, and perform a corresponding file operation on a file in the file system.
In one implementation, the broadcast function called by the extension monitor module 151 may be implemented as fsnotify _ broadcast (), for example.
In step S320, after acquiring the file operation event sent by the extension monitoring module 151, the notification module 152 converts the file operation event into a path representation event, and broadcasts the path representation event to the plurality of applications 110 in the application layer.
In one embodiment, the notification module 152 may broadcast the path representation event to all applications 110 of the application layer via Netlink.
It should be noted that the file system in the present invention includes a real file system, a pseudo file system, and a network file system. That is, according to the extended monitoring module 151 of the present invention, all file operation events of the entire file system including the real file system, the dummy file system, and the network file system may be acquired from the virtual file system 130, and may be sent to the notification module 152 in a broadcast manner. Therefore, according to the technical scheme of the invention, the monitoring on the file system is not required to be added in advance, and the omission of file operation events can be avoided.
In the embodiment of the present invention, the file operation event may specifically include a file creation event, a file renaming event, a file moving event, a file deletion event, a link event, and the like.
According to an embodiment of the present invention, each application 110 may call a system call function corresponding to a file operation type to communicate with the virtual file system 130 in the kernel when operating a file in the file system, so that the virtual file system obtains a file operation event triggered by the application 110 and performs a corresponding file operation on the file in the corresponding file system. For example, when the application 110 performs a delete operation on a file in the file system, a system call unlink () function may be called to send a file delete event to the virtual file system 130.
The virtual file system 130 executes a corresponding file operation on the file system after receiving a file operation event on the file system triggered by each application 110. Subsequently, the virtual file system 130 may call a corresponding file operation event function in the extension monitor module 151 to send the file operation event to the extension monitor module 151. In this way, the extension monitor module 151 is enabled to obtain all file operation events of the file system from the virtual file system 130.
In one embodiment of the present invention, the notification module 152 may register the broadcast event callback function with the extension monitor module 151 during an initialization process during a kernel startup phase of the operating system before performing step S210. In this way, the extension monitor module 151 may call the broadcast event callback function to send the file operation event to the notification module 152 when the file operation event is acquired from the virtual file system 130.
In one embodiment of the invention, the extension monitor module 151 is generated based on the extension of the fsnotify module. In other words, the extended supervisor module 151 is an extended fsnotify module. Specifically, the extension monitor module 151 includes an fsnotify module, a callback function list (fs _ event _ handles). The callback function list fs _ event _ handles may store a broadcast event callback function.
The notification module 152 may call a register _ fs _ event _ handler () function to register the broadcast event callback function with the extended monitoring module 151. The extended monitoring module 151 may store the registered broadcast event callback function in the callback function list fs _ event _ handles.
In this way, when acquiring a file operation event triggered by each application 110 from the virtual file system 130, the extension monitoring module 151 sends the file operation event to the notification module 152 by calling a broadcast event callback function saved in the callback function list fs _ event _ handles.
In one implementation, the notification module 152 serves as a notification front end of the extension monitor module 151, and may be implemented as a vfsntify module. In other embodiments, the notification module 152 may also be implemented as inotify or fsnotify, and the invention is not limited to the specific implementation of the notification module 152.
In one embodiment of the present invention, as shown in fig. 1, the notification module 152 includes an event generation module and an event transmission module. The notification module 152 may specifically convert the file operation event into a path representation event and broadcast the path representation event to the plurality of applications 110 by:
the event generating module acquires a file path (specifically, an intra-device path of a file and a directory) from the file operation event, and generates a path representing event based on the file path. And then calling a file system change function to send the path representation event to the event sending module.
Further, the path indicating event is broadcast to the plurality of applications 110 of the application layer by the event transmission module through Netlink.
According to the monitoring method 300 of the virtual file system of the present invention, based on the extended monitoring module implemented in the kernel, all file operation events of the entire file system can be obtained from the virtual file system, and all file operation events can be sent to the notification module in a broadcast manner, and then the notification module can broadcast the file operation events to a plurality of applications in the application layer. Therefore, according to the technical scheme of the invention, the change of the whole file system can be monitored without depending on the kernel characteristic and increasing the monitoring of the file system according to the change of the file system, so that the omission of file operation events is avoided, and the system overhead is saved. In addition, the invention has wider monitoring range on the file system and supports the monitoring on the file change in a pseudo file system and a network file system.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the method of monitoring a virtual file system of the present invention according to instructions in said program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as disclosed herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense with respect to the scope of the invention, as defined in the appended claims.

Claims (11)

1. A monitoring method of a virtual file system is executed in an operating system, the kernel of the operating system comprises the virtual file system, an extension monitoring module and a notification module, a plurality of applications run on the operating system, and the method comprises the following steps:
the method comprises the steps that an extension monitoring module obtains all file operation events of a file system from a virtual file system, and a broadcast function is called to send the file operation events to a notification module;
the notification module converts the file operation event into a path representation event and broadcasts the path representation event to the plurality of applications.
2. The method of claim 1, wherein before the extension monitor module obtains all file operation events of the file system from the virtual file system, comprising the steps of:
the notification module registers a broadcast event callback function to the extended monitoring module, so that the extended monitoring module calls the broadcast event callback function to send the file operation event to the notification module when acquiring the file operation event.
3. The method of claim 1 or 2, wherein the notification module comprises an event generation module, an event transmission module, the step of the notification module converting the file operation event into a path representation event, and broadcasting the path representation event to the plurality of applications comprises:
the event generating module acquires a file path from the file operation event, generates a path representing event based on the file path, calls a file system change function and sends the path representing event to the event sending module;
an event sending module broadcasts the path representation event to the plurality of applications.
4. The method of any of claims 1-3, wherein broadcasting the path representation event to the plurality of applications comprises:
broadcasting the path representation event to the plurality of applications through a Netlink.
5. The method of any of claims 1-4, wherein the file system comprises a real file system, a pseudo file system, a network file system.
6. The method of any of claims 1-5, wherein the step of the extension monitor module obtaining all file operation events of the file system from the virtual file system comprises:
and the virtual file system receives a file operation event of the application to the file system, and calls a corresponding file operation event function in the extended monitoring module to send the file operation event to the extended monitoring module.
7. The method of any of claims 1-6, wherein the extended monitoring module comprises:
a fsnotify module;
a callback function list adapted to store broadcast event callback functions;
the notification module is adapted to call a register _ fs _ event _ handler () function to register a broadcast event callback function with the extended monitoring module, which is adapted to store the broadcast event callback function in a callback function list.
8. The method of any one of claims 1-7,
the file operation event comprises one or more of a file creation event, a file renaming event, a file moving event, a file deleting event and a linking event.
9. A monitoring apparatus disposed in an operating system kernel including a virtual file system, the operating system kernel having a plurality of applications running thereon, the apparatus comprising:
the system comprises an extension monitoring module, a notification module and a storage module, wherein the extension monitoring module is suitable for acquiring all file operation events of a file system from the virtual file system and calling a broadcast function to send the file operation events to the notification module;
and the notification module is suitable for converting the file operation event into a path representation event and broadcasting the path representation event to the plurality of applications.
10. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-8.
11. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-8.
CN202210587872.7A 2022-05-26 2022-05-26 Monitoring method and monitoring device of virtual file system and computing equipment Pending CN114880290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210587872.7A CN114880290A (en) 2022-05-26 2022-05-26 Monitoring method and monitoring device of virtual file system and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210587872.7A CN114880290A (en) 2022-05-26 2022-05-26 Monitoring method and monitoring device of virtual file system and computing equipment

Publications (1)

Publication Number Publication Date
CN114880290A true CN114880290A (en) 2022-08-09

Family

ID=82677016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210587872.7A Pending CN114880290A (en) 2022-05-26 2022-05-26 Monitoring method and monitoring device of virtual file system and computing equipment

Country Status (1)

Country Link
CN (1) CN114880290A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724905A (en) * 2024-02-05 2024-03-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux
CN117724905B (en) * 2024-02-05 2024-04-19 成都云祺科技有限公司 Real-time copying method, system and recovery method of file system under Linux

Similar Documents

Publication Publication Date Title
US20080294942A1 (en) Self-healing system and method
CN111104421A (en) Data query method and device based on data interface standard configuration
US7865901B2 (en) Managing memory resident objects to optimize a runtime environment
US20180101326A1 (en) Managing a collection of data
US8973135B2 (en) Selectively scanning objects for infection by malware
CN112527414B (en) Front-end-based data processing method, device, equipment and storage medium
JP5832954B2 (en) Tag assignment device and tag assignment method
US20150106793A1 (en) Detecting Byte Ordering Type Errors in Software Code
CN110413432B (en) Information processing method, electronic equipment and storage medium
CN103077071A (en) Method and system for acquiring process information of KVM (Kernel-based Virtual Machine)
EP2761462B1 (en) Method and device for obtaining using-frequency of application program
CN114880290A (en) Monitoring method and monitoring device of virtual file system and computing equipment
CN113885936A (en) Solution method for software package dependence in customized mirror image
CN109032685B (en) Method and terminal for accelerating startup of android system
CN103842986A (en) System and method for supporting a self-tuning locking mechanism in a transactional middleware machine environment
CN111814029A (en) Data query method, system and computing device
WO2014101892A1 (en) Resource adjustment method and device
CN114780353B (en) File log monitoring method and system and computing device
CN109150993B (en) Method for obtaining network request tangent plane, terminal device and storage medium
WO2021203591A1 (en) Data processing method for heterogeneous cloud storage system, and readable medium and system therefor
CN114637969A (en) Target object authentication method and device
CN114138531A (en) Core dump file generation method, computing device and storage medium
WO2021102849A1 (en) Resource acquisition method and apparatus, and electronic device
CN117215966B (en) Test method and test device for chip SDK interface and electronic equipment
CN114518844B (en) Data processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination