[go: up one dir, main page]

CN110888842A - File storage method, file query method, file storage device, file query device and file query equipment - Google Patents

File storage method, file query method, file storage device, file query device and file query equipment Download PDF

Info

Publication number
CN110888842A
CN110888842A CN201911211663.7A CN201911211663A CN110888842A CN 110888842 A CN110888842 A CN 110888842A CN 201911211663 A CN201911211663 A CN 201911211663A CN 110888842 A CN110888842 A CN 110888842A
Authority
CN
China
Prior art keywords
file
storage
mapping
path
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911211663.7A
Other languages
Chinese (zh)
Inventor
姜华华
蔡玮
邢文倩
付兴顺
孙佳乐
田家堂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201911211663.7A priority Critical patent/CN110888842A/en
Publication of CN110888842A publication Critical patent/CN110888842A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/144Query formulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification provides a file storage method, a file query method, a file storage device, a file query device and equipment. The file storage method comprises the following steps: in response to a file storage request, calculating mapping parameters corresponding to a file to be stored; inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not; if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path. The file query method comprises the following steps: receiving a file query request, wherein the file query request comprises mapping parameters corresponding to a file to be queried; acquiring a file saving path corresponding to the mapping parameter; and inquiring the file to be inquired based on the file saving path. By the method, the files are matched with the mapping parameters corresponding to the files during storage and query, so that repeated storage of the same files is avoided, and storage space is saved.

Description

