Document tracking methods, devices, equipment, storage media, and products
By determining the file's superblock pointer and querying the file tracking map using the relative path, the problem of inaccurate file tracking objects is solved, achieving precise file tracking and protection, and ensuring the security and consistency of file operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN KELIRI TECH CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, file tracking is inaccurate when the volume device mount point changes, making it impossible to accurately track and protect user-configured fixed file objects.
By determining the superblock pointer and relative file path of the file to be operated on, querying the preset file tracking mapping table, and constructing the file tracking response behavior, accurate file tracking and protection can be achieved.
It achieves precise tracking and protection of files, avoiding inaccurate tracking due to changes in mount points, and ensuring the security and consistency of file operations.
Smart Images

Figure CN122087789A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data protection technology, and in particular to document tracking methods, apparatus, devices, storage media, and products. Background Technology
[0002] Currently, when protecting and tracking files in Unix-like systems, the user typically sends the file paths to be protected and tracked to the kernel driver module, which then protects and tracks file operations on those paths. Typically, this path is an absolute path, containing the volume's mount point (i.e., the mount path) and the volume's relative file path. Because this path depends on the mount point, the objects being protected and tracked differ depending on which volume device is mounted on that path. Users, however, want the files to be protected and tracked to be fixed and not change with changes in the mount point. Therefore, accurately tracking and protecting target file objects based on the user-configured path has become a pressing technical problem. Summary of the Invention
[0003] The main objective of this application is to provide a document tracking method, apparatus, device, storage medium, and product, which aims to solve the technical problem of inaccurate document tracking objects in existing applications.
[0004] To achieve the above objectives, this application proposes a document tracking method, which includes: In response to a file operation instruction, the superblock pointer and relative file path of the file to be operated are determined based on the file operation instruction. The superblock pointer is a memory address that points to the memory data structure of the volume device where the file to be operated is located. Based on the superblock pointer and the relative file path, a preset file tracking mapping table is queried to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The file operation instruction is responded to based on the file tracking response operation behavior.
[0005] Optionally, before querying the preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response operation behavior, the method further includes: Get information on all currently mounted volume devices; Determine the superblock pointer corresponding to the volume device and network file path; Determine a unique identifier for the volume device based on the volume device information; A preset file tracking mapping table is constructed based on the superblock pointer, the unique identifier, the network file path, and the file tracking information.
[0006] Optionally, before constructing the preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information, the method further includes: In response to configuration commands issued by the user, obtain volume device information; Based on the volume device information, the configuration path in the configuration instruction is split to obtain the target volume device information and the relative path information of the file; File tracking information is determined based on the target volume device information, the relative path information, and the tracking response behavior.
[0007] Optionally, determining file tracking information based on the target volume device information, the relative path information, and the tracking response operation behavior includes: Obtain the mount point information of the volume device, and determine the subvolume prefix and network path prefix based on the mount point information; The relative path information is adjusted based on the subvolume prefix and the network path prefix to obtain the adjusted relative path information; File tracking information is determined based on the adjusted relative path information, the target volume device information, and the tracking response operation behavior.
[0008] Optionally, after constructing a preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information, the method further includes: Monitor the mounting and unmounting information of the monitoring roll-up equipment; The superblock information of the volume device is determined based on the mounting and unmounting information. The preset file tracking mapping table is updated based on the superblock information.
[0009] Optionally, the step of querying a preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response behavior includes: Determine whether a subvolume prefix or network path prefix exists in the relative file path; If it exists, the relative file path is adjusted according to the subvolume prefix or the network path prefix to obtain the target relative path information; The file tracking response behavior is obtained by querying the preset file tracking mapping table based on the superblock pointer and the target relative path information.
[0010] Furthermore, to achieve the above objectives, this application also proposes a document tracking device, which includes: The determination module is used to respond to a file operation instruction and determine the superblock pointer and relative file path corresponding to the file to be operated based on the file operation instruction. The superblock pointer is a memory address pointing to the memory data structure of the volume device where the file to be operated is located. The query module is used to query a preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The response module is used to respond to the file operation instructions based on the file tracking response operation behavior.
[0011] In addition, to achieve the above objectives, this application also proposes a file tracking device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the file tracking method as described above.
[0012] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the file tracking method described above.
[0013] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the file tracking method described above.
[0014] This application responds to file operation commands by determining the superblock pointer and relative file path of the file to be operated on, where the superblock pointer is the memory address of the memory data structure of the volume device where the file to be operated resides. Based on the superblock pointer and relative file path, a preset file tracking mapping table is consulted to obtain the file tracking response behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The file operation command is then responded to according to the file tracking response behavior. Because this application determines the file tracking response behavior based on the superblock pointer and relative file path of the file to be operated, and then performs file tracking, compared to existing file tracking methods based on file mount points, this application's method enables precise file tracking and protection. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating an embodiment of the document tracking method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the document tracking method of this application. Figure 3 This is a schematic diagram of the module structure of the document tracking device according to an embodiment of this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the file tracking method in this application embodiment.
[0018] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0020] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0021] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or file tracking device capable of performing the above functions. The following description uses a file tracking device as an example to illustrate this embodiment and the subsequent embodiments.
[0022] Based on this, embodiments of this application provide a file tracking method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the document tracking method of this application.
[0023] In this embodiment, the file tracking method includes the following steps: Step S10: In response to a file operation instruction, determine the superblock pointer and relative file path corresponding to the file to be operated on based on the file operation instruction. The superblock pointer is a memory address pointing to the memory data structure of the volume device where the file to be operated is located. It should be understood that the superblock is the core metadata structure of the file system, used to store global control information of the file system, such as key parameters like block size, total number of blocks, and file system type. It is usually located at the beginning of the volume device. When the volume is mounted, the operating system allocates a memory data structure (super_block) to store superblock-related information, file system information, volume status information, etc. The address of this memory structure is called the superblock pointer.
[0024] It should be noted that the file operation instructions can be commands for performing operations such as adding, deleting, modifying, and querying files in the system. The relative file path can be the relative path of the file to be operated on relative to the volume device or network path. The process of determining the superblock pointer corresponding to the file to be operated on based on the file operation instructions can be done by hooking (hooking is a mechanism used to monitor or modify the behavior of systems and applications) the function pointer of the file system file operation structure (i.e., member variables in the file_operations structure, such as open, read, write, release, etc.), or by hooking the file operation functions in system calls (such as open, read, write, close, etc.). The function parameters of the function pointers all contain a file object pointer (struct file *). Through the file object pointer, the dentry pointer corresponding to the file to be operated on can be indirectly obtained, which contains the superblock pointer of the volume device. Alternatively, the path information of the file to be operated on can also be obtained through the dentry pointer (this path is a relative file path and does not include mount point information).
[0025] Step S20: Based on the superblock pointer and the relative file path, query the preset file tracking mapping table to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. It should be noted that the preset file tracking mapping table can be a ternary mapping table, including the mapping relationship between the file's superblock pointer, file identifier, and file tracking information. The file tracking information can include the relative file path of the file to be tracked and protected, and the corresponding tracking response actions, such as intercepting write operations to files in that directory, or mirroring the written data of that file to other hosts. The relative file path can be a file location relative to the volume device or network path. The file identifier can be a globally unique identifier (UUID) of the volume device or network path information. The file tracking response actions can include tracking response actions for the file to be operated on, such as interception, encryption, mirroring, and release. The preset file tracking mapping table can be referenced in Table 1 below: Table 1 - Preset File Tracking Map
[0026] Step S30: Respond to the file operation instruction according to the file tracking response operation behavior.
[0027] It should be noted that responding to the file operation instruction according to the file tracking response operation behavior can mean responding to the file operation instruction according to the response operation in the file tracking response operation behavior. When the response operation in the file tracking response operation behavior is interception, then the corresponding file operation in the file operation instruction is intercepted, or operations such as security checks, data synchronization, and data encryption are performed on the file to be operated on.
[0028] This embodiment responds to file operation commands by determining the superblock pointer and relative file path of the file to be operated on, where the superblock pointer is the memory address of the memory data structure of the volume device where the file to be operated resides. Based on the superblock pointer and relative file path, a preset file tracking mapping table is queried to obtain the file tracking response behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The file operation command is then responded to according to the file tracking response behavior. Because this embodiment determines the file tracking response behavior based on the superblock pointer and relative file path of the file to be operated, and then performs file tracking, compared to existing methods of file tracking based on the file's mount point (i.e., absolute path), this embodiment can achieve accurate file tracking and protection.
[0029] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the document tracking method for this application. Before step S20, the method further includes the following steps: Step S001: Obtain information on all currently mounted volume devices; It should be noted that obtaining information about all currently mounted volume devices can be achieved by reading the " / proc / partitions" system file or enumerating files under " / dev / disk", etc. Step S002: Determine the superblock pointer corresponding to the volume device and network file path; It should be noted that for network file systems, since there is no UUID, the mounted network file path is used instead. For example, if the subdirectory "abc" under the network share path " / / 192.168.0.1 / share" is mounted to the path " / mnt / share", then the network file path is " / / 192.168.0.1 / share / abc". The superblock pointer corresponding to the volume device and network file path can be the superblock pointer (struct super_block*) created when the system mounts the volume device and network file path.
[0030] Step S003: Determine the unique identifier of the volume device based on the volume device information; It should be noted that the unique identifier can be the UUID of the volume device. Determining the unique identifier of the volume device based on the volume device information can be achieved by reading the superblock data of each volume device according to the volume device information and obtaining the volume device's UUID from the superblock data.
[0031] Step S004: Construct a preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information.
[0032] It should be noted that the file tracking information may include the relative file path of the file to be tracked and protected, as well as the corresponding tracking response behavior. The construction of the preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information can be a mapping table as shown in Table 1, where the unique identifier is the UUID, and the network file path is the network path in Table 1.
[0033] Furthermore, this embodiment also monitors the loading and unloading information of the roll device in real time; The superblock information of the volume device is determined based on the mounting and unmounting information. The preset file tracking mapping table is updated based on the superblock information.
[0034] It should be noted that this embodiment monitors the mounting and unmounting information of volume devices in real time. When a volume device mounting or unmounting operation is detected, the preset file tracking map is updated based on the mounted or unmounted volume device information. For example, when a volume is mounted, the superblock pointer and UUID of the mounted volume device are obtained and added to the preset file tracking map. When a volume device is unmounted, the superblock pointer, UUID / network path mapping entries are deleted from the preset file tracking map.
[0035] Furthermore, in order to accurately determine the files that need to be tracked, before step S004, the method further includes: obtaining volume device information in response to configuration instructions issued by the user; Based on the volume device information, the configuration path in the configuration instruction is split to obtain the target volume device information and the relative path information of the file; File tracking information is determined based on the target volume device information, the relative path information, and the tracking response behavior.
[0036] It should be noted that the configuration instructions may include the configuration path of the file to be tracked and the tracking response operation behavior. The tracking response operation behavior may be a user-defined response operation for a specific file, including interception, release, etc. The splitting of the configuration path in the configuration instructions based on the volume device information may be to split the configuration path (i.e., the absolute path) into the mount point and the relative path according to the volume device name in the volume device information, so as to obtain the volume device name (i.e., the corresponding volume device name determined according to the mount point) and the relative path of the file in the configuration path, that is, the target volume device information and the relative path information of the file.
[0037] In practical implementation, assuming the configuration paths issued by the user are " / mnt / sdb1 / a / b / c", " / mnt / sdc1 / 1 / 2 / 3", and " / mnt / share", the system's volume device mounting information is as follows: volume " / dev / sdb1" is mounted to " / mnt / sdb1", volume " / dev / sdc1" is mounted to " / mnt / sdc1", and network path " / / 192.168.0.1 / share / abc" is mounted to " / mnt / share". Based on the configuration path and mount point information, we can determine that " / mnt / sdb1 / a / b / c" refers to the subfiles on the path " / a / b / c" on the " / dev / sdb1" volume, " / mnt / sdc1 / 1 / 2 / 3" refers to the subfiles on the path " / 1 / 2 / 3" on the " / dev / sdc1" volume, and " / mnt / share" refers to the subfiles on the network path " / / 192.168.0.1 / share / abc".
[0038] Furthermore, for certain file systems (such as btrfs), subvolumes can be specified during mounting. When file path information is obtained via dentry, it will include the subvolume prefix. For example, if the btrfs subvolume "opt" is specified during mounting, the path obtained when operating on files under that subvolume will be " / opt / 1 / 2 / 3". Additionally, for network file systems (such as cifs and nfs), if a subdirectory under a shared path is mounted to another path, the file path obtained via dentry will also include a path prefix. For instance, if the subdirectory "abc" under the network shared path " / / 192.168.0.1 / share" is mounted to the path " / mnt / share", the file path information obtained via dentry will include the "abc" network path prefix, such as " / abc / 1 / 2 / 3". In these two cases, directly comparing the obtained file path information with the configured path information will not meet the requirements; neither file will be a file that needs to be tracked or protected. To address the aforementioned issues, this embodiment includes the following steps for determining file tracking information based on the target volume device information and the relative path information: Obtain the mount point information of the volume device, and determine the subvolume prefix and network path prefix based on the mount point information; The relative path information is adjusted based on the subvolume prefix and the network path prefix to obtain the adjusted relative path information; File tracking information is determined based on the adjusted relative path information, the target volume device information, and the tracking response operation behavior.
[0039] It should be noted that the adjustment of the relative path information based on the subvolume prefix and the network path prefix can be achieved by adding the subvolume prefix or network path prefix to the beginning of the relative path. Then, the file tracking information is determined based on the concatenated relative path information, the target volume device information, and the tracking response operation behavior.
[0040] In practice, when obtaining mount point information, the subvolume prefix and network path prefix are also obtained. When the file system UUID / network file path and relative path are sent to the kernel module for file tracking (i.e., when the configuration is sent), the subvolume prefix or network path prefix is appended to the relative path (for example, if the relative path is " / a / b / c", the subvolume prefix is "opt", and the network file path prefix is "abc", then after appending the prefix, it becomes " / opt / a / b / c" or " / abc / 1 / 2 / 3"). In this way, when the kernel module tracks file operations and compares paths, it can accurately match the file path.
[0041] Other ways to solve the above problems include: determining whether a subvolume prefix or a network path prefix exists in the relative file path; If it exists, the relative file path is adjusted according to the subvolume prefix or the network path prefix to obtain the target relative path information; The file tracking response behavior is obtained by querying the preset file tracking mapping table based on the superblock pointer and the target relative path information.
[0042] It should be noted that adjusting the relative file path based on the subvolume prefix or the network path prefix to obtain the target relative path information may involve deleting the subvolume prefix or the network path prefix from the relative file path.
[0043] In practice, when obtaining the file path through dentry, the vfsmount structure pointer (struct vfsmount*) is used to determine whether a subvolume prefix or network path prefix exists. If it exists, the path prefix information is obtained through them (for example, the subvolume prefix "opt" or the network prefix "abc" is obtained). Then, the prefix part is skipped after the path obtained through dentry. For example, " / opt / a / b / c" becomes " / a / b / c" after skipping the subvolume prefix, and " / abc / 1 / 2 / 3" becomes " / 1 / 2 / 3" after skipping the network prefix. In this way, the kernel module can accurately match the file path when tracing file operations.
[0044] In practice, when a file tracking device receives a file path configuration request from a user, it first obtains the UUID information of all volume devices and file systems on the current host. For network file systems, which do not have UUIDs, the mounted network path is used instead. Then, it obtains the mount point information of all volume devices on the system and the mount point information of network file systems (that is, the mount point of a volume device or a network file system). This can be achieved by reading the " / proc / mounts" system file (which stores the mount point information of all mounted volume devices and network file systems) and the " / etc / fstab" configuration file (which stores the mount point information of all volume devices and network file systems that are automatically mounted at boot), and taking the union of the two.
[0045] Based on the issued configuration path and mount point information, confirm the target volume device or network path corresponding to the configuration path. After confirming the target volume and relative file path to be tracked and protected, send the volume device's file system UUID or network path and relative file path to the kernel driver module, which then performs the tracking and protection of the target files. Simultaneously, display the names of the tracked and protected volume devices and their relative file paths to the user through the interface, allowing the user to confirm that all files requiring tracking and protection are present in the display. This prevents situations where the user hasn't added the volumes to be protected to " / proc / mounts" or " / etc / fstab," resulting in the volume devices not being sent to the kernel driver module. After user confirmation, save all the information about the volume devices and relative file paths to be tracked and protected to the configuration file (i.e., the default file tracking mapping table). Subsequent system reboots will also follow these configuration policies for file operation tracking and protection. After the configuration is distributed, the target objects that need to be tracked and protected are confirmed. If a hacker subsequently mounts " / dev / sdc1" to " / tmp / sdc1" and performs destructive operations on files under " / tmp / sdc1 / 1 / 2 / 3", the kernel module will automatically intercept these operations (meaning the protection effect will remain effective regardless of the mounted path of the tracked and protected target volume). Furthermore, if an administrator mistakenly mounts " / dev / sdg1" to the path " / mnt / sdc1 / 1 / 2 / 3", deleting files under " / mnt / sdc1 / 1 / 2 / 3" will not be intercepted by the kernel module (because " / dev / sdg1" is not a tracked and protected target volume, and all files on it are not tracked or protected objects; deletion will not be intercepted). To achieve this protection, the kernel module needs to perform the following operations: During loading, the system first enumerates the mounted volume devices and network file systems, obtaining the file system UUID and network path information for each volume device. It also retrieves the superblock pointer (struct super_block*) created when the system mounts the volume device or network file path, and establishes a superblock, file system UUID / network path mapping table. Next, it monitors the mounting and unmounting operations of volumes on the system. If a new volume device or network path is successfully mounted, it obtains the corresponding file system UUID / network path and superblock pointer, adding them to the mapping table. Furthermore, if a mounted volume device is destroyed (when all mount points of the volume are unmounted), the superblock pointer of the volume is obtained before destruction, and the superblock, file system UUID / network path mapping entries are deleted from the mapping table after the mount points are destroyed. After establishing the mapping table, when tracking file operations, the superblock pointer can be obtained based on the file operation parameters, allowing the system to determine which volume device / network file system the file belongs to. By enumerating mounted system volumes and dynamically tracking their mounting and unmounting behavior, a one-to-one mapping relationship is established between the superblock pointer and the volume device / network file system. By comparing the superblock pointer, it can be determined whether the file being operated on belongs to the target volume / network file system.
[0046] This embodiment obtains information on all currently mounted volume devices; determines the superblock pointer corresponding to the volume device and the network file path; determines the unique identifier of the volume device based on the volume device information; and constructs a preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and file tracking information. By constructing this preset file tracking mapping table, this embodiment achieves accurate file tracking without relying on the volume's mount point, avoiding changes in the tracking object due to changes in the mount point.
[0047] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the document tracking method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0048] This application also provides a document tracking device, please refer to... Figure 3 The document tracking device includes: The determination module 10 is used to respond to a file operation instruction and determine the superblock pointer and relative file path corresponding to the file to be operated based on the file operation instruction. The superblock pointer is a memory address pointing to the memory data structure of the volume device where the file to be operated is located. The query module 20 is used to query a preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The response module 30 is used to respond to the file operation instruction based on the file tracking response operation behavior.
[0049] This embodiment responds to file operation commands by determining the superblock pointer and relative file path of the file to be operated on, where the superblock pointer is the memory address of the memory data structure of the volume device where the file to be operated resides. Based on the superblock pointer and relative file path, a preset file tracking mapping table is queried to obtain the file tracking response behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The file operation command is then responded to according to the file tracking response behavior. Because this embodiment determines the file tracking response behavior based on the superblock pointer and relative file path of the file to be operated, and then performs file tracking, compared to existing file tracking methods based on file mount points, this embodiment achieves more accurate file tracking and protection.
[0050] The document tracking device provided in this application, employing the document tracking method described in the above embodiments, can solve the technical problem of inaccurate document tracking objects in existing technologies. Compared with the prior art, the beneficial effects of the document tracking device provided in this application are the same as those of the document tracking method described in the above embodiments, and other technical features in the document tracking device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0051] This application provides a file tracking device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the file tracking method in Embodiment 1 above.
[0052] The following is for reference. Figure 4The diagram illustrates a structural schematic of a file tracking device suitable for implementing embodiments of this application. The file tracking device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The document tracking device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0053] like Figure 4 As shown, the file tracking device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the file tracking device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the document tracking device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show document tracking devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0054] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0055] The document tracking device provided in this application, employing the document tracking method described in the above embodiments, can solve the technical problem of inaccurate document tracking objects in existing technologies. Compared with the prior art, the beneficial effects of the document tracking device provided in this application are the same as those of the document tracking method provided in the above embodiments, and other technical features of the document tracking device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0056] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0057] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0058] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the file tracking method described in the above embodiments.
[0059] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0060] The aforementioned computer-readable storage medium may be included in the file tracking device; or it may exist independently and not be assembled into the file tracking device.
[0061] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Python, Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0062] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0063] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0064] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described file tracking method, thereby solving the technical problem of inaccurate file tracking objects in existing technologies. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the file tracking method provided in the above embodiments, and will not be repeated here.
[0065] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the file tracking method described above.
[0066] The computer program product provided in this application can solve the technical problem of inaccurate file tracking objects in existing technologies. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the file tracking method provided in the above embodiments, and will not be repeated here.
[0067] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.
Claims
1. A file tracking method, characterized in that, The file tracking method includes the following steps: In response to a file operation instruction, the superblock pointer and relative file path of the file to be operated are determined based on the file operation instruction. The superblock pointer is a memory address that points to the memory data structure of the volume device where the file to be operated is located. Based on the superblock pointer and the relative file path, a preset file tracking mapping table is queried to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The file operation instruction is responded to based on the file tracking response operation behavior.
2. The file tracking method as described in claim 1, characterized in that, Before querying the preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response behavior, the process also includes: Get information on all currently mounted volume devices; Determine the superblock pointer corresponding to the volume device and network file path; Determine a unique identifier for the volume device based on the volume device information; A preset file tracking mapping table is constructed based on the superblock pointer, the unique identifier, the network file path, and the file tracking information.
3. The file tracking method as described in claim 2, characterized in that, Before constructing the preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information, the method further includes: In response to configuration commands issued by the user, obtain volume device information; Based on the volume device information, the configuration path in the configuration instruction is split to obtain the target volume device information and the relative path information of the file; File tracking information is determined based on the target volume device information, the relative path information, and the tracking response behavior.
4. The file tracking method as described in claim 3, characterized in that, The step of determining file tracking information based on the target volume device information, the relative path information, and the tracking response operation behavior includes: Obtain the mount point information of the volume device, and determine the subvolume prefix and network path prefix based on the mount point information; The relative path information is adjusted based on the subvolume prefix and the network path prefix to obtain the adjusted relative path information; File tracking information is determined based on the adjusted relative path information, the target volume device information, and the tracking response operation behavior.
5. The file tracking method as described in claim 2, characterized in that, After constructing a preset file tracking mapping table based on the superblock pointer, the unique identifier, the network file path, and the file tracking information, the method further includes: Monitor the mounting and unmounting information of the monitoring roll-up equipment; The superblock information of the volume device is determined based on the mounting and unmounting information. The preset file tracking mapping table is updated based on the superblock information.
6. The document tracking method according to any one of claims 1-5, characterized in that, The process of querying a preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response behavior includes: Determine whether a subvolume prefix or network path prefix exists in the relative file path; If it exists, the relative file path is adjusted according to the subvolume prefix or the network path prefix to obtain the target relative path information; The file tracking response behavior is obtained by querying the preset file tracking mapping table based on the superblock pointer and the target relative path information.
7. A document tracking device, characterized in that, The document tracking device includes: The determination module is used to respond to a file operation instruction and determine the superblock pointer and relative file path corresponding to the file to be operated based on the file operation instruction. The superblock pointer is a memory address pointing to the memory data structure of the volume device where the file to be operated is located. The query module is used to query a preset file tracking mapping table based on the superblock pointer and the relative file path to obtain the file tracking response operation behavior. The preset file tracking mapping table is a mapping table pre-constructed based on the file's superblock pointer, file identifier, and file tracking information. The response module is used to respond to the file operation instructions based on the file tracking response operation behavior.
8. A document tracking device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the file tracking method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the file tracking method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the file tracking method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
File tracking method and device, equipment and storage medium
CN108153869A
File path determination method, device and equipment, and readable storage medium
CN110851405A
File system monitoring method based on file path
CN119668982A
Method, device and computer program product for implementing file system
US20200364148A1