File management method and device, equipment and storage medium

By introducing a hybrid shared interface in the Internet of Things system, edge gateways can perform operations in different file systems, solving the problem of high processing complexity and realizing unified management of file systems.

CN120011307APending Publication Date: 2025-05-16ENVISION DIGITAL INT PTE LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411854108.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In IoT systems, edge gateways need to handle access methods of different file systems, resulting in high complexity in program processing.

Method used

Through a hybrid shared interface, the edge gateway can perform operations in at least two file systems, identify and perform appropriate file system operations by obtaining and parsing system parameters and configuration parameters in the operation parameters.

Benefits of technology

It realizes unified management of files in different file systems, reducing the complexity of processing files in different file systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011307A_ABST
    Figure CN120011307A_ABST
Patent Text Reader

Abstract

The invention discloses a file management method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the steps that first operation parameters are obtained through a first hybrid common interface, the first hybrid common interface is used for executing first operation in at least two file systems, the first operation parameters comprise system parameters and configuration parameters, the system parameters are used for indicating the file system executing the first operation, and the configuration parameters are used for indicating the file system executing the first operation; the configuration parameters are used for describing behaviors of the first operation; determining a first file system for executing the first operation according to system parameters in the first operation parameters; and executing the first operation in the first file system according to configuration parameters in the first operation parameters. According to the method, the complexity of processing files for different file systems is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a file management method, device, equipment and storage medium. Background Art

[0002] With the development of Internet of Things (IoT), IoT devices are widely used in all walks of life, as well as various applications and environments. IoT is a network based on information carriers such as the Internet and traditional telecommunications networks, which enables all ordinary physical objects that can perform independent functions to be interconnected.

[0003] In related technologies, in IoT systems, edge devices access data through edge gateways, and data is persisted in multiple storage systems, which are stored and read through the unique read and write methods of different storage systems.

[0004] In the related art, different file systems have multiple access methods, which results in the edge gateway needing to use file management methods of different file systems to manage data, thus bringing about the problem of high program processing complexity. Summary of the invention

[0005] The embodiments of the present application provide a file management method, device, equipment and storage medium. The technical solutions provided by the embodiments of the present application are as follows:

[0006] According to one aspect of an embodiment of the present application, a file management method is provided, the method being executed by an edge gateway, the method comprising:

[0007] Acquiring a first operation parameter through a first hybrid common interface, where the first hybrid common interface is used to implement execution of a first operation in at least two file systems, where the first operation parameter includes a system parameter and a configuration parameter, where the system parameter is used to indicate the file system that executes the first operation, and the configuration parameter is used to describe a behavior of the first operation;

[0008] Determine a first file system for executing the first operation according to the system parameters in the first operation parameters;

[0009] Execute the first operation in the first file system according to the configuration parameters in the first operation parameters;

[0010] According to one aspect of an embodiment of the present application, a file management device is provided, the device comprising:

[0011] a parameter acquisition module, configured to acquire a first operation parameter through a first hybrid common interface, wherein the first hybrid common interface is used to implement execution of a first operation in at least two file systems, wherein the first operation parameter includes a system parameter and a configuration parameter, wherein the system parameter is used to indicate the file system that executes the first operation, and the configuration parameter is used to describe a behavior of the first operation;

[0012] a system determination module, configured to determine a first file system for executing the first operation according to a system parameter in the first operation parameter;

[0013] An operation execution module is used to execute the first operation in the first file system according to the configuration parameters in the first operation parameters.

[0014] According to one aspect of an embodiment of the present application, a computer device is provided, the computer device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned file management method.

[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned file management method.

[0016] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned warm file management method.

[0017] The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:

[0018] By using a hybrid shared interface, files stored in different file systems can be managed uniformly with minimal operational differences, effectively reducing the complexity of processing files for different file systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0020] Figure 2 is a flowchart of a file management method provided by an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of applying a first hybrid common interface provided by an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of file tag management provided by an embodiment of the present application;

[0023] Figure 5 is a bar chart of dynamically adjusting the number of threads provided by an embodiment of the present application;

[0024] Figure 6 is a block diagram of a file management device provided by an embodiment of the present application;

[0025] Figure 7 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0027] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as an Internet of Things (IoT) system. The solution implementation environment may include: an edge gateway 10, an edge server 20, and at least one edge device 30.

[0028] The edge gateway 10 is an electronic device used to connect the edge device 30 and the edge server 20 and provide support for data transmission, preprocessing and management.

