Sample storage path generation method, device, computer equipment and storage medium

The sample storage path is generated through a three-layer directory structure, which solves the problem of chaotic sample library management in the face recognition system, improves retrieval efficiency and management capabilities, and reduces storage costs.

CN109271871BActive Publication Date: 2024-10-22PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810959028.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-22
Publication Date
2024-10-22
Estimated Expiration
2038-08-22

AI Technical Summary

Technical Problem

In existing face recognition systems, sample database management is disorganized, resulting in high sample data storage costs and low retrieval efficiency, which affects detection accuracy and recognition speed.

Method used

A three-layer directory structure is used to generate the sample storage path. The identification information is used as the first-level directory, and the storage host with the largest remaining space is used as the second-level directory. The sample library directory identification is assigned according to the preset sample library storage threshold, and the storage is formed through splicing. path to optimize space allocation and the number of data files on the storage host.

Benefits of technology

It improves the retrieval efficiency of sample data, simplifies management and maintenance, reduces the storage path storage cost of sample data, and enhances the management and maintenance capabilities of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109271871B_ABST
    Figure CN109271871B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, computer equipment and storage medium for generating a sample storage path, the method comprising: receiving a sample data storage request initiated by a client; querying a sample database according to identification information in the sample data storage request; judging whether to use the identification information as the first-level directory name of the sample storage path according to the query result; using the host name of the storage host with the largest remaining space in the storage host on the network storage platform as the second-level directory name; assigning a sample library directory identifier to the sample data according to a preset sample library storage threshold, and using the sample library directory identifier as the third-level directory name; splicing the first-level directory name, the second-level directory name and the third-level directory name to obtain a storage path; saving the storage path to the sample database, and saving the sample data to the storage host corresponding to the storage path. The technical solution of the present invention improves the retrieval efficiency of sample data, and is conducive to the management and maintenance of samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing, and in particular to a sample storage path generation method, device, computer equipment and storage medium. Background Art

[0002] In the sample library management of the existing face recognition system, the business parties who access the sample library submit data in a disorganized manner without unified specifications, and a large amount of image data is stored in one or several directories. Due to the large number of images in the directory and their different types, the face search operation takes a long time, and the possibility of face comparison errors is high, which also affects the accuracy and recognition speed of face detection; at the same time, the data of each business party is stored together, which is not easy to manage and maintain. Summary of the invention

[0003] The embodiments of the present invention provide a sample storage path generation method, apparatus, computer equipment and storage medium to solve the problem that when storing sample data submitted by a business party, sample data is stored in a disorderly manner, resulting in high sample management and maintenance costs and low sample data retrieval efficiency.

[0004] A method for generating a sample storage path, comprising:

[0005] Receiving a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data;

[0006] querying a sample database according to the identification information, and if the identification information is not found in the sample database, using the identification information as a first-level directory name;

[0007] Traversing each storage host on a preset network storage platform, obtaining the remaining space of each storage host, and using the host name of the storage host with the largest remaining space as the second-level directory name;

[0008] According to a preset sample library storage threshold, a sample library directory identifier is allocated to the sample data, and the sample library directory identifier is used as a third-level directory name;

[0009] According to a preset splicing method, the first-layer directory name, the second-layer directory name and the third-layer directory name are spliced ​​to obtain a storage path;

[0010] Saving the storage path to the sample database;

[0011] According to the storage path, the sample data is saved to a storage host corresponding to the storage path.

[0012] A sample storage path generating device, comprising:

[0013] A receiving module, configured to receive a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data;

[0014] A first-level directory construction module, used to query the sample database according to the identification information, and if the identification information is not found in the sample database, use the identification information as the first-level directory name;

[0015] A second-layer directory construction module is used to traverse each storage host on a preset network storage platform, obtain the remaining space of each storage host, and use the host name of the storage host with the largest remaining space as the second-layer directory name;

