File query method and device, equipment and storage medium

By using preset database tables to store metadata information in a distributed file system and using a database search algorithm, the hash algorithm is solved in the query efficiency problem of the hash algorithm in massive small file scenarios, and fast file query is achieved.

CN119248720APending Publication Date: 2025-01-03BEIJING UDSAFE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411322653.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the era of big data, the traditional file query method based on hash algorithms has led to a sharp increase in query time complexity and inefficient file search in the scenario of massive small file storage.

Method used

Preset database tables are used to store the metadata information of entity data files, and quickly search for metadata information through the target database search algorithm, thereby determining and obtaining the corresponding entity data file storage path, improving file query efficiency.

Benefits of technology

It significantly improves the efficiency of file query in distributed file systems, especially when storing a large number of small files, which reduces query time and improves search efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248720A_ABST
    Figure CN119248720A_ABST
Patent Text Reader

Abstract

The invention discloses a file query method and device, equipment and a storage medium, and relates to the technical field of distributed storage. The method comprises the steps of determining query condition information according to a target query request, searching target metadata information matched with the query condition information from a preset database table by adopting a target database search algorithm, determining a target file storage path according to the target metadata information, and storing the target file according to the target file storage path. A target entity data file corresponding to the target query task is obtained based on the target file storage path, the distributed file system is used for storing the entity data file in a hash mode, the distributed file system comprises a preset database, and a preset database table is stored in the preset database; the preset database table comprises metadata information corresponding to the entity data file. By adopting the technical scheme, the file query efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed storage technology, and in particular to a file query method, device, equipment and storage medium for improving file query efficiency. Background Art

[0002] Computers manage and store data through file systems. In the era of information explosion, the amount of data people can access has grown exponentially. Simply increasing the number of hard disks to expand the storage capacity of computer file systems is difficult to meet demand. Distributed file systems can effectively solve the problem of data storage and management.

[0003] With the development of information technology, distributed file systems, such as those built on Gluster, have strong horizontal expansion capabilities, can support petabytes (PB) storage capacity and thousands of clients, and form a parallel network file system through network interconnection. It has the characteristics of scalability, high performance and high availability, and has been widely used in the era of big data. In the Gluster distributed file system, metadata and physical files are hashed and distributed in the logical disk volume. Physical files are searched and located through hash algorithms, which has high query efficiency for large files (such as more than 1MB). However, when the number of small files (such as less than 1MB) reaches tens of millions, that is, in the scenario of massive small file storage, the traditional file query method based on hash algorithms will cause the data query time complexity to rise sharply, which greatly increases the time complexity of file search and the file query efficiency is low. Summary of the invention

[0004] The present invention provides a file query method, device, equipment and storage medium, which can improve the file query efficiency of a distributed file system.

[0005] According to one aspect of the present invention, there is provided a file query method, which is applied to a distributed file system, wherein the distributed file system is used to store entity data files in a hash mode, wherein the distributed file system includes a preset database, wherein the preset database stores a preset database table, wherein the preset database table includes metadata information corresponding to the entity data file, wherein the method includes:

[0006] Determine query condition information according to the target query request;

[0007] Using a target database search algorithm, searching for target metadata information matching the query condition information from the preset database table;

[0008] Determine a target file storage path according to the target metadata information;

[0009] The target entity data file corresponding to the target query request is obtained based on the target file storage path.

[0010] According to another aspect of the present invention, there is provided a file query device, which is configured in a distributed file system, wherein the distributed file system is used to store entity data files in a hash mode, wherein the distributed file system includes a preset database, wherein the preset database stores a preset database table, wherein the preset database table includes metadata information corresponding to the entity data file, wherein the device includes:

[0011] A query condition acquisition module, used to determine query condition information according to a target query request;

[0012] A metadata search module, configured to use a preset database search algorithm to search for target metadata information matching the query condition information from the preset database table;

[0013] A storage path determination module, used to determine a target file storage path according to the target metadata information;

