File processing method and computer device

By using extended attribute blocks to record file path information in the operating system, the problem of low file association in the file system is solved, thereby improving the accuracy and efficiency of file management.

WO2026098000A1PCT designated stage Publication Date: 2026-05-15XFUSION DIGITAL TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
XFUSION DIGITAL TECH CO LTD
Filing Date
2025-08-21
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the lack of a unified naming standard in the operating system file system and the insufficiently rigorous association between files lead to chaotic file management and make it easy for files to be lost or confused.

Method used

By obtaining the file information and extended attribute information of the first file, and using the extended attribute block to record the file path information of the second file, the association between the first file and the second file is established, including the association processing of backup files, source files, signature files, abnormal generated files and executable files.

Benefits of technology

It achieves accurate file association, avoids file confusion, improves the accuracy and efficiency of restoring original files, simplifies the archiving and management of signed files, and ensures the correct operation of executable files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025116083_15052026_PF_FP_ABST
    Figure CN2025116083_15052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a file processing method and apparatus, a computer device, and a storage medium. The method comprises: in response to a first operation of a user, acquiring file information of a first file; on the basis of the file information of the first file, acquiring extended attribute information of the first file, the extended attribute information comprising file path information of a second file, relationships between the first file and the second file comprising at least one of the following relationships: the first file is a backup file of the second file, the second file is a source file of the first file, the first file is a signature file of the second file, the first file is a file generated after a runtime anomaly of the second file, or the second file is an executable file of the first file; and processing the second file on the basis of the file path information of the second file. By means of the file processing method provided by the present application, the second file corresponding to the first file can be accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Document processing methods and computer equipment

[0001] This application claims priority to Chinese Patent Application No. 202411581317.9, filed with the State Intellectual Property Office of China on November 6, 2024, entitled "Document Processing Method and Computer Equipment", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, specifically to a document processing method and a computer device. Background Technology

[0003] In operating systems, it is often necessary to associate different files. Currently, file associations can be established based on the logical requirements of specific applications. For example, the association between backup files and original files, or the association between signed files and original files. However, due to the lack of a unified naming convention for files in the operating system's file system, the existing methods of establishing file associations based on file names are often not rigorous enough, easily leading to file loss and causing chaotic file management. Summary of the Invention

[0004] This application provides a file processing method and a computer device to solve the technical problem of low correlation between files, which easily leads to file confusion.

[0005] Firstly, this application provides a file processing method, comprising: responding to a user's first operation, obtaining file information of a first file; based on the file information of the first file, obtaining extended attribute information of the first file, the extended attribute information including file path information of a second file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is a source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file; and processing the second file based on the file path information of the second file. Through the above technical solution, the first file and the second file can be associated, facilitating accurate location and processing of the second file through the first file, and avoiding file confusion.

[0006] In one possible implementation, the first file is a backup file of the second file, and processing the second file based on the file path information of the second file includes: copying the first file, and saving the copied first file according to the file path information of the second file to restore the second file. This technical solution can associate the original file with the backup file, thereby improving the accuracy of restoring the original file.

[0007] In one possible implementation, the first file is the file after the second file has been moved to the Trash folder. Processing the second file based on its file path information includes moving the first file to the file path corresponding to the file path information of the second file to recover the second file. This technical solution can associate the original file with the original file after it has been moved to the Trash folder, improving the efficiency and accuracy of retrieving the original file.

[0008] In one possible implementation, the method further includes deleting the extended attribute information of the first file. This technical solution allows for real-time reflection of the original file's status after recovery by deleting the extended attribute information of the first file.

[0009] In one possible implementation, the first file is a signature file of the second file, and processing the second file based on the file path information of the second file includes: obtaining the second file based on the file path information of the second file; and sending the first file and the second file. Through the above technical solution, the file path information of the signature file and the original file can be accurately recorded, facilitating the archiving and management of the signature file.

[0010] In one possible implementation, the first file is a file generated after the second file malfunctions. Processing the second file based on its file path information includes displaying the second file based on its file path information. This technical solution accurately records the file path of the second file based on its file path information, avoiding the problem of being unable to determine the corresponding second file when multiple first files exist simultaneously.

[0011] In one possible implementation, the second file is an executable version of the first file, and processing the second file based on its file path information includes: executing the second file based on its file path information, so that the second file runs the first file. Through this technical solution, the executable file of the first file can be accurately and concisely determined, and the first file can be run quickly and efficiently using the second file.

[0012] In one possible implementation, the method further includes: in response to a second user operation, obtaining the file path information of the second file; and storing the file path information of the second file in the storage area corresponding to the file extended attribute block of the first file. Through the above technical solution, the association between the first file and the second file can be accurately recorded through the storage area corresponding to the file extended attribute block of the first file.

[0013] In one possible implementation, obtaining the extended attribute information of the first file based on its file information includes: determining the inode corresponding to the first file based on its file information, wherein the inode includes an extended attribute block, and the extended attribute block records pointers to data blocks; and obtaining the extended attribute information of the first file from the data blocks based on the pointers. Through this technical solution, the association between the first file and the second file can be bound using the extended attribute information of the first file, facilitating the accurate retrieval of the second file based on the first file.

[0014] In one possible implementation, the first operation includes inputting a first instruction, the first instruction including file information of the first file, or the first operation is a click operation on the first file.

[0015] Secondly, this application provides a file processing method, the method comprising: responding to a second operation by a user, obtaining file information of a first file and file path information of a second file, wherein the file information of the first file corresponds to a storage area of ​​the file extended attributes of the first file; storing the file path information of the second file in the storage area of ​​the file extended attributes of the first file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is a source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file. Through the above technical solution, the extended attributes of the first file can be set, the corresponding file information of the second file can be recorded, and an association relationship between the first file and the second file can be established, facilitating accurate processing of the second file based on the extended attributes of the first file.

[0016] Thirdly, this application provides a file processing apparatus, comprising: an acquisition module, configured to acquire file information of a first file in response to a first user operation; the acquisition module is further configured to acquire extended attribute information of the first file based on the file information of the first file, the extended attribute information including file path information of a second file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is a source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file; and a processing module, configured to process the second file based on the file path information of the second file. Through the above technical solution, the first file and the second file can be associated, facilitating accurate location and processing of the second file through the first file, and avoiding file confusion.

[0017] In one possible implementation, the first file is a backup file of the second file. The processing module is further configured to copy the first file and save the copied first file according to the file path information of the second file to restore the second file. This technical solution associates the original file with the backup file, improving the accuracy of restoring the original file.

[0018] In one possible implementation, the first file is the file after the second file has been moved to the trash folder. The processing module is further configured to move the first file to the file path corresponding to the file path information of the second file, in order to recover the second file. This technical solution can associate the original file with the original file after it has been moved to the trash folder, thereby improving the efficiency and accuracy of retrieving the original file.