File storage method, file query method, file storage device, file query device and file query equipment
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a file storage method, device and equipment.
Background
With the progress of society and the development of technology, organizations, enterprises, organizations, etc. generally save files in the form of electronic documents. However, as the amount of data interaction increases, the same file may be used for multiple times, and accordingly, the same file may be repeatedly stored. When too many identical files are stored in the storage system, a large amount of disk space is wasted, and the efficiency of accessing the files is affected.
In addition, because the naming rules for the files are different under different requirements, the same files may have different names, and it is difficult to directly clean the same files in the storage system. Therefore, a method for avoiding storing duplicate files in large quantities is needed.
Disclosure of Invention
An embodiment of the present specification aims to provide a file storage method, a file query device, and a file query device, so as to solve the problem in the prior art that storage space is wasted due to repeated storage of the same file.
In order to solve the above technical problem, a file storage method, device and apparatus provided in the embodiments of the present specification are implemented as follows:
a file storage method, comprising:
in response to a file storage request, calculating mapping parameters corresponding to a file to be stored;
inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not;
if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
A file storage device comprising:
the parameter calculation module is used for responding to the file storage request and calculating the mapping parameters corresponding to the files to be stored;
the identification query module is used for querying whether a storage file identification corresponding to the mapping parameter exists in the storage file identification set or not;
and the file saving module is used for determining a file saving path corresponding to the mapping parameter under the condition that the storage file identifier corresponding to the mapping parameter does not exist, and storing the file to be stored based on the file saving path.
A file storage device comprising a memory and a processor;
the memory to store computer instructions;
the processor to execute the computer instructions to implement the steps of: in response to a file storage request, calculating mapping parameters corresponding to a file to be stored; inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not; if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
The embodiment of the specification further provides a file query method, a file query device and file query equipment, which are realized in the following way:
a file query method comprises the following steps:
the device comprises a request receiving module, a file searching module and a file searching module, wherein the request receiving module is used for receiving a file searching request which comprises mapping parameters corresponding to files to be searched;
a path obtaining module, configured to obtain a file saving path corresponding to the mapping parameter;
and the file query module is used for querying the file to be queried based on the file storage path.
A file querying device, comprising:
receiving a file query request, wherein the file query request comprises mapping parameters corresponding to a file to be queried;
acquiring a file saving path corresponding to the mapping parameter;
and inquiring the file to be inquired based on the file saving path.
A file querying device comprising a memory and a processor;
the memory to store computer instructions;
the processor to execute the computer instructions to implement the steps of: receiving a file query request, wherein the file query request comprises mapping parameters corresponding to a file to be queried; acquiring a file saving path corresponding to the mapping parameter; and inquiring the file to be inquired based on the file saving path.
As can be seen from the technical solutions provided by the embodiments of the present specification, in the embodiments of the present specification, when a file is stored, a mapping parameter corresponding to the file to be stored is first calculated, and since the mapping parameter corresponds to the file itself, when the same file has been previously stored, even if the file name of the file is not the same as that of the file to be stored, it is possible to determine that the file name and the file to be stored are the same file, thereby avoiding duplicate storage of the file. Correspondingly, when the file is inquired, the file can be inquired through the corresponding mapping parameters, and the file can be accurately inquired under the condition of saving the storage space. By the method, repeated storage of the same file is avoided, and storage space is saved, so that waste of resources is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the specification, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating a file storage method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a file query method according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a file storage device according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a file querying device according to an embodiment of the present disclosure;
fig. 5 is a structural diagram of a file storage device and a file query device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort shall fall within the protection scope of the present specification.
An embodiment of a file storage method in the present specification is described below with reference to fig. 1. The execution main body of the method is computer equipment, and the computer equipment comprises a server, an industrial personal computer (industrial control computer), an all-in-one machine, a PC (personal computer) and the like. The file storage method comprises the following specific steps:
s110: in response to a file storage request, mapping parameters corresponding to a file to be stored are calculated.
The file storage request is a request for storing a file. The file storage request may be a request sent by a user to the computer device when the file needs to be stored, or may also be a request sent by another device when the file needs to be stored.
The file storage request may include a file to be stored. The file to be stored is the file which needs to be stored by the user or other equipment. However, the file to be stored may have been stored in the storage system before, and in order to avoid repeated storage, it is necessary to query whether the same file exists in the storage system.
The mapping parameter is a parameter corresponding to the file itself, and has no association with identification information such as the name of the file, the modification time, and the like. For example, the user modifies the file name picture1.jpg to picture2.jpg without changing the mapping parameter of the file. Different mapping parameters correspond to different files, and if the mapping parameters of the file to be stored obtained through calculation are different from the mapping parameters of other files, the file to be stored is different from the other files.
The method for calculating the mapping parameter can compress and map the file to obtain a parameter value with a fixed format through a mapping function. The mapping function may be to obtain the mapping parameters in a form of compressing the file to obtain the parameters in a fixed format.
In one embodiment, the mapping parameter may be a hash value, i.e. a hash value, corresponding to the file to be stored. The hash value is a parameter of a fixed number of bits obtained by performing padding and successive compression on a message or data by a hash function. Different hash values computed by the same hash function necessarily correspond to different files.
Correspondingly, the hash value may be obtained by calculating a hash value corresponding to the file to be stored by using a hash algorithm. The hash algorithm includes a multiplication hash algorithm, a division hash algorithm, a fibonacci hash algorithm, a secure hash algorithm, and the like. The hash algorithm can convert a file into a hash value with a fixed number of bits, and when the number of bits of the hash value is large, such as 256 bits. In a specific example, the file may be converted to a hash value of 4d08567574de6934e2c9dc16290c055bdc76dca346cfe9a2fc8e04fa2a5f0b8e using the SHA256 hash algorithm. The hash values calculated by different files are basically different, so that whether the corresponding files are the same or not can be determined by judging whether the hash values are the same or not, and the repeatability of the files can be conveniently and quickly judged.
S120: and inquiring whether a storage file identifier corresponding to the mapping parameter exists in the storage file identifier set.
The storage file identification is an identification corresponding to a file already stored in the storage system. The storage file identifier may be a mapping parameter calculated according to a file, or may have a unique correspondence with the mapping parameter, that is, the corresponding mapping parameter may be determined by the storage file identifier, and the corresponding storage file identifier may also be determined by the mapping parameter.
And the preset storage file identification set is used for storing the storage file identification. The storage file identification set comprises storage file identifications corresponding to all files in the storage system.
Correspondingly, under the condition that the storage file identifier set comprises storage file identifiers corresponding to all files in the storage system, whether the files to be stored corresponding to the mapping parameters are stored in the storage system can be determined by judging whether the mapping parameters have corresponding storage file identifiers in the storage file identifier set.
S130: if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
If the storage file identifier corresponding to the mapping parameter does not exist in the storage file identifier set, it indicates that the same file as the file to be stored is not stored in the storage system, and the file to be stored can be directly stored.
And the file saving path is the saving path of the corresponding file to be stored which is determined after the file to be stored is determined to be required to be stored. And acquiring the file to be stored through the file saving path. Under the condition that the mapping parameters are uniquely corresponding to the files to be stored, the mapping parameters can determine corresponding file saving paths, so that the condition that the file saving paths correspond to other attributes of the same file, such as a plurality of different names, modification dates and the like, is avoided.
In an embodiment, the file saving path may be established by obtaining a corresponding file saving path according to the allocation condition of the file to be stored, and then establishing a mapping relationship between the file saving path and the mapping parameter of the file to be stored. When a user needs to query the file, the corresponding mapping parameters can be obtained according to the file query request, the mapping relation is given, and the file storage path of the file to be queried is obtained, so that the file is queried.
In another embodiment, the mapping parameters may be used directly to construct a file save path according to path construction rules. The path construction rule is a rule for converting the mapping parameters into file saving paths. For example, the mapping parameter may be directly used as the name of a file directory, so that the corresponding file can be directly queried by using the mapping parameter; or, in order to avoid flattening of the storage system caused by directly using the mapping parameters as the path for storage, which is not favorable for file query, a plurality of mapping sub-parameters may be selected from the mapping parameters, each level of storage directory is constructed by using the mapping sub-parameters, a file storage path is constructed according to the storage directories, and the files corresponding to the mapping parameters are stored in the smallest subdirectory in the file storage path.
This embodiment is described with a specific example, in which the mapping parameter is a 64-bit character string, and two levels of directories need to be established when the file saving path is constructed. Firstly, creating a primary directory, and acquiring the first two bits of the mapping parameters as the name of the primary directory; and then establishing a secondary directory in the primary directory, and acquiring 3-4 bits of the mapping parameter as the name of the secondary directory. And storing the file to be stored corresponding to the mapping parameter in the secondary directory, and constructing a file storage path according to the primary directory and the secondary directory. In practical application, the name length of each level of directory at the level of the number of levels of the directory is not limited.
By using the method, when the file to be stored is inquired, the file storage path can be directly obtained according to the mapping parameters corresponding to the file to be stored, and the condition that the flat storage structure reduces the retrieval speed and the operation and maintenance difficulty of the system file is avoided, so that the file can be inquired conveniently and quickly.
After determining the file saving path, saving the file to be stored based on the file saving path.
In addition, when the storage file identifier is the mapping parameter, the mapping parameter may be stored in the storage file identifier set as the storage file identifier. And under the condition that the storage file identifier is not a mapping parameter, converting the mapping parameter into a storage file identifier according to the conversion relation between the mapping parameter and the storage file identifier, and storing the storage file identifier in the storage file identifier set.
When the mapping parameters are saved, the registration date corresponding to the mapping parameters can be recorded at the same time. If the query finds that the modification date of the mapping parameter is different from the registration date, the situation that the file corresponding to the mapping parameter needs to be stored again later can be quickly judged.
If the storage file identifier corresponding to the mapping parameter exists in the storage file identifier set through inquiry, the storage file identifier indicates that the same file as the file to be stored is stored in the storage system before, and the file to be stored does not need to be stored again. In this case, the prompt information may be directly fed back to the client or the server to prompt that the file to be stored already exists in the storage system, so as to avoid repeated storage.
When a user queries a file, the user may only obtain information such as a file name and the like, and the mapping parameters are not directly recorded. In order to obtain the mapping parameters through the file name during query and further determine the file storage path, the corresponding relationship between the file information and the mapping parameters can be established, so that a user can conveniently query.
To illustrate the above method by using a scenario example, a user needs to store a photo and send a file storage request containing the photo to the computer device. After receiving the file storage request, the computer device calculates a hash value corresponding to the photo by using the SHA256 algorithm, and inquires whether a storage file identifier corresponding to the hash value exists in a storage file identifier set. If the corresponding hash value is not inquired in the storage file identification set through inquiry, a file saving path corresponding to the photo is constructed according to the hash value of the photo, and the photo is stored based on the file saving path.
According to the embodiment and the introduction of the scene example, the method judges the repeatability of the file through the mapping parameter corresponding to the file to be stored, and avoids the waste of system resources caused by repeatedly storing the same file. In addition, the file storage path is constructed by using the mapping parameters corresponding to the file, so that the retrieval speed of the file is increased, and the retrieval of the file is more efficient and convenient.
An embodiment of a file query method in this specification is described below with reference to fig. 2, where an execution subject of the method is a computer device, and the computer device includes a server, an industrial personal computer (industrial control computer), an all-in-one machine, a PC, and the like. The file query method comprises the following specific steps:
s210: and receiving a file query request, wherein the file query request corresponds to the mapping parameters.
The file query request is a request for querying a file when the file is stored according to the embodiment of the method corresponding to fig. 1. The file query request corresponds to a mapping parameter. For the mapping parameters, reference may be made to the description in step S110, and details are not repeated here.
The mapping parameters can be directly contained in the file query request, and when a client or a server needs to query the file, the mapping parameters of the file to be queried are directly obtained, and the file query request containing the mapping parameters is sent to the computer equipment; the mapping parameter may also be obtained by the computer device according to the file query request after receiving the file query request, for example, a corresponding relationship between a file name and the mapping parameter is stored in the computer device, and when the file query request includes the file name of the file to be queried, the corresponding mapping parameter is obtained according to the file name to perform querying in subsequent steps.
Because the mapping parameters are obtained by compressing the file to be queried, the mapping parameters can be uniquely determined based on the file to be queried, but the file to be queried can not be derived according to the mapping parameters. After the mapping parameters are obtained according to the file query request, the file to be queried needs to be obtained according to the corresponding relationship between the mapping parameters and the file to be queried.
Correspondingly, the mapping parameters comprise hash values, namely, the mapping parameters can be calculated according to the file to be inquired by utilizing a hash algorithm. For the description of the hash value and the hash algorithm, reference may be made to the description of step S110, which is not repeated herein.
S220: and acquiring a file saving path corresponding to the mapping parameter.
The file saving path is the saving path of the file to be inquired. The unique corresponding relation exists between the file saving path and the mapping parameters, namely the file saving path can be determined through the mapping parameters, and the corresponding mapping parameters can also be obtained according to the file saving path.
In an embodiment, when the file to be queried is stored, a mapping relationship between a file saving path of the file to be queried and a corresponding mapping parameter is established, for example, a table is established for saving the mapping relationship between the file saving path and the mapping parameter. When the file to be queried needs to be queried, the corresponding file storage path can be obtained through the mapping parameters based on the mapping relation, so that the file can be queried.
In another embodiment, when the file to be queried is stored, a file saving path is constructed by using the mapping parameters according to a path construction rule. For a specific method for constructing the file saving path, reference may be made to the description in step S130, and details are not described herein. Correspondingly, when a file is queried, the path construction rule can be utilized to obtain a corresponding file storage path according to the mapping parameters.
To illustrate by using a specific example, when storing a file, the user stores the file by using the method as exemplified in step S130, that is, selects a mapping subparameter from the mapping subparameters as the names of storage directories at different levels to construct a file saving path. When a user queries a file, the mapping parameter of the corresponding file to be queried is obtained to be 4d08567574de6934e2c9dc16290c055bdc76dca346cfe9a2fc8e04fa2a5f0b8e, and the mapping parameter is a 64-bit hexadecimal parameter. The 1-2 bits of the hexadecimal parameter are 4d, the 3-4 bits are 08, and according to the path construction rule, the file storage path corresponding to the mapping parameter is 4d/08, and the file to be queried corresponding to the mapping parameter is stored in the directory corresponding to the file storage path, so that the file can be queried.
The corresponding file saving path is obtained through the mapping parameters, so that when only one saved file exists in the storage system in the multiple repeated stored files, the saved files can be uniquely determined through the mapping parameters when the repeated stored files are inquired. For example, two files, that is, picture1.jpg and picture1.jpg, correspond to the same image, and when a user queries a file by using a file name, both the files are converted into a file by using mapping parameters corresponding to the file to query the file.
S230: and inquiring the file to be inquired based on the file saving path.
After the file saving path is obtained, the corresponding file to be queried can be directly obtained according to the file saving path.
Using a specific scenario example for illustration, the client of the user itself stores the corresponding relationship between the original file name and the mapping parameter. When a user needs to query the file picture1.jpg, the client obtains a corresponding 64-bit mapping parameter according to the file name, wherein the mapping parameter is a hash value obtained by calculating the file to be queried by using an SHA256 algorithm and is 64-bit hexadecimal data. And the client constructs a file query request according to the mapping parameters and sends the file query request to the computer equipment. After receiving the file query request, the computer device obtains mapping subparameters from the mapping parameters contained in the file query request, uses the mapping subparameters as names of all levels of directories in sequence, obtains a file storage path of the file to be queried, queries the file based on the file storage path, and feeds the queried file back to the client.
As can be seen from the above description of the embodiment of the file query method and the scenario example, the method obtains the corresponding file storage path according to the mapping parameter obtained by using the file to be queried, thereby implementing unique query of the file according to the mapping parameter.
Fig. 3 is a block diagram of a file storage apparatus according to the present disclosure. The apparatus is disposed in the computer device, and specifically includes:
a parameter calculating module 310, configured to calculate, in response to a file storage request, a mapping parameter corresponding to a file to be stored;
an identifier query module 320, configured to query whether a storage file identifier corresponding to the mapping parameter exists in the storage file identifier set;
the file saving module 330 is configured to, in the absence of the storage file identifier corresponding to the mapping parameter, determine a file saving path corresponding to the mapping parameter, and store the file to be stored based on the file saving path.
Fig. 4 is a block diagram of a file searching apparatus according to the present disclosure. The apparatus is disposed in the computer device, and specifically includes:
a request receiving module 410, configured to receive a file query request, where the file query request includes mapping parameters corresponding to a file to be queried;
a path obtaining module 420, configured to obtain a file saving path corresponding to the mapping parameter;
and a file query module 430, configured to query the file to be queried based on the file saving path.
As shown in fig. 5, an embodiment of the present specification provides a file storage device. The file storage device may include a memory and a processor.
In this embodiment, the memory may be implemented in any suitable manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid state disk, a U disk, or the like. The memory may be used to store computer instructions.
In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The processor may execute the computer instructions to perform the steps of: in response to a file storage request, calculating mapping parameters corresponding to a file to be stored; inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not; if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
As shown in fig. 5, an embodiment of the present specification further provides a file query device. The file querying device may include a memory and a processor.
In this embodiment, the memory may be implemented in any suitable manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid state disk, a U disk, or the like. The memory may be used to store computer instructions.
In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The processor may execute the computer instructions to perform the steps of: receiving a file query request, wherein the file query request comprises mapping parameters corresponding to a file to be queried; acquiring a file saving path corresponding to the mapping parameter; and inquiring the file to be inquired based on the file saving path.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (alternate Description Language), Lava, Lola, HDL, pam, lasdl (Hardware Description Language), vhalware, vhjrajd (Hardware Description Language), and vhigh-Language, which is currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the present specification may be essentially or partially implemented in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.