[0016] A third-layer directory construction module, configured to allocate a sample library directory identifier to the sample data according to a preset sample library storage threshold, and use the sample library directory identifier as a third-layer directory name;

[0017] A splicing module, used for splicing the first-layer directory name, the second-layer directory name and the third-layer directory name according to a preset splicing method to obtain a storage path;

[0018] A first data storage module, used for saving the storage path to the sample database;

[0019] The second data storage module is used to save the sample data to a storage host corresponding to the storage path according to the storage path.

[0020] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned sample storage path generation method when executing the computer program.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned sample storage path generation method.

[0022] The above-mentioned sample storage path generation method, device, computer equipment and storage medium establish a three-layer directory structure for the storage path of sample data, use the identification information of the sample data as the first-layer directory; use the host name of the storage host with the largest remaining storage space on the network storage platform as the second-layer directory; and according to the preset sample library storage threshold, assign a sample library directory identifier to the sample data, and use the sample library directory identifier as the third-layer directory; the storage path obtained by splicing the three-layer directory can reasonably allocate the remaining space of the storage host, which is convenient for classifying the sample data of the business party, and according to the preset sample library storage threshold, optimize the number of sample data files to be stored in each sample library, thereby improving the retrieval efficiency of the sample data, and at the same time, save the storage path of the sample data in a dedicated sample database, save the sample data in the network storage platform, and save the sample data and its storage path separately, which is further conducive to the management and maintenance of the sample. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 is a schematic diagram of an application environment of a method for generating a sample storage path in an embodiment of the present invention;

[0025] Figure 2 is a flow chart of a method for generating a sample storage path in one embodiment of the present invention;

[0026] Figure 3 is a flow chart of constructing a fourth-level directory name in a sample storage path generation method in one embodiment of the present invention;

[0027] Figure 4 is a flow chart of obtaining and storing summary information of sample data in a sample storage path generation method in one embodiment of the present invention;

[0028] Figure 5 is a flow chart of step S3 in the method for generating a sample storage path in one embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of a sample storage path generating device in one embodiment of the present invention;

[0030] Figure 7 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] The sample storage path generation method provided in this application can be applied in Figure 1 In an application environment, the client initiates a sample data storage request to the server, and the server processes the sample data storage request and stores the sample data and related data in a network storage platform and a sample database, respectively. The client can be a browser, a mobile phone APP, a PC host, etc.; the server can be a server or a server cluster; the network storage platform includes several storage hosts, which are connected to each other through a network. The storage hosts are used to store sample data. The storage hosts can use a NAS (Network Attached Storage) system. The NAS system implements data transmission based on a standard network protocol, and provides file sharing and data backup for computers with various operating systems such as Windows, Linux, and Mac OS in the network; the sample database is used to store relevant information of the sample data, and the sample database includes but is not limited to MS-SQL, Oracle, MySQL, Sybase, DB2, etc. The sample storage path generation method provided in an embodiment of the present invention is applied to a server.

[0033] In one embodiment, if Figure 2 As shown, a sample storage path generation method is provided, and its specific implementation process includes the following steps:

[0034] S1: Receive a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data.

[0035] Before using the services of the face recognition system, the business party has registered with the face recognition system and has been assigned business party identification information by the face recognition system. The business party identification information is used to distinguish different business parties. The so-called business party refers to an enterprise or organization registered on the system to use the face recognition service of the face recognition system. The business party identification information can specifically be the business party ID (identification) number.

[0036] When the client of the business party initiates a sample data storage request, the sample data storage request includes sample data and identification information of each sample data. The sample data may be a face image file, and the identification information of the sample data is used to identify the business party to which the sample data belongs, and may be composed of the business party ID and the file name of the sample data.

[0037] The server receives the sample data storage request initiated by the client, and extracts the sample data and the identification information of each sample data.