[0029] The edge server 20 is an electronic device for providing background services for the edge device 30. Optionally, the background services may include but are not limited to: file management, data processing and analysis, device management and control, network management, etc., and may also include other background services, which are not limited in the embodiments of the present application.

[0030] The edge server 20 is a computing and storage device deployed at the edge of the network, which is usually used to perform more powerful and complex computing tasks, and supports local processing, big data analysis, application deployment, storage management and other functions. Exemplarily, the edge server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited to these.

[0031] In some embodiments, the edge gateway 10 is used to run the target application. The target application is used to provide file management functions. In some embodiments, the target application can also run in the edge server 20.

[0032] The edge device 30 is an electronic device with computing, storage and communication capabilities, responsible for collecting, preliminarily processing and partially analyzing data at the source of the data. For example, the edge device 30 may include, but is not limited to: cameras, sensors, industrial equipment, industrial controllers, wearable devices, furniture appliances, smart terminal devices, industrial robots, medical equipment, smart grid equipment, wind power generation equipment, vehicle-mounted terminal equipment, etc., and may also include other edge devices, which are not limited in the embodiments of the present application.

[0033] Exemplarily, the data collected by the edge device 30 is uploaded to the edge server 20 through the edge gateway 10, and the edge server 20 processes, analyzes or stores the data.

[0034] The edge gateway 10 and the edge server 20 can communicate with each other through a network. Optionally, the edge device 30 can communicate with the edge gateway 10 through the network, and then communicate with the edge server 20. The network can be a wired network or a wireless network.

[0035] Please refer to Figure 2 , which shows a flowchart of a file management method provided by an embodiment of the present application. The execution subject of each step of the method may be a computer device, for example, the computer device may be Figure 1 The edge gateway 10 in the implementation environment of the solution shown can also be Figure 1 The edge server 20 in the solution implementation environment shown. The method may include at least one of the following steps (210-230):

[0036] Step 210, obtaining first operation parameters through a first hybrid common interface, the first hybrid common interface is used to implement the first operation in at least two file systems, the first operation parameters include system parameters and configuration parameters, the system parameters are used to indicate the file system that executes the first operation, and the configuration parameters are used to describe the behavior of the first operation.

[0037] The file system is a method for storing and organizing files in an operating system, and the file system engine is a software component for managing and operating the file system. Optionally, the file system may include, but is not limited to: Linux file system, Seaweedfs file system, Amazon S3 object file system, NTFS (New Technology File System), etc., and may also include other file systems, which are not limited in the embodiments of the present application. In some embodiments, the functions of the file system may include, but are not limited to: managing and scheduling storage resources, authority management, file access, creating files, etc., and may also include other functions, which are not limited in the embodiments of the present application.

[0038] In the IoT system, different edge devices may use different operating systems, resulting in different compatible file systems. Therefore, different file system engines are needed to manage files in the IoT system.

[0039] A hybrid shared interface refers to an interface used to implement specified functions for at least two file systems. Specified functions refer to operations such as file access, file management, or security control for files in the file system. In some embodiments, the specified functions may include, but are not limited to: reading files, writing files, modifying files, deleting files, creating directories, deleting directories, copying directories, moving directories, renaming, permission management, etc., and may also include other functions, which are implemented by relevant technical personnel according to needs, and the embodiments of the present application do not limit this. In the target application, the file system engines of the above-mentioned at least two file systems are integrated, and the functions of the file system engines of the two file systems are implemented through the hybrid shared interface.

[0040] In some embodiments, the target application includes at least one hybrid common interface, and different hybrid common interfaces can be used to implement different operations on the file system. That is, for the same operation, the same hybrid common interface can be used to perform the operation in any one of the at least two file systems. In this case, the first hybrid common interface is any one of the at least one hybrid common interface.

[0041] Exemplarily, when the first hybrid common interface is a hybrid common interface for implementing a file read operation, the first hybrid common interface can be used to implement reading of a specified file in at least two file systems. It can be understood that in this example, the first operation is a file read operation.

[0042] In some embodiments, the target application only includes the first hybrid common interface, and different operations of the file system are implemented using the first hybrid common interface. In some embodiments, the configuration parameters of the first operation parameter also include an operation identifier, and the operation identifier is used to indicate the first operation. In this case, the first operation is any one of the at least one operation implemented by the first hybrid common interface.

[0043] Exemplarily, the first hybrid shared interface can implement the following operations: file reading operation, file writing operation, file deletion operation and file modification operation, and the corresponding operation identifiers are identifier 1, identifier 2, identifier 3 and identifier 4. When the operation identifier of the first operation parameter is identifier 3, the first operation is a file deletion operation.