Claims (15)

1. A method of file storage, the method comprising:
responding to a file storage request, and calculating mapping parameters according to a file to be stored;
inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not;
if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
2. The method of claim 1, wherein the computing mapping parameters corresponding to a file to be stored comprises:
and calculating a hash value corresponding to the file to be stored by utilizing a hash algorithm as a mapping parameter.
3. The method of claim 1, wherein the determining a file save path corresponding to the mapping parameter comprises:
acquiring a file saving path of the file to be stored;
and establishing a mapping relation between the file storage path and the mapping parameter.
4. The method of claim 1, wherein the determining a file save path corresponding to the mapping parameter comprises:
and constructing a file storage path by using the mapping parameters according to a path construction rule.
5. The method of claim 4, wherein constructing a file save path using the mapping parameters according to path construction rules comprises:
selecting at least one mapping sub-parameter from the mapping parameters as the name of each level of storage directory;
and constructing a file saving path according to the storage directory.
6. The method of claim 1, wherein prior to determining a file saving path corresponding to the mapping parameter and storing the file to be stored based on the file saving path, further comprising:
and storing the mapping parameters as storage file identifiers in the storage file identifier set.
7. The method of claim 1, wherein after querying whether a stored file identifier corresponding to the mapping parameter exists in the set of stored file identifiers, further comprising:
if yes, feeding back prompt information; the prompt information is used for prompting that the file to be stored exists.
8. A file storage apparatus, the apparatus comprising:
the parameter calculation module is used for responding to the file storage request and calculating the mapping parameters corresponding to the files to be stored;
the identification query module is used for querying whether a storage file identification corresponding to the mapping parameter exists in the storage file identification set or not;
and the file saving module is used for determining a file saving path corresponding to the mapping parameter under the condition that the storage file identifier corresponding to the mapping parameter does not exist, and storing the file to be stored based on the file saving path.
9. A file storage device comprising a memory and a processor;
the memory to store computer instructions;
the processor to execute the computer instructions to implement the steps of: in response to a file storage request, calculating mapping parameters corresponding to a file to be stored; inquiring whether a storage file identifier corresponding to the mapping parameter exists in a storage file identifier set or not; if the mapping parameter does not exist, determining a file saving path corresponding to the mapping parameter, and storing the file to be stored based on the file saving path.
10. A file query method, the method comprising:
receiving a file query request, wherein the file query request corresponds to a mapping parameter;
acquiring a file saving path corresponding to the mapping parameter;
and inquiring the file to be inquired based on the file saving path.
11. The method of claim 10, wherein the mapping parameters comprise:
and calculating the file to be inquired according to a hash algorithm to obtain a hash value.
12. The method of claim 10, wherein the obtaining a file save path corresponding to the mapping parameter comprises:
and converting the mapping parameters into file storage paths according to path construction rules.
13. The method of claim 10, wherein the obtaining a file save path corresponding to the mapping parameter comprises:
and acquiring a file saving path corresponding to the mapping parameter according to the mapping relation between the mapping parameter and the file saving path.
14. An apparatus for querying a file, the apparatus comprising:
the device comprises a request receiving module, a file searching module and a file searching module, wherein the request receiving module is used for receiving a file searching request which comprises mapping parameters corresponding to files to be searched;
a path obtaining module, configured to obtain a file saving path corresponding to the mapping parameter;
and the file query module is used for querying the file to be queried based on the file storage path.
15. A document querying device, comprising a memory and a processor;
the memory to store computer instructions;
the processor to execute the computer instructions to implement the steps of: receiving a file query request, wherein the file query request comprises mapping parameters corresponding to a file to be queried; acquiring a file saving path corresponding to the mapping parameter; and inquiring the file to be inquired based on the file saving path.
CN201911211663.7A 2019-12-02 2019-12-02 File storage method, file query method, file storage device, file query device and file query equipment Pending CN110888842A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911211663.7A CN110888842A (en) 2019-12-02 2019-12-02 File storage method, file query method, file storage device, file query device and file query equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911211663.7A CN110888842A (en) 2019-12-02 2019-12-02 File storage method, file query method, file storage device, file query device and file query equipment