[0014] The file acquisition module is used to acquire the target entity data file corresponding to the target query request based on the target file storage path.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file query method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file query method described in any embodiment of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided, characterized in that the computer program product comprises a computer program, and when the computer program is executed by a processor, the file query method described in any embodiment of the present invention is implemented.

[0021] The file query scheme of the embodiment of the present invention is applied to a distributed file system, which is used to store entity data files in a hash mode. The distributed file system includes a preset database, which stores a preset database table, which includes metadata information corresponding to the entity data file, determines query condition information according to a target query request, uses a target database search algorithm to search for target metadata information matching the query condition information from the preset database table, determines a target file storage path according to the target metadata information, and obtains a target entity data file corresponding to the target query task based on the target file storage path. By adopting the above technical scheme, a database table in a database is used in a distributed file system to store metadata information of the entity data file, so that when executing a query task, the database search algorithm can be used to quickly search for metadata information, and then the corresponding entity data file is obtained according to the found metadata information. For the case where a large number of entity data files are stored in the distributed file system, such as a case where there are many small files, the file query efficiency can be significantly improved.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flow chart of a file query method provided according to an embodiment of the present invention;

[0025] Figure 2 is a flow chart of another file query method provided according to an embodiment of the present invention;

[0026] Figure 3 is a structural schematic diagram of a file query device provided according to an embodiment of the present invention;

[0027] Figure 4 It is a structural schematic diagram of an electronic device for implementing the file query method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Figure 1 This is a flowchart of a file query method provided by an embodiment of the present invention. This embodiment is applicable to the case of searching for files in a distributed file system. The method can be executed by a file query device. The file query device can be implemented in the form of hardware and / or software. The file query device can be configured in an electronic device. The method is applied to a distributed file system. The distributed file system is used to store entity data files in a hash mode. The distributed file system includes a preset database. The preset database stores a preset database table. The preset database table includes metadata information corresponding to the entity data file. Figure 1 As shown, the method includes:

[0031] Step 101: Determine query condition information according to a target query request.

[0032] In the embodiment of the present invention, the specific type of the distributed file system is not limited, for example, it can be a distributed file system built based on Gluster. In the distributed file system, the entity data files are hashed and distributed in the logical disk volume, that is, the entity data files are stored in a hash mode. The entity data file can be understood as a file that actually contains data content, and can also be called a data entity object. The size of the entity data file is not limited, and can include large files (such as more than 1MB) or small files (such as less than 1MB). The number of entity data files stored is usually large, which can reach the order of tens of millions or even higher.

[0033] Exemplarily, the distributed file system receives a file query request sent by a client, records the currently received file query request as a target query request, and parses the target query request to obtain request parameters in the target query request, which may include query condition information. The query condition information may include relevant information of the entity data file to be searched, such as the file name or the file generation time, etc.

[0034] Step 102: Use a target database search algorithm to search for target metadata information matching the query condition information from the preset database table.

[0035] Exemplarily, the metadata information corresponding to the entity data file may include basic information, attributes, dependency relationships, association relationships or combination relationships of the entity data file.

[0036] In the related art, metadata hashes are distributed in logical disk volumes. When searching for matching metadata information based on query condition information, it is necessary to calculate one by one whether each metadata information in the logical disk volume matches the query condition information. When the number of files is large, the time complexity of data search is high and the search efficiency is low, which in turn affects the positioning efficiency of the physical data files.

[0037] In the embodiment of the present invention, the metadata information corresponding to the entity data file is stored in a preset database table in the preset database of the distributed file system, so that when searching for target metadata information (metadata information matching the query condition information), the functions of the database sub-tables and views can be fully utilized, and a suitable search algorithm can be used to search for the target metadata information to improve the search efficiency. The specific type of the preset database is not limited.

[0038] Exemplarily, the target database search algorithm may include a binary search algorithm, a block search algorithm, a Fibonacci search algorithm, an interpolation search algorithm, a hash search, an index search, or a binary sort tree search algorithm, etc., without limitation. The time and space complexity of metadata query efficiency may be calculated based on the hardware configuration of the actual production environment, and the database search algorithm to be used may be determined based on the calculation results and the data magnitude, etc. Optionally, the preset database table also stores index information for accelerating the search process.

