CN111367869A - Mirror image file processing method and device, storage medium and electronic equipment - Google Patents

Mirror image file processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111367869A
CN111367869A CN202010120756.5A CN202010120756A CN111367869A CN 111367869 A CN111367869 A CN 111367869A CN 202010120756 A CN202010120756 A CN 202010120756A CN 111367869 A CN111367869 A CN 111367869A
Authority
CN
China
Prior art keywords
image file
metadata information
information corresponding
mirror image
storage medium
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010120756.5A
Other languages
Chinese (zh)
Inventor
李培培
胡伟
杨杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202010120756.5A priority Critical patent/CN111367869A/en
Publication of CN111367869A publication Critical patent/CN111367869A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Abstract

The disclosure relates to a mirror image file processing method and device, a storage medium and an electronic device. The method comprises the following steps: in response to receiving an image file uploading request, determining whether metadata information corresponding to the image file exists or not; under the condition that the metadata information corresponding to the image file does not exist, generating storage path information corresponding to the image file according to the unique identification code, wherein the storage path information generated according to different unique identification codes is different; sending a storage request to a mirror image storage medium; and adding metadata information corresponding to the image file. By the technical scheme, the phenomenon that the image file is deleted by mistake due to the fact that the storage path information of the newly uploaded image file is consistent with that of the image file to be deleted can be prevented, and therefore the problem of image file deletion is avoided. And when the image file is deleted, the uploading operation does not need to be stopped, and the normal uploading of the image file is not influenced, so that the normal processing of the image file is ensured.

Description

