A file storage method, device and medium
By constructing a file system operation interface and storage policy configuration file that are independent of the file storage tool, dynamic switching between different storage tools is realized, which solves the problems of high development cost and low flexibility when changing storage tools in the existing technology, and improves the flexibility and scalability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 浪潮工业互联网股份有限公司
- Filing Date
- 2026-01-14
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, file storage systems require extensive modifications to the application code when changing storage tools, resulting in high development costs and a lack of flexibility.
Build a file system operation interface that is independent of file storage tools, and realize dynamic switching between different storage tools through storage policy configuration files to reduce coupling and expansion costs.
It enables flexible switching of storage tools without modifying the upper-layer business code, reducing system upgrade risks and operation and maintenance costs, and improving system flexibility and scalability.
Smart Images

Figure CN122132360A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of file management, and particularly relates to a file storage method, equipment and medium. BACKGROUND
[0002] With the rapid development of information technology, file storage and management has become one of the core functions of various information systems.
[0003] File system operations are usually directly bound to specific file storage tools (such as local file systems, distributed storage services, cloud storage platforms, etc.), and application programs need to realize file creation, reading, updating, deletion and other operations by calling the interfaces of specific storage tools.
[0004] Based on this, under the condition of close coupling, when the storage tool needs to be replaced (for example, from local storage to cloud storage), all the codes related to file operations in the application program need to be modified, which has high development cost and lacks flexibility. SUMMARY
[0005] In order to solve the above problems, the present application provides a file storage method, comprising: building a file system operation interface independent of a file storage tool; adding a first file storage tool for file operations of current business requirements; building an interface function response operation between the file system operation interface and the first file storage tool; building a storage strategy configuration file for forwarding file information to the first file storage tool; when the first file storage tool is updated to a second file storage tool, updating the storage strategy configuration file to switch the file storage tool of the file system from the first file storage tool to the second file storage tool.
[0006] In one example, the file system operation interface comprises at least one of the following: file uploading, file fragment uploading, file downloading, and file existence.
[0007] In one example, the building of the file system operation interface independent of the file storage tool specifically comprises: obtaining configuration information of each file system operation interface, the configuration information comprising an interface name, input parameter data and visual configuration data of each file system operation interface, and the input parameter data being independent of parameters of the file storage tool; displaying each file system operation interface on an application end according to the respective configuration information.
[0008] In one example, the adding of the first file storage tool for the file operation of the current service requirement specifically includes: obtaining file operation configuration information of the current service requirement; the file operation configuration information includes a first file storage tool type and a first file storage tool identifier; loading dependent components required when the first file storage tool is called according to the file operation configuration information.
[0009] In one example, the constructing of the functional response operation between the file system operation interface and the first file storage tool specifically includes: when the first file storage tool has a file system operation interface function, connecting the file system operation interface with the file system operation interface function of the first file storage tool; when the first file storage tool does not have a file system operation interface function, newly creating a file system operation interface function for the first file storage tool; connecting the file system operation interface with the newly created file system operation interface function of the first file storage tool.
[0010] In one example, the updating of the storage strategy configuration file specifically includes: modifying a file storage tool parameter of a file system in the storage strategy configuration file from the first file storage tool to the second file storage tool.
[0011] In one example, after the file storage tool of the file system is switched from the first file storage tool to the second file storage tool, the method further includes: if the file information of the first file storage tool is not migrated to the second file storage tool, when the file information of the first file storage tool is requested at an application end, forwarding a file download request to a storage address corresponding to the first file storage tool.
[0012] In one example, after the file storage tool of the file system is switched from the first file storage tool to the second file storage tool, the method further includes: reading file information of the first file storage tool; the file information includes files and metadata; migrating the file information to the second file storage tool; verifying a migration result.
[0013] In another aspect, an embodiment of the present application provides a file storage device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned file storage methods.
[0014] In another aspect, an embodiment of the present application provides a file storage nonvolatile computer storage medium storing computer executable instructions, and the computer executable instructions are capable of performing any of the above-mentioned file storage methods.
[0015] The above-mentioned at least one technical solution adopted by the embodiments of the present application can achieve the following beneficial effects: The application end provides a unified file system operation interface, so that the upper layer business logic does not need to care about the details of the underlying storage implementation, and the coupling degree between modules of the system is reduced. The decoupling of the interface and the implementation is realized.
[0016] When a new file storage tool needs to be introduced, only the storage strategy configuration file needs to be updated, without modifying the upper layer business code, which significantly reduces the cost of expanding new storage tools. Further, dynamic switching between different storage tools can be realized without modifying the upper layer business code, so that the system can flexibly adjust the storage scheme according to business requirements or performance requirements.
[0017] During the upgrade or replacement of the storage tool, since the interface remains stable, the upper layer business can continue to operate normally, reducing the risk of business interruption caused by system upgrade, and further ensuring business continuity. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the present application, some embodiments of the present application will be described in detail below with reference to the accompanying drawings, in which: Figure 1 A flowchart of a file storage method provided by an embodiment of the present application; Figure 2 A file storage scene diagram provided by an embodiment of the present application; Figure 3 A structure diagram of a file storage device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0021] Figure 1 This is a flowchart illustrating a file storage method provided in an embodiment of this application. This method can be applied to various business areas, such as internet finance, e-commerce, instant messaging, gaming, and government services. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.
[0022] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.
[0023] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.
[0024] Figure 1 The process includes the following steps: S101: Construct a file system operation interface that is independent of file storage tools.
[0025] In some embodiments of this application, a universal operating standard independent of specific storage tools is formed. By using a unified interface, the operational differences between different storage tools are shielded, allowing applications to simply call a fixed interface without having to worry about which storage is used at the underlying level (such as local, cloud, or distributed), thereby reducing the coupling between applications and storage from the source.
[0026] Based on this, the construction process can be as follows: Obtain the configuration information for each file system operation interface.
[0027] The configuration information includes the interface name, input parameters, and visualization configuration data for each file system operation interface. It should be noted that this configuration information is obtained through user uploads.
[0028] Based on their respective configuration information, each file system operation interface is displayed on the application side.
[0029] It should be noted that, to prevent accidental deletion by users, deletion operations can be omitted. The file system operation interface includes defining four interfaces: file upload, file chunk upload, file download, and file existence verification.
[0030] Among them, file upload and file chunk upload are sub-interfaces designed to adapt to the different transmission needs of small and large files within the same storage tool. The file existence interface is used for document existence verification, thereby avoiding duplicate file uploads.
[0031] For example, if an e-commerce platform needs to develop a product image management system, it can define four unified interfaces according to these steps: Product image upload interface (input parameters are image file and product ID), product large image segmented upload interface (input parameters are image block, product ID, and total number of blocks), product image download interface (input parameters are product ID and image name, returns image data stream), and product image existence verification interface (input parameters are product ID and image name, returns a boolean value).
[0032] S102: Add a first file storage tool for file operations required by current business needs.
[0033] In some embodiments of this application, a specific storage tool is selected based on business requirements (such as concurrency, cost, and elasticity requirements), and secure connection code is developed to ensure that the application can legally access the storage tool. That is, the selection of storage tools must match the actual scenario (such as distributed storage for high concurrency, local storage for low cost, and cloud storage for elastic scaling).
[0034] Authentication is a prerequisite for security, and unauthorized access must be prevented through methods such as keys and tokens.
[0035] For example, when using a local hard drive: set a system account and password for the server, and only the IT staff managing the system can log in to the server. Employees can only access files through the design draft management system (equivalent to employees not being able to directly touch the hard drive, but only being able to access files through a unified interface button).
[0036] When switching to distributed storage: Set up a dedicated account for the storage system (for example, the account is design_team and the password is Des1gn@2024). Only the enterprise's design management system can log in to the storage system with this account, just like a safe at home. Only the right key (account and password) can open the door.
[0037] Based on this, the process of adding the first file storage tool is as follows: First, obtain the file operation configuration information required for the current business needs.
[0038] The file operation configuration information is obtained through user uploads and may include the type of the first file storage tool, its identifier, and authentication connection relationships. The type of the first file storage tool can be a local file system, a distributed file system, or a cloud storage service.
[0039] Then, based on the file operation configuration information, the dependent components required when calling the first file storage tool are loaded.
[0040] It should be noted that storage tools require corresponding technical components to be invoked by the system. For example, invoking cloud storage requires an SDK, while invoking local storage requires a system I / O library.
[0041] For example, local file systems need to load Linux / Windows system I / O driver components, while cloud storage needs to load SDK components provided by cloud vendors.
[0042] In addition, the system automatically verifies the integrity of dependent components (such as checking if the cloud SDK exists and if the versions are compatible). If any components are missing, the system automatically downloads and installs them from the preset repository to ensure that subsequent operations can call the functions of the storage tool normally.
[0043] S103: Response operation for the interface function between the file system operation interface and the first file storage tool.
[0044] In some embodiments of this application, the defined file system operation interface is implemented through the API (or custom code) of the selected storage tool, allowing the general interface to map to specific storage operations. Since most storage tools typically have corresponding API services, they can be directly referenced. If not, the corresponding functional modules need to be built.
[0045] In other words, if the storage tool provides a ready-made API, the unified interface can be implemented directly by referencing the API, reducing development effort. If the storage tool does not have a corresponding API (such as niche local distributed storage), then custom code should be used to implement the interface functionality to ensure the availability of the unified interface.
[0046] This is equivalent to setting a common storage operation specification for file storage tools (equivalent to setting up a storage tool adapter), enabling the file system operation interface to automatically interface with the file storage tool, allowing the application to be completely independent of the specific storage tool.
[0047] This can also be understood as translating file system operation interfaces into instructions that specific storage tools can understand. For example, a local storage adapter translates file upload requests into operations that write files to a specified directory on the local server.
[0048] Cloud storage adapter: Translates the same file upload interface requirements into an operation that calls the cloud storage SDK to upload files to a specified storage bucket.
[0049] Based on this, the process of constructing the interface function response operation is as follows: When the first file storage tool has a file system operation interface function, the file system operation interface is connected with the file system operation interface function of the first file storage tool.
[0050] If the first file storage tool does not have a file system operation interface function, create a file system operation interface function for the first file storage tool.
[0051] It should be noted that the function of creating a new file system operation interface is implemented through the configuration information of the functional modules uploaded by the user.
[0052] The file system operation interface is integrated with the new file system operation interface function of the first file storage tool.
[0053] In some embodiments of this application, after the above-mentioned docking, an authentication-secure connection will be established based on the authentication connection relationship, and an authentication connection verification will also be performed.
[0054] For example, call the authentication interface of the first file storage tool (or simulate authentication logic) to verify whether the parameters are valid: Local file system: Check if the service account can read and write the preset storage. If the permission is allowed, the authentication is successful.
[0055] Cloud storage: Using the loaded cloud SDK, an authentication request (carrying AccessKey / SecretKey) is sent to the cloud storage service endpoint. If the cloud service returns a successful authentication response, authentication is successful. If the returned key is invalid or the endpoint is unreachable, authentication fails and an error is reported.
[0056] After successful authentication, the application will establish a persistent and secure connection with the first file storage tool.
[0057] S104: Construct a storage policy configuration file for forwarding file information to the first file storage tool.
[0058] In some embodiments of this application, the storage policy configuration file provides the basis for dynamic switching, pre-defining which storage tool should be used in the current business environment. That is, the storage policy configuration file includes file storage tool type and file storage tool identifier, etc.
[0059] Configuration example: In the system configuration file, "storage.type=local" indicates that local storage is currently used, "storage.type=minio" indicates that "MinIO distributed storage" is currently used, and "storage.type=cloud" indicates that cloud storage is currently used. Additionally, the configuration file also contains a unique identifier for the file storage tool, which will not be shown here.
[0060] It should be noted that the configuration information is externally modifiable. For example, users can change the choice of storage tool simply by modifying parameters or replacing configuration files in the system backend, without affecting the application's business code.
[0061] S105: When the first file storage tool is updated to the second file storage tool, the storage policy configuration file is updated to switch the file storage tool of the file system from the first file storage tool to the second file storage tool.
[0062] Updating the storage policy configuration file can be achieved by changing the file storage tool parameter of the file system in the storage policy configuration file from the first file storage tool to the second file storage tool. The file storage tool parameter includes the file storage tool type and file storage tool identifier, among other things.
[0063] It should be noted that the application is unaware of the process of redirecting the file system operation interface to the new second file storage tool. The switching process can be as follows: the application will periodically, or when the system starts up, or when it receives a switching request, read the parameters of the current target file storage tool defined in the storage policy configuration file (for example, if the configuration is cloud storage, it will know to switch to cloud storage).
[0064] It should be noted that before updating the storage policy configuration file, a second file storage tool needs to be added for file operations required by the business. The interface function response operation between the file system operation interface and the second file storage tool needs to be built. The addition and construction process is the same as the method of the first file storage tool, and will not be explained here.
[0065] After the switch is complete, the redirected interface operation can proceed as follows: When the application calls the file upload interface, the uploaded file is forwarded to the second file storage tool via a secure connection. Throughout this process, the application is completely unaware that the underlying storage tool has changed because the application is consistently calling the file system operation interface.
[0066] In some embodiments of this application, the file information of the first file storage tool may not be migrated to the second file storage tool, or it may be partially or completely migrated.
[0067] Based on this, the targeted interface operation can also be as follows: if the file information of the first file storage tool has not been migrated to the second file storage tool, when the application requests the file information of the first file storage tool, the file download request is forwarded to the storage address corresponding to the first file storage tool.
[0068] In other words, there are multiple ways to manage storage tools. For example, the current file upload storage tool and file download storage tool are the only switching modes.
[0069] For example, in an e-commerce testing environment: configure local storage (low cost, suitable for testing), with storage.type=local in the configuration file; E-commerce production environment: Configure cloud storage (high concurrency), with storage.type=cloud in the configuration file.
[0070] Switching operation: After the test is completed, change storage.type=local in the production environment configuration file to storage.type=local. The application will automatically call the cloud storage implementation interface without modifying the overall business code.
[0071] Alternatively, it can be a switchable mode that allows for a single storage tool for uploads and compatibility with downloads. This means that a single storage tool can be specified during uploads, but address forwarding or data stream forwarding can be used during file downloads. Each storage tool only needs to handle its own logic, meaning the business system can have multiple storage tools running simultaneously. Furthermore, by modifying the storage policy configuration file, switching between storage tools can be performed without affecting downloads from other storage tools. This effectively reduces data migration operations, especially when the data structures of the storage tools differ significantly.
[0072] For example, in the early days of e-commerce, 1 million product images from before 2023 were stored locally, while newly uploaded images from 2024 onwards are stored in cloud storage.
[0073] Upload logic: New images are uniformly uploaded to the cloud storage interface to ensure that newly added data is only uploaded to the cloud storage tool.
[0074] Download logic: Develop the URL forwarding logic when a user requests an image: If the image was uploaded after 2024 (determined by metadata), it will be forwarded to the cloud storage address.
[0075] If the image was uploaded before 2023, forward it to the local storage address.
[0076] Technical benefits: No need to migrate 1 million historical images to cloud storage (saving several days of migration time and bandwidth costs), and users experience no difference in download speed.
[0077] It's important to note that while compatibility mode can reduce data migration operations, a significant number of data migrations still occur in practice. Ensuring data remains usable after migration is crucial. For system security, some file metadata may be stored in the storage tool's additional information for each file. Therefore, users must write corresponding migration scripts along with their code during migration. Metadata contains file identity information (such as the "product ID" and "resolution" of product images); loss during migration can lead to business disruptions. The migration script must cover the entire process of "reading source data, uploading to target storage, writing metadata, and verifying availability" to avoid human error.
[0078] Based on this, the migration process is as follows: Periodically read file information from the primary file storage tool; file information includes files and metadata; The file information is then migrated to a second file storage tool. Verify the migration results. For example, verify after migration: as in the example above, when a user requests an image from before 2023, the system automatically downloads it from cloud storage, and the metadata (such as resolution) is consistent with before the migration, and the business is normal.
[0079] In summary, when data migration is necessary (such as the retirement of old storage), it is crucial to protect "file metadata" (such as creation time, permissions, and associated business IDs) and to automate the migration process using migration scripts to ensure that the files can be used normally after migration.
[0080] It should be noted that, although the embodiments in this application are based on... Figure 1 Steps S101 to S105 will be described sequentially, but this does not mean that steps S101 to S105 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1 The order in which steps S101 to S105 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S101 to S105 can be appropriately adjusted according to actual needs.
[0081] pass Figure 1 This approach provides a unified file system operation interface on the application side, freeing upper-layer business logic from concern itself with the underlying storage implementation details, thus reducing the coupling between various modules of the system. It achieves decoupling between the interface and the implementation.
[0082] When a new file storage tool needs to be introduced, only the storage policy configuration file needs to be updated, without modifying the upper-layer business code, significantly reducing the cost of expanding to new storage tools. Furthermore, dynamic switching between different storage tools can be achieved without modifying the upper-layer business code, allowing the system to flexibly adjust the storage solution according to business needs or performance requirements.
[0083] During the upgrade or replacement of storage tools, the upper-layer services can continue to operate normally because the interface remains stable, reducing the risk of business interruption caused by system upgrades and thus ensuring business continuity.
[0084] Furthermore, by using a download-compatible mode, multiple file storage tools can be used in combination during file download, which can solve the technical problems of low data sharing efficiency and difficulty in multi-storage collaboration when using multiple storage tools simultaneously in existing technologies.
[0085] Furthermore, under tight coupling, the differences in maintenance methods of different storage systems increase management complexity, resulting in high operation and maintenance costs. This application enables upper-layer business logic to be free from concern for the underlying storage implementation details and to switch without modifying the upper-layer business code, thereby reducing operation and maintenance costs.
[0086] In summary, it enables plug-and-play and dynamic switching of file storage tools, significantly reduces the coupling between applications and storage systems, improves system flexibility and scalability, simplifies data management processes in multi-storage environments, and provides efficient and flexible storage solutions for modern applications.
[0087] This application provides a file storage system, which includes a fixed file system operation interface, a storage adapter abstraction layer, multiple storage tool adapter implementation modules, a dynamic storage switching manager, and a storage policy configuration management system.
[0088] Among them, the fixed file system operation interface is used to build a file system operation interface that is independent of file storage tools.
[0089] The storage adapter abstraction layer is used to add a primary file storage tool for file operations that meet current business needs.
[0090] Multiple storage tool adapter implementation modules are used to construct the interface function response operation between the file system operation interface and the first file storage tool.
[0091] Storage policy configuration management involves building a storage policy configuration file for forwarding file information to the first file storage tool.
[0092] The dynamic storage switching manager updates the storage policy configuration file when the first file storage tool is updated to the second file storage tool, so as to switch the file storage tool of the file system from the first file storage tool to the second file storage tool.
[0093] By defining a file system operation interface independent of storage tools, and having the storage adapter encapsulate the specific implementations of different file storage tools, the storage switching manager dynamically switches storage tools at runtime, allowing applications to switch between different storage tools without modifying their code. This solves the problems of tight coupling, lack of flexibility, difficulty in multi-storage coordination, and high operation and maintenance costs in storage systems. It effectively reduces the coupling between applications and storage systems, improves system flexibility and scalability, and is suitable for data management needs in various storage environments.
[0094] More intuitively, Figure 2 This is a schematic diagram of a file storage scenario provided in an embodiment of this application.
[0095] exist Figure 2 The document showcases four unified file system operation interfaces and multiple storage tools, each implementing corresponding functional interfaces. Applications can dynamically switch between storage tools based on business needs.
[0096] Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0097] Figure 3 A schematic diagram of a file storage device provided in this application embodiment includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a file storage method as described above.
[0098] Some embodiments of this application provide a file storage non-volatile computer storage medium storing computer-executable instructions capable of executing any of the file storage methods described above.
[0099] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0100] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0101] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0103] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0104] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0105] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0106] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0107] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0108] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0109] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the technical principles of this application should fall within the protection scope of this application.
Claims
1. A file storage method, characterized in that, The method includes: Build a file system operation interface that is independent of file storage tools; Add a primary file storage tool to meet current business needs for file operations; Establish an interface function response operation between the file system operation interface and the first file storage tool; Construct a storage policy configuration file for forwarding file information to the first file storage tool; When the first file storage tool is updated to the second file storage tool, the storage policy configuration file is updated to switch the file system's file storage tool from the first file storage tool to the second file storage tool.
2. The method according to claim 1, characterized in that, File system operation interfaces include at least one of the following: File upload, file chunk upload, file download, file existence check.
3. The method according to claim 1, characterized in that, The construction of a file system operation interface independent of file storage tools specifically includes: Obtain the configuration information for each file system operation interface. The configuration information includes the interface name, input parameter data, and visualization configuration data for each file system operation interface. The input parameter data is independent of the parameters of the file storage tool. Based on their respective configuration information, each file system operation interface is displayed on the application side.
4. The method according to claim 1, characterized in that, The addition of a first file storage tool for file operations required by current business needs specifically includes: Obtain the file operation configuration information required for the current business needs; the file operation configuration information includes the first file storage tool type and the first file storage tool identifier; Based on the file operation configuration information, load the dependent components required when calling the first file storage tool.
5. The method according to claim 1, characterized in that, The functional response operations between the file system construction operation interface and the first file storage tool specifically include: When the first file storage tool has a file system operation interface function, the file system operation interface is connected to the file system operation interface function of the first file storage tool; When the first file storage tool does not have a file system operation interface function, a file system operation interface function is created for the first file storage tool; The file system operation interface is integrated with the new file system operation interface function of the first file storage tool.
6. The method according to claim 1, characterized in that, The update of the storage policy configuration file specifically includes: Change the file storage tool parameter of the file system in the storage policy configuration file from the first file storage tool to the second file storage tool.
7. The method according to claim 1, characterized in that, After switching the file storage tool of the file system from the first file storage tool to the second file storage tool, the method further includes: If the file information of the first file storage tool is not migrated to the second file storage tool, when the application requests the file information of the first file storage tool, the file download request will be forwarded to the storage address corresponding to the first file storage tool.
8. The method according to claim 1, characterized in that, After switching the file storage tool of the file system from the first file storage tool to the second file storage tool, the method further includes: Read the file information from the first file storage tool; the file information includes the file and metadata. The file information is then migrated to a second file storage tool. Verify the migration results.
9. A file storage device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a file storage method according to any one of claims 1-8.
10. A non-volatile computer storage medium for file storage, storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing a file storage method according to any one of claims 1-8.