[0044] The first operation parameter refers to a parameter passed in when calling the first hybrid shared interface, which is used to control the behavior of the first operation. In some embodiments, the first operation parameter is used to indicate at least one of the following: the object of the first operation, the execution object of the first operation, the operation type of the first operation, the file modification content, etc., and can also be used to indicate other information, which is not limited in the embodiments of the present application.

[0045] The configuration parameters of the first operation parameters refer to parameters related to the first operation, which are used to control the execution mode of the first operation. In some embodiments, the configuration parameters may also include at least one of the following: file path, file identifier, target path, access permission information, operation mode information, metadata field, file tag, file modification content, etc., and may also include other information, which is determined by the function of the first operation, and the embodiments of the present application are not limited to this.

[0046] The object of the first operation refers to the object to be processed by the first operation, which determines the scope of influence of the first operation. Optionally, the object of the first operation may include, but is not limited to: files, directories, file systems, storage devices, storage analysis, metadata, etc., and may also be objects in other file systems, which is not limited in the embodiments of the present application. Exemplarily, the file path and / or file identifier in the configuration parameters indicates the object of the first operation.

[0047] The operation type of the first operation refers to a specific operation mode or behavior specified by the first operation. Exemplarily, the operation identifier of the configuration parameter of the first operation parameter is used to indicate the operation type of the first operation.

[0048] For example, please refer to Figure 3 , which shows a schematic diagram of applying a first hybrid common interface provided by an embodiment of the present application, wherein the first hybrid common interface is used to implement Figure 3 The first operation is performed in the three file systems shown, which are: a first file system, a second file system and a third file system. The edge device accesses files in the three file systems through a first hybrid shared interface.

[0049] Step 220: Determine a first file system for executing the first operation according to the system parameters in the first operation parameters.

[0050] The system parameter in the first operation parameter is used to indicate the execution object of the first operation. The execution object of the first operation refers to the object that actually executes the first operation when the first hybrid common interface is called. In the present application, the execution object of the first operation can be any one of at least two file systems.

[0051] Step 230: Execute a first operation in the first file system according to the configuration parameters in the first operation parameters.

[0052] In some embodiments, the first operation can be executed through an operation instruction or through an operation interface. The specific execution method of the first operation is determined by the file operating system.

[0053] The operation instruction refers to a command for managing and operating files for a file system. That is, the first operation can be performed by an operation instruction in a corresponding operation instruction set. In some embodiments, the target application includes an operation instruction set for at least two file systems, and the operation instruction set includes at least one operation instruction, and the operation instruction is used to perform a specified operation in the corresponding file system. The operation instruction set of a file system refers to a set of various commands for managing and operating files for the file system.

[0054] In some embodiments, according to the system parameters in the first operating parameters, a first file system is determined; according to the first file system, a first operating instruction set is determined; according to the configuration parameters in the first operating parameters, a first operating instruction for performing the first operation is determined from at least one operating instruction included in the first operating instruction set. It can be understood that the first operating instruction set refers to the operating instruction set of the first file system.

[0055] In some embodiments, the operation instructions of at least two file systems correspond to at least one hybrid shared interface. In some embodiments, the operation instructions with the same or similar functions in at least two file systems correspond to the same hybrid shared interface.

[0056] In some embodiments, when different hybrid common interfaces correspond to different operations, a first operation instruction is determined from at least one operation instruction included in a first operation instruction set according to the system parameters of the first hybrid common interface and the first operation parameter, and the first operation instruction is used to perform the first operation. That is, according to the operation parameters passed in by the hybrid common interface, the operation instruction of the corresponding file system can be called to perform the first operation.

[0057] Exemplarily, when the first file system is a Linux file system, according to the first operation parameter transmitted by the first hybrid common interface, a corresponding operation instruction in the Linux operation instruction set is called to execute the first operation.

[0058] Exemplarily, when the first file system is an Amazon S3 file system, a corresponding operation instruction in an Amazon S3 SDK (Software Development Kit) is called according to a first operation parameter passed in by a first hybrid common interface to perform a first operation.

[0059] The operation interface refers to an interface for managing and operating files for a file system. That is, the first operation can be performed by calling the corresponding operation interface. In some embodiments, at least two file systems are integrated into the target application with at least one operation interface each.

[0060] In some embodiments, the first file system is determined according to the system parameters in the first operation parameters; and the first operation interface corresponding to the first operation in the first file system is called according to the configuration parameters in the first operation parameters to execute the first operation.