Mirror image file processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an image file, a storage medium, and an electronic device.
Background
The mirror files may include a manifest file and a layer file, and one mirror may refer to one manifest file and a plurality of layer files. The image files are stored in the image storage medium, and in order to release the storage space of the image storage medium, the unreferenced image files need to be deleted.
The image file deleting method and the image uploading method adopted by the related technology can cause the problem that the image file is deleted by mistake when the deleting and the uploading are carried out simultaneously. Therefore, when the storage space of the image storage medium is released, the uploading operation of the image file needs to be stopped in the process of deleting the image file in the related art, so that the normal processing of the image file is affected.
Disclosure of Invention
The present disclosure is directed to a method and an apparatus for processing an image file, a storage medium, and an electronic device, so as to solve the problems in the related art.
In order to achieve the above object, in a first aspect, there is provided a mirroring method, including:
in response to receiving an image file uploading request, determining whether metadata information corresponding to the image file exists or not;
under the condition that the metadata information corresponding to the image file does not exist, generating storage path information corresponding to the image file according to unique identification codes, wherein the storage path information generated according to different unique identification codes is different;
sending a storage request to a mirror image storage medium, wherein the storage request comprises the storage path information so that the mirror image storage medium stores the mirror image file according to the storage path information;
and adding metadata information corresponding to the mirror image file.
Optionally, the method further comprises:
under the condition that the metadata information corresponding to the image file is determined to exist, lock resources of the metadata information corresponding to the image file are obtained;
and under the condition of acquiring the lock resource, modifying the updating time in the metadata information corresponding to the image file according to the current time.
Optionally, the method further comprises:
marking a first metadata information set corresponding to the currently referenced image file according to the reference relation between the image and the image file, and recording the marking start time;
determining a second metadata information set corresponding to the image file which is not referred to currently according to the first metadata information set;
determining a target image file to be deleted according to the second metadata information set; and executing deletion operation aiming at the target image file to be deleted.
Optionally, the determining, according to the second metadata information set, a target image file to be deleted includes:
and for each piece of metadata information in the second metadata information set, determining the image file corresponding to the piece of metadata information as the target image file to be deleted under the condition that the updating time in the piece of metadata information is earlier than the mark starting time.
Optionally, the executing the delete operation includes:
acquiring a lock resource of metadata information corresponding to the target image file; under the condition of acquiring the lock resource, deleting metadata information corresponding to the target image file;
and sending a deletion request to a mirror image storage medium, wherein the deletion request comprises storage path information corresponding to the target mirror image file, so that the mirror image storage medium deletes the target mirror image file according to the storage path information.
Optionally, the method further comprises:
analyzing the metadata file currently stored in the mirror image storage medium, and storing the obtained metadata information and the reference relation between the mirror image and the mirror image file as records of a database to the database.
In a second aspect, there is provided an image processing apparatus, the apparatus including:
the device comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is configured to respond to the received image file uploading request and determine whether metadata information corresponding to the image file exists or not;
the generating module is configured to generate storage path information corresponding to the image file according to unique identification codes under the condition that the metadata information corresponding to the image file does not exist, wherein the storage path information generated according to different unique identification codes is different;
a sending module configured to send a storage request to a mirror image storage medium, where the storage request includes the storage path information, so that the mirror image storage medium stores the mirror image file according to the storage path information;
and the adding module is configured to add the metadata information corresponding to the image file.
Optionally, the apparatus further comprises:
the acquisition module is configured to acquire a lock resource of the metadata information corresponding to the image file under the condition that the metadata information corresponding to the image file is determined to exist;
and the modifying module is configured to modify the updating time in the metadata information corresponding to the image file according to the current time under the condition of acquiring the lock resource.
Optionally, the apparatus further comprises:
the marking module is configured to mark a first metadata information set corresponding to a currently referred mirror image file according to the reference relation between the mirror image and the mirror image file, and record marking start time;
the second determining module is configured to determine a second metadata information set corresponding to the image file which is not referred to currently according to the first metadata information set;
a third determining module configured to determine a target image file to be deleted according to the second metadata information set;
and the execution module is configured to execute deletion operation aiming at the target image file to be deleted.
Optionally, the third determining module is configured to, for each piece of metadata information in the second set of metadata information, determine, as the target image file to be deleted, an image file corresponding to the piece of metadata information if an update time in the piece of metadata information is earlier than the mark start time.
Optionally, the execution module includes:
the acquisition submodule is configured to acquire a lock resource of metadata information corresponding to the target image file;
the deleting submodule is configured to delete the metadata information corresponding to the target image file under the condition that the lock resource is acquired;
the sending submodule is configured to send a deletion request to an image storage medium, where the deletion request includes storage path information corresponding to the target image file, so that the image storage medium deletes the target image file according to the storage path information.
Optionally, the apparatus further comprises:
and the analysis module is configured to analyze the metadata file currently stored in the mirror image storage medium, and store the obtained metadata information and the reference relation between the mirror image and the mirror image file as records of a database in the database.
In a third aspect, a computer readable storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of the method provided by the first aspect of the disclosure.
In a fourth aspect, an electronic device is provided, comprising: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method provided by the first aspect of the present disclosure.
In the technical scheme, the storage path information corresponding to the image file is generated according to the unique identification code, wherein the storage path information generated according to different unique identification codes is different. By adding the unique identification code in the storage path information, even if the same image file is uploaded at different moments, the storage path information generated according to the unique identification code is different, so that the phenomenon that the image file is deleted by mistake due to the fact that the newly uploaded image file is consistent with the storage path information of the image file to be deleted can be prevented, and the problem of image file deletion is avoided. And when the image file is deleted, the uploading operation does not need to be stopped, and the normal uploading of the image file is not influenced, so that the normal processing of the image file is ensured.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flowchart illustrating a method of image file processing according to an exemplary embodiment.
FIG. 2 is a flowchart illustrating a method of image file processing according to another exemplary embodiment.
FIG. 3 is a flowchart illustrating a method of image file processing according to another exemplary embodiment.
FIG. 4 is a block diagram illustrating an image file processing apparatus according to an example embodiment.
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flowchart illustrating an image file processing method according to an exemplary embodiment, which may be applied to a server, such as an image file management server, a cloud server, and the like. As shown in fig. 1, the method may include steps S101-S104.
In S101, in response to receiving an image file upload request, it is determined whether metadata information corresponding to the image file exists.
And if the user needs to upload the image file, the user can send an image file uploading request to the server through the terminal. The terminal may be, for example, a desktop computer, a notebook computer, a tablet computer, a smart phone, and the like. The server can determine whether the metadata information corresponding to the image file exists or not in response to receiving the image file uploading request sent by the terminal.
The metadata information corresponding to the image file refers to information describing the image file, and may include information such as the size of the image file, storage path information, creation time, and update time. For example, the metadata information may be represented in the form of a record table in a database, and the server may determine whether the metadata information corresponding to the image file exists by determining whether a record corresponding to the image file exists in the database.
In S102, if it is determined that the metadata information corresponding to the image file does not exist, the storage path information corresponding to the image file is generated according to the unique identification code.
The mirror image files and the metadata information are in one-to-one correspondence, and each mirror image file has corresponding metadata information. When the deletion operation of the image file is executed, for example, the metadata information may be deleted first, and then the image file is deleted, so that the server, when determining that the metadata information corresponding to the image file does not exist, indicates that the image file may need to be deleted but not yet deleted, needs to store the image file additionally to ensure that the image of the image file is re-referenced, and the problem of image file deletion does not occur.
Each image file can be uniquely identified by a sha256 code, for example, and the sha256 code can be used as identification information of the image file. In the related art, the storage path information of the image file is generated according to the identification information of the image file, and the storage path information refers to which path of the image file is stored in the image storage medium. Since the same image file identification information is the same, the storage path information is the same for the same image file whenever it is uploaded. For example, the image file a needs to be deleted, and before the image file a is actually deleted, a new image a is uploaded, and the image file a refers to the image file a. When the mirror image storage medium deletes the mirror image file, the mirror image file is deleted according to the storage path information, so that after the mirror image file a is deleted, the problem that the mirror image file a referred by the new mirror image A is lost occurs.
In order to solve the problem, in the disclosure, when the server generates the storage path information of the image file, the storage path information corresponding to the image file is generated according to the unique identification code, wherein the storage path information generated according to different unique identification codes is different. The unique identification code may be in the form of numbers, letters, or a combination thereof, and the present disclosure is not particularly limited.
For example, generating the storage path information according to the unique identification code may be generating the storage path information according to the unique identification code and the identification information of the image file. In this way, even if the same image file is uploaded at different times during uploading of the image file, the storage path information generated according to the unique identification code is different. Therefore, the unique identification code is added in the storage path information, so that the newly uploaded image file and the image file to be deleted are respectively stored in different paths, and the newly uploaded image file is stored in the other path, so that the image file cannot be deleted by mistake, and the problem of image file deletion is effectively avoided. And moreover, the uploading operation does not need to be stopped when the image file is deleted, and the normal uploading of the image file is not influenced, so that the normal processing of the image file is ensured.
In S103, a storage request is sent to the mirror storage medium.
The storage request may include storage path information corresponding to the image file generated according to the unique identification code, so that the image file is stored by the image storage medium according to the storage path information.
In S104, metadata information corresponding to the image file is added.
After the mirror image storage medium stores the mirror image file, the mirror image file is uploaded successfully, and the server can add metadata information corresponding to the mirror image file. Illustratively, for example, the metadata information is represented by a form of a record table in the database, and then a record corresponding to the image file may be added in the database.
In the technical scheme, the storage path information corresponding to the image file is generated according to the unique identification code, wherein the storage path information generated according to different unique identification codes is different. By adding the unique identification code in the storage path information, even if the same image file is uploaded at different moments, the storage path information generated according to the unique identification code is different, so that the phenomenon that the image file is deleted by mistake due to the fact that the newly uploaded image file is consistent with the storage path information of the image file to be deleted can be prevented, and the problem of image file deletion is avoided. And when the image file is deleted, the uploading operation does not need to be stopped, and the normal uploading of the image file is not influenced, so that the normal processing of the image file is ensured.
Fig. 2 is a flowchart illustrating an image file processing method according to another exemplary embodiment, and as shown in fig. 2, the method may further include S201 and S202.
In S201, if it is determined that the metadata information corresponding to the image file exists, a lock resource of the metadata information corresponding to the image file is acquired.
In S202, under the condition that the lock resource is acquired, the update time in the metadata information corresponding to the image file is modified according to the current time.
When storing, in order to save storage space, the same image file only needs to be stored in the image storage medium. If the server determines that the metadata information corresponding to the image file exists, the image file is stored, no additional storage is needed, and the update time in the metadata information corresponding to the image file needs to be modified because the image file is uploaded again, namely, is referred again.
In the present disclosure, when modifying the update time in the metadata information, it is necessary to first acquire the lock resource of the metadata information. The lock resource is a synchronization mechanism for limiting resource access, only one operator can acquire the lock resource at the same time, and the problem of execution conflict caused by simultaneous operation of multiple operators is avoided, for example, the conflict between the deletion operation and the uploading operation of the image file is avoided. It should be noted that the operator mentioned here can be understood as a thread in the server executing the program. Illustratively, the metadata information is represented in the form of a database, for example, and the lock resource may refer to a row-level lock in the database.
In an embodiment, when the lock resource is acquired, that is, the modification permission of the metadata information is acquired, the update time in the metadata information corresponding to the image file may be modified according to the current time, and the update time in the metadata information may be modified to the current time.
In another embodiment, under the condition that the lock resource cannot be acquired, other operators may be occupied, and in order to avoid execution conflict, the uploading operation is stopped, and then the uploading of the image file fails, a prompt message may be output to the terminal that sends the image file uploading request, so as to prompt the user that the image file needs to be uploaded again.
In the technical scheme, only one operator is ensured to acquire the lock resource at the same time by locking the metadata information, and the updating time in the metadata information corresponding to the image file is modified under the condition of acquiring the lock resource, so that the problem of conflict execution between the image uploading operation and the image deleting operation is effectively avoided.
In the related art, metadata is stored in a file form, when a reference relation between an image and an image file is searched, the metadata files need to be opened one by one and analyzed, and when the data volume is large, the manner of opening the metadata files one by one is time-consuming and low in efficiency.
In the present disclosure, the metadata file currently stored in the mirror image storage medium is analyzed, and the obtained metadata information and the reference relationship between the mirror image and the mirror image file are stored in the database as a record of the database, for example, the relational database MySQL. Thus, if the metadata file is stored in the database, the metadata information referred to in this disclosure can be regarded as a record in the database. For example, a database may include a manifest table, a layer table, and a manifest _ layer table, where the manifest table may be used to represent manifest metadata information, the layer table may be used to represent layer metadata information, and the manifest _ layer table may be used to represent a reference relationship between a mirror and a mirror file.
Through the mode of database storage, metadata files do not need to be opened one by one for searching, and metadata information and the reference relation between the mirror image and the mirror image file can be searched through SQL statements, so that the referenced mirror image file and the unreferenced mirror image file can be quickly determined, the determination time is greatly shortened, and the processing efficiency of the mirror image file is improved.
Fig. 3 is a flowchart illustrating an image file processing method according to another exemplary embodiment, and as shown in fig. 3, the method may further include S301-S304.
In S301, according to the reference relationship between the mirror image and the mirror image file, marking a first metadata information set corresponding to the currently referenced mirror image file, and recording a start time of marking.
For example, the reference relationship between the mirror image and the mirror image file may be obtained from a record of the database, and according to the reference relationship, the first metadata information set corresponding to the currently referenced mirror image file may be marked, and the marking start time may be recorded. The first metadata information set is a set of metadata information corresponding to the currently referred image file.
In S302, a second metadata information set corresponding to the image file that is not referenced currently is determined according to the first metadata information set.
And removing the metadata information in the first metadata information set from all the metadata information, wherein the set formed by the rest metadata information is the second metadata information set corresponding to the image file which is not referred to currently.
In S303, the target image file to be deleted is determined according to the second metadata information set.
In this step, the image file corresponding to all metadata information or part of metadata information in the second metadata information set may be determined as the target image file to be deleted.
In an embodiment of determining an image file corresponding to a part of metadata information in the second metadata information set as a target image file to be deleted, for example, for each metadata information in the second metadata information set, in a case that an update time in the metadata information is earlier than a mark start time, the image file corresponding to the metadata information may be determined as the target image file to be deleted.
As described in S202, when the image file is uploaded, the update time in the metadata information corresponding to the image file needs to be modified according to the current time when the lock resource is acquired. Thus, if the update time in the metadata information is later than the mark start time, indicating that the image file was re-referenced after marking, the image file cannot be deleted. If the update time in the metadata information is earlier than the mark start time, indicating that the image file was not re-referenced after the mark, the image file may be determined to be the target image file for deletion.
Therefore, the target image file to be deleted is determined through the updating time and the marking starting time in the metadata information, and the image file which is referred again after the marking is started can be ensured not to be deleted, so that the problem of image file deletion is avoided.
In S304, a deletion operation is performed for the target image file to be deleted.
In the present disclosure, when the deletion operation is performed, a lock resource of the metadata information corresponding to the target image file may be first obtained, where the lock resource is already described above.
In one embodiment, in the case that the lock resource is acquired, that is, the modifying and deleting permission of the metadata information corresponding to the target image file is acquired, the metadata information corresponding to the target image file may be deleted, and then, a deletion request may be sent to the image storage medium, where the deletion request may include storage path information corresponding to the target image file, so that the image storage medium deletes the target image file according to the storage path information.
In another embodiment, in the case that the lock resource is not acquired, it indicates that other operators are occupying, for example, the image file may be re-referenced, and the metadata information corresponding to the target image file cannot be deleted, so that the target image file is not deleted, and the target image file is prevented from being deleted by mistake.
It should be noted that, in the above-described operation of uploading the image file, it may be determined whether there is metadata information corresponding to the image file first, and if there is no metadata information, the image file is deleted or about to be deleted. Under the condition that the image file is about to be deleted, the storage path information is generated according to the unique identification code in the method, even if the image file is deleted, the newly uploaded image file is stored in another path and cannot be deleted by mistake, and therefore the problem of image file deletion is effectively avoided.
Based on the same inventive concept, the present disclosure also provides an image file processing apparatus, and fig. 4 is a block diagram illustrating an image file processing apparatus according to an exemplary embodiment. As shown in fig. 4, the apparatus 400 may include:
a first determining module 401, configured to determine whether metadata information corresponding to an image file exists in response to receiving an image file uploading request;
the generating module 402 is configured to, in a case that it is determined that the metadata information corresponding to the image file does not exist, generate storage path information corresponding to the image file according to a unique identification code, where the storage path information generated according to different unique identification codes is different;
a sending module 403, configured to send a storage request to a mirror storage medium, where the storage request includes the storage path information, so that the mirror storage medium stores the mirror file according to the storage path information;
an adding module 404 configured to add metadata information corresponding to the image file.
By adopting the device, the storage path information corresponding to the image file is generated according to the unique identification code, wherein the storage path information generated according to different unique identification codes is different. By adding the unique identification code in the storage path information, even if the same image file is uploaded at different moments, the storage path information generated according to the unique identification code is different, so that the phenomenon that the image file is deleted by mistake due to the fact that the newly uploaded image file is consistent with the storage path information of the image file to be deleted can be prevented, and the problem of image file deletion is avoided. And when the image file is deleted, the uploading operation does not need to be stopped, and the normal uploading of the image file is not influenced, so that the normal processing of the image file is ensured.
Optionally, the apparatus 400 may further include:
the acquisition module is configured to acquire a lock resource of the metadata information corresponding to the image file under the condition that the metadata information corresponding to the image file is determined to exist;
and the modifying module is configured to modify the updating time in the metadata information corresponding to the image file according to the current time under the condition of acquiring the lock resource.
Optionally, the apparatus 400 may further include:
the marking module is configured to mark a first metadata information set corresponding to a currently referred mirror image file according to the reference relation between the mirror image and the mirror image file, and record marking start time;
the second determining module is configured to determine a second metadata information set corresponding to the image file which is not referred to currently according to the first metadata information set;
a third determining module configured to determine a target image file to be deleted according to the second metadata information set;
and the execution module is configured to execute deletion operation aiming at the target image file to be deleted.
Optionally, the third determining module is configured to, for each piece of metadata information in the second set of metadata information, determine, as the target image file to be deleted, an image file corresponding to the piece of metadata information if an update time in the piece of metadata information is earlier than the mark start time.
Optionally, the execution module may include:
the acquisition submodule is configured to acquire a lock resource of metadata information corresponding to the target image file;
the deleting submodule is configured to delete the metadata information corresponding to the target image file under the condition that the lock resource is acquired;
the sending submodule is configured to send a deletion request to an image storage medium, where the deletion request includes storage path information corresponding to the target image file, so that the image storage medium deletes the target image file according to the storage path information.
Optionally, the apparatus 400 may further include:
and the analysis module is configured to analyze the metadata file currently stored in the mirror image storage medium, and store the obtained metadata information and the reference relation between the mirror image and the mirror image file as records of a database in the database.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an electronic device 500 in accordance with an example embodiment. For example, the electronic device 500 may be provided as a server, such as the aforementioned image file management server, cloud server, and the like. Referring to fig. 5, the electronic device 500 comprises a processor 522, which may be one or more in number, and a memory 532 for storing computer programs executable by the processor 522. The computer programs stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processor 522 may be configured to execute the computer program to perform the image file processing method described above.
Additionally, the electronic device 500 may also include a power component 526 and a communication component 550, the power component 526 may be configured to perform power management of the electronic device 500, and the communication component 550 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 500. In addition, the electronic device 500 may also include input/output (I/O) interfaces 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server, Mac OSXTM, UnixTM, LinuxTM, and the like.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions, which when executed by a processor, implement the steps of the image file processing method described above. For example, the computer readable storage medium may be the memory 532 described above including program instructions that are executable by the processor 522 of the electronic device 500 to perform the image file processing method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the image file processing method described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. An image file processing method, characterized in that the method comprises:
in response to receiving an image file uploading request, determining whether metadata information corresponding to the image file exists or not;
under the condition that the metadata information corresponding to the image file does not exist, generating storage path information corresponding to the image file according to unique identification codes, wherein the storage path information generated according to different unique identification codes is different;
sending a storage request to a mirror image storage medium, wherein the storage request comprises the storage path information so that the mirror image storage medium stores the mirror image file according to the storage path information;
and adding metadata information corresponding to the mirror image file.
2. The method of claim 1, further comprising:
under the condition that the metadata information corresponding to the image file is determined to exist, lock resources of the metadata information corresponding to the image file are obtained;
and under the condition of acquiring the lock resource, modifying the updating time in the metadata information corresponding to the image file according to the current time.
3. The method of claim 1, further comprising:
marking a first metadata information set corresponding to the currently referenced image file according to the reference relation between the image and the image file, and recording the marking start time;
determining a second metadata information set corresponding to the image file which is not referred to currently according to the first metadata information set;
determining a target image file to be deleted according to the second metadata information set;
and executing deletion operation aiming at the target image file to be deleted.
4. The method of claim 3, wherein determining the target image file to delete according to the second metadata information set comprises:
and for each piece of metadata information in the second metadata information set, determining the image file corresponding to the piece of metadata information as the target image file to be deleted under the condition that the updating time in the piece of metadata information is earlier than the mark starting time.
5. The method of claim 3, wherein the performing the delete operation comprises:
acquiring a lock resource of metadata information corresponding to the target image file;
under the condition of acquiring the lock resource, deleting metadata information corresponding to the target image file;
and sending a deletion request to a mirror image storage medium, wherein the deletion request comprises storage path information corresponding to the target mirror image file, so that the mirror image storage medium deletes the target mirror image file according to the storage path information.
6. The method of claim 1, further comprising:
analyzing the metadata file currently stored in the mirror image storage medium, and storing the obtained metadata information and the reference relation between the mirror image and the mirror image file as records of a database to the database.
7. An image file processing apparatus, comprising:
the device comprises a first determination module, a second determination module and a third determination module, wherein the first determination module is configured to respond to the received image file uploading request and determine whether metadata information corresponding to the image file exists or not;
the generating module is configured to generate storage path information corresponding to the image file according to unique identification codes under the condition that the metadata information corresponding to the image file does not exist, wherein the storage path information generated according to different unique identification codes is different;
a sending module configured to send a storage request to a mirror image storage medium, where the storage request includes the storage path information, so that the mirror image storage medium stores the mirror image file according to the storage path information;
and the adding module is configured to add the metadata information corresponding to the image file.
8. The apparatus of claim 7, further comprising:
the acquisition module is configured to acquire a lock resource of the metadata information corresponding to the image file under the condition that the metadata information corresponding to the image file is determined to exist;
and the modifying module is configured to modify the updating time in the metadata information corresponding to the image file according to the current time under the condition of acquiring the lock resource.
9. A computer-readable storage medium, on 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 6.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN202010120756.5A 2020-02-26 2020-02-26 Mirror image file processing method and device, storage medium and electronic equipment Pending CN111367869A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010120756.5A CN111367869A (en) 2020-02-26 2020-02-26 Mirror image file processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010120756.5A CN111367869A (en) 2020-02-26 2020-02-26 Mirror image file processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111367869A true CN111367869A (en) 2020-07-03