[0019] In one possible implementation, the processing module is further configured to delete the extended attribute information of the first file. This technical solution allows for real-time reflection of the original file's status after recovery by deleting the extended attribute information of the first file.

[0020] In one possible implementation, the first file is a signature file of the second file, and the processing module is further configured to obtain the second file based on its file path information; and send the first file and the second file. This technical solution accurately records the file path information of the signature file and the original file, facilitating the archiving and management of the signature file.

[0021] In one possible implementation, the first file is a file generated after the second file malfunctions. The processing module is further configured to display the second file based on its file path information. This technical solution accurately records the file path of the second file based on its file path information, avoiding the problem of being unable to determine the corresponding second file when multiple first files exist simultaneously.

[0022] In one possible implementation, the second file is an executable file of the first file. The processing module is further configured to execute the second file based on the file path information of the second file, so that the second file runs the first file. Through the above technical solution, the executable file of the first file can be accurately and concisely determined, and the first file can be run quickly and efficiently using the second file.

[0023] In one possible implementation, the processing module is further configured to, in response to a second user operation, obtain the file path information of the second file; and store the file path information of the second file in the storage area corresponding to the file extended attribute block of the first file. Through the above technical solution, the association between the first file and the second file can be accurately recorded through the storage area corresponding to the file extended attribute block of the first file.

[0024] In one possible implementation, the processing module is further configured to determine the inode corresponding to the first file based on the file information of the first file, wherein the inode includes an extended attribute block, and the extended attribute block records pointers to data blocks; and retrieve the extended attribute information of the first file from the data blocks based on the pointers. Through the above technical solution, the association between the first file and the second file can be bound using the extended attribute information of the first file, facilitating the accurate retrieval of the second file based on the first file.

[0025] In one possible implementation, the first operation includes inputting a first instruction, the first instruction including file information of the first file, or the first operation is a click operation on the first file. In a fourth aspect, this application provides a file processing apparatus, comprising: an acquisition module, configured to acquire file information of a first file and file path information of a second file in response to a second operation by a user, wherein the file information of the first file corresponds to a storage area of ​​the file extended attributes of the first file; and a processing module, configured to store the file path information of the second file in the storage area of ​​the file extended attributes of the first file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is a source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file. Through the above technical solution, the extended attributes of the first file can be set, the corresponding file information of the second file can be recorded, and an association relationship between the first file and the second file can be established, facilitating accurate processing of the second file based on the extended attributes of the first file.

[0026] Fifthly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the file processing method as described in any of the preceding claims.

[0027] Sixthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the file processing method as described above.

[0028] In a seventh aspect, embodiments of this application provide a computer program product that includes a computer program that, when run on a processor, causes the processor to execute the file processing method described in the first aspect, the second aspect, or any possible implementation of the first aspect.

[0029] In the file processing method provided in this application, file information of a first file is obtained in response to a user's first operation; based on the file information of the first file, extended attribute information of the first file is obtained, the extended attribute information including file path information of a second file; and the second file is processed based on the file path information of the second file. The association between the first file and the second file can be accurately recorded through the extended attribute information of the first file, and the second file corresponding to the first file can be accurately located through this association. Attached Figure Description

[0030] Figure 1 is a schematic diagram of an application scenario of the file processing method provided in the embodiments of this application.

[0031] Figure 2 is a schematic diagram of the file system structure provided in an embodiment of this application.

[0032] Figure 3 is a flowchart of the file processing method provided in an embodiment of this application.

[0033] Figure 4 is a flowchart of a document processing method provided in another embodiment of this application.

[0034] Figure 5 is a flowchart of a document processing method provided in another embodiment of this application.

[0035] Figure 6 is a flowchart of a document processing method provided in another embodiment of this application.

[0036] Figure 7 is a flowchart of a document processing method provided in another embodiment of this application.

[0037] Figure 8 is a flowchart of a document processing method provided in another embodiment of this application.

[0038] Figure 9 is a flowchart of a document processing method provided in another embodiment of this application.

[0039] Figure 10 is a structural diagram of the document processing apparatus provided in an embodiment of this application. Detailed Implementation

[0040] For ease of understanding, some concepts related to the embodiments of this application are illustrated and explained by way of example.

[0041] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence. For ease of understanding, the technical terms involved in the embodiments of this application will be introduced below.

[0042] (1) File system (FS)

[0043] A file system is a method used by an operating system to identify files on a storage device or partition; in other words, it's a method of organizing files on a storage device. Generally, the software component in an operating system responsible for managing and storing file information is called a file management system, or simply a file system. From a system perspective, a file system organizes and allocates space on a storage device, is responsible for storing files, and protects and retrieves stored files. Specifically, the file system is responsible for operations such as creating, storing, reading, modifying, dumping, and revoking files, as well as controlling file access for users.

[0044] (2) Extended attribute (EA)

[0045] Extended attributes are a feature of the file system that allows users to record file metadata. Metadata is information used to describe file attributes. For example, file extended attributes indicate the file's metadata in the form of name-value pairs.

[0046] In Linux systems, dedicated commands can be used to view or set file extended attributes. For example, in network file protocols, the Server Message Block (SMB) protocol allows querying and setting file extended attributes through the `File_Full_Ea_Information` subcommand for querying (`QUERY_INFO`) and setting (`SET_INFO`).

[0047] (3) Storage devices

[0048] A storage device is a device that provides file storage functionality. Most storage devices offer network protocol interfaces such as Network File System (NFS) and Server Message Block (SMB) to allow other devices to access files through these interfaces. For example, a storage device might be a storage array. A storage array consists of a large number of storage units arranged in an N x M matrix. Simply put, a storage array essentially treats multiple disks as a single disk, storing data in segments across different disks. When accessing data, the relevant disks in the storage array operate simultaneously, significantly reducing data access time and achieving better space utilization.

[0049] The technical terms involved in the embodiments of this application have been introduced above. The following will describe the application scenarios of the file processing method provided in the embodiments of this application. As shown in Figure 1, the file processing method is applied to computer device 1. In the embodiments of this application, computer device 1 may be a computer, server, smart screen, mobile phone, tablet computer, smart wearable device, augmented reality (AR) / virtual reality (VR) device, laptop computer, netbook, energy storage device, power distribution equipment, vehicle-mounted equipment, self-moving device, etc. The embodiments of this application do not limit the specific type of computer device.

[0050] The specific structure of the computer device will be described below. Referring to Figure 1, which is a schematic diagram of the structure of a computer device 1 provided in an embodiment of this application, the computer device 1 includes, but is not limited to, as shown in Figure 1, a memory 101, a processor 102, an input / output (I / O) interface 103, and a bus 104. The processor 102 is coupled to the memory 101 and the I / O interface 103 via the bus 104.

[0051] The memory 101 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 102, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0052] Random access memory can include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.

[0053] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 102. Non-volatile memory can include disk storage devices and flash memory.

[0054] Memory 101 is used to store one or more computer programs. The one or more computer programs are configured to be executed by processor 102. The one or more computer programs include multiple instructions that, when executed by processor 102, can implement a data processing method that can be executed on computer device 1.

[0055] In other embodiments, the computer device 1 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the computer device 1.

[0056] Processor 102 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0057] The processor 102 provides computing and control capabilities. For example, the processor 102 is used to execute computer programs stored in the memory 101 to implement the data transfer method described above.

[0058] I / O interface 103 is used to provide a channel for user input or output. For example, I / O interface 103 can be used to connect various input and output devices, such as mouse, keyboard, touch screen, etc., so that users can enter information or visualize information.

[0059] Bus 104 is used at least to provide a channel for communication between memory 101, processor 102 and I / O interface 103 in computer device 1.

[0060] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the computer device 1. For example, the computer device 1 may also include a wireless communication module (not shown in the figure), which can provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication networks, Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR). The computer device 1 may also include a file system (as shown in Figure 2), which is used to manage and organize files and directories, organize files and directories on the memory 101, and provide operations such as access, read, write, modify, and delete.

[0061] In other embodiments of this application, the computer device 1 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0062] To better understand the file processing method provided in this application, the structure of the file system is described below. As shown in Figure 2, the file system 105 includes an inode area 1051 and a data block area 1052. The inode area 1051 includes multiple inodes. As shown in Figure 2, the inode area 1051 includes inode 1, inode 2, ..., inode N. The inodes record file information, including access control information, data organization information, and an extended attribute block (EAB). The access control information may include owner information, group information, the time of the last file modification, the time of the last modification of file attributes, the time of the last access to the file, and access permissions. The data organization information may include the address of the data block, file data encryption / decryption information, file size, and indirect inode addresses. The extended attribute block is a field within an inode, and it can store pointers to data blocks in the data block area 1012.

[0063] In one implementation, the file's inode can occupy the size of a block. A block can be 4KB, or 4096 bytes.

[0064] Data block area 1052 comprises multiple data blocks. As shown in Figure 2, data block area 1052 includes data block 1, data block 2, ..., data block M, ..., data block N. Data blocks can store various information about the file, such as its extended attributes and content.

[0065] In some embodiments, the file system 105 may further include a superblock (not shown in the figure). The superblock is located in the first block of the file system 105 and stores the control information of the file system 105. This includes directory entries of the file system 105. The directory entries are organized in a tree topology to form a directory tree used by users, providing the business with the function of accessing files by path. The data blocks in the data block area 1052 are used to store the content of the files. The inode area 1051 stores the directory entries and the inodes corresponding to each file. The inodes also store the file attributes and storage address, which points to the data block storing the content of the file. When performing file retrieval, the directory entries in the superblock can be used to search level by level, using the full path file name as the keyword.

[0066] The technical solutions of this application will be described in detail below with specific embodiments. The specific embodiments described below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0067] Figure 3 is a flowchart illustrating a file processing method provided in an embodiment of this application. The file processing method is applied in a computer device. As shown in Figure 3, the file processing method may include:

[0068] Step S301: In response to the user's first operation, obtain the file information of the first file.

[0069] In this embodiment, when a user needs to use a first file, the computer device responds to the user's first operation on the first file by obtaining the file information of the first file. The first operation includes inputting a first instruction. For example, entering the `get` instruction in a command box. The first instruction includes the file information of the first file, wherein the file information of the first file includes one or more of the file name and file path of the first file. The first operation may also include a click operation on the first file, which includes a single click and / or a double click. Clicking the first file can open or select the file.

[0070] Step S302: Based on the file information of the first file, obtain the extended attribute information of the first file, wherein the extended attribute information of the first file includes the file path information of the second file.

[0071] In this embodiment of the application, obtaining the extended attribute information of the first file based on the file information of the first file includes: determining the index node corresponding to the first file according to the file information of the first file, wherein the index node includes an extended attribute block, and the extended attribute block records a pointer to a data block; and obtaining the extended attribute information of the first file from the data block according to the pointer.

[0072] In this embodiment, the data block stores the extended attributes of the first file, and the extended attributes record the file information of the second file. Therefore, the association between the first file and the second file can be established through the extended attributes.

[0073] In this embodiment of the application, the index node records the relevant metadata of the first file, including but not limited to: the owner information of the first file, the group information of the first file, the time of the last modification of the first file, the time of the last modification of the attributes of the first file, the time of the last access to the first file, the access permissions of the first file, and the extended attribute block of the first file.

[0074] In some embodiments, the relationship between the first file and the second file includes at least one of the following: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file. The above description of the relationship between the first file and the second file is illustrative and is not intended to limit practical applications.

[0075] In one embodiment, if the first file is a backup file of the second file, assuming the second file is named `myfile` and its path is ` / a / b / myfile`, and the first file is named `myfile.bak` and its path is ` / a / b / myfile.bak`, then an association can be established between the two files based on their filenames, indicating that the first file is a backup file of the second file. When the first and second files are stored in the same location on the storage device, their association can be determined based on their file paths. For example, if the first file's path is ` / a / b / myfile.bak` and the second file's path is ` / a / b / myfile`, then the first file can be identified as a backup file of the second file. However, when the first and second files are stored in different locations on the storage device, and files with the same filename as either the first or second file exist in those locations, it becomes more difficult to determine their association, making it impossible to accurately locate the backup file of the second file, and potentially leading to file confusion. For example, the first file's file path is / a / b / myfile.bak; the second file's file path is / c / d / myfile, and a file named myfile.bak exists in the same directory as the second file. It's highly likely that the file named myfile.bak will be mistakenly identified as a backup of the second file. To solve this problem, extended attributes can be set for the first file, and these attributes can be used to record the association between the first and second files.

[0076] In some embodiments, when the first file is a backup file of the second file, the extended attribute information of the first file includes at least one of the following: the universally unique identifier (UUID) of the disk device where the second file is located, the modification time of the second file, and the file path information of the second file.

[0077] In some embodiments, when the first file is a signature file of the second file, the extended attribute information of the first file includes at least one of the following: a universally unique identifier of the disk device where the second file is located, and the file path information of the second file.

[0078] In some embodiments, when the first file is a deleted second file, the extended attribute information of the first file includes at least one of the following: a universally unique identifier of the disk device where the second file is located, the time when the second file was modified, and the file path information of the second file.

[0079] In some embodiments, when the first file is a file generated after the second file runs abnormally, the extended attributes of the first file include at least the file path information of the second file. The first file is a core dump file generated when an exception occurs during the execution of the second file. A core dump file is a file generated by a computer system when a program crashes or terminates abnormally, and it may contain at least the memory contents of the program at the time of the crash or abnormal termination.

[0080] In some embodiments, when the first file is a data file and the second file is an executable file of the first file, the extended attributes of the first file include at least: the file path information of the second file. Specifically, the second file is an executable file corresponding to an application that operates on the first file.

[0081] In some embodiments, when the file system includes an extended attribute block, the limited capacity of the extended attribute block makes it impossible to record the relationships between all files in the file system. Data compression techniques can be used to compress the data recorded in the extended data block. Since the pointers to data blocks recorded in the extended attribute block can be of any form, compressing the data recorded in the extended data block using data compression techniques will not result in data loss.

[0082] Step S303: Process the second file based on the file path information of the second file.

[0083] In this embodiment, a second file can be obtained based on the association relationship, and related operations can be performed on the second file. Specifically, after obtaining the association relationship between the first file and the second file based on the extended attribute information of the first file, the second file can be processed based on the file path information of the second file.

[0084] In this embodiment of the application, if the first file is a backup file of the second file, processing the second file based on the file path information of the second file includes: copying the first file, saving the copied first file according to the file path information of the second file, so as to restore the second file.

[0085] In this embodiment of the application, if the first file is a file that the second file has moved to the trash folder, processing the second file based on the file path information of the second file includes: moving the first file to the file path corresponding to the file path information of the second file to restore the second file.

[0086] In this embodiment of the application, if the first file is a signature file of the second file, processing the second file based on the file path information of the second file includes: obtaining the second file based on the file path information of the second file; and sending the first file and the second file.

[0087] In this embodiment of the application, if the first file is a file generated after the second file runs abnormally, the step of processing the second file based on the file path information of the second file includes: displaying the second file based on the file path information of the second file.

[0088] In this embodiment of the application, if the second file is an executable file of the first file, the step of processing the second file based on the file path information of the second file includes: executing the second file based on the file path information of the second file, so that the second file runs the first file.

[0089] In some embodiments, the file processing method further includes: in response to a second user operation, obtaining file path information of a second file; and storing the file path information of the second file in the storage area corresponding to the file extended attribute block of the first file. The extended attributes of the first file are set by storing the file path information of the second file in the storage area corresponding to the file extended attribute block of the first file. The extended attributes of the first file indicate the metadata corresponding to the first file in a key-value pair format. Specifically, the extended attributes of the first file may include an extended attribute name and an extended attribute value. For example, assuming the first file is a backup file obtained by copying the second file, the extended attribute name of the first file can be set to "user.backup_orig", and the extended attribute value can be set to "uuid0;path / to / origin;modtime". Here, "back" is the file name of the second file, "uuid0" represents the universally unique identifier of the storage device where the second file is located, "path / to / origin" represents the path where the second file is stored on the storage device, and "modtime" represents the time the second file was modified.

[0090] In some embodiments, the extended attributes of the first file may be set by the application requesting the storage of the first file. When the first file is already stored on the storage device, the application may send a request to the storage device to request the storage device to set the extended attributes of the first file. For example, the storage device receives a preset request from the application, which requests the setting of the extended attributes of the first file, and the preset request includes the extended attributes of the first file; the storage device obtains the extended attributes of the first file according to the preset request. The preset request may carry the name and value of the extended attributes of the first file. Thus, the storage device can set the extended attributes of the first file based on the name and value of the extended attributes in the preset request.

[0091] In some embodiments, a user can set the extended attributes of a first file by entering preset instructions through a computer device. For example, in the user interface of the computer device, the user can instruct the storage device to set the extended attributes of the first file by entering preset instructions on the user interface. The preset instructions entered by the user may instruct the storage device to modify the extended attributes of multiple files in batches, and the first file belongs to multiple files whose extended attributes are being modified in batches; the preset instructions entered by the user may also instruct the storage device to modify the extended attributes of a specific file (e.g., the first file). Alternatively, the user can instruct the storage device to set the extended attributes of the first file by entering command lines into the storage device. The preset instructions entered by the user include one or more strings. Based on the preset instructions, the storage device determines that the extended attributes of the first file are one or more strings. For example, if the preset instructions include string 1 and string 2, the storage device can determine that the extended attribute name in the extended attributes of the first file is string 1, and the extended attribute value is string 2.

[0092] In this embodiment, by setting the extended attributes of the first file and recording the file information of the corresponding second file, an association relationship between the first file and the second file is established. This association relationship can be used to accurately find and process the second file corresponding to the first file, thus avoiding file confusion.

[0093] Figure 4 is a flowchart illustrating a file processing method provided in an embodiment of this application. The file processing method is applied in a computer device. As shown in Figure 4, the file processing method may include:

[0094] Step S401: In response to the user's second operation, obtain the file information of the first file and the file path information of the second file, wherein the file information of the first file corresponds to the storage area of ​​the file extended attributes of the first file.

[0095] In this embodiment, after setting the extended attributes of the first file, when a user needs to use the first file, the computer device, in response to a second operation on the first file, obtains the file information of the first file and the file path information of the second file. The file information of the first file corresponds to the storage area of ​​the file extended attributes of the first file. The second operation may include, but is not limited to, opening a file and selecting a file. For example, in response to the operation of opening the first file, the corresponding inode can be obtained based on the file name of the first file. Similarly, in response to the operation of selecting the first file, the corresponding inode can be obtained based on the file name of the first file.

[0096] Step S402: Store the file path information of the second file in the storage area of ​​the file extension attributes of the first file.

[0097] In this embodiment, after obtaining the file information of the first file and the file path information of the second file, the association between the first and second files is established by storing the file path information of the second file in the storage area of ​​the file extended attributes of the first file. Specifically, in response to the second operation on the first file, a corresponding index node can be obtained based on the file information of the first file. The index node includes an extended attribute block, which records pointers to the storage area. Information recorded in the storage area can be read based on these pointers. Therefore, it is necessary to store the file path information of the second file in the storage area of ​​the file extended attributes of the first file.

[0098] In this embodiment, the index node records file information of the second file, including but not limited to: the owner information of the second file, the group information of the second file, the time of the last modification of the second file, the time of the last modification of the attributes of the second file, the time of the last access to the second file, the access permissions of the second file, and the extended attribute block of the second file. The extended attribute block records pointers to data blocks.