Publications (1)

Publication Number Publication Date
CN110888842A true CN110888842A (en) 2020-03-17

Family

ID=69749866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911211663.7A Pending CN110888842A (en) 2019-12-02 2019-12-02 File storage method, file query method, file storage device, file query device and file query equipment

Country Status (1)

Country Link
CN (1) CN110888842A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611208A (en) * 2020-05-27 2020-09-01 北京太极华保科技股份有限公司 File storage and query method and device and storage medium
CN112052257A (en) * 2020-09-03 2020-12-08 中国银行股份有限公司 Service processing method, device and equipment
CN112084155A (en) * 2020-09-09 2020-12-15 深圳市欢太科技有限公司 Picture processing method, device, equipment, terminal and readable storage medium
CN112115105A (en) * 2020-09-28 2020-12-22 中国建设银行股份有限公司 Service processing method, device and equipment
CN112988663A (en) * 2021-03-11 2021-06-18 维沃移动通信有限公司 File storage method and electronic equipment
CN113220649A (en) * 2021-04-21 2021-08-06 浙江大华技术股份有限公司 File storage method, file retrieval method, file storage device, file retrieval device, electronic equipment and storage medium
CN113312314A (en) * 2021-06-02 2021-08-27 上海万物新生环保科技集团有限公司 Method, device and equipment for android platform repeated file retrieval
CN113836099A (en) * 2021-09-15 2021-12-24 维沃移动通信有限公司 Information processing method and device
CN114237751A (en) * 2021-12-20 2022-03-25 联想(北京)信息技术有限公司 Information configuration method and device
CN115865794A (en) * 2021-09-24 2023-03-28 中移(杭州)信息技术有限公司 A method, device, equipment and storage medium for determining information

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149457A1 (en) * 2012-03-29 2014-05-29 Tencent Technology (Shenzhen) Company Limted Method and apparatus for data storage and downloading
CN105069111A (en) * 2015-08-10 2015-11-18 广东工业大学 Similarity based data-block-grade data duplication removal method for cloud storage
CN107577423A (en) * 2017-08-15 2018-01-12 上海斐讯数据通信技术有限公司 A kind of method and system for optimizing memory space
CN108256114A (en) * 2018-02-09 2018-07-06 金蝶软件(中国)有限公司 The online method for previewing of document, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140149457A1 (en) * 2012-03-29 2014-05-29 Tencent Technology (Shenzhen) Company Limted Method and apparatus for data storage and downloading
CN105069111A (en) * 2015-08-10 2015-11-18 广东工业大学 Similarity based data-block-grade data duplication removal method for cloud storage
CN107577423A (en) * 2017-08-15 2018-01-12 上海斐讯数据通信技术有限公司 A kind of method and system for optimizing memory space
CN108256114A (en) * 2018-02-09 2018-07-06 金蝶软件(中国)有限公司 The online method for previewing of document, device, computer equipment and storage medium

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611208A (en) * 2020-05-27 2020-09-01 北京太极华保科技股份有限公司 File storage and query method and device and storage medium
CN112052257A (en) * 2020-09-03 2020-12-08 中国银行股份有限公司 Service processing method, device and equipment
CN112052257B (en) * 2020-09-03 2024-04-19 中国银行股份有限公司 Service processing method, device and equipment
CN112084155B (en) * 2020-09-09 2024-03-22 深圳市欢太科技有限公司 Picture processing method, device, equipment, terminal and readable storage medium
CN112084155A (en) * 2020-09-09 2020-12-15 深圳市欢太科技有限公司 Picture processing method, device, equipment, terminal and readable storage medium
CN112115105A (en) * 2020-09-28 2020-12-22 中国建设银行股份有限公司 Service processing method, device and equipment
CN112988663A (en) * 2021-03-11 2021-06-18 维沃移动通信有限公司 File storage method and electronic equipment
CN113220649A (en) * 2021-04-21 2021-08-06 浙江大华技术股份有限公司 File storage method, file retrieval method, file storage device, file retrieval device, electronic equipment and storage medium
CN113312314A (en) * 2021-06-02 2021-08-27 上海万物新生环保科技集团有限公司 Method, device and equipment for android platform repeated file retrieval
CN113836099A (en) * 2021-09-15 2021-12-24 维沃移动通信有限公司 Information processing method and device
CN115865794A (en) * 2021-09-24 2023-03-28 中移(杭州)信息技术有限公司 A method, device, equipment and storage medium for determining information
CN114237751A (en) * 2021-12-20 2022-03-25 联想(北京)信息技术有限公司 Information configuration method and device
CN114237751B (en) * 2021-12-20 2024-07-23 联想(北京)信息技术有限公司 Information configuration method and device