[0061] Exemplarily, when the first file system is a SeaweedFS file system, according to the first operation parameter passed in by the first hybrid common interface, the operation interface corresponding to the first operation in the first file system is called to execute the first operation.

[0062] In some embodiments, the first operation is a file query operation, and the configuration parameters in the first operation parameters include a first file identifier and a first file path, the first file identifier is used to indicate the first file, and the first file path is used to indicate the location of the first file in the first file system; according to the first file identifier and the first file path, the first file is searched in the first file system; and the first file is returned through the first hybrid shared interface.

[0063] A file identifier, also known as a file name, is used to distinguish different files. A file path refers to the location of a file in a file system, and describes how to find a target file from a root directory or a current directory. Optionally, a file path can be an absolute path or a relative path, which is not limited in the embodiments of the present application.

[0064] In some embodiments, the first operation is a file modification operation, and the configuration parameters in the first operation parameters include a first file identifier, a first file path, and a first file modification content, and the first file modification content is used to indicate the content modified for the first file; according to the first file identifier and the first file path, the first file is searched in the first file system; and the first file is modified according to the first file modification content.

[0065] File modification content refers to content that modifies the data in a file or the metadata of a file, and may include but is not limited to: adding content, deleting content, replacing content, inserting content, etc., and may also include other content, which is not limited in the embodiments of the present application.

[0066] It should be noted that the execution process of other operations on at least two file systems through the first hybrid shared interface is similar to the above content, and therefore will not be listed here one by one.

[0067] In summary, the technical solution provided in the embodiment of the present application uniformly manages files stored in different file systems through a hybrid common interface with relatively small operational differences, thereby effectively reducing the complexity of processing files for different file systems.

[0068] The following is an introduction to the management of file tags.

[0069] In some embodiments, when the first label record in the file label information satisfies the change condition, a first notification message is sent, and the first notification message is used to indicate that the first label record has changed, and the first label record is used to indicate the first file label of the second file, and the first file label is used to indicate the working status of at least one edge device; wherein the change condition is related to at least one of the following: the file path of the second file, the file type of the second file, the type of change in the first label record, and the first file label.

[0070] The file tag is used to indicate the working status of the edge device. The working status of the edge device refers to the operation status of the edge device. In some embodiments, the file tag may include but is not limited to: working condition tags, fatigue tags, wear tags, etc., and may also include other text tags, which are not limited in the embodiments of the present application. The working condition tag is used to indicate the working condition of the edge device. The working condition of the edge device refers to information related to the operating environment, state or load of the edge device during operation. The fatigue tag is used to indicate the fatigue state of the edge device. The fatigue state of the edge device refers to the state of the edge device after being in operation for a long time. The wear tag is used to indicate the wear state of the edge device. The wear state of the edge device refers to the state of functional degradation, performance degradation or physical wear of the edge device due to long-term use, external environmental factors or workload.

[0071] The second file refers to any file stored in any one of the at least two file systems. The change condition refers to a condition that triggers sending the first notification message when a file tag changes.

[0072] The file tag information is used to store the tag record of the file tag of each file in each file system. The file tag record is used to indicate the file tag of the edge device corresponding to the file.

[0073] The file type is used to distinguish different file contents, formats or uses. In some embodiments, the file type of a file is stored in the metadata of the file. Optionally, the file type can be pre-defined by relevant technicians according to needs. Exemplarily, in the field of wind power, the file type can include but is not limited to: time domain type, frequency domain type and conventional type, etc.

[0074] In some embodiments, the change condition includes the case where the second tag information is changed and the second file belongs to the file indicated by the change configuration information. In some embodiments, the change configuration information is at least one of the following: specifying a file path, specifying a file type, specifying a change type, and specifying a tag type. The relevant technicians can set it according to the needs, and the embodiments of the present application are not limited to this.

[0075] Exemplarily, when the second file is a file of a designated file path indicated by the change configuration information, if the first tag record of the second file is changed, a first notification message is sent.

[0076] Exemplarily, when the second file is a file of a specified file type indicated by the change configuration information, if the first tag record of the second file is changed, a first notification message is sent.

[0077] The first notification message is used to prompt that the file tag of the second file type has changed. In some embodiments, the sending of the first notification message is triggered by MQ (Message Queue) message middleware.

[0078] In some embodiments, the file tag information includes at least one tag record, the tag record includes a file identifier, a file path, and a tag key-value pair, the tag key-value pair includes a file tag identifier and tag information, the tag identifier is used to indicate the file tag, and the tag information is the content of the file tag indicated by the tag identifier.