[0099] In some embodiments, when the file system includes an extended attribute block, the limited capacity of the extended attribute block makes it impossible to record the relationships between all files in the file system. Data compression techniques can be used to compress the data recorded in the extended data block. Since the pointers to data blocks recorded in the extended attribute block can be of any form, compressing the data recorded in the extended data block using data compression techniques will not result in data loss. In this embodiment, the data block stores the extended attributes of a first file, and the extended attributes record the file information of a second file. Therefore, the extended attributes can establish a relationship between the first file and the second file. In some embodiments, the relationship between the first file and the second file includes at least one of the following: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is a signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file. The above description of the relationship between the second file and the first file is illustrative and is not intended to limit practical applications. Through this embodiment, extended attributes of the first file can be set, corresponding file information of the second file can be recorded, and a relationship between the first file and the second file can be established, facilitating accurate processing of the second file based on the extended attributes of the first file.

[0100] In the embodiments of this application, the first file may be the original file or a file obtained from the original file; the second file may be the original file or a file obtained from the original file, and this application does not limit this.

[0101] Figure 5 is another schematic flowchart of the file processing method provided in this application embodiment, which is applied to a computer device. As shown in Figure 5, the file processing method may include:

[0102] In step S501, in response to the second operation, the second file is copied to obtain the first file.

[0103] In one embodiment, in a backup file application scenario, in response to a second operation performed by the user on a second file, the second file is copied to obtain a first file. Here, the second operation is a copy operation, the second file is the source file, and the first file is a backup file of the second file.

[0104] Step S502: Obtain the file information of the first file and the file path information of the second file.

[0105] In this embodiment, after obtaining the first file, the file information of the first file and the file path of the second file can be acquired. Based on the file path of the second file, the inode corresponding to the first file can be determined. The inode includes an extended attribute block, which records pointers to data blocks. The data blocks store the extended attributes of the first file, and the extended attributes record the file information of the second file.

[0106] Step S503: Store the file path information of the second file in the storage area of ​​the file extension attributes of the first file.

[0107] In this embodiment, determining the association between the first and second files based on file names has certain limitations. For example, when the first and second files have different file paths, it is easy to fail to accurately locate the backup file of the second file. The file information of the second file can be recorded by setting extended attributes of the first file, with the file information of the first file corresponding to the storage area of ​​the extended attributes of the first file. The association between the first and second files is established through the extended attributes of the first file. The file information of the first file includes its file name and / or file path; the file information of the second file includes at least: the UUID of the disk device where the second file is located, the file path information of the second file, and the time when the second file was modified.

[0108] In some embodiments of this application, it is assumed that the second file is the original file, which can be named "origin"; and the first file is the backup file, which can be named "bak". In response to the operation of copying the original file, a backup file is obtained; the UUID of the disk device where the original file is located is obtained and set to "uuid0"; the file path of the original file on the disk device is obtained and set to "path / to / origin"; the modification time of the original file is obtained and set to "modtime"; based on the UUID, file path, and modification time of the original file, the extended attribute of the backup file is set to "user.backup_orig" using the `setfattr` command. For example, the `setfattr` command is: `setfattr -n user.backup_orig -v "uuid0;path / to / origin;modtime" bak`. Here, `-n user.backup_orig` indicates that the extended attribute name of the backup file is set to "user.backup_orig", and `-v "uuid0;path / to / origin;modtime"` indicates that the extended attribute of the backup file is set to "uuid0;path / to / origin;modtime". This allows the file path information of the second file to be stored in the storage area of ​​the file extension attributes of the first file, thus establishing a relationship between the first file and the second file.

[0109] Step S504: In response to the user's first operation, obtain the file information of the first file.

[0110] In this embodiment, after establishing the association between the first file and the second file, the second file corresponding to the first file can be accurately determined based on the association. Specifically, in response to a user's first operation on the first file, the file information of the first file is obtained. In response to the first operation on the first file, the corresponding index node is obtained based on the file information of the first file, wherein the index node includes an extended attribute block, and the extended attribute block records pointers to data blocks.

[0111] In some embodiments of this application, in response to the operation of opening a backup file, the corresponding inode can be obtained based on the filename of the backup file. For example, as shown in Figure 2, inode N is obtained based on the filename of the backup file being myfile.bak. Inode N includes an extended attribute block, which records pointers (e.g., M) to data blocks.

[0112] Step S505: Based on the file information of the first file, obtain the extended attribute information of the first file, which includes the file path information of the second file.

[0113] In this embodiment, data block M is determined to be a data block recording the extended attributes of the first file based on the pointer. The extended attributes of the first file in data block M are read, wherein the extended attribute information includes the file path information of the second file. For example, as shown in Figure 2, extended attribute 2: user.origin = " / path / to / original / file". Based on extended attribute 2, the file path of the second file on the disk device can be determined, thereby accurately reading the second file corresponding to the first file based on the file path and finding the original file corresponding to the backup file.

[0114] Step S506: Save the copied first file according to the file path information of the second file to restore the second file.

[0115] In some embodiments of this application, the copied original file is saved according to the file path information of the second file, which facilitates the subsequent recovery of the second file.

[0116] In this embodiment of the application, by setting the extended attribute (user.backup_orig) of the backup file, the original file and the backup file can be associated together and the storage location of the original file can be tightly bound. Information such as the modification time of the original file can be recorded in the extended attribute, which is beneficial for accurately restoring the original file.

[0117] Figure 6 is another schematic flowchart of the file processing method provided in this application embodiment, which is applied to a computer device. As shown in Figure 6, the file processing method may include:

[0118] Step S601: In response to the second operation, the second file is signed to generate the first file.

[0119] In one embodiment, in an application scenario involving file signing, in response to a signing operation, the second file is signed, and a first file is generated based on the signed second file. The first file serves as a signature file for the second file.

[0120] Step S602: Obtain the file information of the first file and the file path information of the second file.

[0121] In this embodiment, after obtaining the first file, the file information of the first file and the file path of the second file can be acquired. Based on the file path of the second file, the inode corresponding to the first file can be determined. The inode includes an extended attribute block, which records pointers to data blocks. The data blocks store the extended attributes of the first file, and the extended attributes record the file information of the second file.

[0122] Step S603: Store the file path information of the second file in the storage area of ​​the file extended attributes of the first file.

[0123] In some embodiments of this application, after signing the second file, it is necessary to record the file path of the original file (e.g., the second file) in the signed file (e.g., the first file). This can be achieved by setting extended attributes of the first file to record the file information of the second file. Specifically, the extended attributes of the first file are set by storing the file path information of the second file in the storage area of ​​the extended attributes of the first file, wherein the extended attributes record the file information of the second file. The file information of the second file includes at least: the UUID of the disk device where the second file resides and the file path of the second file on the disk device.