[0038] Specifically, the client submits a face image file through a browser form. The form may have a dedicated field for recording the business party's ID. The server can then obtain the face image file from the form and at the same time obtain the business party ID to which the face image file belongs.

[0039] S2: querying the sample database according to the identification information. If the identification information is not found in the sample database, the identification information is used as the first-level directory name.

[0040] The storage path of each sample data is stored in the sample database. The storage path consists of multiple layers of directories, where the identification information associated with the business party can be used as the first-layer directory name. When the face recognition system performs a recognition task for a business party, it can filter out sample data that does not belong to the business party based on the identification information, which can narrow the scope of sample data retrieval.

[0041] Specifically, the server uses the identification information of the received sample data as the search field to query the sample database. If the identification information is not found in the sample database, it is determined that the business party is submitting the sample data for the first time. The server needs to create a new storage path for the sample data, use the identification information as the first-level directory name, and save the identification information in the form of a string as a temporary variable.

[0042] S3: traverse each storage host on the preset network storage platform, obtain the remaining space of each storage host, and use the host name of the storage host with the largest remaining space as the second-level directory name.

[0043] The sample data is stored on the network storage platform, and the storage path of the sample data can locate the storage location of each sample data in the storage host of each network storage platform. Based on the consideration of reasonable use of storage space, the sample data belonging to a business party is not necessarily stored continuously on a certain storage host, but may be stored in various storage hosts.

[0044] When the server receives the sample data storage request initiated by the client and establishes a storage path for the sample data, it traverses the remaining storage space of each storage host on the network storage platform and uses the host name of the storage host with the largest remaining storage space as the second-level directory name.

[0045] Specifically, the server can use a loop structure to call the system command "df" to view the remaining storage space on the remote storage host, and arrange the obtained remaining storage space in descending order; corresponding to the storage host with the largest remaining storage space, the server can obtain the host name of the storage host by calling the system command "nmap"; finally, the server saves the obtained host name in the form of a string as a temporary variable.

[0046] S4: According to the preset sample library storage threshold, a sample library directory identifier is allocated to the sample data, and the sample library directory identifier is used as the third-level directory name.

[0047] The face recognition system uses a file directory as a sample library. The number of sample data stored in a sample library is limited. The number of sample data files that can be stored in the sample library is used as the sample library storage threshold. The size of the sample library storage threshold affects the sample data retrieval speed of the face recognition system and the speed of face recognition calculation. Preferably, the sample library storage threshold is 20,000, that is, the number of sample data that can be stored in a file directory is 20,000.

[0048] The server allocates sample libraries according to the sample library storage threshold, assigns a sample library directory identifier to each sample library, and uses the sample library directory identifier as the third-level directory name. For example, the server assigns a sample library directory identifier of 01, representing the first sample library, which can store 20,000 sample data. If the server receives more than 20,000 sample data, it assigns a new sample library directory identifier of 02, representing the second sample library, and so on.

[0049] Specifically, the server allocates a sample library directory identifier 01 for the currently received sample data, and detects whether the number of sample data in the current sample library exceeds the sample library storage threshold. If it exceeds the sample library storage threshold, a new sample library directory identifier is allocated. The server saves the sample library directory identifier in the form of a string as a temporary variable.

[0050] S5: According to a preset splicing method, the first-level directory name, the second-level directory name and the third-level directory name are spliced ​​to obtain a storage path.

[0051] The storage path consists of the first-level directory name, the second-level directory name, the third-level directory name, and the connection symbol. The connection symbols include slash, backslash, double slash, back-double slash, quotation mark, and double quotation mark. Different operating systems have different connection symbols for their directory structures. For example, the Windows system uses backslashes "\" to connect different directory names for file directories; Unix / Linux systems use slashes " / " to connect different directory names. The server can select different connection symbols based on the different operating systems of the storage hosts on the network storage platform.