Family

ID=71208091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010120756.5A Pending CN111367869A (en) 2020-02-26 2020-02-26 Mirror image file processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111367869A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130869A (en) * 2020-09-11 2020-12-25 苏州浪潮智能科技有限公司 AI platform mirror image processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112130869A (en) * 2020-09-11 2020-12-25 苏州浪潮智能科技有限公司 AI platform mirror image processing method and device
CN112130869B (en) * 2020-09-11 2022-11-29 苏州浪潮智能科技有限公司 AI platform mirror image processing method and device

Similar Documents

Publication Publication Date Title
US9779153B2 (en) Data transfer between storage systems using data fingerprints
CN106874281B (en) Method and device for realizing database read-write separation
US10698797B2 (en) Mobile application program testing method, server, terminal, and storage medium
US9864736B2 (en) Information processing apparatus, control method, and recording medium
CN108647317B (en) Incremental file generation method and device, storage medium and electronic equipment
WO2019148657A1 (en) Method for testing associated environments, electronic device and computer readable storage medium
CN111367869A (en) Mirror image file processing method and device, storage medium and electronic equipment
CN112000850A (en) Method, device, system and equipment for data processing
CN110046062B (en) Distributed data processing method and system
CN107526816B (en) Stream distribution record storage method and device and electronic equipment
CN107422991B (en) Storage strategy management system
CN111680008A (en) Log processing method and system, readable storage medium and intelligent device
CN104808985B (en) The management method and device of object in application program
JPWO2020065778A1 (en) Information processing equipment, control methods, and programs
CN110909002B (en) Intelligent device dynamic attribute storage method and gateway
US11455117B2 (en) Data reading method, apparatus, and system, avoiding version rollback issues in distributed system
US11445036B1 (en) Cluster management method and apparatus, electronic device and storage medium
CN112035174B (en) Method, apparatus and computer storage medium for running web service
US11394748B2 (en) Authentication method for anonymous account and server
CN112256318B (en) Construction method and equipment for dependent product
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN115098889B (en) Authority management method, device, equipment and storage medium
CN112306551A (en) Method, system and device for acquiring historical configuration information
US11099837B2 (en) Providing build avoidance without requiring local source code
CN113687920A (en) Object strategy operation method, device and equipment of distributed system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination