[go: up one dir, main page]

CN110399346B - Storage path setting method and device using file counter and computer equipment - Google Patents

Storage path setting method and device using file counter and computer equipment Download PDF

Info

Publication number
CN110399346B
CN110399346B CN201910537911.0A CN201910537911A CN110399346B CN 110399346 B CN110399346 B CN 110399346B CN 201910537911 A CN201910537911 A CN 201910537911A CN 110399346 B CN110399346 B CN 110399346B
Authority
CN
China
Prior art keywords
preset
file
folder
storage
threshold
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.)
Active
Application number
CN201910537911.0A
Other languages
Chinese (zh)
Other versions
CN110399346A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910537911.0A priority Critical patent/CN110399346B/en
Priority to PCT/CN2019/103543 priority patent/WO2020252929A1/en
Publication of CN110399346A publication Critical patent/CN110399346A/en
Application granted granted Critical
Publication of CN110399346B publication Critical patent/CN110399346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

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

Abstract

The application discloses a storage path setting method, a storage path setting device, computer equipment and a storage medium by using a file counter, wherein the method comprises the following steps: receiving a designated picture uploaded by an uploading terminal; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, file management is convenient, and file processing efficiency is improved.

Description

Storage path setting method and device using file counter and computer equipment
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a computer device, and a storage medium for setting a storage path using a file counter.
Background
The storage mode of the storage terminal in the traditional technology generally adopts rough storage for files, for example, all files are stored in a default storage folder, and when a developer detects that the storage amount of the files in the default storage folder is too large, the files are transferred to other storage folders, so that the number of the files in a single folder is too large, and the files are inconvenient to find and call. The prior art lacks a solution for controlling the number of files in terms of storage of the files in order to facilitate file management (e.g. searching and calling the files).
Disclosure of Invention
The main purpose of the application is to provide a storage path setting method, a device, computer equipment and a storage medium by using a file counter, which aim to automatically control the number of files in a folder, facilitate file management and improve file processing efficiency.
In order to achieve the above object, the present application proposes a storage path setting method using a file counter, applied to a storage terminal, including:
receiving a designated picture uploaded by an uploading terminal;
judging whether the file size of the appointed picture is larger than a preset size threshold value or not;
if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value;
acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value or not;
if the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold or not;
if the number of files in the default storage folder is greater than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than the number of files in the default storage folder.
Further, the storage terminal is configured to store a face picture, and the step of determining whether the file size of the specified picture is greater than a preset size threshold includes:
extracting the outline of the image in the appointed picture by adopting a preset outline extraction rule;
comparing the contour of the image with a preset standard face contour by using a preset contour difference algorithm, so as to obtain a difference degree value;
judging whether the difference degree value is smaller than a preset difference threshold value or not;
if the difference degree value is smaller than a preset difference threshold value, judging whether the file size of the appointed picture is larger than a preset size threshold value.
Further, after the step of determining whether the file size of the specified picture is greater than a preset size threshold, the method includes:
if the file size of the designated picture is not greater than a preset size threshold, increasing the count of a preset file counter by a second preset value, wherein the second preset value is smaller than the first preset value;
acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value or not;
If the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold or not;
if the number of files in the default storage folder is greater than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than the number of files in the default storage folder.
Further, there are a plurality of specified pictures, and if the file size of the specified picture is greater than a preset size threshold, the step of increasing the count of the preset file counter by a first preset value includes:
according to the formula: m=p a A+p b B, calculating a value M, wherein p exists in a plurality of specified pictures a Pictures with file sizes larger than a preset size threshold value are displayed, wherein p exists in the designated pictures b The pictures with the file sizes not larger than a preset size threshold value are A, B which are preset fixed values, wherein A is larger than B;
the count of the preset file counter is increased by a value M.
Further, after the step of obtaining the current reading of the file counter and determining whether the current reading of the file counter is greater than a preset reading threshold, the method includes:
If the current reading of the file counter is not greater than the preset reading threshold, maintaining the current storage path;
and storing the appointed picture into a default storage folder pointed by the current storage path according to the current storage path.
Further, the default folder stores the same type of picture files, and if the current reading of the file counter is greater than a preset reading threshold, the step of resetting the count of the file counter and determining whether the number of files in the default folder is greater than a preset number threshold includes:
analyzing the default folder so as to acquire the type of the picture file stored in the default folder;
and acquiring the quantity threshold corresponding to the default folder according to the type of the picture file by utilizing the corresponding relation between the preset type and the quantity threshold.
Further, if the number of files in the default storage folder is greater than a preset number threshold, setting a file storage path of the storage terminal to point to a preset designated folder, where the number of files in the designated folder is less than the number of files in the default storage folder, and the step of setting the file storage path to point to the preset designated folder includes:
If the number of files in the default storage folder is larger than a preset number threshold, creating a designated folder in an upper directory of the default storage folder;
modifying the last-level subdirectory of the path pointing to the default storage folder into the specified folder, thereby obtaining a specified path pointing to the specified folder;
and setting a file storage path of the storage terminal as the specified path.
The application provides a storage path setting device using a file counter, which is applied to a storage terminal and comprises:
the appointed picture receiving unit is used for receiving the appointed picture uploaded by the uploading terminal;
a size threshold judging unit, configured to judge whether a file size of the specified picture is greater than a preset size threshold;
a first predetermined value increasing unit, configured to increase the count of a preset file counter by a first predetermined value if the file size of the specified picture is greater than a preset size threshold;
the reading threshold judging unit is used for acquiring the current reading of the file counter and judging whether the current reading of the file counter is larger than a preset reading threshold or not;
the quantity threshold judging unit is used for resetting the count of the file counter and judging whether the quantity of files in a default storage folder is larger than a preset quantity threshold or not if the current reading of the file counter is larger than the preset reading threshold;
And the storage path setting unit is used for setting the file storage path of the storage terminal to point to a preset designated folder if the number of files in the default storage folder is larger than a preset number threshold, wherein the number of files in the designated folder is smaller than the number of files in the default storage folder.
The present application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the computer program is executed by the processor.
The present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method of any of the above.
The method, the device, the computer equipment and the storage medium for setting the storage path by using the file counter receive the appointed picture uploaded by the uploading terminal; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, and file management is convenient.
Drawings
FIG. 1 is a flow chart of a method for setting a storage path by using a file counter according to an embodiment of the present application;
FIG. 2 is a schematic block diagram of a storage path setting device using a file counter according to an embodiment of the present application;
fig. 3 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a storage path setting method using a file counter, which is applied to a storage terminal, and includes:
s1, receiving a designated picture uploaded by an uploading terminal;
s2, judging whether the file size of the appointed picture is larger than a preset size threshold value or not;
s3, if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value;
S4, acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value or not;
s5, if the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold;
and S6, if the number of files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than that in the default storage folder.
The prior art lacks a technical solution for controlling the number of files in terms of storage of the files to facilitate file management (e.g. searching and calling the files). For this, the present application adopts a preset file counter to determine whether the number of files in the default storage folder should be determined, and further determine whether the storage path should be updated, so as to solve the defect caused by the rough storage in the conventional technology.
As described in step S1, the designated picture uploaded by the uploading terminal is received. The uploading terminal and the storage terminal have signal connection relation, and the uploading terminal uploads the picture file to be stored to the storage terminal for storage. Wherein the specified picture may be any type of picture, such as a scenic picture, a face picture, etc. The storage terminal (e.g., a storage server) is configured to serve the uploading terminal.
As described in step S2, it is determined whether the file size of the specified picture is greater than a preset size threshold. Wherein, the specified picture can be only one or a plurality of pictures. When only one specified picture exists, only one judgment is carried out. When a plurality of specified pictures exist, respectively performing multiple judgment to determine whether the file sizes of the plurality of specified pictures are respectively larger than a preset size threshold.
As described in step S3, if the file size of the specified picture is greater than the preset size threshold, the count of the preset file counter is increased by a first preset value. The preset file counter is a counter preset in the storage terminal and used for calculating the related files, when the files need to be stored, the reading of the counter is increased by a certain value, and therefore the number of the stored files can be known through the counter. Wherein the first predetermined value may be an exemplary value, preferably 1 or more. Further, if there are a plurality of specified pictures, when n specified pictures are greater than a preset size threshold, the count of the preset file counter is increased by n times the first preset value. Further, if m specified pictures are not larger than the preset size threshold, the count of the preset file counter is increased by m and multiplied by the second preset value, wherein the second preset value is smaller than the first preset value. Therefore, the file counter is adopted to perform preliminary calculation on the file storage condition, so that unnecessary calculation burden caused by judging the number of files in the default storage folder when any picture file is stored is avoided.
And as described in the step S4, the current reading of the file counter is obtained, and whether the current reading of the file counter is greater than a preset reading threshold is determined. When the current reading of the file counter is larger than a preset reading threshold value, the storage condition of the current default storage folder is required to be verified to determine whether the storage burden is excessive. And when the current reading of the file counter is not greater than a preset reading threshold value, indicating that the file storage condition of the current default storage folder does not need to be verified.
As described in step S5, if the current reading of the file counter is greater than the preset reading threshold, the count of the file counter is cleared, and it is determined whether the number of files in the default storage folder is greater than the preset number threshold. If the current reading of the file counter is larger than a preset reading threshold value, the fact that the number of files in the default storage folder needs to be verified is indicated, meanwhile, the count of the file counter is cleared, and preparation is made for judging whether the number of files in the default storage folder needs to be verified next time or not. The default storage folder refers to a storage folder used for directly storing files in the storage terminal, namely, a folder pointed by a default storage path.
As described in step S6, if the number of files in the default storage folder is greater than the preset number threshold, the file storage path of the storage terminal is set to point to a preset designated folder, where the number of files in the designated folder is less than the number of files in the default storage folder. Therefore, the number of the stored files in the single storage folder is not larger than the sum of the preset number threshold and the number of files represented by the preset reading threshold, and unnecessary calculation burden caused by judging the number of the files in the default storage folder when any picture file is stored is avoided. The designated folder may be an empty folder, or may be a folder in which a file is stored, and preferably is a newly-built empty folder.
In one embodiment, the step S2 of determining whether the file size of the specified picture is greater than a preset size threshold, includes:
s201, extracting the outline of the image in the appointed picture by adopting a preset outline extraction rule;
s202, comparing the contour of the image with a preset standard face contour by using a preset contour difference algorithm, so as to obtain a difference degree value;
S203, judging whether the difference degree value is smaller than a preset difference threshold value;
and S204, if the difference degree value is smaller than a preset difference threshold value, judging whether the file size of the appointed picture is larger than a preset size threshold value.
As described above, it is realized to judge whether the file size of the specified picture is larger than a preset size threshold. The storage terminal in this embodiment is configured to store a face picture, so in order to avoid misstoring the picture, a preset contour difference algorithm is used to determine whether the specified picture is a face picture. Any feasible rule may be adopted for extracting the contour of the image in the specified picture, and since such contour extraction method is a mature algorithm (for example, continuous pixels with the tristimulus values different in a predetermined range are used as the same area, so as to outline the contour), the description is omitted here. The process of comparing the contour of the image with the contour of the preset standard face by using the preset contour difference algorithm to obtain the difference degree value is, for example: overlapping the highest point of the outline of the image with the highest point of the outline of the standard face; performing equal proportion stretching operation on the outline of the image so as to enable the lowest point of the outline of the image to coincide with the lowest point of the outline of the standard face; and calculating the difference between the area of the contour of the image after the equal-proportion stretching operation and the area of the contour of the standard human face, and taking the difference between the areas as the difference degree value. In addition, the degree of misalignment between the contour of the image after the equal-proportion stretching operation and the standard face contour (for example, the area A1 where the contour of the image exceeds the face contour and the area A2 where the face contour is not filled with the contour of the image are used as calculation factors, and the formula of the degree of difference=mxa1+nxa2 may be used, wherein M, N is a weight parameter that may be negative). It is stated here that the above example is only one contour difference algorithm, and the present application is also applicable to any feasible contour difference algorithm. Accordingly, if the difference degree value is smaller than a preset difference threshold, the designated picture is a face picture, and then whether the file size of the designated picture is larger than a preset size threshold is judged. Thereby avoiding the possibility of misstoring the picture. If the contour difference algorithm using the difference between the areas as the difference value is adopted, compared with other algorithms, the consumed calculation force is smaller, and the method is more suitable for primarily judging whether the picture is a face picture (only simple judgment is needed).
In one embodiment, after the step S2 of determining whether the file size of the specified picture is greater than a preset size threshold, the method includes:
ST3, if the file size of the designated picture is not larger than a preset size threshold, increasing the count of a preset file counter by a second preset value, wherein the second preset value is smaller than the first preset value;
ST4, acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value;
ST5, if the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold;
and ST6, if the number of files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than that in the default storage folder.
As described above, it is achieved that the file storage path of the storage terminal is set to point to a preset designated folder. If the file size of the specified picture is not greater than the preset size threshold, the specified picture occupies smaller storage space, and the same storage space can store more specified pictures which are not greater than the preset size threshold, so that the count of the preset file counter is increased by a second preset value, wherein the second preset value is smaller than the first preset value. Wherein the second predetermined value is preferably less than or equal to 1. Accordingly, the number of the stored files in the single storage folder is not larger than the sum of the preset number threshold and the number of files represented by the preset reading threshold, and unnecessary calculation burden caused by judging the number of the files in the default storage folder when any picture file is stored is avoided. The designated folder may be an empty folder, or may be a folder in which a file is stored, and preferably is a newly-built empty folder.
In one embodiment, there are a plurality of specified pictures, and step S3 of increasing the count of the preset file counter by a first predetermined value if the file size of the specified picture is greater than the preset size threshold value includes:
s301, according to the formula: m=p a A+p b B, calculating a value M, wherein p exists in a plurality of specified pictures a Pictures with file sizes larger than a preset size threshold value are displayed, wherein p exists in the designated pictures b The pictures with the file sizes not larger than a preset size threshold value are A, B which are preset fixed values, wherein A is larger than B;
s302, increasing the count of a preset file counter by a value M.
As described above, it is achieved that the count of the preset file counter is increased by the value M according to a plurality of specified pictures. In this embodiment, the uploading terminal uploads a plurality of designated pictures at a time, so that the count of the file counter is increased by a value M, where M is according to the formula: m=p a A+p b B, wherein p exists in a plurality of the specified pictures a Pictures with file sizes larger than a preset size threshold value are displayed, wherein p exists in the designated pictures b A picture with file size not greater than a preset size threshold A, BAre all preset fixed values, wherein A is larger than B. The preset file counter is adapted to the uploading situation of a plurality of appointed pictures. Wherein A is preferably 1 or more, and B is preferably 1 or less.
In one embodiment, after the step S4 of obtaining the current reading of the file counter and determining whether the current reading of the file counter is greater than a preset reading threshold, the method includes:
s411, if the current reading of the file counter is not greater than a preset reading threshold, maintaining a current storage path;
and S412, according to the current storage path, storing the designated picture into a default storage folder pointed by the current storage path.
As described above, saving the specified picture is realized. The file counter is used for carrying out preliminary calculation on the file storage condition, if the current reading of the file counter is not larger than a preset reading threshold value, the condition for verifying the default storage folder is not met, namely the current storage burden of the default storage folder is considered acceptable, and therefore the current storage path is maintained, wherein the current storage path is the path pointing to the default storage folder. And therefore, according to the current storage path, the designated picture is saved into a default storage folder pointed by the current storage path.
In one embodiment, the default folder stores the same type of picture files, and before step S5 of resetting the count of the file counter and determining whether the number of files in the default folder is greater than a preset number threshold if the current reading of the file counter is greater than the preset reading threshold, the method includes:
S421, analyzing the default folder, so as to obtain the type of the picture file stored in the default folder;
s422, acquiring the quantity threshold corresponding to the default folder according to the type of the picture file by utilizing the corresponding relation between the preset type and the quantity threshold.
As described above, the acquisition of the number threshold corresponding to the default folder is achieved. In order to store files in a classified manner so as to realize targeted management of the files, the present embodiment stores the same type of picture files by using a default folder, and average file sizes of different types of picture files are different (for example, the file sizes of face pictures are larger than that of simple cartoon pictures), and accordingly, different quantity thresholds should be set. And according to the type of the picture file, acquiring the quantity threshold corresponding to the default folder by utilizing the corresponding relation between the preset type and the quantity threshold. The process of analyzing the default folder to obtain the type of the picture file stored in the default folder is, for example: analyzing the attribute of the default folder, and extracting the type of the storage file from the attribute, namely acquiring the type of the picture file stored in the default folder; or analyzing the files stored in the default folder, so as to acquire the types of the picture files stored in the default folder.
In one embodiment, the step S6 of setting the file storage path of the storage terminal to point to a preset designated folder if the number of files in the default storage folder is greater than a preset number threshold, where the number of files in the designated folder is less than the number of files in the default storage folder includes:
s601, if the number of files in a default storage folder is larger than a preset number threshold, creating a designated folder in an upper directory of the default storage folder;
s602, modifying the last-stage subdirectory of the path pointing to the default storage folder into the specified folder, so as to obtain a specified path pointing to the specified folder;
s603, setting a file storage path of the storage terminal as the specified path.
As described above, it is achieved that the file storage path of the storage terminal is set to point to a preset designated folder. In the embodiment, the newly constructed folder is used as the designated folder, so that the old file is prevented from interfering with file storage management. And the last-stage sub-directory of the current path pointing to the default storage folder is modified into the designated folder, so that the designated path pointing to the designated folder is obtained, the file storage path of the storage terminal is set as the designated path, thus the storage path does not need to be reconstructed, and the new and old storage folders belong to the same father directory, so that file management is facilitated.
According to the storage path setting method using the file counter, a designated picture uploaded by an uploading terminal is received; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, and file management is convenient.
Referring to fig. 2, an embodiment of the present application provides a storage path setting device using a file counter, which is applied to a storage terminal, including:
a designated picture receiving unit 10, configured to receive a designated picture uploaded by an uploading terminal;
a size threshold judging unit 20, configured to judge whether the file size of the specified picture is greater than a preset size threshold;
a first predetermined value increasing unit 30, configured to increase the count of a preset file counter by a first predetermined value if the file size of the specified picture is greater than a preset size threshold;
A reading threshold value judging unit 40, configured to obtain a current reading of the file counter, and judge whether the current reading of the file counter is greater than a preset reading threshold value;
a quantity threshold judging unit 50, configured to clear the count of the file counter if the current reading of the file counter is greater than a preset reading threshold, and judge whether the number of files in the default storage folder is greater than a preset quantity threshold;
and a storage path setting unit 60, configured to set a file storage path of the storage terminal to point to a preset designated folder if the number of files in a default storage folder is greater than a preset number threshold, where the number of files in the designated folder is less than the number of files in the default storage folder.
The operations performed by the units respectively correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the size threshold determining unit 20 includes:
a contour extraction subunit, configured to extract a contour of an image in the specified picture by using a preset contour extraction rule;
The contour comparison subunit is used for comparing the contour of the image with a preset standard face contour by utilizing a preset contour difference algorithm, so as to obtain a difference degree value;
the difference threshold judging subunit is used for judging whether the difference degree value is smaller than a preset difference threshold or not;
and the size threshold judging subunit is used for judging whether the file size of the designated picture is larger than a preset size threshold or not if the difference degree value is smaller than the preset difference threshold.
The operations that the subunits are respectively used for executing correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the apparatus comprises:
a second predetermined value increasing unit, configured to increase the count of a preset file counter by a second predetermined value if the file size of the specified picture is not greater than a preset size threshold, where the second predetermined value is smaller than the first predetermined value;
the reading threshold judging unit is used for acquiring the current reading of the file counter and judging whether the current reading of the file counter is larger than a preset reading threshold or not;
The file quantity judging unit is used for resetting the count of the file counter and judging whether the number of files in a default storage folder is larger than a preset quantity threshold value or not if the current reading of the file counter is larger than the preset reading threshold value;
and the storage path setting unit is used for setting the file storage path of the storage terminal to point to a preset designated folder if the number of files in the default storage folder is larger than a preset number threshold, wherein the number of files in the designated folder is smaller than the number of files in the default storage folder.
The operations performed by the units respectively correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, there are a plurality of the specified pictures, and the first predetermined value adding unit 30 includes:
a numerical M calculation subunit configured to, according to the formula: m=p a A+p b B, calculating a value M, wherein p exists in a plurality of specified pictures a Pictures with file sizes larger than a preset size threshold value are displayed, wherein p exists in the designated pictures b The pictures with the file sizes not larger than a preset size threshold value are A, B which are preset fixed values, wherein A is larger than B;
And the increment value M subunit is used for incrementing the count of the preset file counter by a value M.
The operations that the subunits are respectively used for executing correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the apparatus comprises:
the storage path maintaining unit is used for maintaining the current storage path if the current reading of the file counter is not greater than a preset reading threshold value;
and the storage unit is used for storing the appointed picture into a default storage folder pointed by the current storage path according to the current storage path.
The operations performed by the units respectively correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the default folder stores the same type of picture file, and the apparatus includes:
the analysis unit is used for analyzing the default folder so as to acquire the type of the picture file stored in the default folder;
the quantity threshold value obtaining unit is used for obtaining the quantity threshold value corresponding to the default folder according to the type of the picture file by utilizing the corresponding relation between the preset type and the quantity threshold value.
The operations performed by the units respectively correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
In one embodiment, the storage path setting unit 60 includes:
a newly-built designated folder unit, configured to newly-build a designated folder in an upper directory of a default storage folder if the number of files in the default storage folder is greater than a preset number threshold;
a sub-directory modification subunit, configured to modify a last-level sub-directory of a path pointing to the default storage folder into the specified folder, so as to obtain a specified path pointing to the specified folder;
and the storage path setting subunit is used for setting the file storage path of the storage terminal as the specified path.
The operations that the subunits are respectively used for executing correspond to the steps of the storage path setting method using the file counter in the foregoing embodiment one by one, and are not described herein again.
The storage path setting device utilizing the file counter receives the appointed picture uploaded by the uploading terminal; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, and file management is convenient.
Referring to fig. 3, in an embodiment of the present invention, there is further provided a computer device, which may be a server, and the internal structure of which may be as shown in the drawing. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured 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, computer programs, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data used by a storage path setting method using a file counter. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a storage path setting method using a file counter.
The processor executes the storage path setting method using the file counter, where the steps included in the method correspond to the steps of executing the storage path setting method using the file counter in the foregoing embodiment one-to-one, and are not described herein again.
It will be appreciated by persons skilled in the art that the structures shown in the drawings are only block diagrams of some of the structures that may be associated with the aspects of the present application and are not intended to limit the scope of the computer apparatus to which the aspects of the present application may be applied.
The computer equipment receives the appointed picture uploaded by the uploading terminal; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, and file management is convenient.
An embodiment of the present application further provides a computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements a method for setting a storage path using a file counter, where the method includes steps corresponding to the steps of executing the method for setting a storage path using a file counter in the foregoing embodiment one-to-one, and will not be described herein again.
The computer readable storage medium of the application receives a designated picture uploaded by an uploading terminal; if the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value; if the current reading of the file counter is larger than a preset reading threshold value, resetting the counting of the file counter; and if the number of the files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder. Therefore, the automatic control of the number of files in the folder is realized, and file management is convenient.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile 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. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (7)