[0052] Specifically, the server concatenates the temporary variables and connection symbols corresponding to the first-level directory name, the second-level directory name, and the third-level directory name in steps S2, S3, and S4 to obtain the storage path. Taking the storage host as a Unix / Linux system as an example, the storage path of a sample data can be expressed as:

[0053] PA01 / Host01 / 01 /

[0054] Among them, PA01 represents the business party ID to which the sample data belongs, Host01 represents the host name of a storage host with the largest remaining storage space in the network storage platform, and 01 represents the first sample library under the storage host.

[0055] S6: Save the storage path to the sample database.

[0056] The storage path of each sample data is saved in the sample database, and the storage location of the sample data is managed and maintained through the database.

[0057] Specifically, the server inserts the storage path corresponding to each sample data as a record into the sample data storage path table of the sample database through JDBC. Among them, JDBC (Java DataBase Connectivity) is a Java API for executing SQL statements, which can provide unified access to multiple relational databases. It consists of a set of classes and interfaces written in Java. JDBC provides a benchmark, based on which more advanced tools and interfaces can be built, enabling database developers to write database applications. The interface programs written by database developers through JDBC can be applied to different databases, and there is no need to write interface programs for different databases separately, which greatly improves development efficiency.

[0058] S7: According to the storage path, the sample data is saved to the storage host corresponding to the storage path.

[0059] The network storage platform is a whole relative to the client or server, and the storage tasks are shared by various storage hosts within the network storage platform. The server can accurately locate the storage location of each sample data to a storage host in the network storage platform based on the storage path.

[0060] The server can transfer the sample data sent by the client to the storage host corresponding to the storage path through the socket or the system call of the remote copy file.

[0061] Specifically, when the server and the network storage platform communicate through sockets, the server uses the storage path as the input of the URL (Uniform Resource Location) and sends the sample data to the storage host through the socket's sendto() function; when the server and the network storage platform communicate through other file sharing protocols, the server can use the remote copy system function scp() to send the sample data to the storage host.

[0062] In this embodiment, a three-layer directory structure is established for the storage path of the sample data, and the identification information of the sample data is used as the first-layer directory; the host name of the storage host with the largest remaining storage space on the network storage platform is used as the second-layer directory; and according to the preset sample library storage threshold, a sample library directory identifier is allocated to the sample data, and the sample library directory identifier is used as the third-layer directory; the storage path obtained by splicing the three-layer directory can reasonably allocate the remaining space of the storage host, which is convenient for classifying the sample data of the business party, and according to the preset sample library storage threshold, the number of sample data files to be stored in each sample library is optimized, thereby improving the retrieval efficiency of the sample data. At the same time, the storage path of the sample data is saved in a dedicated sample database, the sample data is saved in the network storage platform, and the sample data and its storage path are saved separately, which is further beneficial to the management and maintenance of the samples.

[0063] Further, in one embodiment, if Figure 3 As shown, after step S5, that is, according to a preset splicing method, the first-level directory name, the second-level directory name and the third-level directory name are spliced ​​to obtain the storage path, and before step S6, that is, before the storage path is saved to the sample database, the sample storage path generation method further includes constructing a fourth-level directory name according to the file type of the sample data, and its specific implementation includes the following steps:

[0064] S8: Get the file type of the sample data.

[0065] The face recognition system supports three image formats: JPG, PNG and BMP, which means that face recognition can be performed on images in these three formats. Among them, BMP does not use compression technology and directly saves the original image data; JPG is a lossy compression format with a high compression ratio; PNG uses a data-free compression algorithm derived from LZ77. LZ77 encoding is a dictionary-based lossless compression algorithm that is widely used in communications, computer file archiving, etc. The same image, after being saved in JPG, PNG, and BMP formats, has file sizes from small to large.

[0066] Specifically, the server makes a judgment based on the suffix of the received sample data. If the suffix of the sample data is JPG or JPEG, it is determined that the sample data belongs to the JPG file type; if the suffix of the sample data is PNG, it is determined that the sample data belongs to the PNG file type; if the suffix of the sample data is BMP, it is determined that the sample data belongs to the BMP file type.