[0124] In this embodiment, it is assumed that the second file is the original file, which can be named "origin", and the first file is the signature file, which can be named "signature". In response to the signing operation performed on the original file, a signature file is generated; the UUID of the storage device where the original file is located is obtained and set to "uuid0"; the file path of the original file in the storage device is obtained and set to "path / to / origin"; based on the UUID and file path of the original file, the extended attribute of the signature file is set to "user.sig_orig" using the `setfattr` command. For example, the `setfattr` command is: `setfattr -n user.sig_orig -v "uuid0;path / to / origin"signature`. Here, `-n user.sig_orig` indicates that the extended attribute name of the signature file is set to "user.sig_orig", and `-v "uuid0;path / to / origin"` indicates that the extended attribute of the signature file is set to "uuid0;path / to / origin". Recording the UUID of the original file during the digital signature process can increase the credibility of the signature, prevent the signed file from being tampered with or moved to other devices for execution, and ensure the validity of the signature.

[0125] Step S604: In response to the user's first operation, obtain the file information of the first file.

[0126] In this embodiment, after establishing the association between the first file and the second file, the second file corresponding to the first file can be accurately determined based on the association. Specifically, in response to a user's first operation on the first file, the file information of the first file is obtained. In response to the first operation on the first file, the corresponding index node is obtained based on the file information of the first file, wherein the index node includes an extended attribute block, and the extended attribute block records pointers to data blocks.

[0127] In some embodiments of this application, in response to the first operation of verifying the signature file, a corresponding inode can be obtained based on the filename of the signature file. A pointer to a data block is then obtained from this inode.

[0128] Step S605: Based on the file information of the first file, obtain the extended attribute information of the first file, including the file path information of the second file.

[0129] In some embodiments of this application, data block M is determined to be a data block recording the extended attributes of the signature file based on the pointer. The extended attribute values ​​of the signature file in data block M are obtained, for example, -v"uuid0;path / to / origin". The file path on the disk device where the original file corresponding to the signature file is located can be obtained based on the extended attribute value, such as path / to / origin. The original file can be obtained based on this path. The UUID of the disk device where the original file corresponding to the signature file is located can also be obtained based on the extended data, for example, uuid0.

[0130] Step S606: Obtain the second file based on the file path information of the second file, and send the first file and the second file.

[0131] In this embodiment of the application, after obtaining the second file through the file path of the second file, the first file and the second file can be sent to the recipient.

[0132] In this embodiment of the application, by setting the extended attributes of the signature file, the storage location of its original file can be tightly bound, which is beneficial for archiving and managing the signature file.

[0133] Figure 7 is a schematic flowchart of another file processing method provided in an embodiment of this application. The file processing method is applied in a computer device. As shown in Figure 7, the file processing method may include:

[0134] In step S701, in response to the second operation, the second file is moved to the first address indicated by the preset path, and the first file under the preset path is obtained.

[0135] In one embodiment, in a file deletion application scenario, it is generally not necessary to completely delete the file from the disk. Instead, the file is moved to a first address indicated by a preset path, such as the trash can or recycle bin. In response to the operation of moving a second file to the first address or deleting the second file, a first file is obtained at the preset path. The preset path can be the file path corresponding to the trash can or recycle bin application, and the second file is the source file of the first file.

[0136] Step S702: Obtain the file information of the first file and the file path information of the second file.

[0137] In this embodiment, after obtaining the first file, the file information of the first file and the file path of the second file can be acquired. Based on the file path of the second file, the inode corresponding to the first file can be determined. The inode includes an extended attribute block, which records pointers to data blocks. The data blocks store the extended attributes of the first file, and the extended attributes record the file information of the second file.

[0138] Step S703: Store the file path information of the second file in the storage area of ​​the file extended attributes of the first file.

[0139] In this embodiment, after moving the second file to the first address, it is generally necessary to record the file path of the moved second file using other independent files. Therefore, restoring the second file requires parsing the entire independent file, reducing execution efficiency. To facilitate subsequent recovery of the deleted second file, the file information of the first file and the file path information of the second file can be obtained. Based on the file path information of the second file, the corresponding inode of the first file can be determined. The inode includes an extended attribute block, which records pointers to data blocks. The data blocks store the extended attributes of the first file, which record the file information of the second file. By using the extended attributes of the first file to record the file path of the second file before deletion, an association between the first and second files is established.

[0140] In some embodiments of this application, it is assumed that the second file is the original file, which can be named "origin"; and the first file is the deleted second file. The file path (oldpath) and modification time (modtime) of the original file are obtained. In response to the operation of moving the original file to the trash directory, the deleted original file is obtained, and its filename is devno-modtime.deleted. Based on the file path and modification time of the original file, the extended attribute of the deleted original file is set to user.del_orig using the setfattr command. For example, the setfattr command is: setfattr -n user.del_orig -v "oldpath" devno-modtime.deleted. Here, -n user.del_orig indicates that the extended attribute name of the deleted original file is set to user.del_orig, and -v "oldpath" devno-modtime.deleted indicates that the extended attribute of the deleted original file is set to "oldpath" devno-modtime.deleted. Thus, the file path information of the second file is stored in the storage area of ​​the file extended attribute of the first file, establishing an association between the first and second files.

[0141] Step S704: In response to the user's first operation, obtain the file information of the first file.

[0142] In this embodiment, after establishing the association between the first file and the second file, the second file corresponding to the first file can be accurately determined based on the association. Specifically, in response to a user's first operation on the first file, the file information of the first file is obtained. In response to the first operation on the first file, the corresponding index node is obtained based on the file information of the first file, wherein the index node includes an extended attribute block, and the extended attribute block records pointers to data blocks.

[0143] In some embodiments of this application, when a user needs to recover a second file, the computer device responds to the first operation on the first file and obtains the corresponding index node based on the file information of the first file.

[0144] Step S705: Based on the file information of the first file, obtain the extended attribute information of the first file, including the file path information of the second file.

[0145] In some embodiments of this application, the file path oldpath of the original file can be obtained by reading the extended attributes recorded in the data block, such as reading the extended attribute user.del_orig set in the original file after deletion.

[0146] Step S706: Move the first file to the file path corresponding to the file path information of the second file to restore the second file.

[0147] In some embodiments of this application, the first file is moved to a second address based on its extended attribute information to recover the second file. The second address is the file path corresponding to the file path information of the second file. Specifically, based on the file information of the second file recorded in the extended attributes, the association between the first and second files can be obtained. The file path of the second file before deletion is obtained through a first instruction and set as `myoldpath`. The first file is moved to the file path `myoldpath` of the second file through a second instruction. The first instruction is `getfattr --only-values ​​-n user.del_orig devno-modtime.deleted`; the second instruction is `mv devno-modtime.deleted myoldpath`. In this way, the deleted first file can be recovered, and the second file can be obtained.