1. A storage path setting method using a file counter, which is applied to a storage terminal, comprising:
receiving a designated picture uploaded by an uploading terminal;
judging whether the file size of the appointed picture is larger than a preset size threshold value or not;
If the file size of the designated picture is larger than a preset size threshold, increasing the count of a preset file counter by a first preset value;
acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value or not;
if the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold or not;
if the number of files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than that in the default storage folder;
the storage terminal is used for storing face pictures, and the step of judging whether the file size of the designated picture is larger than a preset size threshold value comprises the following steps:
extracting the outline of the image in the appointed picture by adopting a preset outline extraction rule;
comparing the contour of the image with a preset standard face contour by using a preset contour difference algorithm, so as to obtain a difference degree value;
Judging whether the difference degree value is smaller than a preset difference threshold value or not;
if the difference degree value is smaller than a preset difference threshold value, judging whether the file size of the appointed picture is larger than a preset size threshold value or not;
after the step of determining whether the file size of the specified picture is greater than a preset size threshold, the method includes:
if the file size of the designated picture is not greater than a preset size threshold, increasing the count of a preset file counter by a second preset value, wherein the second preset value is smaller than the first preset value;
acquiring the current reading of the file counter, and judging whether the current reading of the file counter is larger than a preset reading threshold value or not;
if the current reading of the file counter is larger than a preset reading threshold, resetting the counting of the file counter, and judging whether the number of files in a default storage folder is larger than a preset number threshold or not;
if the number of files in the default storage folder is larger than a preset number threshold, setting the file storage path of the storage terminal to point to a preset designated folder, wherein the number of files in the designated folder is smaller than that in the default storage folder;
The step of increasing the count of the preset file counter by a first preset value if the file size of the specified picture is larger than the preset size threshold value comprises the following steps:
according to the formula: m=p a A+p b B, calculating a value M, wherein p exists in a plurality of specified pictures a Pictures with file sizes larger than a preset size threshold value are displayed, wherein p exists in the designated pictures b The pictures with the file sizes not larger than a preset size threshold value are A, B which are preset fixed values, wherein A is larger than B;
the count of the preset file counter is increased by a value M.
2. The storage path setting method using a file counter according to claim 1, wherein after the step of obtaining a current reading of the file counter and determining whether the current reading of the file counter is greater than a preset reading threshold, comprising:
if the current reading of the file counter is not greater than the preset reading threshold, maintaining the current storage path;
and storing the appointed picture into a default storage folder pointed by the current storage path according to the current storage path.
3. The method for setting a storage path using a file counter according to claim 1, wherein the default storage folder stores the same type of picture files, and the step of resetting the count of the file counter and determining whether the number of files in the default storage folder is greater than a preset number threshold value if the current reading of the file counter is greater than the preset reading threshold value comprises:
Analyzing the default storage folder so as to acquire the type of the picture file stored in the default storage folder;
and acquiring the quantity threshold corresponding to the default storage folder according to the type of the picture file by utilizing the corresponding relation between the preset type and the quantity threshold.
4. The storage path setting method using a file counter according to claim 1, wherein the step of setting the file storage path of the storage terminal to point to a preset designated folder if the number of files in a default storage folder is greater than a preset number threshold, wherein the number of files in the designated folder is less than the number of files in the default storage folder, comprises:
if the number of files in the default storage folder is larger than a preset number threshold, creating a designated folder in an upper directory of the default storage folder;
modifying the last-level subdirectory of the path pointing to the default storage folder into the specified folder, thereby obtaining a specified path pointing to the specified folder;
and setting a file storage path of the storage terminal as the specified path.
5. A storage path setting apparatus using a file counter, characterized by being applied to a storage terminal and configured to perform the method as recited in any one of claims 1 to 4, comprising:
The appointed picture receiving unit is used for receiving the appointed picture uploaded by the uploading terminal;
a size threshold judging unit, configured to judge whether a file size of the specified picture is greater than a preset size threshold;
a first predetermined value increasing unit, configured to increase the count of a preset file counter by a first predetermined value if the file size of the specified picture is greater than a preset size threshold;
the reading threshold judging unit is used for acquiring the current reading of the file counter and judging whether the current reading of the file counter is larger than a preset reading threshold or not;
the quantity threshold judging unit is used for resetting the count of the file counter and judging whether the quantity of files in a default storage folder is larger than a preset quantity threshold or not if the current reading of the file counter is larger than the preset reading threshold;
and the storage path setting unit is used for setting the file storage path of the storage terminal to point to a preset designated folder if the number of files in the default storage folder is larger than a preset number threshold, wherein the number of files in the designated folder is smaller than the number of files in the default storage folder.
6. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
CN201910537911.0A 2019-06-20 2019-06-20 Storage path setting method and device using file counter and computer equipment Active CN110399346B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910537911.0A CN110399346B (en) 2019-06-20 2019-06-20 Storage path setting method and device using file counter and computer equipment
PCT/CN2019/103543 WO2020252929A1 (en) 2019-06-20 2019-08-30 Method and apparatus for configuring storage path by using file counter, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910537911.0A CN110399346B (en) 2019-06-20 2019-06-20 Storage path setting method and device using file counter and computer equipment