[0079] In some embodiments, the file tag information may be implemented in the form of a relational database. In some embodiments, at least one tag key-value pair is stored in the file tag information in a column storage manner of a relational database. In some embodiments, at least one tag key-value pair is indexed using a file identifier and a file path as an association condition.

[0080] In some embodiments, among at least one tag record included in the file tag information, a tag record matching the second file identifier and the second file path is searched to obtain a second tag record; an editing operation is performed on the tag key-value pair in the second tag record; wherein the editing operation includes at least one of the following: a new addition operation, a deletion operation, a modification operation, and a search operation.

[0081] In some embodiments, when the working status of the edge device corresponding to the second file changes, the first label record of the second file is updated through an editing operation, and the changed first label record is sent when the changed first label record meets the change condition.

[0082] For example, please refer to Figure 4, which shows a schematic diagram of file tag management provided by an embodiment of the present application, wherein the file tags include working condition tags, fatigue tags, and loss tags. When the working condition tag of the second file meets the change condition, a first notification message is sent to the corresponding edge device.

[0083] Through the above method, at least one file tag is set for the file, and unified tag management is performed for different file systems. When there is a file tag that meets the change conditions, a message notification of the tag change is triggered, so that the corresponding user can quickly obtain the notification of the file tag change of the edge device as needed.

[0084] The following is an introduction to the management of the edge gateway load.

[0085] In some embodiments, first load information of the edge gateway is obtained, and the first load information is used to indicate the resource usage of the edge gateway; according to the thread configuration information, the number of parallel threads is adjusted to the first number of threads corresponding to the first load information, and the thread configuration information includes at least one set of load information and thread numbers with a corresponding relationship.

[0086] The first load information refers to the usage of resources of the edge gateway. In some embodiments, when the executor of the file management method is an edge server, the first load information refers to the usage of resources of the edge server. In some embodiments, the first load information may include, but is not limited to: CPU (Central Processing Unit) usage, number of processes, average load, memory usage, available memory, disk usage, read and write speed, network bandwidth usage, network delay, etc., and may also include other load information, which is not limited in the embodiments of the present application.

[0087] Thread configuration information refers to the pre-configured number of threads allowed to be used in parallel under a specified load. The thread configuration information includes at least one set of corresponding load information and thread number, which is pre-set by relevant technicians and is not limited in the present application embodiment.

[0088] The number of parallel threads refers to the number of threads currently used in parallel by the devices in the edge gateway.

[0089] In some embodiments, when the first load information satisfies the first condition, the number of parallel threads is added to the first number of threads to obtain the adjusted number of parallel threads; when the first load information satisfies the second condition, the number of parallel threads is halved to obtain the adjusted number of parallel threads.

[0090] In some embodiments, the first condition is that the first load information does not exceed the first load threshold, and the first load information increases by a first value relative to the first load information when the number of threads was last adjusted. In some embodiments, the first load threshold, the first value, and the first number are pre-set by relevant technical personnel.

[0091] Exemplarily, the first condition can be described as the first load information being less than or equal to 50%, and the first load information increases by 5% relative to the first load information for adjusting the number of threads last time, and each time the first load information meets the first condition, one thread is added based on the current parallel threads.

[0092] In some embodiments, the second condition refers to the first load information exceeding a second load threshold.

[0093] Exemplarily, assuming that the current number of parallel threads is 10, the second condition can be described as the first load information being greater than or equal to 80%. When the first load information satisfies the second condition, the current number of parallel threads is halved, that is, reduced to 5.

[0094] It should be noted that, when the first load information satisfies neither the first condition nor the second condition, the number of parallel threads is not adjusted.

[0095] For example, please refer to Figure 5 , which shows a bar chart of dynamically adjusting the number of threads provided by an embodiment of the present application. Taking the presentation of the first load information in percentage as an example, starting from the first load information being 0 and the number of parallel threads being 0, when the first load information is less than or equal to 50%, one parallel thread is added for every 5% increase in the first load information. When the first load information is greater than or equal to 80%, the number of parallel threads is halved. The change of the number of parallel threads with the system load is as follows:

[0096] When the first load information is 5%, 1 thread is executed in parallel

[0097] When the first load information is 10%, 2 threads are executed in parallel

[0098] When the first load information is 15%, 3 threads are executed in parallel

[0099] When the first load information is 20%, 4 threads are executed in parallel

[0100] When the first load information is 25%, 5 threads are executed in parallel

[0101] When the first load information is 30%, 6 threads are executed in parallel