[0148] In some embodiments, the extended attributes of the record file path myoldpath can also be deleted via a third command. The third command is `setfattr -x user.del_orig myoldpath`.

[0149] In this embodiment, by setting the extended attributes of the deleted second file, the file path of the second file before deletion can be accurately recorded. Because the extended attributes of the second file are closely tied to the first file, the original path of the second file can be saved more safely and reliably, and the method for obtaining the original path is also simpler.

[0150] Figure 8 is a flowchart illustrating another file processing method provided in an embodiment of this application. The file processing method is applied in a computer device. As shown in Figure 8, the file processing method may include:

[0151] Step S801: If an exception occurs when executing the second file, generate the first file.

[0152] In this embodiment, the second file is an executable file, and the first file is a core dump file. During the execution of the second file by a process, if an exception occurs, the operating system generates a core dump file to record the context information at the time of the exception, facilitating analysis of the cause of the exception. The operating system typically saves core dump files in a specific file path. Specifically, the operating system can set the name format of the generated core dump file through configuration files (such as / etc / sysctl.conf or / proc / sys / kernel / core_pattern). For example, the default coredump file name format is "core-%e-%p-%s-%t-%e", where %e represents the name of the executable file.

[0153] Step S802: In response to the user's second operation, obtain the file information of the first file and the file path information of the second file.

[0154] In this embodiment, after obtaining the first file, the file information of the first file and the file path of the second file can be acquired. Based on the file path of the second file, the inode corresponding to the first file can be determined. The inode includes an extended attribute block, which records pointers to data blocks. The data blocks store the extended attributes of the first file, and the extended attributes record the file information of the second file.

[0155] Step S803: Store the file path information of the second file in the storage area of ​​the file extended attributes of the first file.

[0156] In this embodiment, since the filename of an executable file in the operating system does not include its file path, it can be difficult to determine which executable file a kernel dump file corresponds to when executable files with the same name exist in different file paths. This can be addressed by setting extended attributes of the kernel dump file to record the executable file corresponding to the process that caused the exception. By storing the file path information of the second file in the storage area of ​​the extended attributes of the first file, the extended attributes of the first file are set. These extended attributes record the file information of the second file, thus accurately recording the file path of the executable file corresponding to the first file and avoiding confusion when multiple first files exist simultaneously.

[0157] Step S804: In response to the user's first operation, obtain the file information of the first file.

[0158] In this embodiment, after establishing the association between the first file and the second file, the second file corresponding to the first file can be accurately determined based on the association. Specifically, in response to a user's first operation on the first file, the file information of the first file is obtained. In response to the first operation on the first file, the corresponding index node is obtained based on the file information of the first file, wherein the index node includes an extended attribute block, and the extended attribute block records pointers to data blocks.

[0159] In response to the first operation on the first file, the corresponding index node is obtained based on the file information of the first file. The index node includes an extended attribute block, which records pointers to data blocks.

[0160] In this embodiment of the application, in response to the selection operation of the core dump file, the corresponding index node can be obtained according to the file name of the core dump file. The index node includes an extended attribute block, and the extended attribute block records pointers to data blocks.

[0161] Step S805: Based on the file information of the first file, obtain the extended attribute information of the first file, including the file path information of the second file.

[0162] In this embodiment, the file path of the executable file corresponding to the core dump file is obtained by reading the extended attributes of the core dump file recorded in the data block using a pointer. An association between the first file and the second file can be established through this extended attribute, and the executable file corresponding to the core dump file can be obtained based on this association.

[0163] Step S806: Display the second file based on its file path information.

[0164] In this embodiment, the second file is displayed based on its file path information, making it convenient for users to read the second file and find the cause of any abnormalities.

[0165] In this embodiment, the file path of the executable file corresponding to the core dump file can be accurately recorded through the extended attribute (user.exe_orig) of the core dump file, thus avoiding the problem of not being able to determine the corresponding executable file when multiple core dump files exist at the same time.

[0166] In this embodiment of the application, the file processing method further includes the step of sending a first file to an electronic device. By sending the first file to the electronic device, an analyst can obtain the original executable file based on the extended attributes of the first file.

[0167] Figure 9 is another schematic flowchart of the file processing method provided in this application embodiment, which is applied in a computer device. As shown in Figure 9, the file processing method may include:

[0168] Step S901: In response to the selection operation performed on the second file, obtain the file path information of the second file.

[0169] Step S902: Store the file path information of the second file in the storage area of ​​the file extension attributes of the first file.

[0170] In this embodiment, the operating system includes various data files, each of which can be associated with a corresponding application to open and use the data file. For example, a file with the .c extension is often associated with an editor for coding; a file with the .doc extension is associated with Word or WPS to open and edit the file in the Word or WPS environment; and a video file with the .3gp or .mpg extension can be associated with a player such as VMplayer to play the file. Because file extensions may not reflect the file type, associating a file with an application by its extension may result in associating the wrong application. In response to a selection operation performed on a second file, the file path information of the second file is obtained, and the file path information of the second file is stored in the storage area of ​​the file extension attributes of the first file. Setting the extension attributes of the first file allows for accurate determination of the executable file of the application corresponding to the second file when operating on it.

[0171] In one embodiment, in response to the selection of a data file (e.g., mydatafile), extended attributes are set based on that data file. For example, the extended attribute of the data file is set to user.opener using the setfattr command. For instance, the setfattr command is: setfattr -n user.opener -v "exepath" mydatafile. Here, -n user.opener indicates that the extended attribute name of the data file is set to user.opener, and -v "exepath" mydatafile indicates that the extended attribute of the data file is set to "exepath". Here, exepath records the file path of the executable file of the application that opens the data file.

[0172] Step S903: In response to the user's first operation, obtain the file information of the first file.

[0173] Step S904: Based on the file information of the first file, obtain the extended attribute information of the first file, which includes the file path information of the second file.

[0174] In this embodiment, in response to a user's first operation, file information of a first file is obtained, and a corresponding index node is obtained based on the file information of the first file. The index node includes an extended attribute block, which records pointers to data blocks. The extended attribute information of the first file recorded in the data block is read based on the pointers, for example, user.opener. The extended attribute information of the first file includes the file path information of a second file.

[0175] Step S905: Based on the file path information of the second file, execute the second file so that the second file runs the first file.

[0176] In this embodiment, the second file is executed based on its file path information to make it run the first file. The first file (e.g., an executable file) of the application corresponding to the data file is obtained from the extended attributes based on the association relationship. For example, the executable file myexe of the application corresponding to the data file is obtained using the command getfattr --only-values-n user.opener mydatafile; with mydatafile as a parameter, the executable file is invoked (e.g., myexe mydatafile), and the data file is opened through the executable file.

