Adapter, method, system and device suitable for multiple file storage systems
By designing an adapter suitable for multiple file storage systems, the compatibility issues caused by different JAVA SDKs are solved, a unified interface between the target application and multiple file storage systems is realized, the development cost and the difficulty of compatibility implementation are reduced, and new technologies are promoted. Introduction of the system.
Patent Information
- Application Number
- CN202011479845.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-15
AI Technical Summary
The JAVA SDKs of different file storage systems are inconsistent, causing the application system to be compatible and customized for each file storage system, which increases development costs and is not conducive to the introduction of new file storage systems.
An adapter suitable for multiple file storage systems is designed, including object building module, common interface module, adaptation module, configuration module and control module. Storage service objects and service interfaces are created through these modules, shielding the file storage system. JAVA SDK details provide a unified service interface, and the target application only needs to connect with the adapter.
It reduces the development cost of target applications, simplifies the introduction process of new file storage systems, reduces the workload of implementing compatibility with new systems, and makes it easier to introduce new file storage systems.
Smart Images

Figure CN112486926B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an adapter, method, system and device applicable to multiple file storage systems. Background Art
[0002] In order to meet the needs of users with different usage habits, file storage systems come in various forms. For file storage systems managed using JAVA SDK, because different file storage systems have different JAVA SDKs, the application system needs to be customized for compatibility with each file storage system, increasing development costs. Moreover, when adding a new file storage system, all application systems need to be customized for compatibility, which is not conducive to the introduction of the new file storage system. Summary of the invention
[0003] The main purpose of this application is to provide an adapter, method, system and device suitable for multiple file storage systems, aiming to solve the technical problem in the prior art that the JAVA SDKs of different file storage systems need to be compatible and customized for each file storage system at the same time, which is not conducive to the introduction of new file storage systems.
[0004] In order to achieve the above-mentioned invention object, the present application proposes an adapter applicable to multiple file storage systems, wherein the adapter applicable to multiple file storage systems is used to perform data operations on multiple file storage systems, and the file storage systems are managed using JAVA SDK;
[0005] The adapter applicable to multiple file storage systems includes: an object construction module, a general interface module, an adaptation module, a configuration module, and a control module;
[0006] The object construction module is used to create an object based on the factory class to obtain a storage service object, and the storage service object is used to adapt to the object of the file storage system;
[0007] The universal interface module is used to provide a unified service interface, and the service interface is used to provide file services to the target application;
[0008] The adaptation module is used to generate the service interface according to the storage service object;
[0009] The configuration module is used to obtain configuration data, and the configuration data is used by the object construction module to create the storage service object;
[0010] The control module is used to control the configuration module, the adaptation module, and the object construction module to respond to the data operation request sent by the target application through the service interface.
[0011] Further, the multiple file storage systems include: at least one OBS file storage system and at least one IOBS file storage system;
[0012] The storage service object is used to adapt to the objects of the OBS file storage system and the objects of the IOBS file storage system.
[0013] Further, the storage service object includes: a file upload service object;
[0014] The file upload service object is used to obtain a data upload request. When the data upload request is to upload data to the IOBS file storage system, a target file name parameter is obtained according to the data upload request. According to the data upload request and the target file name parameter, an instruction for calling an IOBS upload interface is generated. The instruction for calling an IOBS upload interface is used to call the data upload interface of the IOBS file storage system.
[0015] Furthermore, the storage service object also includes: a file download service object;
[0016] The file download service object is used to obtain a data download request, obtain the target public and private attributes according to the data download request, and generate a download interface call instruction according to the data download request and the target public and private attributes. The download interface call instruction is used to call the data download interface of the file storage system.
[0017] Furthermore, the file download service object is also used to determine a target storage bucket according to the data download request;
[0018] The configuration module is further configured to obtain the target public and private attributes from the public and private corresponding data of the storage bucket according to the target storage bucket.
[0019] Furthermore, when the adapter is started, the tenant identifier and key are obtained through the configuration module, and initialization is performed according to the tenant identifier and the key;
[0020] The tenant identifier and the key are used for authentication between the adapter and the target file storage system, wherein the target file storage system is any one of the file storage systems, and the tenant identifier and the key are issued by the target file storage system.
[0021] Furthermore, the adapter also includes: a log module;
[0022] When the object building module creates an object based on the factory class, data points are buried in the object;
[0023] The log module generates log data according to the data embedding point.
[0024] The present application also proposes an adaptation method applicable to multiple file storage systems, the method being applied to any of the above-mentioned adapters applicable to multiple file storage systems;
[0025] The method comprises:
[0026] Receive a data operation request sent by a target application through a service interface;
[0027] When the data operation request is a data upload request, a call upload interface instruction is generated according to the data transfer instruction by the storage service object, and the call upload interface instruction is used to call the data upload interface of the file storage system;
[0028] When the data operation request is a data download request, the storage service object obtains the target public and private attributes according to the data download request, and generates a download interface call instruction according to the data download request and the target public and private attributes. The download interface call instruction is used to call the data download interface of the file storage system.
[0029] The present application also proposes a file storage service system, the file storage service system comprising: a plurality of file storage systems, and any of the above-mentioned adapters applicable to the plurality of file storage systems;
[0030] The adapter applicable to multiple file storage systems is used to receive a data operation request sent by a target application through a service interface. When the data operation request is a data upload request, the storage service object generates a call upload interface instruction according to the data transmission instruction, and the call upload interface instruction is used to call the data upload interface of the file storage system. When the data operation request is a data download request, the storage service object obtains the target public and private attributes according to the data download request, and generates a call download interface instruction according to the data download request and the target public and private attributes. The call download interface instruction is used to call the data download interface of the file storage system.
[0031] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0032] The adapter, method, system and device applicable to multiple file storage systems of the present application create objects based on factory classes through an object construction module to obtain storage service objects, the storage service objects are used to adapt to objects of the file storage system, a unified service interface is provided through a general interface module, the service interface is used to provide file services to a target application, a service interface is generated according to the storage service object through an adaptation module, configuration data is obtained through a configuration module, the configuration data is used to create the storage service object through an object construction module, and the configuration module, the adaptation module and the object construction module are controlled by a control module to respond to data operation requests sent by a target application through a service interface, so that the target application does not need to pay attention to the details of the JAVA SDK of the file storage system, but only needs to be connected with the adapter applicable to multiple file storage systems, thereby saving the development cost of the target application; and when adding a new file storage system, it is only necessary to connect the adapter applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing a new file storage system, which is conducive to the introduction of a new file storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a process flow of an adapter applicable to multiple file storage systems according to an embodiment of the present application;
[0034] Figure 2 A schematic block diagram of the structure of an adaptation method applicable to multiple file storage systems according to an embodiment of the present application;
[0035] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0036] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0038] In order to solve the technical problem that the JAVA SDK of different file storage systems in the prior art does not need to be compatible and customized for each file storage system at the same time, which is not conducive to the introduction of new file storage systems. The present application proposes an adapter suitable for multiple file storage systems, and the adapter suitable for multiple file storage systems is suitable for the field of distributed artificial intelligence technology of artificial intelligence. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices. By using adapters applicable to multiple file storage systems, the target application does not need to pay attention to the details of the JAVASDK of the file storage system, but only needs to connect with the adapters applicable to multiple file storage systems, thereby saving the development cost of the target application.
[0039] Reference Figure 1 In an embodiment of the present application, an adapter applicable to multiple file storage systems is provided, wherein the adapter applicable to multiple file storage systems is used to perform data operations on multiple file storage systems, and the file storage systems are managed using JAVA SDK;
[0040] The adapter applicable to multiple file storage systems includes: an object construction module 100, a general interface module 200, an adaptation module 300, a configuration module 400, and a control module 500;
[0041] The object construction module 100 is used to create an object based on the factory class to obtain a storage service object, and the storage service object is used to adapt to the object of the file storage system;
[0042] The universal interface module 200 is used to provide a unified service interface, and the service interface is used to provide file services to the target application 600;
[0043] The adaptation module 300 is used to generate the service interface according to the storage service object;
[0044] The configuration module 400 is used to obtain configuration data, and the configuration data is used by the object construction module 100 to create the storage service object;
[0045] The control module 500 is used to control the configuration module 400, the adaptation module 300, and the object construction module 100 to respond to the data operation request sent by the target application 600 through the service interface.
[0046] In this embodiment, the object building module 100 creates an object based on the factory class to obtain a storage service object, which is used to adapt to the object of the file storage system. The universal interface module 200 provides a unified service interface, which is used to provide file services to the target application 600. The adapter module 300 generates a service interface according to the storage service object, and the configuration module 400 obtains configuration data. The configuration data is used by the object building module 100 to create the storage service object. The control module 500 controls the configuration module 400, the adapter module 300, and the object building module 100 to respond to the data operation request sent by the target application 600 through the service interface, so that the target application 600 does not need to pay attention to the details of the JAVA SDK of the file storage system, but only needs to connect with the adapter applicable to multiple file storage systems, thereby saving the development cost of the target application 600; and when adding a new file storage system, it is only necessary to connect the adapter applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing the new file storage system, which is conducive to the introduction of the new file storage system.
[0047] JAVA SDK is a software development kit for JAVA.
[0048] The storage service object is obtained by creating an object based on the factory class, that is, the storage service object is a factory class object. The storage service object is used to adapt to the object of the file storage system, that is, the storage service object is adapted to the object of the JAVA SDK that manages the file storage system.
[0049] In JAVA, general class objects are created through the new function, but some classes must be created through their getInstance method. This type of class is called a factory class.
[0050] Creating objects based on factory classes is the factory method pattern. The factory method pattern defines an interface for creating objects, allowing subclasses to decide which class to instantiate. The factory can strictly define the creation of objects, and clients can use them directly after creating them through the factory.
[0051] The service interface is an API, and the target application 600 calls the API according to the API calling requirement, thereby shielding the target application 600 from the differences in the JAVA SDK for managing the file storage system.
[0052] Preferably, the service interface includes a data upload service interface, a data download service interface, and a data deletion service interface. The data upload service interface is used to provide data upload service for the target application 600. The data download service interface is used to provide data download service for the target application 600. The data deletion service interface is used to provide data deletion service for the target application 600.
[0053] The target application 600 refers to a software system that needs to upload and download data from a file storage system.
[0054] The adaptation module 300 generates the service interface according to the storage service object, that is, encapsulates the storage service object into the service interface.
[0055] The configuration module 400 obtains configuration data from a configuration center.
[0056] The configuration center is used to store configuration data. It is understandable that the configuration center may be a functional module of the adapter applicable to multiple file storage systems, or may not be a functional module of the adapter applicable to multiple file storage systems.
[0057] Preferably, the configuration center is not a functional module of the adapter applicable to multiple file storage systems, so that the configuration center can be used to manage the configuration data of all microservice components of the entire cloud platform.
[0058] The control module 500 controls the configuration module 400, the adaptation module 300, and the object construction module 100 to respond to the data operation request sent by the target application 600 through the service interface. That is to say, in the process of responding to the data operation request and performing data operation according to the data operation request, the control module 500 plays a routing role.
[0059] The adapter suitable for multiple file storage systems receives data operation requests sent by the target application 600 through the service interface, and the data operation requests include: data upload request, data download request, and data deletion request; calls the configuration module 400, the adaptation module 300, and the object construction module 100 through the control module 500 to respond to the data operation request, and performs data operations according to the data operation request.
[0060] The target application 600 sends a data upload request to the adapter through the data upload service interface, sends a data download request to the adapter through the data download service interface, and sends a data deletion request to the adapter through the data deletion service interface.
[0061] In one embodiment, the plurality of file storage systems include: at least one OBS file storage system and at least one IOBS file storage system;
[0062] The storage service object is used to adapt to the objects of the OBS file storage system and the objects of the IOBS file storage system. In other words, the storage service object is adapted to the objects of the JAVA SDK that manages the OBS file storage system and the objects of the JAVA SDK that manages the IOBS file storage system.
[0063] The Java SDKs for managing the OBS and IOBS file storage systems are different.
[0064] The OBS file storage system is a file storage system based on the object storage service.
[0065] Object storage, also called object-based storage, is a general term used to describe an approach to addressing and processing discrete units, which are called objects. Like files, objects contain data, but unlike files, objects are not hierarchical in a hierarchy. Each object is at the same level in a flat address space called a storage pool, and one object does not belong to another object at a lower level. Both files and objects have metadata related to the data they contain, but objects are characterized by extended metadata. Each object is assigned a unique identifier, allowing a server or end user to retrieve the object without having to know the physical address of the data. This approach helps to automate and simplify data storage in cloud computing environments.
[0066] IOBS stands for Internet Object Based Storage. The IOBS file storage system is an Internet-oriented cloud storage system.
[0067] It is understandable that the multiple file storage systems also include other file storage systems managed by JAVA SDK, which is not specifically limited here.
[0068] In one embodiment, the storage service object includes: a file upload service object;
[0069] The file upload service object is used to obtain a data upload request. When the data upload request is to upload data to the IOBS file storage system, a target file name parameter is obtained according to the data upload request. According to the data upload request and the target file name parameter, an instruction for calling an IOBS upload interface is generated. The instruction for calling an IOBS upload interface is used to call the data upload interface of the IOBS file storage system.
[0070] The step of obtaining target file name parameters according to the data upload request includes: the storage service object determines a file identifier according to the data upload request, and obtains the target file name parameters from data corresponding to the file name according to the file identifier.
[0071] The file name corresponding data includes a file identifier and a file name parameter, and the file identifier in the file name corresponding data corresponds to the file name parameter in a one-to-one manner.
[0072] Preferably, the data corresponding to the file name is stored in a configuration center. The configuration center is used to manage the configuration data of all microservice components of the entire cloud platform. It is understandable that the data corresponding to the file name can also be stored in the adapter.
[0073] The data upload interface of the IOBS file storage system is uploadEncrypt(), and the data upload interface of the OBS file storage system is putObject(). Compared with putObject(), uploadEncrypt() has an additional fileName parameter (i.e., file name parameter). Therefore, before calling uploadEncrypt() to upload data to the IOBS file storage system, the calling IOBS upload interface instruction is generated according to the data upload request and the target file name parameter, thereby satisfying the requirement of calling the uploadEncrypt() interface; and from the outside of the adapter applicable to multiple file storage systems, it is not necessary to provide the fileName parameter, only the file identifier is required.
[0074] The data upload request includes a file identifier and a file size. It is understandable that the data upload request may also include a user identifier.
[0075] The file identifier may be a file name, a globally unique identifier, a uniform resource locator (URL), or other identifier that uniquely identifies a file.
[0076] The user identifier may be an identifier that uniquely identifies a user, such as a user name, a user ID, or a user account.
[0077] In one embodiment, the storage service object further includes: a file download service object;
[0078] The file download service object is used to obtain a data download request, obtain the target public and private attributes according to the data download request, and generate a download interface call instruction according to the data download request and the target public and private attributes. The download interface call instruction is used to call the data download interface of the file storage system.
[0079] This embodiment implements shielding of the public bucket attributes and private bucket attributes of data download, so that the target application 600 does not need to care about the public bucket and private bucket attributes, further saving the development cost of the target application 600.
[0080] The data download request includes: a file identifier.
[0081] Among them, data downloading is divided into downloading from a public bucket and downloading from a private bucket. Before calling the data download interface of the OBS file storage system or the IOBS file storage system, a download interface calling instruction is generated according to the data download request and the public and private attributes of the target, thereby satisfying the calling requirements of the data download interface of the file storage system; and from the outside of the adapter applicable to multiple file storage systems, there is no need to understand whether the data download is downloaded from a public bucket or a private bucket.
[0082] In one embodiment, the file download service object is further used to determine a target storage bucket according to the data download request;
[0083] The configuration module 400 is further configured to obtain the target public and private attributes from the public and private corresponding data of the bucket according to the target bucket.
[0084] The public and private corresponding data of the storage bucket is stored in the configuration center, for example, the config-service component of the configuration center records the public and private corresponding data of the storage bucket. It is understandable that the public and private corresponding data of the storage bucket can also be stored in the adapter applicable to multiple file storage systems.
[0085] In one embodiment, the storage service object further includes: a file deletion service object;
[0086] The file download service object is used to obtain a data deletion request, and generate a call deletion interface instruction according to the data deletion request, wherein the call deletion interface instruction is used to call the data deletion interface of the file storage system.
[0087] In one embodiment, when the adapter is started, the configuration module 400 obtains the tenant identifier and the key, and initializes the adapter according to the tenant identifier and the key;
[0088] The tenant identifier and the key are used for authentication between the adapter and the target file storage system, wherein the target file storage system is any one of the file storage systems, and the tenant identifier and the key are issued by the target file storage system.
[0089] Preferably, the tenant identifier and the key are stored in a configuration center. It is understandable that the tenant identifier and the key may also be stored in the adapter applicable to multiple file storage systems.
[0090] The tenant identifier and the key are provided by a file storage system (eg, the OBS file storage system, the IOBS file storage system).
[0091] In one embodiment, the adapter further comprises: a log module;
[0092] When the object construction module 100 creates an object based on the factory class, data points are buried in the object;
[0093] The log module generates log data according to the data embedding point.
[0094] Preferably, the service interface also includes a monitoring service interface; the log module sends asynchronous events to the monitoring service interface according to the data embedding point.
[0095] The monitoring service interface monitors the content including but not limited to: upload frequency and upload file size monitoring.
[0096] The present application also proposes an adaptation method applicable to multiple file storage systems, the method being applied to any of the above-mentioned adapters applicable to multiple file storage systems;
[0097] The method comprises:
[0098] S1: Receive data operation requests sent by the target application through the service interface;
[0099] S2: when the data operation request is a data upload request, generating a call upload interface instruction according to the data transfer instruction through the storage service object, wherein the call upload interface instruction is used to call the data upload interface of the file storage system;
[0100] S3: When the data operation request is a data download request, the target public and private attributes are obtained according to the data download request through the storage service object, and a download interface calling instruction is generated according to the data download request and the target public and private attributes. The download interface calling instruction is used to call the data download interface of the file storage system.
[0101] The adapters applicable to multiple file storage systems in this embodiment enable the target application to not pay attention to the details of the JAVA SDK of the file storage system, but only need to connect with the adapters applicable to multiple file storage systems, thereby saving the development cost of the target application; and when adding a new file storage system, it is only necessary to connect the adapters applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing the new file storage system and facilitating the introduction of the new file storage system.
[0102] In one embodiment, after the step of receiving the data operation request sent by the target application through the service interface, the method further includes:
[0103] When the data operation request is a data deletion request, a call deletion interface instruction is generated according to the data deletion request, and the call deletion interface instruction is used to call the data deletion interface of the file storage system.
[0104] The present application also proposes a file storage service system, the file storage service system comprising: a plurality of file storage systems, and any of the above-mentioned adapters applicable to the plurality of file storage systems;
[0105] The adapter applicable to multiple file storage systems is used to receive a data operation request sent by a target application through a service interface. When the data operation request is a data upload request, the storage service object generates a call upload interface instruction according to the data transmission instruction, and the call upload interface instruction is used to call the data upload interface of the file storage system. When the data operation request is a data download request, the storage service object obtains the target public and private attributes according to the data download request, and generates a call download interface instruction according to the data download request and the target public and private attributes. The call download interface instruction is used to call the data download interface of the file storage system.
[0106] This embodiment uses adapters applicable to multiple file storage systems so that the target application does not need to pay attention to the details of the JAVA SDK of the file storage system, and only needs to connect with the adapters applicable to multiple file storage systems, thereby saving the development cost of the target application; and when adding a new file storage system, it is only necessary to connect the adapters applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing the new file storage system, which is conducive to the introduction of the new file storage system.
[0107] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as adaptation methods applicable to multiple file storage systems. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an adaptation method applicable to multiple file storage systems is implemented. The adaptation method applicable to multiple file storage systems is applied to the adapter applicable to multiple file storage systems described in any one of the above items; the method includes: receiving a data operation request sent by a target application through a service interface; when the data operation request is a data upload request, generating a call upload interface instruction according to the data transmission instruction through the storage service object, and the call upload interface instruction is used to call the data upload interface of the file storage system; when the data operation request is a data download request, obtaining the target public and private attributes according to the data download request through the storage service object, and generating a call download interface instruction according to the data download request and the target public and private attributes, and the call download interface instruction is used to call the data download interface of the file storage system.
[0108] This embodiment uses adapters applicable to multiple file storage systems so that the target application does not need to pay attention to the details of the JAVA SDK of the file storage system, and only needs to connect with the adapters applicable to multiple file storage systems, thereby saving the development cost of the target application; and when adding a new file storage system, it is only necessary to connect the adapters applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing the new file storage system, which is conducive to the introduction of the new file storage system.
[0109] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, an adaptation method applicable to multiple file storage systems is implemented, and the method is applied to the adapter applicable to multiple file storage systems described in any of the above items; the method includes: receiving a data operation request sent by a target application through a service interface; when the data operation request is a data upload request, generating a call upload interface instruction according to the data transmission instruction through the storage service object, and the call upload interface instruction is used to call the data upload interface of the file storage system; when the data operation request is a data download request, obtaining the target public and private attributes according to the data download request through the storage service object, and generating a call download interface instruction according to the data download request and the target public and private attributes, and the call download interface instruction is used to call the data download interface of the file storage system.
[0110] The above-mentioned adaptation method applicable to multiple file storage systems, through the adapter applicable to multiple file storage systems, makes the target application not need to pay attention to the details of the JAVA SDK of the file storage system, but only needs to connect with the adapter applicable to multiple file storage systems, thereby saving the development cost of the target application; and when adding a new file storage system, it is only necessary to connect the adapter applicable to multiple file storage systems with the new file storage system to achieve compatibility, thereby reducing the development workload of introducing the new file storage system, which is conducive to the introduction of the new file storage system.
[0111] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0112] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0113] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An adapter suitable for multiple file storage systems, characterized in that: The adapter applicable to multiple file storage systems is used to perform data operations on multiple file storage systems, and the file storage systems are managed using JAVA SDK; The adapter applicable to multiple file storage systems includes: an object construction module, a general interface module, an adaptation module, a configuration module, and a control module; The object construction module is used to create an object based on the factory class to obtain a storage service object, and the storage service object is used to adapt to the object of the file storage system; The universal interface module is used to provide a unified service interface, and the service interface is used to provide file services to the target application; The adaptation module is used to generate the service interface according to the storage service object; The configuration module is used to obtain configuration data, and the configuration data is used by the object construction module to create the storage service object; The control module is used to control the configuration module, the adaptation module, and the object construction module to respond to the data operation request sent by the target application through the service interface; The multiple file storage systems include: at least one OBS file storage system and at least one IOBS file storage system; The storage service object is used to adapt to the objects of the OBS file storage system and the objects of the IOBS file storage system; the storage service object includes: a file upload service object; The file upload service object is used to obtain a data upload request. When the data upload request is to upload data to the IOBS file storage system, a target file name parameter is obtained according to the data upload request. The step of obtaining the target file name parameter includes the storage service object determining a file identifier according to the data upload request, and obtaining the target file name parameter from data corresponding to the file name according to the file identifier. The data upload interface of the IOBS file storage system has an additional fileName parameter compared to the data upload interface of the OBS file storage system. Before calling the data upload interface of the IOBS file storage system to upload data to the IOBS file storage system, an IOBS upload interface call instruction is generated according to the data upload request and the target file name parameter. The IOBS upload interface call instruction is used to call the data upload interface of the IOBS file storage system.
2. The adapter applicable to multiple file storage systems according to claim 1, characterized in that: The storage service objects also include: file download service objects; The file download service object is used to obtain a data download request, obtain the target public and private attributes according to the data download request, and generate a download interface call instruction according to the data download request and the target public and private attributes. The download interface call instruction is used to call the data download interface of the file storage system.
3. The adapter applicable to multiple file storage systems according to claim 2, characterized in that: The file download service object is further used to determine a target storage bucket according to the data download request; The configuration module is further configured to obtain the target public and private attributes from the public and private corresponding data of the storage bucket according to the target storage bucket.
4. The adapter applicable to multiple file storage systems according to claim 1, characterized in that: When the adapter is started, the tenant identifier and key are obtained through the configuration module, and initialization is performed according to the tenant identifier and the key; The tenant identifier and the key are used for authentication between the adapter and the target file storage system, wherein the target file storage system is any one of the file storage systems, and the tenant identifier and the key are issued by the target file storage system.
5. The adapter applicable to multiple file storage systems according to claim 1, characterized in that: The adapter also includes: a log module; When the object building module creates an object based on the factory class, data points are buried in the object; The log module generates log data according to the data embedding point.
6. An adaptation method applicable to multiple file storage systems, characterized in that: The method is applied to an adapter applicable to multiple file storage systems as described in any one of claims 1 to 5; The method comprises: Receive a data operation request sent by a target application through a service interface; When the data operation request is a data upload request, the storage service object generates a call upload interface instruction according to the upload data instruction, and the call upload interface instruction is used to call the data upload interface of the file storage system; When the data operation request is a data download request, the storage service object obtains the target public and private attributes according to the data download request, and generates a download interface call instruction according to the data download request and the target public and private attributes. The download interface call instruction is used to call the data download interface of the file storage system.
7. A file storage service system, characterized in that: The file storage service system comprises: a plurality of file storage systems, and an adapter applicable to the plurality of file storage systems as described in any one of claims 1 to 5; The adapter applicable to multiple file storage systems is used to receive data operation requests sent by a target application through a service interface. When the data operation request is a data upload request, the storage service object generates a call upload interface instruction according to the upload data instruction. The call upload interface instruction is used to call the data upload interface of the file storage system. When the data operation request is a data download request, the storage service object obtains the target public and private attributes according to the data download request, and generates a call download interface instruction according to the data download request and the target public and private attributes. The call download interface instruction is used to call the data download interface of the file storage system.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to claim 6 are implemented.
Citation Information
Patent Citations
Heterogeneous storage management system and method oriented to cloud computing
CN104156216A
Logic processing server in object storage system
CN106970854A