[0039] Step 103: Determine the target file storage path according to the target metadata information.

[0040] For example, when storing entity data files, a hash algorithm is usually used to calculate the hash value corresponding to the file storage path of the entity data file. The hash value can be stored in the metadata information. After finding the target metadata information, the hash value can be extracted from it and the file storage path, that is, the target file storage path, can be calculated in reverse.

[0041] Step 104: Acquire the target entity data file corresponding to the target query request based on the target file storage path.

[0042] Exemplarily, the target file storage path is the storage path of the entity data file (referred to as the target entity data file) to be found corresponding to the target query request. By accessing the target file storage path, the target entity data file can be obtained, and then the target query request can be responded to.

[0043] The file query method of the embodiment of the present invention is applied to a distributed file system, which is used to store entity data files in a hash mode. The distributed file system includes a preset database, which stores a preset database table, and the preset database table includes metadata information corresponding to the entity data file. The query condition information is determined according to the target query request, and the target database search algorithm is used to search for target metadata information matching the query condition information from the preset database table, and the target file storage path is determined according to the target metadata information. The target entity data file corresponding to the target query task is obtained based on the target file storage path. By adopting the above technical solution, the database table in the database is used in the distributed file system to store the metadata information of the entity data file, so that when executing the query task, the database search algorithm can be used to quickly search for the metadata information, and then the corresponding entity data file is obtained according to the found metadata information. For the case where a large number of entity data files are stored in the distributed file system, the file query efficiency can be significantly improved.

[0044] In some embodiments, the preset database table also includes a file storage path corresponding to the entity data file stored in association with the metadata information; wherein determining the target file storage path according to the target metadata information includes: obtaining the file storage path stored in association with the target metadata information in the preset database table as the target file storage path. In this way, the amount of calculation can be reduced, the calculation resources in the distributed file system can be saved, and the efficiency of file query can be further improved.

[0045] Exemplarily, in a preset database table, the metadata information and file storage path corresponding to the same entity data file are associated and stored. After the target metadata information is found, the file storage path associated with the target metadata information in the preset database table is obtained, and the target file storage path can be obtained. There is no need to extract hash values ​​and reversely calculate the file storage path and other related operations. While saving computing resources, the target file storage path can be quickly obtained, further improving file query efficiency.

[0046] In some embodiments, after determining the query condition information according to the target query request, the method further includes: determining the target query type corresponding to the query condition information; and determining the target database search algorithm corresponding to the target query type based on a first preset correspondence relationship, wherein the first preset correspondence relationship includes a correspondence relationship between different query types and preset database search algorithms. Thus, the preset correspondence relationship between different query types and search algorithms can be used to quickly determine the target database search algorithm suitable for the target query type corresponding to the current query condition information, thereby further optimizing the file query effect.

[0047] Exemplarily, the query type can be divided based on the query field type in the query condition information. For example, if the query field type is a numerical type, such as time or ranking, the corresponding preset database search algorithm can be a binary search algorithm; for another example, if the query field type is a letter type or a Chinese character type, the corresponding preset database search algorithm can be a block search algorithm. Of course, the query type can also be divided in other ways, which are not specifically limited.

[0048] Exemplarily, for each query type, real data can be used to optimize query efficiency through training or experiments, determine the corresponding appropriate database search algorithm, establish a correspondence between different query types and preset database search algorithms, and obtain a first preset correspondence.

[0049] In some embodiments, the metadata information in the preset database table is pre-sorted according to the metadata pre-sorting method. The specific sorting method is not limited and can be set in combination with the preset database search algorithm. In this way, the file query efficiency can be further improved.

[0050] Figure 2 1 is a flowchart of another file query method provided by an embodiment of the present invention, which is optimized based on the above embodiment, and the number of preset database tables is at least two, and different preset database tables correspond to different metadata pre-sorting methods. Figure 2 As shown, the method includes:

[0051] Step 201: Determine query condition information according to a target query request.

[0052] The distributed file system in the embodiment of the present invention is built based on Gluster.

[0053] Step 202: Determine the target query type corresponding to the query condition information.