[0067] S9: Using the type name of the file type as the fourth-level directory name, and adding the fourth-level directory name to the storage path according to a preset adding method.

[0068] The server uses the character strings "JPG", "PNG" and "BMP" as the fourth-level directory names, and concatenates them with the first-level directory names, the second-level directory names, the third-level directory names and the connection symbol to obtain the storage path. The specific concatenation process has been described in step S5 and will not be repeated here. The storage paths corresponding to the sample data of the three file types can be:

[0069] PA01 / Host01 / 01 / JPG

[0070] PA01 / Host01 / 01 / PNG

[0071] PA01 / Host01 / 01 / BMP

[0072] In this embodiment, the file type is added to the storage path to distinguish face images of different formats. Since there is an image preprocessing stage in the face recognition process, its main task is to extract the RGB value of each pixel in the image, and the extraction work is completed by three different application layer interfaces. If the images in the sample library are mixed in a directory without distinguishing between formats, when the number of sample image files accumulates to millions, frequent switching of the application layer interface to extract the RGB value will lead to frequent switching of the CPU context. The time overhead accumulated by this CPU context switching will eventually affect the speed of face recognition.

[0073] Therefore, classifying and storing sample data according to file formats can indirectly optimize the speed of face recognition.

[0074] Further, in one embodiment, after step S7, that is, after the sample data is saved to a storage host corresponding to the storage path according to the storage path, the sample storage path generation method further includes:

[0075] Assign a file ID to the sample data and rename the file name of the sample data with the file ID.

[0076] In order to facilitate unified management, after the sample data is saved on the storage host, the server reassigns a file identifier to the sample data and renames the file name of the sample data with the file identifier.

[0077] Specifically, the file identifier may be a number that increases in numerical order, such as 01, 02, 03, etc.; or it may be a number that starts with the business party id and an underscore, followed by a number in numerical order, such as PA_01, PA_02, PA_03, etc.

[0078] In this embodiment, the server uniformly renames the file names of the sample data, so that the file names of the sample data are more standardized, which is convenient for data retrieval and identification, and is conducive to unified management of the sample data.

[0079] Furthermore, if Figure 4 As shown, in one embodiment, after step S9, that is, taking the type name of the file type as the fourth-level directory name, and adding the fourth-level directory name to the storage path according to a preset adding method, and before step S6, that is, before saving the storage path to the sample database, the sample storage path generation method includes the following steps:

[0080] S10: Grouping and accumulating the received sample data to obtain summary information of the sample data.

[0081] The summary information of sample data is an overview of the data related to the sample data, including but not limited to: the business party to which the sample data belongs, that is, the business party ID; the file type of the sample data, the number of sample data files of each type, the file size of the sample data, the time when the sample data was entered, the number of sample data files included in each business party, the size of the sample data under each business party, etc. The summary information of sample data can provide sample management personnel with an overview of the sample data or a database index.

[0082] The server can group the sample data according to the business party to which it belongs, and then accumulate the sample data under each group to obtain summary information of the sample data; the server can also group the sample data according to the file type, and then accumulate the sample data under each group to obtain summary information of the sample data.

[0083] Specifically, taking the example of grouping by the business party to which the sample data belongs, the server can obtain the business party to which the sample data belongs through the business party id in the browser form; obtain the entry time of each sample data through the browser form submission time; obtain the file size of each sample data through the system call function file(); obtain the file type of the sample data by checking the suffix of the sample data file; and obtain the summary information of the sample data under each business party by accumulating the relevant information of each sample data above. For example, the summary information of the sample data under a certain business party is: the number of sample files is 256; the file types of the sample data include PNG and JPG; the total file size of the 256 sample data is 12MB. The server can store the summary information of the obtained sample data in a data structure.

