CN108255989B - Picture storage method and device, terminal equipment and computer storage medium - Google Patents

Picture storage method and device, terminal equipment and computer storage medium Download PDF

Info

Publication number
CN108255989B
CN108255989B CN201711466472.6A CN201711466472A CN108255989B CN 108255989 B CN108255989 B CN 108255989B CN 201711466472 A CN201711466472 A CN 201711466472A CN 108255989 B CN108255989 B CN 108255989B
Authority
CN
China
Prior art keywords
picture
storage
stored
file
storing
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
CN201711466472.6A
Other languages
Chinese (zh)
Other versions
CN108255989A (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.)
Shenzhen Infinova Ltd
Original Assignee
Shenzhen Infinova 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 Shenzhen Infinova Ltd filed Critical Shenzhen Infinova Ltd
Priority to CN201711466472.6A priority Critical patent/CN108255989B/en
Publication of CN108255989A publication Critical patent/CN108255989A/en
Application granted granted Critical
Publication of CN108255989B publication Critical patent/CN108255989B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (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 invention is suitable for the technical field of picture storage, and provides a picture storage method, a device, terminal equipment and a computer storage medium, wherein the picture storage method comprises the following steps: initializing a server, and generating a storage device information file, an index file and a picture storage file according to a preset rule; when receiving storage request information of a picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored; if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file. The invention manages the pictures by creating the picture storage files in advance, and solves the problem of unstable system caused by file fragments generated by frequently deleting and creating the picture files.

Description

Picture storage method and device, terminal equipment and computer storage medium
Technical Field
The invention belongs to the technical field of picture storage, and particularly relates to a picture storage method and device, terminal equipment and a computer storage medium.
Background
The image server needs to manage a large amount of image files, when the storage space is insufficient, old image files need to be deleted according to a certain rule, new files need to be created, and file fragments can be generated by deleting the created files for a long time, so that the stability of the system is influenced.
Therefore, a new technical solution is needed to solve the above technical problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide a picture storage method, an apparatus, a terminal device, and a computer storage medium, so as to solve the problem in the prior art that a system is unstable due to file fragments generated by frequently deleting and creating picture files.
A first aspect of an embodiment of the present invention provides a picture storage method, including:
initializing a server, and generating a storage device information file, an index file and a picture storage file according to a preset rule;
when receiving storage request information of a picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored;
if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file.
A second aspect of an embodiment of the present invention provides a picture storage apparatus, including:
the initialization module is used for initializing the server and generating a storage device information file, an index file and a picture storage file according to a preset rule;
the detection module is used for detecting whether a storage space is reserved in the picture storage file for storing the picture to be stored or not when the storage request information of the picture to be stored is received;
and the storage module is used for storing the picture to be stored into the picture storage file if a storage space is reserved in the picture storage file for storing the picture to be stored, newly adding the index information of the picture to be stored into the index file, and updating the storage equipment information file.
A third aspect of embodiments of the present invention provides a picture storage terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as provided in the first aspect above.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the embodiment of the invention generates the picture storage file in advance, and then stores the picture into the picture storage file if the picture storage file has space storage. The pictures are managed in a mode of creating the picture storage files in advance, the problem that when the picture files are stored directly, due to frequent deletion and creation of fragments, a system is unstable is solved, the generation of file fragments is reduced, and the stability of the system is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a picture storage method according to an embodiment of the present invention;
fig. 2 is a picture storing flow chart of a picture storing method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a picture storage device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a picture storage terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example one
Fig. 1 shows an implementation flow of a picture storage method provided in an embodiment of the present invention, where an execution subject of the method may be a terminal device, which is detailed as follows:
step S101, initializing a server, and generating a storage device information file, an index file and a picture storage file according to a predetermined rule.
In the embodiment of the invention, the picture server is initialized, and the storage device information file, the index file and the picture storage file are generated according to the preset rule.
Optionally, the predetermined rule includes calculating the number of folders and files to be pre-generated according to information of the hard disk or other storage devices, the number of files generated by a single folder, and the size of a single file; for a certain hard disk, the number of folders may be (hard disk capacity-hard disk information file-reserved space-folder index file)/(N × Size).
Optionally, taking a storage device as a hard disk as an example, the storage location of the storage device information file is a first partition (corresponding to a disk space) of a first hard disk, and mainly includes general description information of the hard disk: storing the whole information description (working disk sequence, hard disk partition type, total hard disk number and the like), and the folder information in use (folder name, total space of folder, remaining space of folder, picture of earliest time, picture of latest time and the like); and each hard disk information: general hard disk description information (number of partitions, general hard disk space and remaining space, whether in a covered state, number of times of covering, earliest late time picture timestamp, etc.), folder information for each partition (folder name, general folder space, folder remaining space, number of folder files, earliest time picture, latest time picture, etc.), and file information in each folder (file name, general file space and remaining space, earliest late time picture timestamp, etc.).
Optionally, the index file stores an index of all file storage contents, and the index includes the following contents: the picture creating time, the picture size, the file name of the picture, the position of the picture in the file, the picture format and the like.
Optionally, the picture storage file may be used to store a file of pictures, and the file content includes: total space of the file, space already written, remaining space, location currently written, and pictures stored sequentially.
Step S102, when receiving the storage request information of the picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored.
In the embodiment of the present invention, optionally, when a request for storing a picture is received, the picture storage files are sequentially detected from far to near according to the modification time of the picture storage files until the picture storage files have a space for storing the picture to be stored.
Further, according to the modification time of the image storage files, the image storage files in the same folder are detected from far to near; after the detection of the file folder is finished, if no picture storage file with a storage space is detected, detecting the next file folder; when all folders are detected, namely partitions to which the folders belong are detected, if no picture storage file with a storage space is detected, detecting the next partition; and when all the partitions are detected, namely after the hard disk to which the partitions belong is detected, if no picture storage file with storage space is detected, detecting the next hard disk.
Step S103, if yes, storing the picture to be stored in the picture storage file, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
In the embodiment of the present invention, optionally, after the detection is performed on the picture storage file, if the picture storage file has a space for storage, an index is added to the index file, information of the picture in the file is recorded, and a picture access address is generated. The picture access address comprises a server IP + hard disk, a partition name + folder name + picture name, and the picture name can be named by adopting a current timestamp + sequence, so that a plurality of pictures can be stored in the same second.
Illustratively, the picture access address: http://192.168.1.100/sda1/image 1/1510916093-0. jpg.
Further, when a user needs to acquire a picture, the user only needs to request a picture access address to acquire the hard disk, the folder information and the picture name information, so that a related index file is found, corresponding picture index information is found in the index file, and the picture is acquired according to the index information.
Optionally, if it is detected that there is not enough storage space in the picture storage file to store the to-be-stored picture, detecting the picture storage file according to a preset rule until there is enough space in the picture storage file to store the to-be-stored file, and performing a picture storage process as shown in fig. 2:
firstly, after a picture server acquires a picture storage request, detecting whether a storage space is available in the picture storage file for storing the picture to be stored: if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file; if not, sequentially detecting whether other picture storage files in a folder containing the picture storage files have enough storage space to store the pictures to be stored according to the sequence from far to near of the modification time of the picture storage files: if so, storing the picture to be stored into the picture storage file stored in the space, and adding an index record of the picture to be stored into an index file in the folder; if not, detecting whether a storage space exists in the disk space of the folder for storing the picture to be stored: if so, storing the picture to be stored in the disk space, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file; if not, detecting whether the hard disk has a storage space for storing the picture to be stored: if so, storing the picture to be stored to the hard disk, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file; if not, detecting whether other hard disks have storage spaces for storing the pictures to be stored: if so, storing the picture to be stored to any hard disk with a storage space in the other hard disks, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file; if not, clearing the pictures stored in the picture storage file, deleting the index information corresponding to the cleared pictures, storing the pictures to be stored into the picture storage file, adding the index information of the pictures to be stored into the index file, and updating the storage equipment information file.
Optionally, when there is not enough storage space to store the to-be-stored picture after traversing all the picture storage files in the folder, sequentially detecting whether there is a space for storing the to-be-stored picture in other folders in the disk space including the folder according to a sequence from far to near of modification time of the folder. And if the picture to be stored is stored in the space, storing the picture to be stored in the picture storage file stored in the space, and adding the index record of the picture to be stored in the index file in the folder.
Optionally, when there is still insufficient storage space to store the to-be-stored picture after traversing all folders in the disk space, sequentially detecting whether there is a picture storage file in other disk spaces in the hard disk including the disk space to store the to-be-stored picture according to a sequence from far to near of modification time of the disk space. And if the picture to be stored is stored in the space, storing the picture to be stored in the picture storage file stored in the space, and adding the index record of the picture to be stored in the index file in the folder.
Optionally, when there is not enough storage space to store the to-be-stored picture after traversing the hard disk, detecting whether a picture storage file of a next hard disk has a space to store the to-be-stored picture. And if the picture to be stored is stored in the space, storing the picture to be stored in the picture storage file stored in the space, and adding the index record of the picture to be stored in the index file in the folder.
Further, if there is no space for storing the to-be-stored picture in the picture storage file, it indicates that all the storage spaces are full of pictures. At this time, according to the sequence of the modification time of the picture storage files from far to near, the pictures stored in the first picture storage file are emptied, the index information corresponding to the emptied pictures is deleted, the pictures to be stored are stored in the picture storage file, the index information of the pictures to be stored is newly added in the index file, and the storage equipment information file is updated. Namely, the pictures in the picture storage file are covered, and since the pictures are stored sequentially for a single file, in the covering process, all the pictures in the file are covered, that is, all the indexes of the pictures in the file are also all cleared, wherein the pictures in the file are covered by taking the file as a unit.
Therefore, the embodiment of the invention generates the storage equipment information file, the index file and the picture storage file according to the preset rule; when receiving storage request information of a picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored; if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file. The picture files are managed in a mode of distributing the picture storage files in advance, and the problem that when the picture files are directly stored, file fragments are generated due to frequent creation and deletion, and therefore the system is unstable is solved. Frequent deletion and creation of files can be avoided, and the stability of the system is enhanced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example two
Fig. 3 shows a block diagram of a picture storage device according to an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. The picture storage apparatus 3 includes: an initialization module 31, a detection module 32 and a storage module 33.
The initialization module 31 is configured to initialize a server, and generate a storage device information file, an index file, and an image storage file according to a predetermined rule;
the detection module 32 is configured to detect whether a storage space exists in the picture storage file for storing the picture to be stored when receiving storage request information of the picture to be stored;
and the storage module 33 is configured to store the to-be-stored picture to the picture storage file if there is a storage space in the picture storage file for storing the to-be-stored picture, add the index information of the to-be-stored picture to the index file, and update the storage device information file.
Optionally, the picture storage device 3 further includes:
the folder detection module is used for detecting whether a storage space is available in a folder containing the picture storage file for storing the picture to be stored if the picture storage file does not have enough storage space for storing the picture to be stored;
if the folder containing the picture storage file has a storage space for storing the picture to be stored, storing the picture to be stored in the folder, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
Optionally, the picture storage device 3 further includes:
the disk detection module is used for detecting whether a disk space where the folder is located has a storage space for storing the picture to be stored or not if the folder containing the picture storage file does not have enough storage space for storing the picture to be stored;
if the disk space has a storage space for storing the picture to be stored, storing the picture to be stored in the disk space, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
Optionally, the picture storage device 3 further includes:
the hard disk detection module is used for storing the picture to be stored to the hard disk if the hard disk has a storage space for storing the picture to be stored, newly adding the index information of the picture to be stored in the index file and updating the storage equipment information file;
if the hard disk does not have enough storage space to store the picture to be stored, detecting whether other hard disks have storage spaces to store the picture to be stored, if the other hard disks have storage spaces to store the picture to be stored, storing the picture to be stored to any hard disk of the other hard disks, which has the storage space, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
Optionally, the picture storage device 3 further includes:
and the covering module is used for emptying the pictures stored in the picture storage file if the other hard disks do not have enough storage space for storing the pictures to be stored, deleting the index information corresponding to the emptied pictures, storing the pictures to be stored in the picture storage file, newly adding the index information of the pictures to be stored in the index file, and updating the storage equipment information file.
Optionally, the index information includes:
the storage time of the picture to be stored, the size and the format of the picture to be stored and the access address of the picture to be stored.
EXAMPLE III
Fig. 4 is a schematic diagram of a picture storage terminal device according to an embodiment of the present invention. As shown in fig. 4, the picture storage terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42, such as a picture storage program, stored in said memory 41 and executable on said processor 40. The processor 40, when executing the computer program 42, implements the steps in the above-described embodiments of the picture storage method, such as the steps 101 to 103 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 31 to 33 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the picture storage terminal device 4. For example, the computer program 42 may be divided into an initialization module, a detection module, and a storage module, and the specific functions of each module are as follows:
the initialization module is used for initializing the server and generating a storage device information file, an index file and a picture storage file according to a preset rule;
the detection module is used for detecting whether a storage space is reserved in the picture storage file for storing the picture to be stored or not when the storage request information of the picture to be stored is received;
and the storage module is used for storing the picture to be stored into the picture storage file if a storage space is reserved in the picture storage file for storing the picture to be stored, newly adding the index information of the picture to be stored into the index file, and updating the storage equipment information file.
The picture storage terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The picture storage terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the picture storage terminal device 4, and does not constitute a limitation of the picture storage terminal device 4, and may include more or less components than those shown, or combine some components, or different components, for example, the picture storage terminal device may further include an input-output device, a network access device, a bus, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the picture storage terminal device 4, such as a hard disk or a memory of the picture storage terminal device 4. The memory 41 may also be an external storage device of the picture storage terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the picture storage terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the picture storage terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the picture storage terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
As can be seen from the above, the embodiment of the present invention initializes the server, and generates the storage device information file, the index file, and the picture storage file according to the predetermined rule; when receiving storage request information of a picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored; if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file. The picture storage file is generated in advance to store the picture, so that the problem that the system is unstable due to fragments generated by frequent deletion and creation when the picture file is directly processed is solved, and the stability of the system is improved.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (7)

1. A picture storage method, comprising:
initializing a server, and generating a storage device information file, an index file and a picture storage file according to a preset rule; the preset rule comprises the steps of calculating the number of folders and files needing to be generated in advance according to the information of the hard disk or other storage equipment, wherein the number of the files generated by a single folder and the size of the single file are calculated;
when receiving the storage request information of the picture to be stored, detecting whether a storage space is available in the picture storage file for storing the picture to be stored, specifically: according to the modification time of the picture storage files, detecting the picture storage files in the same folder from far to near, and after the detection of the folders is finished, if the picture storage files with storage spaces are not detected, detecting the next folder until all the folders are detected;
if so, storing the picture to be stored in the picture storage file, newly adding the index information of the picture to be stored in the index file, generating a picture access address, and updating the storage equipment information file; the picture access address comprises a server IP + hard disk, a partition name + folder name + picture name;
if the picture storage file does not have enough storage space for storing the picture to be stored, detecting whether a folder containing the picture storage file has storage space for storing the picture to be stored;
if a storage space is reserved in a folder containing the picture storage file for storing the picture to be stored, storing the picture to be stored in the folder, adding the index information of the picture to be stored in the index file, and updating the storage equipment information file;
if the folder containing the picture storage file does not have enough storage space for storing the picture to be stored, detecting whether a disk space where the folder is located has storage space for storing the picture to be stored;
if the disk space has a storage space for storing the picture to be stored, storing the picture to be stored in the disk space, adding the index information of the picture to be stored in the index file, and updating the storage equipment information file;
if the disk space does not have enough storage space to store the picture to be stored, detecting whether the hard disk has storage space to store the picture to be stored;
if the hard disk has a storage space for storing the picture to be stored, storing the picture to be stored to the hard disk, newly adding the index information of the picture to be stored in the index file, and updating the storage equipment information file;
if the hard disk does not have enough storage space to store the picture to be stored, detecting whether other hard disks have storage spaces to store the picture to be stored, if the other hard disks have storage spaces to store the picture to be stored, storing the picture to be stored to any hard disk of the other hard disks, which has the storage space, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
2. The picture storage method according to claim 1, further comprising:
if the other hard disks do not have enough storage space to store the picture to be stored, emptying the picture stored in the picture storage file, deleting the index information corresponding to the emptied picture, storing the picture to be stored in the picture storage file, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
3. The picture storage method according to claim 1 or 2, wherein the index information includes:
the storage time of the picture to be stored, the size and the format of the picture to be stored and the access address of the picture to be stored.
4. A picture storage device, comprising:
the initialization module is used for initializing the server and generating a storage device information file, an index file and a picture storage file according to a preset rule; the preset rule comprises the steps of calculating the number of folders and files needing to be generated in advance according to the information of the hard disk or other storage equipment, wherein the number of the files generated by a single folder and the size of the single file are calculated;
the detection module is used for detecting whether a storage space is reserved in the picture storage file for storing the picture to be stored when receiving the storage request information of the picture to be stored, and specifically comprises the following steps: according to the modification time of the picture storage files, detecting the picture storage files in the same folder from far to near, and after the detection of the folders is finished, if the picture storage files with storage spaces are not detected, detecting the next folder until all the folders are detected;
the storage module is used for storing the picture to be stored into the picture storage file if the picture storage file has a storage space for storing the picture to be stored, newly adding the index information of the picture to be stored into the index file, generating a picture access address and updating the storage equipment information file; the picture access address comprises a server IP + hard disk, a partition name + folder name + picture name;
the folder detection module is used for detecting whether a storage space is available in a folder containing the picture storage file for storing the picture to be stored if the picture storage file does not have enough storage space for storing the picture to be stored; if a storage space is reserved in a folder containing the picture storage file for storing the picture to be stored, storing the picture to be stored in the folder, adding the index information of the picture to be stored in the index file, and updating the storage equipment information file;
the disk detection module is used for detecting whether a disk space where the folder is located has a storage space for storing the picture to be stored or not if the folder containing the picture storage file does not have enough storage space for storing the picture to be stored; if the disk space has a storage space for storing the picture to be stored, storing the picture to be stored in the disk space, adding the index information of the picture to be stored in the index file, and updating the storage equipment information file;
the hard disk detection module is used for storing the picture to be stored to the hard disk if the hard disk has a storage space for storing the picture to be stored, newly adding the index information of the picture to be stored in the index file and updating the storage equipment information file; if the hard disk does not have enough storage space to store the picture to be stored, detecting whether other hard disks have storage spaces to store the picture to be stored, if the other hard disks have storage spaces to store the picture to be stored, storing the picture to be stored to any hard disk of the other hard disks, which has the storage space, adding the index information of the picture to be stored in the index file, and updating the storage device information file.
5. The storage device of claim 4, wherein the index information comprises:
the storage time of the picture to be stored, the size and the format of the picture to be stored and the access address of the picture to be stored.
6. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 3 when executing the computer program.
7. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201711466472.6A 2017-12-28 2017-12-28 Picture storage method and device, terminal equipment and computer storage medium Active CN108255989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711466472.6A CN108255989B (en) 2017-12-28 2017-12-28 Picture storage method and device, terminal equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711466472.6A CN108255989B (en) 2017-12-28 2017-12-28 Picture storage method and device, terminal equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN108255989A CN108255989A (en) 2018-07-06
CN108255989B true CN108255989B (en) 2021-05-14

Family

ID=62724458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711466472.6A Active CN108255989B (en) 2017-12-28 2017-12-28 Picture storage method and device, terminal equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN108255989B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522282B (en) * 2018-09-29 2024-02-02 中国平安人寿保险股份有限公司 Picture management method, device, computer device and storage medium
CN111209159A (en) * 2019-12-31 2020-05-29 中国建设银行股份有限公司 Information processing method, device, equipment and storage medium
CN113495970A (en) * 2020-04-01 2021-10-12 深圳云天励飞技术有限公司 Picture retrieval method and device and electronic equipment
CN114496176B (en) * 2022-04-06 2022-09-27 广州思德医疗科技有限公司 Picture storage and extraction method, system and storage medium
CN117150059B (en) * 2023-10-27 2024-02-13 湖南视觉伟业智能科技有限公司 Fragmented image data storage method based on NVR equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102200978A (en) * 2010-03-26 2011-09-28 宁波Gqy视讯股份有限公司 Data real-time storage method, data real-time storage device and data real-time storage system in data transmission
CN105068761A (en) * 2015-07-31 2015-11-18 广东浩亚信息科技有限公司 Easy-to-retrieve video screenshot storing method and system
CN106326393A (en) * 2016-08-17 2017-01-11 东方网力科技股份有限公司 Method and device for storing and reading small picture
CN107239522A (en) * 2017-05-26 2017-10-10 努比亚技术有限公司 Picture storage method, equipment and computer-readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6260049B1 (en) * 1998-11-10 2001-07-10 Electronic Paper Solutions, Inc. Automated shelf management system and process for tracking and purging file folders in a file storage facility

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102200978A (en) * 2010-03-26 2011-09-28 宁波Gqy视讯股份有限公司 Data real-time storage method, data real-time storage device and data real-time storage system in data transmission
CN105068761A (en) * 2015-07-31 2015-11-18 广东浩亚信息科技有限公司 Easy-to-retrieve video screenshot storing method and system
CN106326393A (en) * 2016-08-17 2017-01-11 东方网力科技股份有限公司 Method and device for storing and reading small picture
CN107239522A (en) * 2017-05-26 2017-10-10 努比亚技术有限公司 Picture storage method, equipment and computer-readable storage medium

Also Published As

Publication number Publication date
CN108255989A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN108255989B (en) Picture storage method and device, terminal equipment and computer storage medium
US11537556B2 (en) Optimized content object storage service for large scale content
US9514139B2 (en) Space efficient cascading point in time copying
CN109522314B (en) Block chain-based data archiving method and terminal equipment
JP2012089094A5 (en)
KR20190076197A (en) Apparatus and method for storing data based on blockchain
CN109804359A (en) For the system and method by write back data to storage equipment
US9003151B2 (en) Methods and systems for data cleanup using physical image of files on storage devices
CN111125034A (en) Aggregation object data processing method, system and related equipment
CN109376126B (en) File or folder processing method, mobile terminal and storage medium
CN105242879A (en) Data storage method and protocol server
JP2022159405A (en) Method and device for appending data, electronic device, storage medium, and computer program
CN109918352A (en) The method of storage system and storing data
US10423580B2 (en) Storage and compression of an aggregation file
CN115129257A (en) Data reading and writing method, electronic equipment and computer readable storage medium
CN114138558A (en) Object storage method and device, electronic equipment and storage medium
CN111143240B (en) Image storage method, system and terminal equipment
CN111143092B (en) Fault recording data processing method, system and terminal equipment
CN113127438B (en) Method, apparatus, server and medium for storing data
CN106528876B (en) The information processing method and distributed information processing system of distributed system
CN110019040B (en) Folder processing method, mobile terminal and storage medium
US20120317387A1 (en) Fast copy using file system block mappings
CN115544981A (en) Document processing method, document processing device, electronic device, storage medium, and program product
CN112269665B (en) Memory processing method and device, electronic equipment and storage medium
US11640339B2 (en) Creating a backup data set

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