[0054] Step 203: Determine a target database search algorithm corresponding to the target query type based on a first preset corresponding relationship, wherein the first preset corresponding relationship includes a corresponding relationship between different query types and preset database search algorithms.

[0055] Step 204: Determine the target preset database table corresponding to the target query type based on a second preset correspondence relationship, wherein the second preset correspondence relationship includes a correspondence relationship between different query types and preset database tables.

[0056] Exemplarily, different sorting methods are used to sort the metadata information in advance, and the sorting results are stored in different preset database tables. In addition, a correspondence between different query types and preset database tables is established in advance to obtain a second preset correspondence. When it is necessary to search for target metadata information, the target preset database table that needs to be searched can be quickly determined based on the correspondence, and then the corresponding target database search algorithm is used to search, thereby greatly improving the search efficiency.

[0057] For example, as in the above example, assuming that the query field type is a numerical type, such as time or ranking, the corresponding metadata pre-sorting method can be numerical ascending or descending sorting, such as sorting in chronological order; for another example, the query field type is an alphabetic type or a Chinese character type, the corresponding metadata pre-sorting method can be clustering according to the first letters of the pinyin of the letters or Chinese characters, and then sorting the clusters according to English letters from a to z or from z to a, etc.

[0058] There is no limit to the execution order of step 203 and step 204 , and step 204 may be executed first and then step 203 .

[0059] Step 205: Use a target database search algorithm to search for target metadata information matching the query condition information from a target preset database table.

[0060] Step 206: Obtain the file storage path associated with the target metadata information in the target preset database table as the target file storage path.

[0061] Step 207: Acquire the target entity data file corresponding to the target query request based on the target file storage path.

[0062] In the file query method provided by the embodiment of the present invention, the number of preset database tables is at least two, different preset database tables correspond to different metadata pre-sorting methods, and correspondences between different query types and preset database tables are pre-established. When it is necessary to find target metadata information, a target preset database table suitable for the target query type corresponding to the current query condition information can be quickly determined, thereby quickly and accurately finding the matching target metadata information, and directly obtaining the associated stored target file storage path from the target preset database table, further improving the file query efficiency.

[0063] In some embodiments, the preset database is a distributed database, and a preset number of nodes in the distributed database store the same preset database table. Thus, concurrent data query can be supported, further improving query efficiency, and multiple nodes can back up each other to ensure the disaster recovery capability and security of the distributed file system, that is, after any node fails, it will not affect the continuous service of the business relying on the distributed file system.

[0064] Exemplarily, the preset number can be set according to actual needs, for example, three, that is, every three nodes store metadata information of the same entity data file. When one of the three nodes fails, such as metadata information is damaged or lost, the metadata information can be obtained from the databases of the other two nodes for recovery.

[0065] Figure 3 1 is a schematic diagram of the structure of a file query device provided according to an embodiment of the present invention, wherein the device is configured in a distributed file system, wherein the distributed file system is used to store entity data files in a hash mode, wherein the distributed file system includes a preset database, wherein the preset database stores a preset database table, wherein the preset database table includes metadata information corresponding to the entity data file, such as Figure 3 As shown, the device comprises:

[0066] The query condition acquisition module 301 is used to determine the query condition information according to the target query request;

[0067] The metadata search module 302 is used to use a preset database search algorithm to search for target metadata information matching the query condition information from the preset database table;

[0068] A storage path determination module 303 is used to determine a target file storage path according to the target metadata information;

[0069] The file acquisition module 304 is used to acquire the target entity data file corresponding to the target query request based on the target file storage path.

[0070] The file query device provided by the embodiment of the present invention uses a database table in a database to store metadata information of entity data files in a distributed file system, so that when executing a query task, the database search algorithm can be used to quickly search for metadata information, and then the corresponding entity data files are acquired according to the found metadata information. For the situation where a large number of entity data files are stored in the distributed file system, the file query efficiency can be significantly improved.

[0071] Optionally, the preset database table also includes a file storage path corresponding to the entity data file stored in association with the metadata information; wherein the storage path determination module is used to: obtain the file storage path stored in association with the target metadata information in the preset database table as the target file storage path.