Publications (2)

Publication Number Publication Date
CN110399346A CN110399346A (en) 2019-11-01
CN110399346B true CN110399346B (en) 2024-01-16

Family

ID=68323276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910537911.0A Active CN110399346B (en) 2019-06-20 2019-06-20 Storage path setting method and device using file counter and computer equipment

Country Status (2)

Country Link
CN (1) CN110399346B (en)
WO (1) WO2020252929A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281769A (en) * 2021-12-14 2022-04-05 北京天融信网络安全技术有限公司 File management method, device, computer equipment and storage medium on disk

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010112636A (en) * 2000-06-14 2001-12-20 이데이 노부유끼 Information processing apparatus, information processing method, information management system, and program storage medium
CN102769752A (en) * 2012-07-25 2012-11-07 北京汉王智通科技有限公司 JPEG image compression method and system
CN107133357A (en) * 2017-05-26 2017-09-05 维沃移动通信有限公司 A kind of picture storage method and mobile terminal
CN107239522A (en) * 2017-05-26 2017-10-10 努比亚技术有限公司 Picture storage method, equipment and computer-readable storage medium
CN108319524A (en) * 2018-02-02 2018-07-24 郑州云海信息技术有限公司 A kind of method and device that baseboard management controller passes through KVM carry files
CN108595589A (en) * 2018-04-19 2018-09-28 中国科学院电子学研究所苏州研究院 A kind of efficient access method of magnanimity science data picture

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110023081A (en) * 2009-08-28 2011-03-08 삼성전자주식회사 A control method of a digital photographing apparatus having a memory having a limited space, a recording medium recording the method, and a digital photographing apparatus operating according to the method
WO2012056493A1 (en) * 2010-10-26 2012-05-03 Hitachi, Ltd. File management method and computer system
US9542328B2 (en) * 2015-01-26 2017-01-10 International Business Machines Corporation Dynamically controlling a file system write cache
US9319563B1 (en) * 2015-02-05 2016-04-19 Kabushiki Kaisha Toshiba Image processing device and method for processing image data
US11100049B2 (en) * 2015-09-27 2021-08-24 Saurabh A. Prakash Customizable browser for computer filesystem and electronic mail
WO2017056072A1 (en) * 2015-10-01 2017-04-06 Pacbyte Software Pty Ltd Method and system for preparing data files for transmission over a data network
CN107239543A (en) * 2017-06-05 2017-10-10 深圳天珑无线科技有限公司 Application icon processing method and processing device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010112636A (en) * 2000-06-14 2001-12-20 이데이 노부유끼 Information processing apparatus, information processing method, information management system, and program storage medium
CN102769752A (en) * 2012-07-25 2012-11-07 北京汉王智通科技有限公司 JPEG image compression method and system
CN107133357A (en) * 2017-05-26 2017-09-05 维沃移动通信有限公司 A kind of picture storage method and mobile terminal
CN107239522A (en) * 2017-05-26 2017-10-10 努比亚技术有限公司 Picture storage method, equipment and computer-readable storage medium
CN108319524A (en) * 2018-02-02 2018-07-24 郑州云海信息技术有限公司 A kind of method and device that baseboard management controller passes through KVM carry files
CN108595589A (en) * 2018-04-19 2018-09-28 中国科学院电子学研究所苏州研究院 A kind of efficient access method of magnanimity science data picture