[0102] When the first load information is 35%, 7 threads are executed in parallel

[0103] When the first load information is 40%, 8 threads are executed in parallel

[0104] When the first load information is 45%, 9 threads are executed in parallel

[0105] When the first load information is 50%, 10 threads are executed in parallel

[0106] When the first load information is 80%, 5 threads are executed in parallel

[0107] Through the above method, the parallelism of threads used for file upload and download is adaptively adjusted according to the load of the edge gateway. In the initial state, the concurrency is gradually increased according to the load; after entering the stable state, a certain concurrency is maintained; when the load is high, the concurrency consumption is quickly reduced by halving the concurrency. This method realizes the dynamic adjustment of the concurrency of threads according to the load, which helps to improve the utilization efficiency of resources and thus improve the performance and throughput of the edge gateway.

[0108] The following is an introduction to file expiration management.

[0109] In some embodiments, based on a periodic threshold, it is periodically checked whether at least one file included in each of the at least two file systems is valid; based on the check result of at least one file included in each of the at least two file systems, the files included in the at least two file systems are deleted.

[0110] That is to say, the files stored in each file system are traversed regularly to determine the validity of each file, and invalid files are deleted according to the deletion policy.

[0111] In some embodiments, each file corresponds to a valid duration. The valid duration of a file refers to the time that the file is allowed to be continuously stored in the corresponding file system. Optionally, a valid duration is set for at least one file included in each of the at least two file systems.

[0112] In some embodiments, when the time interval between the first moment and the second moment is equal to a period threshold, the metadata of at least one file stored in the second file system is traversed; based on the creation time of the metadata of the at least one file and the corresponding validity period, it is determined whether the at least one file is valid.

[0113] The metadata of a file refers to a series of data used to describe the attributes of a file. In some embodiments, the attributes included in the metadata may include, but are not limited to: file identification, file path, creation time, modification time, metadata modification time, file permissions, creation user identification, file size, file type, etc., and may also include other attributes, which are not limited in the embodiments of the present application.

[0114] It should be noted that the second time may be the current time, and the first time refers to the time when the file was last checked to see if it was invalid.

[0115] In the present application, when checking whether a file is valid, the same deletion policy is used to scan files in different file systems, and there is no need to set different deletion policies for different file systems.

[0116] In some embodiments, when the time interval between a first moment and a second moment is equal to a period threshold, the metadata of at least one file stored in the second file system is traversed, the metadata of each file is information related to the file, the metadata includes the creation time of the file, and the period threshold refers to the time interval for checking whether the file is invalid; in the validity period configuration information, the validity period matching the third file in the at least one file is searched to obtain a first validity period, the first validity period refers to the validity period for storing the third file in the second file system, the validity period configuration information includes at least one set of file range information and the validity period, the file range information is used to indicate the location of the file with the configured validity period in at least two file systems; when the first storage period is greater than the first validity period, the third file is deleted from the second file system, the first storage period is determined based on the creation time of the third file; wherein the first moment is earlier than the second moment, and the first moment is the moment of the most recent execution of the step of checking whether the file is invalid.

[0117] The effective configuration information is used to indicate the effective duration of files stored in at least two file systems. The file range information is used to indicate the scope of the effective duration corresponding to the file range information in at least two file systems. In some embodiments, the file range information includes at least one of the following: system identification, file directory, file path, file name, file type, etc. Exemplarily, in the case where the file range information is a file path, each set of file range information and effective duration means that the effective duration of all files under the path indicated by the file range information is set to the effective duration corresponding to the file range information. The unit of the effective duration can be any one of the following: minutes, days, months, years, etc.

[0118] The first storage duration refers to the duration for which the third file is continuously stored in the second file system. In some embodiments, the effective configuration information may implement a relational database.

[0119] Exemplarily, the effective configuration information is implemented as shown in Table 1 below. Each row in Table 1 represents a set of file range information and effective duration. The file range information includes a file path and a file system. Taking the first row in Table 1 as an example, when scanning the metadata corresponding to the file path / path / to / path1 in the first file system, it is determined whether each file under the file path is valid based on the file creation time in the metadata and the effective duration shown in Table 2. If the file is invalid, the file can be deleted from the first file system.

[0120] Table 1

[0121] File Path File System Validity period (days) / path / to / path1 The first file system 60 / path / to / path2 The first file system 180 / path3 / Second file system 90 / path4 / Second file system 180 / path5 / Third file system 365 / path6 / Third file system 90

[0122] Through the above method, different effective periods are configured for different files according to needs, and whether the files stored in each file system are invalid is judged periodically based on the file creation time and the corresponding effective period, which reduces the workload of relevant technical personnel to manually delete invalid files and is also beneficial to improving the space utilization of each file system.

[0123] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0124] Please refer to Figure 6 , which shows a block diagram of a file management device provided by an embodiment of the present application. The device has the functions of implementing the above examples, and the functions can be implemented by hardware, or by hardware executing corresponding software. The device can be the computer device introduced above, or it can be set in a computer device. Figure 6 As shown, the device 600 may include a parameter acquisition module 610 , a system determination module 620 and an operation execution module 630 .

[0125] The parameter acquisition module 610 is used to acquire a first operation parameter through a first hybrid common interface, where the first hybrid common interface is used to implement a first operation in at least two file systems, where the first operation parameter includes a system parameter and a configuration parameter, where the system parameter is used to indicate the file system that performs the first operation, and the configuration parameter is used to describe the behavior of the first operation.

[0126] The system determination module 620 is used to determine a first file system for executing the first operation according to the system parameters in the first operation parameters.

[0127] The operation execution module 630 is used to execute the first operation in the first file system according to the configuration parameters in the first operation parameters.

[0128] In some embodiments, the first operation is a file query operation, and the configuration parameters in the first operation parameters include a first file identifier and a first file path, the first file identifier is used to indicate the first file, and the first file path is used to indicate the location of the first file in the first file system; the operation execution module 630 is used to search for the first file in the first file system according to the first file identifier and the first file path; and return the first file through the first hybrid shared interface.

[0129] In some embodiments, the device 600 further includes a message sending module (in Figure 6 (not shown) is used to send a first notification message when the first label record in the file label information meets the change condition, the first notification message is used to indicate that the first label record has changed, the first label record is used to indicate the first file label of the second file, and the first file label is used to indicate the working status of the edge device corresponding to the second file; wherein the change condition is related to at least one of the following: the file path of the second file, the file type of the second file, the type of change of the first label record, and the first file label.

[0130] In some embodiments, the file tag information includes at least one tag record, the tag record includes a file identifier, a file path and a tag key-value pair, the tag key-value pair includes a file tag identifier and tag information, the tag identifier is used to indicate a file tag, and the tag information is the content of the file tag indicated by the tag identifier; the device 600 also includes a tag editing module (in Figure 6 (not shown) is used to search for a label record that matches the second file identifier and the second file path in at least one label record included in the file label information to obtain a second label record; and perform an editing operation on the label key-value pair in the second label record; wherein the editing operation includes at least one of the following: a adding operation, a deleting operation, a modifying operation, and a searching operation.

[0131] In some embodiments, the device 600 further includes a load adjustment module (in Figure 6 (not shown) is used to obtain first load information of the edge gateway, wherein the first load information is used to indicate resource usage of the edge gateway; according to thread configuration information, the number of parallel threads is adjusted to the first number of threads corresponding to the first load information, and the thread configuration information includes at least one set of load information and thread number having a corresponding relationship.

[0132] In some embodiments, the device 600 further includes a file detection module (in Figure 6), used for traversing metadata of at least one file stored in the second file system when the time interval between the first moment and the second moment is equal to the period threshold, the metadata of each file is information related to the file, the metadata includes the creation time of the file, and the period threshold refers to the time interval for checking whether the file is invalid; in the validity period configuration information, searching for the valid duration matching the third file in the at least one file to obtain a first valid duration, the first valid duration refers to the valid duration of the third file stored by the second file system, the validity period configuration information includes at least one set of file range information and the valid duration, the file range information is used to indicate the location of the file configuring the valid duration in the at least two file systems; when the first storage duration is greater than the first valid duration, deleting the third file from the second file system, the first storage duration is determined based on the creation time of the third file; wherein the first moment is earlier than the second moment, and the first moment is the moment of the most recent execution of the step of checking whether the file is invalid.

[0133] In summary, the technical solution provided in the embodiment of the present application uniformly manages files stored in different file systems through a hybrid common interface with relatively small operational differences, thereby effectively reducing the complexity of processing files for different file systems.

[0134] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0135] Please refer to Figure 7 , which shows a structural block diagram of a computer device 700 provided in one embodiment of the present application. The computer device 700 may be Figure 1 The edge gateway 10 in the implementation environment shown may also be Figure 1 The edge server 20 in the illustrated implementation environment is used to implement the file management method provided in the above embodiment.

[0136] Specifically:

[0137] Typically, the computer device 700 includes a processor 710 and a memory 720 .

[0138] The processor 710 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 710 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 710 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 710 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 710 may also include an AI processor, which is used to process computing operations related to machine learning.

[0139] The memory 720 may include one or more computer-readable storage media, which may be non-transitory. The memory 720 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 720 is used to store a computer program, which is configured to be executed by one or more processors to implement the file management method.

[0140] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the computer device 700, and the computer device 700 may include more or less components than shown in the figure, or combine some components, or adopt a different arrangement of components.

[0141] In an exemplary embodiment, a computer-readable storage medium is also provided, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned file management method is implemented. Optionally, the computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM).

[0142] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned file management method.

[0143] It should be noted that the relevant data collection and processing in this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0144] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0145] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A file management method, characterized in that: The method is performed by an edge gateway, and the method includes: Acquiring a first operation parameter through a first hybrid common interface, where the first hybrid common interface is used to implement execution of a first operation in at least two file systems, where the first operation parameter includes a system parameter and a configuration parameter, where the system parameter is used to indicate the file system that executes the first operation, and the configuration parameter is used to describe a behavior of the first operation; Determine a first file system for executing the first operation according to the system parameters in the first operation parameters; The first operation is performed in the first file system according to the configuration parameters in the first operation parameters.

