File retrieval method and device based on object storage service, equipment and medium
By obtaining file upload instructions in user needs, determining the target object storage service, and using the service for file storage and retrieval, the problem of single object storage service selection in the prior art is solved, and the efficiency and user experience of file storage and retrieval are improved.
Patent Information
- Application Number
- CN202411723839.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
AI Technical Summary
Existing object storage services cannot be selected according to personal needs, resulting in single functions and inefficient functions when storing and retrieving files.
A file retrieval method based on an object storage service is provided, by obtaining file upload instructions in user needs, determining the target object storage service, and using the service for file storage and retrieval. The specific steps include uploading the file to the target object storage service, processing file metadata and storing it to the Elasticsearch search engine, and retrieving and downloading the file through Elasticsearch.
It realizes the selection of target services from multiple object storage services according to user needs, improves the efficiency of file storage and retrieval, and improves the user experience.
Smart Images

Figure CN119520510A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage and retrieval technology, and in particular to a file retrieval method, device, equipment and medium based on object storage service. Background Art
[0002] Due to the excessive number of diverse types of file classification storage and retrieval needs in various industries, when storing large numbers of files of different types, the object storage service used cannot be selected based on personal needs, resulting in the use of relatively single functions when using the object storage service, which in turn affects the efficiency of file storage and retrieval. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a file retrieval method, device, equipment and medium based on an object storage service, which can determine a target object storage service from multiple object storage services based on user needs, and use the target object storage service to store files, so as to use the Elasticsearch search engine to retrieve files in the target object storage service. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a file retrieval method based on an object storage service, comprising:
[0005] Obtain a file upload instruction uploaded via the current user interface, and determine a target object storage service name and a corresponding target service interface from a preset object storage service name list based on user requirements in the file upload instruction;
[0006] The target service interface is called through a client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service;
[0007] Processing the file to be uploaded by using a preset file processing service to obtain a metadata index and a file path corresponding to the file to be uploaded, and storing the metadata index and the corresponding file path in an Elasticsearch search engine;
[0008] The file download instruction uploaded via the current user interface is received through the Elasticsearch search engine, and the file path corresponding to the target file is determined based on the plurality of metadata indexes and the file information in the file download instruction, so as to search for and download the target file through the determined file path.
[0009] Optionally, after calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes:
[0010] The file types, file names, storage locations and file versions corresponding to the uploaded files are visualized using a preset data visualization chart library to obtain a visualization interface, so as to manage the editing operations performed on the uploaded files using the visualization interface.
[0011] Optionally, after calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes:
[0012] Upload the uploaded files stored in the storage space corresponding to the target object storage service to the storage space corresponding to the new object storage service via the service interface corresponding to the name of the new object storage service;
[0013] Among them, data synchronization and sharing operations can be performed between the object storage services corresponding to the object storage service names in the preset object storage service name list.
[0014] Optionally, after calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes:
[0015] Determine whether the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed;
[0016] If the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed, corresponding successful execution information is generated and the successful execution information is uploaded to the current user interface.
[0017] Optionally, after determining the target object storage service name and the corresponding target service interface from a preset object storage service name list based on the user demand in the file upload instruction, the method further includes:
[0018] Using a preset client object generation program, and based on user requirements and each of the object storage services, respectively generate client objects to be initialized that correspond to each of the object storage services;
[0019] Initializing the to-be-initialized client objects corresponding to each object storage service based on preset software development tool documents corresponding to each object storage service to obtain a client object;
[0020] The client object is authenticated and authorized using the key information in the preset software development tool document, so that the client object that has passed the authentication and authorization can communicate data with the corresponding object storage service.
[0021] Optionally, after the preset file processing service is used to process the file to be uploaded to obtain a metadata index and a file path corresponding to the file to be uploaded, and the metadata index and the corresponding file path are stored in an Elasticsearch search engine, the method further includes:
[0022] A target client corresponding to the Elasticsearch search engine is established by calling a preset interface in the preset client establishment software, so that the target client can perform create operations, read operations, update operations and delete operations on the information stored in the Elasticsearch search engine.
[0023] Optionally, the preset data visualization chart library is Echarts, the preset software development tool document is an SDK document, and the preset client establishment software is RestHighLevelClient.
[0024] In a second aspect, the present application provides a file retrieval device based on an object storage service, comprising:
[0025] An upload instruction acquisition module is used to acquire a file upload instruction uploaded via the current user interface, and determine a target object storage service name and a corresponding target service interface from a preset object storage service name list based on user requirements in the file upload instruction;
[0026] A file upload module, configured to call the target service interface through a client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service;
[0027] A file processing service control module, used to process the to-be-uploaded file using a preset file processing service to obtain a metadata index and a file path corresponding to the to-be-uploaded file, and store the metadata index and the corresponding file path in an Elasticsearch search engine;
[0028] The file path determination module is used to receive a file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on a number of metadata indexes and the file information in the file download instruction, so as to search and download the target file through the determined file path.
[0029] In a third aspect, the present application provides an electronic device, including:
[0030] Memory, used to store computer programs;
[0031] The processor is used to execute the computer program to implement the aforementioned file retrieval method based on the object storage service.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned file retrieval method based on an object storage service.
[0033] As can be seen from the above, before performing file retrieval based on the object storage service, the present application needs to obtain the file upload instruction uploaded via the current user interface, and determine the target object storage service name from the preset object storage service name list based on the user requirements in the file upload instruction, so as to determine the corresponding target service interface based on the target object storage service name; call the target service interface through the client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service; use the preset file processing service to process the file to be uploaded, so as to obtain the metadata index and file path corresponding to the file to be uploaded, and store the metadata index and the corresponding file path in the Elasticsearch search engine; receive the file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on several of the metadata indexes and the file information in the file download instruction, so as to find and download the target file through the file path. It can be seen that the present application determines the target object storage service and the corresponding target service interface based on the user needs in the file upload instruction; calls the target service interface through the client object in the target object storage service to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the object storage service; then, uses the preset file processing service to process the file to be uploaded, and stores the obtained metadata index and the corresponding file path in the Elasticsearch search engine, so as to use the Elasticsearch search engine to determine the file path corresponding to the target file through the file download instruction, so as to find and download the target file through the file path. In this way, it is possible to determine the target object storage service from multiple object storage services based on user needs, and use the target object storage service to store files, so as to use the Elasticsearch search engine to retrieve files in the target object storage service, thereby improving the efficiency of file storage and retrieval and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A flowchart of a file retrieval method based on an object storage service disclosed in this application;
[0036] Figure 2 A schematic diagram of a specific file retrieval process based on an object storage service disclosed in this application;
[0037] Figure 3 This is a structural diagram of a file retrieval device based on an object storage service disclosed in this application;
[0038] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Since there are too many and diverse types of files in various industries, classified storage and retrieval requirements, when storing files of different types and large numbers, the object storage service used cannot be selected based on personal needs, resulting in a relatively single selection of object storage services, affecting the efficiency of file storage. To this end, the present application provides a file retrieval method based on an object storage service, which can determine a target object storage service from multiple object storage services based on user needs, and use the target object storage service to store files, so as to use the Elasticsearch search engine to retrieve files in the target object storage service.
[0041] See also Figure 1 As shown, an embodiment of the present invention discloses a file retrieval method based on an object storage service, comprising:
[0042] Step S11: Obtain a file upload instruction uploaded via the current user interface, and determine a target object storage service name and a corresponding target service interface from a preset object storage service name list based on user requirements in the file upload instruction.
[0043] In this embodiment, multiple different object storage services need to be integrated so that the object storage services can be switched based on the application scenario and user needs, thereby providing a method for storing, managing, analyzing and protecting any amount of data that can be applied to a variety of application scenarios. In addition, the Elasticsearch search engine is a distributed, RESTful API (Representational State Transfer Application Programming Interface)-based search and analysis engine that can be used for large-scale data storage and fast retrieval and provides powerful search capabilities.
[0044] It is worth mentioning that object storage services are storage services that store data as objects and provide unique identifiers to manage and access data. In addition, the Elasticsearch search engine is a distributed, RESTful-style search and data analysis engine, as well as a scalable data storage and vector database that can cope with an increasing number of use cases. Among them, the Elasticsearch search engine, as the core of the Elastic Stack (a stack), can centrally store data, achieve lightning-fast search speeds, fine-grained relevance adjustments, and powerful analytical capabilities, and can be scaled.
[0045] In this embodiment, the user can upload files to the object storage service, but before uploading the files, it is necessary to first select the name of the object storage service to upload to. The embodiment of the present application can display a list of preset object storage service names so that the user can select one or more object storage services from the list of preset object storage service names based on user needs, so as to upload the files to be uploaded to the storage space in the selected object storage service.
[0046] In this embodiment, after determining the target object storage service name and the corresponding target service interface from the preset object storage service name list based on the user requirements in the file upload instruction, it is necessary to generate a client object corresponding to the object storage service so as to use the client object to communicate data with the object storage service. Specifically, after determining the target object storage service name and the corresponding target service interface from the preset object storage service name list based on the user requirements in the file upload instruction, it may also include: using a preset client object generation program, and generating to-be-initialized client objects corresponding to each of the object storage services based on user requirements and each of the object storage services; initializing the to-be-initialized client objects corresponding to each of the object storage services based on the preset software development tool documents corresponding to each of the object storage services to obtain the client objects; using the key information in the preset software development tool documents to authenticate and grant permissions to the client objects so as to use the client objects that have passed the authentication and permission grant to communicate data with the corresponding object storage services.
[0047] Step S12: calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service.
[0048] In this embodiment, before using the object storage service for file storage, the embodiment of the present application needs to create an account for applying the object storage service, then generate a corresponding private key, and then create a storage space based on demand to perform file storage operations in the created storage space.
[0049] It is worth mentioning that the embodiment of the present application needs to integrate front-end and back-end technologies, wherein the front-end technology uses Vue (i.e., a framework for building user interfaces and single-page applications), Html (Hyper Text Markup Language), CSS (Cascading Style Sheets) and E Charts (a visual chart library) to construct the user interface, thereby forming a user-visualized operation interface. Specifically, after calling the target service interface through the client object in the target object storage service corresponding to the name of the target object storage service to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, it may also include: using a preset data visualization chart library to visualize the file type, file name, storage location and file version corresponding to several uploaded files to obtain a visualization interface, so as to use the visualization interface to manage the editing operations performed on several uploaded files.
[0050] It is understandable that users can manage files through a visual interface. For example: files are stored according to the file type, name, storage location, and upload date, and the file versions are controlled and managed. In the first specific implementation, the embodiment of the present application can use ECharts to display the file type ratio, storage location ratio, and quantity ratio as a visual interface, so that users can intuitively see the various usage situations of the files. In the second specific implementation, the embodiment of the present application can record the editing operations, modification operations, update operations, and replacement operations performed on the file to form a version control record of the file. In the third specific implementation, the embodiment of the present application can edit and preview files. In addition, users can add notes to any files and folders, and can share files.
[0051] It is worth mentioning that the front end can classify and manage files, and feedback optional conditions based on file information. Subsequently, when the user performs a classified query on the file, the conditions uploaded by the user are transmitted to the back end, so that the back end can use the Elasticsearch search engine to process and retrieve the conditions, thereby returning the corresponding files. In addition, the back-end technology uses the Java language and the SpringBoot framework to integrate the Elasticsearch search engine and the object storage service application. Among them, when encapsulating the object storage service application, the embodiment of the present application needs to design an abstract layer to encapsulate the interfaces of different storage services, and facilitate the subsequent selection of other object storage services to be integrated into the system according to needs. It is worth mentioning that the user performs operations on the relevant files on the front end, and the back end is used to receive the operation requests of the front end and process the operation requests, such as uploading, downloading, classifying, and retrieving files. In addition, the Elasticsearch search engine is responsible for indexing and searching files, and supports complex queries and full-text retrieval.
[0052] In this embodiment, after uploading the files to be uploaded to the storage space corresponding to the target object storage service, the files can be uploaded to a new object storage service based on user needs. Specifically, after calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the files to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, it also includes: uploading the uploaded files stored in the storage space corresponding to the target object storage service to the storage space corresponding to the new object storage service via the service interface corresponding to the name of the new object storage service; wherein, data synchronization and sharing operations can be performed between the object storage services corresponding to the object storage service names in the preset object storage service name list. That is, the object storage services can synchronize data with each other to achieve efficient flow between files, and users can also re-upload the uploaded files to other object storage services, thereby realizing the function of multi-distribution of files.
[0053] In a specific implementation, the embodiment of the present application can upload files through an API interface (Application Programming Interface) corresponding to an object storage service, store the files in a storage space corresponding to the object storage service, and send a successful execution message to the front end after the storage is successful. Specifically, after calling the target service interface through a client object in a target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, it also includes: determining whether the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed; if the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed, then generating corresponding successful execution information, and uploading the successful execution information to the current user interface.
[0054] Step S13: Process the file to be uploaded using a preset file processing service to obtain a metadata index and a file path corresponding to the file to be uploaded, and store the metadata index and the corresponding file path in an Elasticsearch search engine.
[0055] It is worth mentioning that after selecting the object storage service, the preset file processing service can be used to process the file to obtain the metadata index and file path corresponding to the file, and store the file metadata index in the Elasticsearch search engine. Later, when the user retrieves the corresponding file based on the Elasticsearch search engine, the source file corresponding to the file is downloaded. Among them, the file transfer uses efficient hash calculation, which can achieve seconds. If the file size is larger than the preset file size threshold, the file will be uploaded after being fragmented, and breakpoint resumption is supported.
[0056] When users upload files on the visual interface, they can select the location to upload the file, the type of file, and other instructions before uploading the file, then click the upload function button and select the file to be uploaded. In addition, users can choose whether to add upload notes, and then forward data such as the file source file and file-related parameter descriptions to the backend. After receiving the file and other parameters, the backend uploads the file through the preset service interface corresponding to the object storage service.
[0057] In this embodiment, the client dependency of the Elasticsearch search engine needs to be configured. In a specific implementation, the API of the Rest High Level Client (an advanced client of Elasticsearch) is used to create a client corresponding to the Elasticsearch search engine so as to perform CRUD operations through the client, wherein the CRUD operations are create operations, read operations, update operations, and delete operations, and support various complex query and aggregation operations. Specifically, the method of using the preset file processing service to process the file to be uploaded to obtain the metadata index and file path corresponding to the file to be uploaded, and storing the metadata index and the corresponding file path in the Elasticsearch search engine may also include: establishing a target client corresponding to the Elasticsearch search engine by calling a preset interface in the preset client establishment software, so as to perform create operations, read operations, update operations, and delete operations on the information stored in the Elasticsearch search engine through the target client.
[0058] Step S14: receiving the file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determining the file path corresponding to the target file based on the plurality of metadata indexes and the file information in the file download instruction, so as to search for and download the target file through the determined file path.
[0059] In this embodiment, when searching for files, the corresponding file data can be searched based on the file name or directory structure and other multiple conditions. Among them, when searching for a single file, the specified file name can be directly searched; when searching for multiple files, the related files can be queried by querying the file type, location and upload date, or by combining conditions. That is, the user sends a file search request to the backend through the front end, and the backend queries the Elasticsearch search engine for the existence of the file according to the combination of conditions in the file search request. If it exists, the corresponding file data is returned to the front end according to the file path corresponding to the file, so that the front end can display the file data queried according to the conditions for the user to download.
[0060] It is worth mentioning that the administrator can set the user's access rights to files. Among them, the user's access rights to files include but are not limited to read permission: the user has the access rights to the file or file directory; write permission: the user has the permission to modify the file or file directory; add permission: the user has the permission to create a new file in the file directory; delete permission: the user has the permission to delete the file or file directory; upload permission: the user has the permission to upload files in the file directory; download permission: the user has the permission to download the file or file directory.
[0061] As can be seen from the above, before performing file retrieval based on the object storage service, the embodiment of the present application needs to obtain a file upload instruction uploaded via the current user interface, and determine the target object storage service name from the preset object storage service name list based on the user requirements in the file upload instruction, so as to determine the corresponding target service interface based on the target object storage service name; call the target service interface through the client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service; use the preset file processing service to process the file to be uploaded, so as to obtain the metadata index and file path corresponding to the file to be uploaded, and store the metadata index and the corresponding file path in the Elasticsearch search engine; receive the file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on several of the metadata indexes and the file information in the file download instruction, so as to find and download the target file through the file path. In this way, the target object storage service can be determined from multiple object storage services based on user needs, and the target object storage service can be used to store files, and the Elasticsearch search engine can be used to retrieve files in the target object storage service, thereby improving the efficiency of file storage and retrieval and enhancing the user experience.
[0062] For further information, see Figure 2 As shown, an embodiment of the present invention discloses a file retrieval method based on an object storage service, comprising:
[0063] First, the user needs to log in to the system, and then the system identifies the user's permissions based on the identity information of the user's login account, so as to display some interfaces that the user has the permission to operate based on the identified permissions, such as: managing, modifying, uploading and downloading some files.
[0064] Secondly, the user can operate through the visual interface to send the file upload request to the backend through the preset interface, and then the backend processes the file upload request received through the preset interface. The backend can select a target storage service from a number of object storage services based on the user's needs in the file upload request. In a specific implementation, object storage service 1, object storage service 2, object storage service 3, and object storage service n are all object storage services in the backend.
[0065] It is worth mentioning that users can upload files to a specified location and manage them by category. In addition, it supports online preview and editing of files, and supports multiple upload methods such as breakpoint continuation and multi-part upload. When downloading files, users can obtain files by searching for file names, or search for files by type, time, size and other conditions, and then download them. It is understandable that users can also manage file permissions, such as whether files can be edited, whether files can be previewed, whether files can be encrypted, etc.
[0066] Then, the file is processed using a preset file processing service to obtain a metadata index and file information corresponding to the file, and the metadata index and file information corresponding to the file are stored in the Elasticsearch search engine.
[0067] Finally, the user can send the file download request to the Elasticsearch search engine through the visual interface, so that the Elasticsearch search engine can search based on the condition combination in the file download request to determine the target file, and send the target file to the visual interface so that the user can download the target file.
[0068] As can be seen from the above, before performing file retrieval based on the object storage service, the embodiment of the present application needs to determine the target object storage service and the corresponding target service interface based on the user requirements in the file upload instruction; call the target service interface through the client object in the target object storage service to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the object storage service; then, use the preset file processing service to process the file to be uploaded, and store the obtained metadata index and the corresponding file path in the Elasticsearch search engine, so as to use the Elasticsearch search engine to determine the file path corresponding to the target file through the file download instruction, so as to find and download the target file through the file path. In this way, multiple object storage services can be provided for users to choose and switch, and backup data can be synchronized between each object storage service, which improves security and stability.
[0069] Accordingly, see Figure 3 As shown, the present application also provides a file retrieval device based on an object storage service, comprising:
[0070] The upload instruction acquisition module 11 is used to acquire the file upload instruction uploaded via the current user interface, and determine the target object storage service name and the corresponding target service interface from the preset object storage service name list based on the user requirements in the file upload instruction;
[0071] The file upload module 12 is used to call the target service interface through the client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service;
[0072] The file processing service control module 13 is used to process the to-be-uploaded file by using a preset file processing service to obtain a metadata index and a file path corresponding to the to-be-uploaded file, and store the metadata index and the corresponding file path in an Elasticsearch search engine;
[0073] The file path determination module 14 is used to receive the file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on the plurality of metadata indexes and the file information in the file download instruction, so as to search for and download the target file through the determined file path.
[0074] As can be seen from the above, before performing file retrieval based on the object storage service, the embodiment of the present application needs to obtain a file upload instruction uploaded via the current user interface, and determine the target object storage service name from the preset object storage service name list based on the user requirements in the file upload instruction, so as to determine the corresponding target service interface based on the target object storage service name; call the target service interface through the client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service; use the preset file processing service to process the file to be uploaded, so as to obtain the metadata index and file path corresponding to the file to be uploaded, and store the metadata index and the corresponding file path in the Elasticsearch search engine; receive the file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on several of the metadata indexes and the file information in the file download instruction, so as to find and download the target file through the file path. It can be seen that the present application determines the target object storage service and the corresponding target service interface based on the user demand in the file upload instruction; calls the target service interface through the client object in the target object storage service to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the object storage service; then, uses the preset file processing service to process the file to be uploaded, and stores the obtained metadata index and the corresponding file path in the Elasticsearch search engine, so as to use the Elasticsearch search engine to determine the file path corresponding to the target file through the file download instruction, so as to find and download the target file through the file path. In this way, it is possible to determine the target object storage service from multiple object storage services based on user demand, and use the target object storage service to store files, so as to use the Elasticsearch search engine to retrieve files in the target object storage service.
[0075] In some specific implementations, the file retrieval device based on the object storage service may further include:
[0076] The visualization operation unit is used to use a preset data visualization chart library to visualize the file type, file name, storage location and file version corresponding to a number of uploaded files to obtain a visualization interface, so as to use the visualization interface to manage the editing operations performed on the uploaded files.
[0077] In some specific implementations, the file retrieval device based on the object storage service may further include:
[0078] A storage service determination unit is used to upload the uploaded files stored in the storage space corresponding to the target object storage service to the storage space corresponding to the new object storage service via the service interface corresponding to the name of the new object storage service; wherein data synchronization and sharing operations can be performed between the object storage services corresponding to the object storage service names in the preset object storage service name list.
[0079] In some specific implementations, the file retrieval device based on the object storage service may further include:
[0080] An operation determination unit, used to determine whether an operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed;
[0081] The execution information generating unit is used to generate corresponding successful execution information if the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed, and upload the successful execution information to the current user interface.
[0082] In some specific implementations, the upload instruction acquisition module 11 may specifically include:
[0083] A client object generation unit, configured to generate client objects to be initialized corresponding to each of the object storage services respectively based on user requirements and each of the object storage services by using a preset client object generation program;
[0084] A client object initialization unit, configured to initialize the to-be-initialized client object corresponding to each object storage service based on a preset software development tool document corresponding to each object storage service, so as to obtain a client object;
[0085] The data communication unit is used to use the key information in the preset software development tool document to authenticate the client object and grant permissions, so as to use the client object that has passed the identity authentication and permission grant to communicate data with the corresponding object storage service.
[0086] In some specific implementations, the file retrieval device based on the object storage service may further include:
[0087] The client establishment unit is used to establish a target client corresponding to the Elasticsearch search engine by calling a preset interface in the preset client establishment software, so as to perform creation operations, reading operations, update operations and deletion operations on the information stored in the Elasticsearch search engine through the target client.
[0088] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the file retrieval method based on the object storage service disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0089] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0090] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0091] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the file retrieval method based on the object storage service performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.
[0092] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the file retrieval method based on the object storage service disclosed above is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.
[0093] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0094] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0095] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0096] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0097] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A file retrieval method based on an object storage service, characterized in that: include: Obtain a file upload instruction uploaded via the current user interface, and determine a target object storage service name and a corresponding target service interface from a preset object storage service name list based on user requirements in the file upload instruction; The target service interface is called through a client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service; Processing the file to be uploaded by using a preset file processing service to obtain a metadata index and a file path corresponding to the file to be uploaded, and storing the metadata index and the corresponding file path in an Elasticsearch search engine; The file download instruction uploaded via the current user interface is received through the Elasticsearch search engine, and the file path corresponding to the target file is determined based on the plurality of metadata indexes and the file information in the file download instruction, so as to search for and download the target file through the determined file path.
2. The file retrieval method based on the object storage service according to claim 1, characterized in that: After calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes: The file types, file names, storage locations and file versions corresponding to the uploaded files are visualized using a preset data visualization chart library to obtain a visualization interface, so as to manage the editing operations performed on the uploaded files using the visualization interface.
3. The file retrieval method based on the object storage service according to claim 1, characterized in that: After calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes: Upload the uploaded files stored in the storage space corresponding to the target object storage service to the storage space corresponding to the new object storage service via the service interface corresponding to the name of the new object storage service; Among them, data synchronization and sharing operations can be performed between the object storage services corresponding to the object storage service names in the preset object storage service name list.
4. The file retrieval method based on the object storage service according to claim 1, characterized in that: After calling the target service interface through the client object in the target object storage service corresponding to the target object storage service name to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service, the method further includes: Determine whether the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed; If the operation of uploading the file to be uploaded to the storage space corresponding to the object storage service is successfully executed, corresponding successful execution information is generated and the successful execution information is uploaded to the current user interface.
5. The file retrieval method based on the object storage service according to claim 1, characterized in that: After determining the target object storage service name and the corresponding target service interface from the preset object storage service name list based on the user demand in the file upload instruction, the method further includes: Using a preset client object generation program, and based on user requirements and each of the object storage services, respectively generate client objects to be initialized that correspond to each of the object storage services; Initializing the to-be-initialized client objects corresponding to each object storage service based on preset software development tool documents corresponding to each object storage service to obtain a client object; The client object is authenticated and authorized using the key information in the preset software development tool document, so that the client object that has passed the authentication and authorization can communicate data with the corresponding object storage service.
6. The file retrieval method based on the object storage service according to claim 1, characterized in that: The method further includes: processing the file to be uploaded by using a preset file processing service to obtain a metadata index and a file path corresponding to the file to be uploaded, and storing the metadata index and the corresponding file path in an Elasticsearch search engine. A target client corresponding to the Elasticsearch search engine is established by calling a preset interface in the preset client establishment software, so that the target client can perform create operations, read operations, update operations and delete operations on the information stored in the Elasticsearch search engine.
7. The file retrieval method based on the object storage service according to any one of claims 1 to 6, characterized in that: The preset data visualization chart library is Echarts, the preset software development tool document is the SDK document, and the preset client establishment software is RestHighLevelClient.
8. A file retrieval device based on an object storage service, characterized in that: include: An upload instruction acquisition module is used to acquire a file upload instruction uploaded via the current user interface, and determine a target object storage service name and a corresponding target service interface from a preset object storage service name list based on user requirements in the file upload instruction; A file upload module, configured to call the target service interface through a client object in the target object storage service corresponding to the target object storage service name, so as to upload the file to be uploaded in the file upload instruction to the storage space corresponding to the target object storage service; A file processing service control module, used to process the to-be-uploaded file using a preset file processing service to obtain a metadata index and a file path corresponding to the to-be-uploaded file, and store the metadata index and the corresponding file path in an Elasticsearch search engine; The file path determination module is used to receive a file download instruction uploaded via the current user interface through the Elasticsearch search engine, and determine the file path corresponding to the target file based on a number of metadata indexes and the file information in the file download instruction, so as to search and download the target file through the determined file path.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the file retrieval method based on the object storage service according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the file retrieval method based on the object storage service are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Client-side virtualization framework
CN102447723A
Search service creation method and device and computer readable storage medium
CN108874924A
File management method, device and system,apparatus and computer readable storage medium
CN110263001A
Object file downloading method, device and system, server and storage medium
CN112187921A
Rich text full-text retrieval and cloud storage system
CN114546948A