WO2020252929A1 - 利用文件计数器的存储路径设置方法、装置和计算机设备 - Google Patents
利用文件计数器的存储路径设置方法、装置和计算机设备 Download PDFInfo
- Publication number
- WO2020252929A1 WO2020252929A1 PCT/CN2019/103543 CN2019103543W WO2020252929A1 WO 2020252929 A1 WO2020252929 A1 WO 2020252929A1 CN 2019103543 W CN2019103543 W CN 2019103543W WO 2020252929 A1 WO2020252929 A1 WO 2020252929A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- preset
- file
- threshold
- folder
- storage
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
Definitions
- This application relates to the field of computers, and in particular to a storage path setting method, device, computer equipment and storage medium using a file counter.
- the storage terminal in the traditional technology generally uses rough storage for files. For example, all files are stored in the default storage folder. When the developer finds that the file storage capacity in the default storage folder is too large, then dump it. To other storage folders, the number of files in a single folder is too large, and it is not convenient to find and call files.
- the main purpose of this application is to provide a storage path setting method, device, computer equipment and storage medium using a file counter, aiming to automatically control the number of files in a folder, facilitate file management, and improve the efficiency of file processing.
- this application proposes a storage path setting method using a file counter, which is applied to a storage terminal and includes:
- the file storage path of the storage terminal is set to point to the preset designated folder, where the number of files in the designated folder is less than the preset number threshold. The number of files in the default storage folder.
- This application provides a storage path setting device using a file counter, which is applied to a storage terminal, and includes:
- the designated picture receiving unit is used to receive the designated picture uploaded by the upload terminal;
- a size threshold judging unit for judging whether the file size of the designated picture is greater than a preset size threshold
- the first predetermined value increasing unit is configured to increase the count of the preset file counter by a first predetermined value if the file size of the designated picture is greater than a preset size threshold;
- a reading threshold judging unit configured to obtain the current reading of the document counter, and judge whether the current reading of the document counter is greater than a preset reading threshold
- the quantity threshold judging unit is configured to, if the current reading of the file counter is greater than the preset reading threshold, reset the count of the file counter to zero, and judge whether the number of files in the default storage folder is greater than the preset quantity threshold ;
- the storage path setting unit is configured to, if the number of files in the default storage folder is greater than a preset number threshold, set the file storage path of the storage terminal to point to a preset designated folder, where the designated folder is The number of files in is less than the number of files in the default storage folder.
- the present application provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the above methods when the computer program is executed.
- the present application provides a non-volatile computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
- the storage path setting method, device, computer equipment, and storage medium of the file counter of the present application receive the specified picture uploaded by the upload terminal; if the file size of the specified picture is greater than the preset size threshold, the preset file counter If the current reading of the file counter is greater than the preset reading threshold, clear the count of the file counter to zero; if the number of files in the default storage folder is greater than the preset number threshold, Then, the file storage path of the storage terminal is set to point to a preset designated folder. This realizes automatic control of the number of files in the folder and facilitates file management.
- FIG. 1 is a schematic flowchart of a storage path setting method using a file counter according to an embodiment of the application
- FIG. 2 is a schematic block diagram of the structure of a storage path setting device using a file counter according to an embodiment of the application;
- FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
- an embodiment of the present application provides a storage path setting method using a file counter, applied to a storage terminal, and includes:
- the file storage path of the storage terminal is set to point to the preset designated folder, where the number of files in the designated folder is less than The number of files in the default storage folder.
- this application uses a preset file counter to determine whether the number of files in the default storage folder should be determined, and then whether the storage path should be updated, so as to solve the defects caused by the crude storage of the traditional technology.
- the designated picture uploaded by the upload terminal is received.
- the designated picture may be any type of picture, such as a landscape picture, a human face picture, etc.
- the storage terminal (for example, a storage server) is used to serve the upload terminal.
- step S2 it is determined whether the file size of the designated picture is greater than a preset size threshold.
- a preset size threshold There may be only one designated picture or multiple pictures. When there is only one designated picture, only one judgment is required. When there are multiple designated pictures, multiple judgments are made to determine whether the file sizes of the designated pictures are larger than a preset size threshold.
- the preset file counter is increased by a first predetermined value.
- the preset file counter is a counter preset in the storage terminal used to calculate the storage file. When there is a file to be stored, the reading of the counter is increased by a certain value, so that the storage can be known through the counter The number of files.
- the first predetermined value may be an exemplary value, and is preferably greater than or equal to 1. Further, if there are multiple designated pictures, when there are n designated pictures larger than a preset size threshold, the count of the preset file counter is increased by n times the first predetermined value.
- this application uses a file counter to perform preliminary calculations on the file storage status, so as to avoid the unnecessary calculation burden caused by judging the number of files in the default storage folder when storing any picture file.
- the current reading of the file counter is acquired, and it is determined whether the current reading of the file counter is greater than a preset reading threshold.
- the current reading of the file counter is greater than the preset reading threshold, it indicates that the storage status of the current default storage folder needs to be verified to determine whether the storage burden is too heavy.
- the current reading of the file counter is not greater than the preset reading threshold, it indicates that the file storage status of the current default storage folder does not need to be verified.
- 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 greater than the preset reading threshold, it indicates that the number of files in the default storage folder needs to be verified, and at the same time, the count of the file counter is cleared to determine whether the default storage folder needs to be verified for the next time Prepare for the number of documents.
- the default storage folder refers to the storage folder used to directly store files in the storage terminal, that is, the folder pointed to by the default storage path.
- the file storage path of the storage terminal is set to point to the preset designated folder, where the designated folder is The number of files in is less than the number of files in the default storage folder. Accordingly, the number of stored files in a single storage folder can be made not greater than the sum of the preset number threshold and the number of files represented by the preset reading threshold, while avoiding storage of any picture file to be judged in the default storage folder Unnecessary calculation burden caused by the number of files.
- the designated folder may be an empty folder, or a folder that has stored files, preferably a newly created empty folder.
- the storage terminal is used to store a face picture
- the step S2 of judging whether the file size of the specified picture is greater than a preset size threshold includes:
- S202 Use a preset contour difference algorithm to compare the contour of the image with a preset standard face contour to obtain a difference degree value
- S203 Determine whether the difference degree value is less than a preset difference threshold
- the storage terminal in this embodiment is used to store face pictures. Therefore, in order to avoid storing pictures by mistake, a preset contour difference algorithm is used to determine whether a specified picture is a face picture.
- a preset contour difference algorithm is used to determine whether a specified picture is a face picture.
- any feasible rule can be used to extract the contour of the image in the specified picture, because this type of contour extraction method is a mature algorithm (for example, the continuous pixel points with the difference of the three primary color values within a predetermined range are taken as the same area, thereby drawing the contour ), I won’t repeat it here.
- the process of using a preset contour difference algorithm to compare the contour of the image with a preset standard face contour to obtain a difference degree value is, for example, comparing the highest point of the contour of the image with the standard The highest point of the face contour coincides; the contour of the image is stretched in an equal proportion, so that the lowest point of the contour of the image coincides with the lowest point of the standard face contour; the image after the equal proportion stretch operation is calculated The difference between the area of the contour of and the area of the standard face contour, and the difference between the areas is used as the difference degree value.
- the designated picture is a face picture, and then it is determined whether the file size of the designated picture is greater than the preset size threshold.
- the above-mentioned contour difference algorithm that uses the difference in area as the difference degree value is adopted, compared with other algorithms, it consumes less computing power and is more suitable for preliminary judgment of whether the picture is a face picture (only simple judgment is required) That's it).
- the method includes:
- the file storage path of the storage terminal is set to point to a preset designated folder. If the file size of the designated picture is not greater than the preset size threshold, it indicates that the designated picture occupies a smaller storage space, and the same storage space can store more designated pictures not greater than the preset size threshold.
- the count of the preset file counter is increased by a second predetermined value, wherein the second predetermined value is smaller than the first predetermined value.
- the second predetermined value is preferably less than or equal to 1.
- this embodiment can make the number of stored files in a single storage folder not greater than the sum of the preset number threshold and the number of files represented by the preset reading threshold, while avoiding the storage of any picture file to determine the default storage The unnecessary calculation burden caused by the number of files in the folder.
- the designated folder may be an empty folder, or a folder that has stored files, preferably a newly created empty folder.
- the step S3 of increasing the count of the preset file counter by a first predetermined value includes :
- M p a A + p b B, the calculated value M, where p a present file size is greater than a preset sheet size threshold of said plurality of copies to picture image, there is a specified picture p b pictures whose file size is not greater than the preset size threshold, A and B are both preset fixed values, where A is greater than B;
- the count of the preset file counter is increased by the value M according to a plurality of designated pictures.
- p a pictures with a file size greater than a preset size threshold in the specified pictures and p b pictures with a file size not greater than the preset size threshold exist in the specified pictures
- a and B are both preset fixed values, where A is greater than B.
- the preset file counter is adapted to the situation of uploading multiple specified pictures.
- A is preferably greater than or equal to 1
- B is preferably less than or equal to 1.
- the method includes:
- the specified picture is saved.
- the file counter is used for preliminary calculation of the file storage status. If the current reading of the file counter is not greater than the preset reading threshold, it indicates that the condition for verifying the default storage folder has not been met, that is, the current storage burden of the default storage folder is considered It is acceptable, so keep the current storage path, where the current storage path is the path to the default storage folder. Therefore, according to the current storage path, the specified picture is saved to the default storage folder pointed to by the current storage path.
- the default folder stores picture files of the same type, and if the current reading of the file counter is greater than a preset reading threshold, the count of the file counter is cleared, and the default storage is determined Before step S5 of whether the number of files in the folder is greater than the preset number threshold, the method includes:
- S421 Analyze the default folder, so as to obtain the type of the picture file stored in the default folder;
- the number threshold corresponding to the default folder is acquired.
- this embodiment uses the default folder to store the same type of picture files, but the average file size of different types of picture files is different (for example, face pictures are compared with simple cartoon pictures). The file size is larger), and different thresholds should be set accordingly. Accordingly, the corresponding relationship between the type and the number threshold is preset, and the preset corresponding relationship between the type and the number threshold is used to obtain the number threshold corresponding to the default folder according to the type of the picture file.
- the process of analyzing the default folder to obtain the type of picture file stored in the default folder is, for example, analyzing the attribute of the default folder, extracting the storage file type from the attribute, that is, obtaining all The type of picture files stored in the default folder; or, analyzing the files stored in the default folder to obtain the type of picture files stored in the default folder.
- the file storage path of the storage terminal is set to point to a preset designated folder, wherein the designated folder.
- S602 Modify the last-level subdirectory of the path pointing to the default storage folder to the designated folder, so as to obtain the designated path pointing to the designated folder;
- the file storage path of the storage terminal is set to point to a preset designated folder.
- a newly constructed folder is used as a designated folder, so as to prevent old files from interfering with file storage management.
- the last-level subdirectory of the current path pointing to the default storage folder is modified to the designated folder to obtain the designated path pointing to the designated folder, and the file storage path of the storage terminal is set For the specified path, there is no need to rebuild the storage path, and the new and old storage folders belong to the same parent directory to facilitate file management.
- the storage path setting method using a file counter of the present application receives a designated picture uploaded by an upload terminal; if the file size of the designated picture is greater than a preset size threshold, the count of the preset file counter is increased by a first predetermined value; If the current reading of the file counter is greater than the preset reading threshold, the count of the file counter is cleared; if the number of files in the default storage folder is greater than the preset number threshold, the file in the storage terminal The storage path is set to point to the preset specified folder. This realizes automatic control of the number of files in the folder and facilitates file management.
- an embodiment of the present application provides a storage path setting device using a file counter, which is applied to a storage terminal, and includes:
- the designated picture receiving unit 10 is configured to receive the designated picture uploaded by the upload terminal;
- the size threshold judging unit 20 is configured to judge whether the file size of the designated picture is greater than a preset size threshold
- the first predetermined value increasing unit 30 is configured to increase the count of the preset file counter by a first predetermined value if the file size of the designated picture is greater than a preset size threshold;
- the reading threshold judging unit 40 is configured to obtain the current reading of the document counter and judge whether the current reading of the document counter is greater than a preset reading threshold;
- the quantity threshold judging unit 50 is configured to, if the current reading of the file counter is greater than the preset reading threshold, reset the count of the file counter to zero, and judge whether the number of files in the default storage folder is greater than the preset number Threshold
- the storage path setting unit 60 is configured to, if the number of files in the default storage folder is greater than a preset number threshold, set the file storage path of the storage terminal to point to a preset designated folder, where the designated folder The number of files in is less than the number of files in the default storage folder.
- the size threshold judgment unit 20 includes:
- the contour extraction subunit is used to extract the contour of the image in the specified picture by using a preset contour extraction rule
- the contour comparison subunit is used to compare the contour of the image with the preset standard face contour by using a preset contour difference algorithm, so as to obtain a difference degree value;
- the difference threshold judgment subunit is used to judge whether the difference degree value is less than a preset difference threshold
- the size threshold determination subunit is configured to determine whether the file size of the specified picture is greater than the preset size threshold if the difference degree value is less than a preset difference threshold.
- the device includes:
- the second predetermined value increasing unit is configured to, if the file size of the designated picture is not greater than the preset size threshold, increase the count of the preset file counter by a second predetermined value, wherein the second predetermined value is smaller than the First predetermined value
- a reading threshold judging unit configured to obtain the current reading of the document counter, and judge whether the current reading of the document counter is greater than a preset reading threshold
- the file quantity judging unit is configured to, if the current reading of the file counter is greater than the preset reading threshold, clear the count of the file counter, and determine whether the number of files in the default storage folder is greater than the preset number threshold ;
- the storage path setting unit is configured to, if the number of files in the default storage folder is greater than a preset number threshold, set the file storage path of the storage terminal to point to a preset designated folder, where the designated folder is The number of files in is less than the number of files in the default storage folder.
- the first predetermined value increasing unit 30 includes:
- M p a A+p b B.
- p a pictures whose file size is greater than the preset size threshold.
- p b pictures whose file size is not greater than the preset size threshold in the specified pictures, A and B are both preset fixed values, where A is greater than B;
- the increase value M subunit is used to increase the value M of the preset file counter.
- the device includes:
- the storage path holding unit is configured to maintain the current storage path if the current reading of the file counter is not greater than the preset reading threshold;
- the saving unit is configured to save the designated picture in the default storage folder pointed to by the current storage path according to the current storage path.
- the default folder stores picture files of the same type
- the device includes:
- the quantity threshold obtaining unit is configured to obtain the quantity threshold corresponding to the default folder according to the type of the picture file by using the preset correspondence relationship between the type and the quantity threshold.
- the storage path setting unit 60 includes:
- Create a new designated folder subunit which is used to create a new designated folder in the parent directory of the default storage folder if the number of files in the default storage folder is greater than a preset number threshold;
- a subdirectory modification subunit for modifying the last level subdirectory of the path pointing to the default storage folder to the designated folder, so as to obtain the designated path pointing to the designated folder;
- the storage path setting subunit is used to set the file storage path of the storage terminal to the specified path.
- the storage path setting device using a file counter of the present application receives a designated picture uploaded by an upload terminal; if the file size of the designated picture is greater than a preset size threshold, the count of the preset file counter is increased by a first predetermined value; If the current reading of the file counter is greater than the preset reading threshold, the count of the file counter is cleared; if the number of files in the default storage folder is greater than the preset number threshold, the file in the storage terminal The storage path is set to point to the preset specified folder. This realizes automatic control of the number of files in the folder and facilitates file management.
- an embodiment of the present application also provides a computer device.
- the computer device may be a server, and its internal structure may be as shown in the figure.
- the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus.
- the computer designed processor is used to provide calculation 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 memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
- the database of the computer device is used to store the data used in the storage path setting method using the file counter.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer program is executed by the processor to realize a storage path setting method using a file counter.
- the above-mentioned processor executes the storage path setting method using the file counter, wherein the steps included in the method respectively correspond to the steps of executing the storage path setting method using the file counter of the foregoing embodiment, and will not be repeated here.
- the computer device of this application receives a designated picture uploaded by an upload terminal; if the file size of the designated picture is greater than a preset size threshold, the count of the preset file counter is increased by a first predetermined value; if the file counter is The current reading is greater than the preset reading threshold, then the count of the file counter is cleared; 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 the preset Set the designated folder. This realizes automatic control of the number of files in the folder and facilitates file management.
- An embodiment of the present application also provides a non-volatile computer-readable storage medium on which a computer program is stored.
- a method for setting a storage path using a file counter is implemented, wherein the method includes The steps respectively correspond to the steps of performing the storage path setting method using the file counter of the foregoing embodiment, and will not be repeated here.
- the non-volatile computer-readable storage medium of the present application receives a designated picture uploaded by an upload terminal; if the file size of the designated picture is greater than a preset size threshold, the count of the preset file counter is increased by a first predetermined If the current reading of the file counter is greater than the preset reading threshold, the count of the file counter is cleared; if the number of files in the default storage folder is greater than the preset number threshold, the storage terminal The file storage path is set to point to the preset specified folder. This realizes automatic control of the number of files in the folder and facilitates file management.
- Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory may include random access memory (RAM) or external cache memory.
- RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), 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), etc.
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
一种利用文件计数器的存储路径设置方法、装置、计算机设备和存储介质,所述方法包括:接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理,提高文件处理效率。
Description
本申请要求于2019年6月20日提交中国专利局、申请号为201910537911.0,发明名称为“利用文件计数器的存储路径设置方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及到计算机领域,特别是涉及到一种利用文件计数器的存储路径设置方法、装置、计算机设备和存储介质。
传统技术中的存储终端对于文件的存储方式一般是采用粗犷式存储,例如将所有文件均存储至默认存储文件夹,当开发人员发觉默认存储文件夹中的文件存储量太大后,再转存至其他存储文件夹,从而使单个文件夹的文件数目过大,不便于查找与调用文件。发明人意识到现有技术在文件的存储方面缺少能够控制文件数量以便于文件管理(例如查找与调用文件)的技术方案。
本申请的主要目的为提供一种利用文件计数器的存储路径设置方法、装置、计算机设备和存储介质,旨在实现自动控制文件夹的文件数量,方便文件管理,提高文件处理的效率。
为了实现上述发明目的,本申请提出一种利用文件计数器的存储路径设置方法,应用于存储终端,包括:
接收上传终端上传的指定图片;
判断所述指定图片的文件大小是否大于预设的大小阈值;
若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;
获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
本申请提供一种利用文件计数器的存储路径设置装置,应用于存储终端,包括:
指定图片接收单元,用于接收上传终端上传的指定图片;
大小阈值判断单元,用于判断所述指定图片的文件大小是否大于预设的大小阈值;
第一预定数值增加单元,用于若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;
读数阈值判断单元,用于获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
数量阈值判断单元,用于若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
存储路径设置单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述方法的步骤。
本申请提供一种非易失性的计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。
本申请的利用文件计数器的存储路径设置方法、装置、计算机设备和存储介质,接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理。
图1 为本申请一实施例的利用文件计数器的存储路径设置方法的流程示意图;
图2 为本申请一实施例的利用文件计数器的存储路径设置装置的结构示意框图;
图3 为本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种利用文件计数器的存储路径设置方法,应用于存储终端,包括:
S1、接收上传终端上传的指定图片;
S2、判断所述指定图片的文件大小是否大于预设的大小阈值;
S3、若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;
S4、获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
S5、若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
S6、若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
现有技术在文件的存储方面缺少能够控制文件数量以便于文件管理(例如查找与调用文件)的技术方案。对于此,本申请采用预设的文件计数器来判断是否应该判断默认存储文件夹中的文件数量,进而判断是否应该更新存储路径,以解决传统技术的粗犷式存储所带来的缺陷。
如上述步骤S1所述,接收上传终端上传的指定图片。其中所述上传终端与所述存储终端存在信号连接关系,上传终端将想要保存的图片文件上传至存储终端进行保存。其中所述指定图片可以为任意类型的图片,例如风景图片、人脸图片等。所述存储终端(例如为存储服务器)用于服务所述上传终端。
如上述步骤S2所述,判断所述指定图片的文件大小是否大于预设的大小阈值。其中所述指定图片可以仅存在一张,也可以存在多张。当所述指定图片仅存在一张时,仅进行一次判断即可。当所述指定图片存在多张时,分别进行多次判断,以确定多张所述指定图片的文件大小是否分别大于预设的大小阈值。
如上述步骤S3所述,若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值。其中预设的文件计数器是所述存储终端中预设的用于计算与所述存储文件相关的计数器,当有文件需要存储时,则将计数器的读数增加一定数值,从而通过计数器即可知道存储的文件数量。其中第一预定数值可以为例意数值,优选为大于等于1。进一步地,若所述指定图片存在多张,当有n张指定图片大于预设的大小阈值时,则将预设的文件计数器的计数增加n乘以所述第一预定数值。进一步地,若存在m张指定图片不大于预设的大小阈值时,则将预设的文件计数器的计数增加m乘以所述第二预定数值,其中第二预定数值小于第一预定数值。据此,本申请采用文件计数器以对文件存储状况进行初步计算,以避免存储任意一张图片文件均进行判断默认存储文件夹中的文件数量而导致的无谓的计算负担。
如上述步骤S4所述,获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值。当所述文件计数器的当前读数大于预设的读数阈值时,则表明当前的默认存储文件夹的存储状况有必要进行核实,以确定存储负担是否过重。当所述文件计数器的当前读数不大于预设的读数阈值时,则表明当前的默认存储文件夹的文件存储状况无需进行核实。
如上述步骤S5所述,若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值。若所述文件计数器的当前读数大于预设的读数阈值,表明需要核实默认存储文件夹中的文件数量,同时将所述文件计数器的计数清零,为下一次判断是否需要核实默认存储文件夹中的文件数量做准备。其中默认存储文件夹,是指在存储终端中用于直接存储文件的存储文件夹,即默认存储路径所指向的文件夹。
如上述步骤S6所述,若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。据此,可以使得单个存储文件夹中的存储文件数量不大于预设的数量阈值与预设的读数阈值代表的文件数量之和,同时避免存储任意一张图片文件均进行判断默认存储文件夹中的文件数量而导致的无谓的计算负担。其中所述指定文件夹可以为空的文件夹,也可以为已存储有文件的文件夹,优选为新建的空的文件夹。
在一个实施方式中,所述存储终端用于存储人脸图片,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤S2,包括:
S201、采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;
S202、利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;
S203、判断所述差异程度值是否小于预设的差异阈值;
S204、若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
如上所述,实现了判断所述指定图片的文件大小是否大于预设的大小阈值。本实施方式中的所述存储终端用于存储人脸图片,因此为了避免误存图片,采用了预设的轮廓差异算法以确定指定图片是否人脸图片。其中,提取所述指定图片中的图像的轮廓可以采用任意可行规则,由于此类轮廓提取方法为已成熟算法(例如将三原色值差异在预定范围内的连续像素点作为相同区域,从而勾画出轮廓),在此不再赘述。其中利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值的过程,例如为:将所述图像的轮廓的最高点与所述标准人脸轮廓最高点重合;将所述图像的轮廓进行等比例拉伸操作,以使所述图像的轮廓的最低点与所述标准人脸轮廓最低点重合;计算等比例拉伸操作后的图像的轮廓的面积与所述标准人脸轮廓的面积之差,并将所述面积之差作为所述差异程度值。另外,也可以将等比例拉伸操作后的图像的轮廓与所述标准人脸轮廓的未重合程度(例如将图像的轮廓超出人脸轮廓的面积A1、以及人脸轮廓未被图像的轮廓填充的面积A2作为计算因素,利用公式:差异程度值= M×A1+N×A2,其中M、N分别为可为负值的权重参数)作为所述差异程度值等。在此声明,上述举例仅为一种轮廓差异算法,本申请还可适用于任意可行的轮廓差异算法。据此,若所述差异程度值小于预设的差异阈值,则所述指定图片为人脸图片,再判断所述指定图片的文件大小是否大于预设的大小阈值。从而避免了图片误存的可能。其中,若采用上述将所述面积之差作为所述差异程度值的轮廓差异算法,相较于其他算法,消耗的算力更小,更适应于初步判断图片是否为人脸图片(仅需简单判断即可)。
在一个实施方式中,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤S2之后,包括:
ST3、若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;
ST4、获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
ST5、若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
ST6、若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
如上所述,实现了将所述存储终端的文件存储路径设置为指向预设的指定文件夹。若所述指定图片的文件大小不大于预设的大小阈值,表明所述指定图片所占存储空间更小,相同的存储空间可以存储更多的不大于预设的大小阈值指定图片,因此则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值。其中第二预定数值优选小于等于1。据此,本实施方式可以使得单个存储文件夹中的存储文件数量不大于预设的数量阈值与预设的读数阈值代表的文件数量之和,同时避免存储任意一张图片文件均进行判断默认存储文件夹中的文件数量而导致的无谓的计算负担。其中所述指定文件夹可以为空的文件夹,也可以为已存储有文件的文件夹,优选为新建的空的文件夹。
在一个实施方式中,所述指定图片存在多张,所述若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值的步骤S3,包括:
S301、根据公式:M=p
aA+p
bB,计算出数值M,其中多张所述指定图片中存在p
a张文件大小大于预设的大小阈值的图片,所述指定图片中存在p
b张文件大小不大于预设的大小阈值的图片,A、B均为预设固定数值,其中A大于B;
S302、将预设的文件计数器的计数增加数值M。
如上所述,实现了根据多张指定图片,将预设的文件计数器的计数增加数值M。本实施方式中,所述上传终端一次上传了多张指定图片,因此将所述文件计数器的计数增加数值M,其中M根据公式:M=p
aA+p
bB得到,其中多张所述指定图片中存在p
a张文件大小大于预设的大小阈值的图片,所述指定图片中存在p
b张文件大小不大于预设的大小阈值的图片,A、B均为预设固定数值,其中A大于B。据此使预设的文件计数器适应于多张指定图片上传的境况。其中A优选大于等于1, B优选择小于等于1。
在一个实施方式中,所述获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值的步骤S4之后,包括:
S411、若所述文件计数器的当前读数不大于预设的读数阈值,则保持当前的存储路径;
S412、根据当前的存储路径,将所述指定图片保存至当前的存储路径指向的默认存储文件夹中。
如上所述,实现了保存指定图片。文件计数器用于对文件存储状况进行初步计算,若所述文件计数器的当前读数不大于预设的读数阈值,表明未达到核实默认存储文件夹的条件,即默认存储文件夹当前的存储负担被视为可接受,因此保持当前的存储路径,其中当前的存储路径即是指向默认存储文件夹的路径。因此根据当前的存储路径,将所述指定图片保存至当前的存储路径指向的默认存储文件夹中。
在一个实施方式中,所述默认文件夹存储同一类型的图片文件,所述若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值的步骤S5之前,包括:
S421、分析所述默认文件夹,从而获取所述默认文件夹存储的图片文件的类型;
S422、利用预设的类型与数量阈值的对应关系,根据所述图片文件的类型,获取与所述默认文件夹对应的数量阈值。
如上所述,实现了获取与所述默认文件夹对应的数量阈值。为了分类存储,以实现文件的针对性管理,本实施方式采用默认文件夹存储同一类型的图片文件,而不同类型的图片文件的平均文件大小不同(例如人脸图片相较于简单的卡通图片的文件大小更大),相应的应该设置不同的数量阈值。据此预先设置有类型与数量阈值的对应关系,再利用预设的类型与数量阈值的对应关系,根据所述图片文件的类型,获取与所述默认文件夹对应的数量阈值。其中,分析所述默认文件夹,从而获取所述默认文件夹存储的图片文件的类型的过程例如为:分析所述默认文件夹的属性,从所述属性中提取出存储文件类型,即获取所述默认文件夹存储的图片文件的类型;或者,分析所述默认文件夹中存储的文件,从而获取所述默认文件夹存储的图片文件的类型。
在一个实施方式中,所述若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量的步骤S6,包括:
S601、若默认存储文件夹中的文件数量大于预设的数量阈值,则在所述默认存储文件夹的上级目录中新建指定文件夹;
S602、将指向所述默认存储文件夹的路径的最后一级子目录修改为所述指定文件夹,从而得到指向所述指定文件夹的指定路径;
S603、将所述存储终端的文件存储路径设置为所述指定路径。
如上所述,实现了将所述存储终端的文件存储路径设置为指向预设的指定文件夹。本实施方式采用新建设的文件夹作为指定文件夹,从而避免旧文件干扰文件存储管理。并且采用对当前的指向所述默认存储文件夹的路径的最后一级子目录修改为所述指定文件夹,从而得到指向所述指定文件夹的指定路径,将所述存储终端的文件存储路径设置为所述指定路径,从而无需重新构建存储路径,并且使新旧两个存储文件夹同属于相同的父目录下,以方便文件管理。
本申请的利用文件计数器的存储路径设置方法,接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理。
参照图2,本申请实施例提供一种利用文件计数器的存储路径设置装置,应用于存储终端,包括:
指定图片接收单元10,用于接收上传终端上传的指定图片;
大小阈值判断单元20,用于判断所述指定图片的文件大小是否大于预设的大小阈值;
第一预定数值增加单元30,用于若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;
读数阈值判断单元40,用于获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
数量阈值判断单元50,用于若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
存储路径设置单元60,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
其中上述单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述大小阈值判断单元20,包括:
轮廓提取子单元,用于采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;
轮廓对比子单元,用于利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;
差异阈值判断子单元,用于判断所述差异程度值是否小于预设的差异阈值;
大小阈值判断子单元,用于若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
其中上述子单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述装置,包括:
第二预定数值增加单元,用于若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;
读数阈值判断单元,用于获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;
文件数量判断单元,用于若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;
存储路径设置单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
其中上述单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述指定图片存在多张,所述第一预定数值增加单元30,包括:
数值M计算子单元,用于根据公式:M=p
aA+p
bB,计算出数值M,其中多张所述指定图片中存在p
a张文件大小大于预设的大小阈值的图片,所述指定图片中存在p
b张文件大小不大于预设的大小阈值的图片,A、B均为预设固定数值,其中A大于B;
增加数值M子单元,用于将预设的文件计数器的计数增加数值M。
其中上述子单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述装置,包括:
存储路径保持单元,用于若所述文件计数器的当前读数不大于预设的读数阈值,则保持当前的存储路径;
保存单元,用于根据当前的存储路径,将所述指定图片保存至当前的存储路径指向的默认存储文件夹中。
其中上述单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述默认文件夹存储同一类型的图片文件,所述装置,包括:
分析单元,用于分析所述默认文件夹,从而获取所述默认文件夹存储的图片文件的类型;
数量阈值获取单元,用于利用预设的类型与数量阈值的对应关系,根据所述图片文件的类型,获取与所述默认文件夹对应的数量阈值。
其中上述单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述存储路径设置单元60,包括:
新建指定文件夹子单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则在所述默认存储文件夹的上级目录中新建指定文件夹;
子目录修改子单元,用于将指向所述默认存储文件夹的路径的最后一级子目录修改为所述指定文件夹,从而得到指向所述指定文件夹的指定路径;
存储路径设置子单元,用于将所述存储终端的文件存储路径设置为所述指定路径。
其中上述子单元分别用于执行的操作与前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
本申请的利用文件计数器的存储路径设置装置,接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储利用文件计数器的存储路径设置方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种利用文件计数器的存储路径设置方法。
上述处理器执行上述利用文件计数器的存储路径设置方法,其中所述方法包括的步骤分别与执行前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
本领域技术人员可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。
本申请的计算机设备,接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理。
本申请一实施例还提供一种非易失性的计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现利用文件计数器的存储路径设置方法,其中所述方法包括的步骤分别与执行前述实施方式的利用文件计数器的存储路径设置方法的步骤一一对应,在此不再赘述。
本申请的非易失性的计算机可读存储介质,接收上传终端上传的指定图片;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹。从而实现了自动控制文件夹的文件数量,方便文件管理。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种利用文件计数器的存储路径设置方法,其特征在于,应用于存储终端,包括:接收上传终端上传的指定图片;判断所述指定图片的文件大小是否大于预设的大小阈值;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述存储终端用于存储人脸图片,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤,包括:采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;判断所述差异程度值是否小于预设的差异阈值;若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤之后,包括:若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述指定图片存在多张,所述若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值的步骤,包括:根据公式:M=p aA+p bB,计算出数值M,其中多张所述指定图片中存在p a张文件大小大于预设的大小阈值的图片,所述指定图片中存在p b张文件大小不大于预设的大小阈值的图片,A、B均为预设固定数值,其中A大于B;将预设的文件计数器的计数增加数值M。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值的步骤之后,包括:若所述文件计数器的当前读数不大于预设的读数阈值,则保持当前的存储路径;根据当前的存储路径,将所述指定图片保存至当前的存储路径指向的默认存储文件夹中。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述默认文件夹存储同一类型的图片文件,所述若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值的步骤之前,包括:分析所述默认文件夹,从而获取所述默认文件夹存储的图片文件的类型;利用预设的类型与数量阈值的对应关系,根据所述图片文件的类型,获取与所述默认文件夹对应的数量阈值。
- 根据权利要求1所述的利用文件计数器的存储路径设置方法,其特征在于,所述若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量的步骤,包括:若默认存储文件夹中的文件数量大于预设的数量阈值,则在所述默认存储文件夹的上级目录中新建指定文件夹;将指向所述默认存储文件夹的路径的最后一级子目录修改为所述指定文件夹,从而得到指向所述指定文件夹的指定路径;将所述存储终端的文件存储路径设置为所述指定路径。
- 一种利用文件计数器的存储路径设置装置,其特征在于,应用于存储终端,包括:指定图片接收单元,用于接收上传终端上传的指定图片;大小阈值判断单元,用于判断所述指定图片的文件大小是否大于预设的大小阈值;第一预定数值增加单元,用于若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;读数阈值判断单元,用于获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;数量阈值判断单元,用于若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;存储路径设置单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述大小阈值判断单元,包括:轮廓提取子单元,用于采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;轮廓对比子单元,用于利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;差异阈值判断子单元,用于判断所述差异程度值是否小于预设的差异阈值;大小阈值判断子单元,用于若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述装置,包括:第二预定数值增加单元,用于若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;读数阈值判断单元,用于获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;文件数量判断单元,用于若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;存储路径设置单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述指定图片存在多张,所述第一预定数值增加单元,包括:数值M计算子单元,用于根据公式:M=p aA+p bB,计算出数值M,其中多张所述指定图片中存在p a张文件大小大于预设的大小阈值的图片,所述指定图片中存在p b张文件大小不大于预设的大小阈值的图片,A、B均为预设固定数值,其中A大于B;增加数值M子单元,用于将预设的文件计数器的计数增加数值M。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述装置,包括:存储路径保持单元,用于若所述文件计数器的当前读数不大于预设的读数阈值,则保持当前的存储路径;保存单元,用于根据当前的存储路径,将所述指定图片保存至当前的存储路径指向的默认存储文件夹中。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述默认文件夹存储同一类型的图片文件,所述装置,包括:分析单元,用于分析所述默认文件夹,从而获取所述默认文件夹存储的图片文件的类型;数量阈值获取单元,用于利用预设的类型与数量阈值的对应关系,根据所述图片文件的类型,获取与所述默认文件夹对应的数量阈值。
- 根据权利要求8所述的利用文件计数器的存储路径设置装置,其特征在于,所述存储路径设置单元,包括:新建指定文件夹子单元,用于若默认存储文件夹中的文件数量大于预设的数量阈值,则在所述默认存储文件夹的上级目录中新建指定文件夹;子目录修改子单元,用于将指向所述默认存储文件夹的路径的最后一级子目录修改为所述指定文件夹,从而得到指向所述指定文件夹的指定路径;存储路径设置子单元,用于将所述存储终端的文件存储路径设置为所述指定路径。
- 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现利用文件计数器的存储路径设置方法,所述利用文件计数器的存储路径设置方法,包括:接收上传终端上传的指定图片;判断所述指定图片的文件大小是否大于预设的大小阈值;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求15所述的计算机设备,其特征在于,所述存储终端用于存储人脸图片,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤,包括:采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;判断所述差异程度值是否小于预设的差异阈值;若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
- 根据权利要求15所述的计算机设备,其特征在于,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤之后,包括:若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 一种非易失性的计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现利用文件计数器的存储路径设置方法,所述利用文件计数器的存储路径设置方法,包括:接收上传终端上传的指定图片;判断所述指定图片的文件大小是否大于预设的大小阈值;若所述指定图片的文件大小大于预设的大小阈值,则将预设的文件计数器的计数增加第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
- 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述存储终端用于存储人脸图片,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤,包括:采用预设的轮廓提取规则,提取所述指定图片中的图像的轮廓;利用预设的轮廓差异算法,将所述图像的轮廓与预设的标准人脸轮廓进行对比,从而获得差异程度值;判断所述差异程度值是否小于预设的差异阈值;若所述差异程度值小于预设的差异阈值,则判断所述指定图片的文件大小是否大于预设的大小阈值。
- 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述判断所述指定图片的文件大小是否大于预设的大小阈值的步骤之后,包括:若所述指定图片的文件大小不大于预设的大小阈值,则将预设的文件计数器的计数增加第二预定数值,其中所述第二预定数值小于所述第一预定数值;获取所述文件计数器的当前读数,并判断所述文件计数器的当前读数是否大于预设的读数阈值;若所述文件计数器的当前读数大于预设的读数阈值,则将所述文件计数器的计数清零,并判断默认存储文件夹中的文件数量是否大于预设的数量阈值;若默认存储文件夹中的文件数量大于预设的数量阈值,则将所述存储终端的文件存储路径设置为指向预设的指定文件夹,其中所述指定文件夹中的文件数量少于所述默认存储文件夹中的文件数量。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910537911.0 | 2019-06-20 | ||
| CN201910537911.0A CN110399346B (zh) | 2019-06-20 | 2019-06-20 | 利用文件计数器的存储路径设置方法、装置和计算机设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020252929A1 true WO2020252929A1 (zh) | 2020-12-24 |
Family
ID=68323276
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/103543 Ceased WO2020252929A1 (zh) | 2019-06-20 | 2019-08-30 | 利用文件计数器的存储路径设置方法、装置和计算机设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110399346B (zh) |
| WO (1) | WO2020252929A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114281769A (zh) * | 2021-12-14 | 2022-04-05 | 北京天融信网络安全技术有限公司 | 磁盘上文件管理方法、装置、计算机设备及存储介质 |
| CN115878576A (zh) * | 2022-12-27 | 2023-03-31 | 湖北天融信网络安全技术有限公司 | 一种数据存储的处理方法及装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102769752A (zh) * | 2012-07-25 | 2012-11-07 | 北京汉王智通科技有限公司 | 一种jpeg图像压缩方法和系统 |
| US9319563B1 (en) * | 2015-02-05 | 2016-04-19 | Kabushiki Kaisha Toshiba | Image processing device and method for processing image data |
| CN107133357A (zh) * | 2017-05-26 | 2017-09-05 | 维沃移动通信有限公司 | 一种图片存储方法及移动终端 |
| CN107239543A (zh) * | 2017-06-05 | 2017-10-10 | 深圳天珑无线科技有限公司 | 应用图标处理方法及装置 |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4419282B2 (ja) * | 2000-06-14 | 2010-02-24 | ソニー株式会社 | 情報処理装置、情報処理方法、および情報管理システム、並びにプログラム格納媒体 |
| KR20110023081A (ko) * | 2009-08-28 | 2011-03-08 | 삼성전자주식회사 | 한정된 공간을 갖는 메모리를 구비하는 디지털 촬영 장치의 제어 방법, 상기 방법을 기록한 기록 매체, 상기 방법에 따라 동작하는 디지털 촬영 장치 |
| 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 |
| CA3000096A1 (en) * | 2015-09-27 | 2017-03-30 | Saurabh A. PRAKASH | Customizable browser for computer filesystem and electronic mail |
| US20200019535A1 (en) * | 2015-10-01 | 2020-01-16 | PacByte Solutions Pty Ltd | Method and system for preparing data files for transmission over a data network |
| CN107239522A (zh) * | 2017-05-26 | 2017-10-10 | 努比亚技术有限公司 | 图片存储方法、设备和计算机存储介质 |
| CN108319524A (zh) * | 2018-02-02 | 2018-07-24 | 郑州云海信息技术有限公司 | 一种基板管理控制器通过kvm挂载文件夹的方法及装置 |
| CN108595589A (zh) * | 2018-04-19 | 2018-09-28 | 中国科学院电子学研究所苏州研究院 | 一种海量科学数据图片高效存取方法 |
-
2019
- 2019-06-20 CN CN201910537911.0A patent/CN110399346B/zh active Active
- 2019-08-30 WO PCT/CN2019/103543 patent/WO2020252929A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102769752A (zh) * | 2012-07-25 | 2012-11-07 | 北京汉王智通科技有限公司 | 一种jpeg图像压缩方法和系统 |
| US9319563B1 (en) * | 2015-02-05 | 2016-04-19 | Kabushiki Kaisha Toshiba | Image processing device and method for processing image data |
| CN107133357A (zh) * | 2017-05-26 | 2017-09-05 | 维沃移动通信有限公司 | 一种图片存储方法及移动终端 |
| CN107239543A (zh) * | 2017-06-05 | 2017-10-10 | 深圳天珑无线科技有限公司 | 应用图标处理方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110399346A (zh) | 2019-11-01 |
| CN110399346B (zh) | 2024-01-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8527651B2 (en) | Content identification method and system, and SCIDM client and server | |
| WO2020143317A1 (zh) | 分片文件验证方法及终端设备 | |
| WO2020143325A1 (zh) | 一种电子文档的生成方法及设备 | |
| US20070180265A1 (en) | Film management method | |
| WO2021036810A1 (zh) | 证据的验证方法、系统、装置、设备及可读存储介质 | |
| US9934390B2 (en) | Data redaction system | |
| US20140019594A1 (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 | |
| CN106649721B (zh) | 一种文件排重方法和装置 | |
| WO2021120480A1 (zh) | 基于图像识别的取证方法、系统、计算机设备及存储介质 | |
| US10771358B2 (en) | Data acquisition device, data acquisition method and storage medium | |
| CN106708951A (zh) | 支持所有权认证的客户端图像模糊去重方法 | |
| WO2020252929A1 (zh) | 利用文件计数器的存储路径设置方法、装置和计算机设备 | |
| WO2022100250A1 (zh) | 图像融合方法、装置、计算机设备和存储介质 | |
| WO2020238556A1 (zh) | 基于配置平台的数据传输方法、装置和计算机设备 | |
| CN105260639A (zh) | 一种脸部识别系统的数据更新的方法及装置 | |
| CN109859142B (zh) | 图像亮度的调节方法、装置、计算机设备和存储介质 | |
| CN116645527A (zh) | 图像识别方法、系统、电子设备和存储介质 | |
| WO2021139448A1 (zh) | 基于多个源模型修正新模型的方法、装置以及计算机设备 | |
| WO2021022875A1 (zh) | 数据的分布式存储方法及系统 | |
| EP3805929B1 (en) | Computing system performing image backup and image backup method | |
| CN113810433B (zh) | 文件上传方法、装置和计算机设备 | |
| US20160110531A1 (en) | Information processing apparatus, terminal apparatus and information processing method | |
| CN108255703B (zh) | 一种sql脚本的故障修复方法及其终端 | |
| CN119356595B (zh) | 基于动态申请内存的数据部署方法、设备以及存储介质 | |
| US10831368B2 (en) | Local storage memory management for a mobile device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19934280 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19934280 Country of ref document: EP Kind code of ref document: A1 |