[0084] S11: Save the summary information to the sample database.

[0085] Specifically, a sample data summary information table is established in the sample database, and the fields in the table correspond to the relevant information of the sample data. The server can save the summary information of the sample data to the sample data summary information table of the sample database through JDBC.

[0086] In this embodiment, the server collects relevant information of the sample data and forms summary information of the sample data. The summary information can provide sample management personnel with an overview of the sample data. At the same time, the summary information is stored in the database, which is convenient for retrieval and thus more conducive to sample management and maintenance.

[0087] Furthermore, if Figure 5 As shown, in one embodiment, in step S3, each storage host on the preset network storage platform is traversed, the remaining space of each storage host is obtained, and the host name of the storage host with the largest remaining space is used as the second-level directory name, including the following specific steps:

[0088] S31: At preset time intervals, traverse each storage host on the preset network storage platform, obtain the remaining space value of each storage host, and update the remaining space value of each storage host to a preset storage host remaining space table, wherein the storage host remaining space table includes the host name and remaining space value of each storage host.

[0089] The server establishes a storage host remaining space table locally, which is used to record the remaining storage space value of each storage host on the network storage platform. The server starts a scheduled task, which traverses each storage host on the preset network storage platform at a preset time interval, obtains the remaining space value of each storage host, and records the remaining space value in the storage host remaining space table. Among them, the preset time interval can first set a default initial value, preferably, the initial value is 30 seconds. The server can adjust the preset time interval according to the number of current sample data storage requests. If the number of current sample data storage requests is large, the preset time interval can be reduced by 0.5 seconds on the basis of the default value, which means that the server needs to respond to the client's data storage request more quickly and obtain the storage host remaining space value more frequently and in real time; if the number of current sample data storage requests is small, the preset time interval can keep the default value unchanged, or increase 0.5 seconds on the basis of the default value to reduce the server's frequent access to the storage host in the network storage platform.

[0090] Specifically, the scheduled task started on the server traverses each storage host on the network storage platform every 30 seconds. The specific process of traversing the storage host and obtaining the storage host name has been detailed in step S3 and will not be repeated here. The difference is that the server here saves the remaining space value of each storage host locally, which can be saved locally in the form of a temporary array, a global variable array, or an embedded database.

[0091] Preferably, an embedded database SQLite is used to save the remaining storage space value of the storage host. The server creates a local SQLite database locally and establishes a storage host remaining space table, which records the host name of each storage host and the current remaining storage space of each host. The fields in the table can also include the remaining storage space of the storage host in each preset time period to reflect the change curve of the remaining storage space of the storage host. The scheduled task will traverse each storage host on the preset network storage platform at a preset time interval, obtain the remaining space value of each storage host, and update the remaining space value to the storage host remaining space table. Among them, SQLite is a typical embedded database. Compared with ordinary non-embedded databases, it occupies very little space. Unlike the common client-server paradigm, SQLite is an in-process library that implements a self-sufficient, serverless, zero-configuration, transactional SQL database engine. Therefore, SQLite can be statically or dynamically connected to the application to achieve seamless data docking.

[0092] S32: Use the host name of the storage host with the largest remaining space value in the storage host remaining space table as the second-level directory name.

[0093] When the server receives the sample data storage request initiated by the client, it no longer needs to traverse the storage hosts on the network storage platform through the network, but directly queries the local embedded database to obtain the host name of the storage host with the largest remaining space value.

[0094] Specifically, the server can directly query the embedded database through SQL statements, and sort the query results according to the amount of remaining storage space, so as to obtain the host name of the storage host with the largest remaining space value.

[0095] In this embodiment, the server establishes an embedded database locally, obtains the remaining storage space of each storage host on the network storage platform at preset time intervals through a scheduled task, and regularly updates the remaining space value to the local embedded database, so that after receiving a sample data storage request, the server does not need to obtain the remaining storage space of the storage host through the network, but directly accesses the local embedded database to obtain the remaining storage space of the storage host by looking up the table, which saves the processing time of step S3 and improves the response efficiency of the server.