Similar Documents

Publication Publication Date Title
CN110888842A (en) File storage method, file query method, file storage device, file query device and file query equipment
EP3975474B1 (en) Methods and apparatuses for chaining service data
CN108845816A (en) Application program update method, system, computer equipment and storage medium
CN105988996B (en) Index file generation method and device
CN111797091A (en) Method and device for querying data in database, electronic equipment and storage medium
CN110807002B (en) A workflow-based report generation method, system, device and storage medium
US10516791B2 (en) Information processing system, information processing apparatus, and information processing method for executing an iteration of one or more processes
CN108491715B (en) Terminal fingerprint database generation method and device and server
CN113672224B (en) Method and device for generating applet page code and computer equipment
CN107784085B (en) Data list exporting method and terminal thereof
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN108959294B (en) Method and device for accessing search engine
CN112115105A (en) Service processing method, device and equipment
CN102479355A (en) Method, device and terminal for realizing business document loading
CN114090672A (en) Business data import and export method, system, computer equipment and medium
CN112947900A (en) Web application development method and device, server and development terminal
CN110928548A (en) Data processing method and equipment
CN111008254B (en) Object creation method, device, computer equipment and storage medium
CN105468412A (en) Dynamic packaging method and dynamic packaging device
CN100377158C (en) Method for creating library file
CN107643906B (en) Data processing method and device
CN109325057B (en) Middleware management method, device, computer equipment and storage medium
CN115712411A (en) Method and device for generating user-defined serial number
CN116069725A (en) File migration method, device, apparatus, medium and program product
CN111459981B (en) Query task processing method, device, server and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200317

RJ01 Rejection of invention patent application after publication