Also Published As

Publication number Publication date
CN110399346A (en) 2019-11-01
WO2020252929A1 (en) 2020-12-24

Similar Documents

Publication Publication Date Title
CN110348315B (en) Method and device for dynamically updating human face feature base and human face snapshot system
US10169900B2 (en) Picture processing method and apparatus
CN108399052B (en) Picture compression method and device, computer equipment and storage medium
CN104408428B (en) Method and device for processing photos in same scene
CN110049310B (en) Video image acquisition method and device, video quality detection method and device
CN108063818B (en) Data downloading method, device, terminal and computer readable storage medium
US20210182043A1 (en) App pushing method, device, electronic device and computer-readable storage medium
US9602565B2 (en) Video processing system, video content monitoring method, video processing apparatus, control method of the apparatus, and storage medium storing control program of the apparatus
CN111445487B (en) Image segmentation method, device, computer equipment and storage medium
CN114139015A (en) Video storage method, device, equipment and medium based on key event identification
WO2015027882A1 (en) Method, apparatus and terminal for image processing
CN110942455A (en) Method and device for detecting missing of cotter pin of power transmission line and computer equipment
CN110659373A (en) Image retrieval method, image retrieval device, computer device and storage medium
CN111091146B (en) Picture similarity obtaining method and device, computer equipment and storage medium
CN110399346B (en) Storage path setting method and device using file counter and computer equipment
CN104349169B (en) A kind of image processing method and electronic equipment
CN111860590B (en) License plate voting method, license plate voting device, computer equipment and storage medium
CN109859142B (en) Image brightness adjusting method and device, computer equipment and storage medium
CN112714040A (en) Holographic message detection method, device, equipment and storage medium
CN104580913A (en) Picture continuous shooting method and device
US9076207B1 (en) Image processing method, system and electronic device
CN111985531B (en) Method, device, equipment and storage medium for determining abnormal resource demand cluster
CN110365927B (en) Video recording method, video recording device, storage medium and computer equipment
CN117667481A (en) Nef file repairing method, device, equipment and storage medium
US20150085194A1 (en) Still image provision device

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
GR01 Patent grant
GR01 Patent grant