[0072] Optionally, the device further comprises:

[0073] A target query type determination module, configured to determine a target query type corresponding to the query condition information after determining the query condition information according to the target query request;

[0074] The target search algorithm determination module is used to determine the target database search algorithm corresponding to the target query type based on a first preset corresponding relationship, wherein the first preset corresponding relationship includes a corresponding relationship between different query types and preset database search algorithms.

[0075] Optionally, the number of the preset database tables is at least two, and different preset database tables correspond to different metadata pre-sorting methods; the device further includes: a target database table determination module, which is used to determine the target preset database table corresponding to the target query type based on a second preset corresponding relationship after determining the target query type corresponding to the query condition information, wherein the second preset corresponding relationship includes a corresponding relationship between different query types and preset database tables;

[0076] The metadata search module is used to: use a target database search algorithm to search for target metadata information matching the query condition information from the target preset database table.

[0077] Optionally, the preset database is a distributed database, and a preset number of nodes in the distributed database store the same preset database table.

[0078] Optionally, the distributed file system is built based on Gluster.

[0079] The file query device provided in the embodiment of the present invention can execute the file query method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0080] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0081] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0082] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0083] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a file query method.

[0084] In some embodiments, the file query method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the file query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the file query method in any other appropriate manner (e.g., by means of firmware).

[0085] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0087] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0088] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0089] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0090] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0091] The embodiments of the present disclosure provide a computer program product, including a computer program, which implements the file query method provided in the above embodiments when executed by a processor.

[0092] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0093] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A file query method, characterized in that: Applied to a distributed file system, the distributed file system is used to store entity data files in a hash mode, the distributed file system includes a preset database, the preset database stores a preset database table, and the preset database table includes metadata information corresponding to the entity data file, the method includes: Determine query condition information according to the target query request; Using a target database search algorithm, searching for target metadata information matching the query condition information from the preset database table; Determine a target file storage path according to the target metadata information; The target entity data file corresponding to the target query request is obtained based on the target file storage path.

2. The method according to claim 1, characterized in that The preset database table also includes a file storage path corresponding to the entity data file stored in association with the metadata information; Wherein, determining the target file storage path according to the target metadata information includes: A file storage path associated with the target metadata information and stored in the preset database table is obtained as the target file storage path.

3. The method according to claim 2, characterized in that After determining the query condition information according to the target query request, the method further includes: Determine a target query type corresponding to the query condition information; Based on a first preset corresponding relationship, a target database search algorithm corresponding to the target query type is determined, wherein the first preset corresponding relationship includes a corresponding relationship between different query types and preset database search algorithms.

4. The method according to claim 3, characterized in that The number of the preset database tables is at least two, and different preset database tables correspond to different metadata pre-sorting methods; After determining the target query type corresponding to the query condition information, the method further includes: Based on a second preset correspondence relationship, determining a target preset database table corresponding to the target query type, wherein the second preset correspondence relationship includes a correspondence relationship between different query types and preset database tables; The method of using a target database search algorithm to search the preset database table for target metadata information that matches the query condition information includes: A target database search algorithm is used to search the target metadata information matching the query condition information from the target preset database table.

5. The method according to claim 1, characterized in that The preset database is a distributed database, and a preset number of nodes in the distributed database store the same preset database table.

6. The method according to any one of claims 1 to 5, characterized in that: The distributed file system is built based on Gluster.

7. A file query device, characterized in that: The device is configured in a distributed file system, the distributed file system is used to store entity data files in a hash mode, the distributed file system includes a preset database, the preset database stores a preset database table, and the preset database table includes metadata information corresponding to the entity data file, the device includes: A query condition acquisition module, used to determine query condition information according to a target query request; A metadata search module, configured to use a preset database search algorithm to search for target metadata information matching the query condition information from the preset database table; A storage path determination module, used to determine a target file storage path according to the target metadata information; The file acquisition module is used to acquire the target entity data file corresponding to the target query request based on the target file storage path.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the file query method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the file query method according to any one of claims 1 to 6 when executed.

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