[0096] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0097] In one embodiment, a sample storage path generation device is provided, and the sample storage path generation device corresponds one-to-one to the sample storage path generation method in the above embodiment. Figure 6 As shown, the sample storage path generation device includes a receiving module 61, a first-level directory construction module 62, a second-level directory construction module 63, a third-level directory construction module 64, a splicing module 65, a first data storage module 66, and a second data storage module 67. The functional modules are described in detail as follows:

[0098] A receiving module 61, configured to receive a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data;

[0099] A first-level directory construction module 62, used to query the sample database according to the identification information, and if the identification information is not found in the sample database, the identification information is used as the first-level directory name;

[0100] The second-layer directory construction module 63 is used to traverse each storage host on the preset network storage platform, obtain the remaining space of each storage host, and use the host name of the storage host with the largest remaining space as the second-layer directory name;

[0101] A third-layer directory construction module 64 is used to assign a sample library directory identifier to the sample data according to a preset sample library storage threshold, and use the sample library directory identifier as a third-layer directory name;

[0102] A splicing module 65, used to splice the first-layer directory name, the second-layer directory name and the third-layer directory name according to a preset splicing method to obtain a storage path;

[0103] A first data storage module 66, used to save the storage path to a sample database;

[0104] The second data storage module 67 is used to save the sample data to a storage host corresponding to the storage path according to the storage path.

[0105] Furthermore, the sample storage path generating device also includes:

[0106] A file detection module 68, used to obtain the file type of the sample data;

[0107] The fourth-level directory construction module 69 is used to use the type name of the file type as the fourth-level directory name, and add the fourth-level directory name to the storage path according to a preset adding method.

[0108] Furthermore, the sample storage path generating device also includes:

[0109] The renaming module 610 is used to assign a file identifier to the sample data and rename the file name of the sample data with the file identifier.

[0110] Furthermore, the sample storage path generating device also includes:

[0111] The statistical module 611 is used to group and accumulate the received sample data to obtain summary information of the sample data;

[0112] The summary information storage module 612 is used to store the summary information in the sample database.

[0113] Furthermore, the second-level directory construction module 63 includes:

[0114] The timed traversal submodule 631 is used to traverse each storage host on the preset network storage platform at a preset time interval, obtain the remaining space value of each storage host, and update the remaining space value of each storage host to a preset storage host remaining space table, wherein the storage host remaining space table includes the host name and remaining space value of each storage host;

[0115] The second-level directory construction submodule 632 is configured to use the host name of the storage host with the largest remaining space value in the storage host remaining space table as the second-level directory name.

[0116] For the specific definition of the sample storage path generation device, please refer to the definition of the sample storage path generation method above, which will not be repeated here. Each module in the above-mentioned sample storage path generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0117] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a sample storage path generation method is implemented.

[0118] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the sample storage path generation method in the above embodiment are implemented, such as Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the sample storage path generation device in the above embodiment are realized, for example Figure 6 The functions of modules 61 to 67 are shown in Figure 6. To avoid repetition, they will not be described here.

[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the sample storage path generation method in the above method embodiment is implemented, or when the computer program is executed by a processor, the functions of each module / unit in the sample storage path generation device in the above device embodiment are implemented. To avoid repetition, it will not be described here.

[0120] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0121] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0122] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for generating a sample storage path, It is characterized in that The sample storage path generation method comprises: Receiving a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data; Searching a sample database according to the identification information, if the identification information is not found in the sample database, using the identification information associated with the business party as the first-level directory name; Traversing each storage host on the preset network storage platform, obtaining the remaining space of each storage host, and using the host name of the storage host with the largest remaining space as the second-level directory name, wherein the sample data belonging to one business party is dispersedly stored in each storage host on the preset network storage platform when being stored; The number of files of the sample data that can be stored in the sample library is used as a sample library storage threshold, and according to the sample library storage threshold, a sample library directory identifier is allocated to the sample data, and the sample library directory identifier is used as a third-level directory name; According to a preset splicing method, the first-layer directory name, the second-layer directory name and the third-layer directory name are spliced ​​to obtain a storage path; Saving the storage path to the sample database; According to the storage path, the sample data is saved to a storage host corresponding to the storage path.