2. The method according to claim 1, characterized in that The first operation is a file query operation, and the configuration parameters in the first operation parameter include a first file identifier and a first file path, the first file identifier is used to indicate the first file, and the first file path is used to indicate a location of the first file in the first file system; The performing the first operation in the file system according to the configuration parameters in the first operation parameters includes: Searching for the first file in the first file system according to the first file identifier and the first file path; The first file is returned through the first hybrid common interface.

3. The method according to claim 1, characterized in that The method further comprises: When the first label record in the file label information meets the change condition, a first notification message is sent, where the first notification message is used to indicate that the first label record has changed, where the first label record is used to indicate the first file label of the second file, and where the first file label is used to indicate the working status of the edge device corresponding to the second file; The change condition is related to at least one of the following: a file path of the second file, a file type of the second file, a type of change recorded by the first tag, and a tag of the first file.

4. The method according to claim 3, characterized in that The file tag information includes at least one tag record, the tag record includes a file identifier, a file path and a tag key-value pair, the tag key-value pair includes a file tag identifier and tag information, the tag identifier is used to indicate a file tag, and the tag information is the content of the file tag indicated by the tag identifier; the method further includes: Searching for a label record that matches the second file identifier and the second file path in at least one label record included in the file label information to obtain a second label record; Performing an editing operation on the tag key-value pair in the second tag record; The editing operation includes at least one of the following: a adding operation, a deleting operation, a modifying operation, and a searching operation.

5. The method according to claim 1, characterized in that The method further comprises: Acquire first load information of the edge gateway, where the first load information is used to indicate resource usage of the edge gateway; According to the thread configuration information, the number of parallel threads is adjusted to the first number of threads corresponding to the first load information, wherein the thread configuration information includes at least one set of load information and thread number having a corresponding relationship.

6. The method according to claim 1, characterized in that The method further comprises: When the time interval between the first moment and the second moment is equal to the period threshold, traverse metadata of at least one file stored in the second file system, where the metadata of each file is information related to the file, and the metadata includes a creation time of the file, and the period threshold refers to a time interval for checking whether the file is invalid; In the validity period configuration information, searching for a validity period that matches a third file in the at least one file to obtain a first validity period, where the first validity period refers to a validity period for storing the third file in the second file system, where the validity period configuration information includes at least one set of file range information and a validity period, where the file range information is used to indicate a location of a file that configures the validity period in the at least two file systems; In a case where a first storage duration is greater than the first valid duration, wherein the first storage duration is determined based on a creation time of the third file, deleting the third file from the second file system; The first time is earlier than the second time, and the first time is the time of the most recent execution of the step of checking whether the file is invalid.

7. A file management device, characterized in that: The device comprises: a parameter acquisition module, configured to acquire a first operation parameter through a first hybrid common interface, wherein the first hybrid common interface is used to implement execution of a first operation in at least two file systems, wherein the first operation parameter includes a system parameter and a configuration parameter, wherein the system parameter is used to indicate the file system that executes the first operation, and the configuration parameter is used to describe a behavior of the first operation; a system determination module, configured to determine a first file system for executing the first operation according to a system parameter in the first operation parameter; An operation execution module is used to execute the first operation in the first file system according to the configuration parameters in the first operation parameters.

8. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to be executed by a processor to implement the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product comprises a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 6.