[0177] In this embodiment, by setting the extended attribute (user.opener) of the data file, the file path of the executable file of the application corresponding to the data file can be set in a finer manner. Since setting the opening method for each data file is rather cumbersome, using the extended attribute can accurately and concisely determine the executable file of the application corresponding to the data file.

[0178] Figure 10 is a structural diagram of a file processing apparatus provided in an embodiment of this application. The file processing apparatus 100 may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the file processing apparatus 100 may be stored in the memory of a computer device and executed by at least one processor to perform file processing functions (see Figures 3-9 for details).

[0179] In this embodiment, the file processing device 100 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 1001 and a processing module 1002. The term "module" in this application refers to a series of computer program segments that can be executed by at least one processor and perform a fixed function, and which are stored in memory. In this embodiment, the file processing device 100 can be used to implement the file processing methods shown in Figures 3 to 9. As shown in Figure 10, the file processing device 100 is applied in a computer device (the computer device shown in Figure 1), and the file processing device 100 includes:

[0180] The acquisition module 1001 is used to acquire file information of the first file in response to the user's first operation;

[0181] The acquisition module 1001 is further configured to acquire extended attribute information of the first file based on the file information of the first file, wherein the extended attribute information includes the file path information of the second file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is the signature file of the second file, the first file is a file generated after the second file runs abnormally, or the second file is an executable file of the first file;

[0182] The processing module 1002 is used to process the second file based on the file path information of the second file.

[0183] In this embodiment of the application, the first file is a backup file of the second file, and the processing module 1002 is further configured to copy the first file and save the copied first file according to the file path information of the second file to restore the second file.

[0184] In this embodiment of the application, the first file is the file after the second file is moved to the trash folder. The processing module 1002 is also used to move the first file to the file path corresponding to the file path information of the second file in order to restore the second file.

[0185] In this embodiment of the application, the first file is the signature file of the second file, and the processing module 1002 is further configured to obtain the second file based on the file path information of the second file; and send the first file and the second file.

[0186] In this embodiment of the application, the first file is a file generated after the second file runs abnormally, and the processing module 1002 is further used to display the second file based on the file path information of the second file.

[0187] In this embodiment of the application, the second file is an executable file of the first file, and the processing module 1002 is further configured to execute the second file based on the file path information of the second file, so that the second file runs the first file.

[0188] In this embodiment of the application, the processing module 1002 is further configured to respond to a second operation by the user, obtain the file path information of the second file, and store the file path information of the second file in the storage area corresponding to the file extended attribute block of the first file.

[0189] In this embodiment of the application, the processing module 1002 is further configured to determine the index node corresponding to the first file based on the file information of the first file, wherein the index node includes an extended attribute block, the extended attribute block records a pointer to a data block; and obtain the extended attribute information of the first file from the data block according to the pointer.

[0190] In one possible implementation, the acquisition module 1001 is used to acquire file information of the first file and file path information of the second file in response to a second user operation, wherein the file information of the first file corresponds to the storage area of ​​the file extended attributes of the first file; the processing module 1002 is used to store the file path information of the second file in the storage area of ​​the file extended attributes of the first file; wherein the relationship between the first file and the second file includes at least one of the following relationships: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is the signature file of the second file, the first file is a file generated after the second file runs abnormally, or the second file is an executable file of the first file.

[0191] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, and the method implemented when the program instructions are executed can refer to the methods in the above embodiments of this application.

[0192] This application provides a computer program product that includes a computer program that, when run on a processor, causes the processor to execute the file processing method described in the first aspect or any possible implementation thereof.

[0193] The computer-readable storage medium may be the internal memory of the computer device described in the above embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device.

[0194] In some embodiments, the computer-readable storage medium may include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of the computer device, etc.

[0195] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

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

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

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

[0199] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A file processing method, characterized in that, include: In response to the user's first action, retrieve the file information of the first file; Based on the file information of the first file, the extended attribute information of the first file is obtained, and the extended attribute information includes the file path information of the second file; The relationship between the first file and the second file includes at least one of the following: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is the signature file of the second file, the first file is a file generated after the second file runs abnormally, or the second file is an executable file of the first file; The second file is processed based on its file path information.

2. The file processing method according to claim 1, characterized in that, The first file is a backup file of the second file, and the process of processing the second file based on the file path information of the second file includes: Copy the first file, and save the copied first file according to the file path information of the second file to restore the second file.

3. The file processing method according to claim 1, characterized in that, The first file is the file after the second file has been moved to the trash folder, and the process of processing the second file based on the file path information of the second file includes: Move the first file to the file path corresponding to the file path information of the second file to restore the second file.

4. The file processing method according to claim 1, characterized in that, The first file is the signature file of the second file, and the processing of the second file based on the file path information of the second file includes: The second file is obtained based on its file path information. Send the first file and the second file.

5. The file processing method according to claim 1, characterized in that, The first file is a file generated after the second file malfunctions. The process of processing the second file based on its file path information includes: Based on the file path information of the second file, the second file is displayed.

6. The file processing method according to claim 1, characterized in that, The second file is an executable file of the first file, and the step of processing the second file based on the file path information of the second file includes: Based on the file path information of the second file, the second file is executed so that the second file runs the first file.

7. The document processing method according to any one of claims 1 to 6, characterized in that, The method further includes: In response to the user's second operation, obtain the file path information of the second file; The file path information of the second file is stored in the storage area corresponding to the file extended attribute block of the first file.

8. The document processing method according to any one of claims 1 to 7, characterized in that, The step of obtaining the extended attribute information of the first file based on the file information of the first file includes: Based on the file information of the first file, the index node corresponding to the first file is determined, wherein the index node includes an extended attribute block, and the extended attribute block records pointers to data blocks; The extended attribute information of the first file is obtained from the data block according to the pointer.

9. The document processing method according to any one of claims 1 to 8, characterized in that, The first operation includes inputting a first instruction, the first instruction including file information of the first file, or the first operation is a click operation on the first file.

10. A file processing method, characterized in that, The method includes: In response to the user's second operation, the file information of the first file and the file path information of the second file are obtained, wherein the file information of the first file corresponds to the storage area of ​​the file extended attributes of the first file; The file path information of the second file is stored in the storage area of ​​the file extended attributes of the first file; The relationship between the first file and the second file includes at least one of the following: the first file is a backup file of the second file, the second file is the source file of the first file, the first file is the signature file of the second file, the first file is a file generated after the second file malfunctions, or the second file is an executable file of the first file.

11. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the file processing method as described in any one of claims 1 to 10.