2. The method for generating a sample storage path according to claim 1, It is characterized in that After the first-layer directory name, the second-layer directory name, and the third-layer directory name are concatenated in a preset concatenation manner to obtain a storage path, and before the storage path is saved in the sample database, the sample storage path generation method further includes: Obtaining the file type of the sample data; The type name of the file type is used as a fourth-level directory name, and the fourth-level directory name is added to the storage path according to a preset adding method.

3. The method for generating a sample storage path according to claim 2, It is characterized in that After the sample data is saved on a storage host corresponding to the storage path according to the storage path, the sample storage path generation method further includes: A file identifier is assigned to the sample data, and a file name of the sample data is renamed with the file identifier.

4. The sample storage path generation method according to claim 2 or 3, It is characterized in that After taking the type name of the file type as the fourth-level directory name and adding the fourth-level directory name to the storage path according to a preset adding method, and before saving the storage path to the sample database, the sample storage path generating method further includes: Grouping and accumulating the received sample data to obtain summary information of the sample data; The summary information is saved in the sample database.

5. The method for generating a sample storage path according to claim 3, It is characterized in that The traversing each storage host on the preset network storage platform, obtaining the remaining space of each storage host, and taking the host name of the storage host with the largest remaining space as the second-level directory name, includes: At a preset time interval, traverse each storage host on a preset network storage platform, obtain the remaining space value of each storage host, and update the remaining space value of each storage host into a preset storage host remaining space table, wherein the storage host remaining space table includes the host name and remaining space value of each storage host; The host name of the storage host with the largest remaining space value in the storage host remaining space table is used as the second-level directory name.

6. A sample storage path generating device, It is characterized in that The sample storage path generating device comprises: A receiving module, configured to receive a sample data storage request initiated by a client, wherein the sample data storage request includes sample data and identification information of each sample data; A first-level directory construction module, configured to query a sample database according to the identification information, and if the identification information is not found in the sample database, use the identification information associated with the business party as a first-level directory name; A second-layer directory construction module is used to traverse each storage host on the preset network storage platform, obtain the remaining space of each storage host, and use the host name of the storage host with the largest remaining space as the second-layer directory name, wherein the sample data belonging to one business party is stored in a dispersed manner in each storage host on the preset network storage platform; A third-layer directory construction module, configured to use the number of files of the sample data that can be stored in the sample library as a sample library storage threshold, allocate a sample library directory identifier to the sample data according to the sample library storage threshold, and use the sample library directory identifier as a third-layer directory name; A splicing module, used for splicing the first-layer directory name, the second-layer directory name and the third-layer directory name according to a preset splicing method to obtain a storage path; A first data storage module, used for saving the storage path to the sample database; The second data storage module is used to save the sample data to a storage host corresponding to the storage path according to the storage path.

7. The sample storage path generating device according to claim 6, It is characterized in that The sample storage path generating device also includes: A file detection module, used to obtain the file type of the sample data; The fourth-level directory construction module is used to use the type name of the file type as the fourth-level directory name, and add the fourth-level directory name to the storage path according to a preset adding method.

8. The sample storage path generating device according to claim 6, It is characterized in that The sample storage path generating device also includes: The renaming module is used to assign a file identifier to the sample data and rename the file name of the sample data with the file identifier.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the sample storage path generation method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the sample storage path generation method according to any one of claims 1 to 5 are implemented.