A method and device for unified picture management, electronic equipment, and storage medium

Receiving and processing image access requests through unified management methods, the repeated image storage and compatibility issues are solved, and efficient and unified image data access is achieved.

CN116860759BActive Publication Date: 2025-08-19HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310999973.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-09
Publication Date
2025-08-19
Estimated Expiration
2043-08-09

AI Technical Summary

Technical Problem

In the prior art, each service system stores and manages image data separately, resulting in repeated upload and storage of images, and the acquisition process is complicated and compatibility problems exist.

Method used

Through a unified management method, you can receive user's image access requests and judge the cache situation. If it is not cached, you can obtain the original image or cut the image from the cloud server and cache it, and integrate all the graph rules to avoid compatibility issues.

Benefits of technology

It realizes simple and efficient access to image data, avoids repeated uploads and storage, unifies image processing rules, and improves data acquisition efficiency and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116860759B_ABST
    Figure CN116860759B_ABST
Patent Text Reader

Abstract

The present application discloses a unified image management method and device, an electronic device, and a storage medium, the method comprising: receiving a target image access request sent by a user through any business system; determining whether the image corresponding to the access link of the request is cached; if the corresponding image is cached, feeding back the cached corresponding image to the user; if the corresponding image is not cached, determining a target cloud server storing the target image; judging whether image slicing is required based on image specification information in the access link; if image slicing is not required, obtaining the original image of the target image from the target cloud server and feeding it back to the user, and caching it; if image slicing is required, converting its own current image slicing rule into the image slicing rule of the target cloud server, slicing the original image of the target image using the image slicing rule, and obtaining the current image slicing of the target image; feeding back the current image slicing of the target image to the user and caching it.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of picture management technology, and in particular to a method and device for unified picture management, an electronic device, and a storage medium. Background Art

[0002] To meet diverse business needs, an enterprise typically deploys multiple business systems and connects to multiple third-party business systems. These systems often contain a variety of image data.

[0003] Currently, each system stores and manages its own image data separately. However, with the development of cloud storage services, many companies are choosing to store their system's image data on a designated cloud service provider's cloud storage server. This means that each system uploads its own image data to the cloud storage server for storage. When a user accesses an image through a system, they can directly request the image from the corresponding cloud storage server through that system, or request another system to retrieve the image data from the corresponding cloud storage server and then return it to the currently used system. Upon receiving the request, the cloud storage server will perform appropriate image processing, such as cropping, based on the current request, and then provide the processed image as feedback.

[0004] However, each system stores and manages data separately, resulting in a large number of duplicate images being uploaded and stored. Furthermore, image acquisition requires not only requesting feedback from other systems but also processing the images each time, making the entire process cumbersome. Furthermore, different cloud storage servers handle data differently, leading to compatibility issues with the acquired data. Summary of the Invention

[0005] Based on the above-mentioned deficiencies of the existing technology, the present application provides a method and device for unified image management, an electronic device, and a storage medium to solve the problems that the existing technology is relatively cumbersome and the storage and retrieval of data is incompatible.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a method for unified image management, comprising:

[0008] Receive target image access requests sent by users through any business system;

[0009] Determine whether the image corresponding to the access link of the target image access request is cached;

[0010] If it is determined that the image corresponding to the access link of the target image location request is cached, feeding back the cached image corresponding to the access link of the target image location request to the user;

[0011] If it is determined that the image corresponding to the access link of the target image access request is not cached, then based on the target image access request, determining a target cloud server storing the target image from each connected cloud server;

[0012] Determining whether image slicing is required based on image specification information in the access link of the target image access request;

[0013] If it is determined that image cropping is not necessary, the original image of the target image is obtained from the target cloud server and fed back to the user;

[0014] caching the original image of the target image as the image corresponding to the access link of the target image location request;

[0015] If it is determined that image slicing is required, the current image slicing rule is converted into the image slicing rule of the target cloud server, so as to slice the original image of the target image according to the image slicing rule of the target cloud server to obtain the current image slicing of the target image;

[0016] The current cut image of the target image is fed back to the user, and the current cut image of the target image is cached as the image corresponding to the access link of the target image location request.

[0017] Optionally, in the above-mentioned unified image management method, before caching the current slice of the target image as the image corresponding to the access link of the target image location request, the method further includes:

[0018] Determine whether the number of requests to access the current cut of the target image within a historical preset time length from the current moment is greater than a preset number; wherein, if it is determined that the number of requests to access the current cut of the target image within a historical preset time length from the current moment is greater than a preset number, then execute the caching of the current cut of the target image as the image corresponding to the access link of the target image orientation request.

[0019] Optionally, the above-mentioned unified image management method further includes:

[0020] Determine the number of times the currently cached image has been accessed within a historical target time period; wherein the historical target time period is a historical time period of a specified length closest to the current moment;

[0021] Determine an overlay coefficient based on the number of times the currently cached image has been accessed within a historical target time period; wherein the greater the number of times the image has been accessed, the greater the overlay coefficient;

[0022] If the currently cached image is an original image, the first preset value is added to the superposition coefficient to obtain the current cache time;

[0023] If the currently cached image is a cut image, the second preset value is added to the superposition coefficient to obtain the current cache time; wherein the first preset value is greater than the second preset value;

[0024] The cache period of the currently cached image is set to the current cache time.

[0025] Optionally, the above-mentioned unified image management method further includes:

[0026] Receiving a current image file to be stored sent by a target business system; wherein the target business system is any one of the business systems; the current image file to be stored includes at least the current image to be stored and file information of the current image to be stored;

[0027] Performing a hash calculation on the current image file to be stored to obtain an identifier corresponding to the current image to be stored;

[0028] Checking whether there is an identifier corresponding to the current image to be stored in the file index table;

[0029] If the identification corresponding to the current picture to be stored does not exist in the query file index table, storing the current picture to be stored in the cloud server indicated by the file information of the current picture to be stored based on the file information of the current picture to be stored;

[0030] Recording the identifier corresponding to the current image to be stored and the storage address of the current image to be stored in the file index table;

[0031] Storing the image metadata in the file information of the current image to be stored locally;

[0032] Based on the basic information of the current picture to be stored, generating a new picture message corresponding to the current picture to be stored;

[0033] Sending the newly added picture message corresponding to the currently to-be-stored picture to the message queue, so as to feed back the newly added picture message corresponding to the currently to-be-stored picture to each of the business systems monitoring the message queue;

[0034] The current picture to be stored is audited to obtain an audit result of the current picture to be stored, and the audit result of the current picture to be stored is fed back to each of the business systems monitoring the message queue through the message queue.

[0035] Optionally, in the above-mentioned unified picture management method, after querying whether the file index table contains the identifier corresponding to the picture to be stored, the method further includes:

[0036] If the identifier corresponding to the current picture to be stored is found in the file index table, the identifier corresponding to the current picture to be stored in the file index table and the storage address of the current picture to be stored are fed back to the target business system.

[0037] Optionally, in the above-mentioned unified picture management method, storing the current picture to be stored in a cloud server indicated by the file information of the current picture to be stored based on the file information of the current picture to be stored includes:

[0038] Based on the file information of the current image to be stored, a current security token corresponding to the current image to be stored is generated; wherein the current security token corresponding to the current image to be stored is a security token of a cloud server to be uploaded generated for the current image to be stored; the cloud server to be uploaded refers to the cloud server indicated by the file information of the current image to be stored;

[0039] The current security token corresponding to the current picture to be stored is fed back to the target business system to trigger the target business system to use the current security token corresponding to the current picture to be stored to store the current picture to be stored in the cloud server to be uploaded.

[0040] Optionally, in the above-mentioned unified picture management method, after reviewing the picture currently to be stored, obtaining the review result of the picture currently to be stored, and feeding back the review result of the picture currently to be stored to each of the business systems monitoring the message queue through the message queue, the method further includes:

[0041] If the review result of the current picture to be stored is passed, the current picture to be stored is put online, and the online message of the current picture to be stored is fed back to each of the business systems monitoring the message queue through the message queue;

[0042] If the audit result of the currently to-be-stored picture is not passed, or a delisting instruction is received for the currently to-be-stored picture, the picture metadata of the currently to-be-stored picture is deleted from the local computer, and the identifier and storage address corresponding to the currently to-be-stored picture are deleted from the file index table;

[0043] The current image to be stored is deleted from the corresponding cloud server, and the offline message of the current image to be stored is fed back to each of the business systems monitoring the message queue through the message queue.

[0044] A second aspect of the present application provides a unified image management device, including:

[0045] A first receiving unit is configured to receive a target image access request sent by a user through any business system;

[0046] A first determining unit, configured to determine whether an image corresponding to the access link of the target image access request is cached;

[0047] a cache data feedback unit, configured to feed back the cached image corresponding to the access link of the target image location request to the user when determining that the image corresponding to the access link of the target image location request is cached;

[0048] A server determining unit, configured to, when determining that the image corresponding to the access link of the target image access request is not cached, determine a target cloud server storing the target image from among the connected cloud servers based on the target image access request;

[0049] a second determining unit, configured to determine whether image slicing is required based on image specification information in the access link of the target image access request;

[0050] An original image feedback unit, configured to obtain the original image of the target image from the target cloud server and feed it back to the user when it is determined that image cutting is not necessary;

[0051] an original image caching unit, configured to cache the original image of the target image as the image corresponding to the access link of the target image location request;

[0052] a cutting unit configured to, when determining that cutting is required, convert its own current cutting rule into the cutting rule of the target cloud server, so as to cut the original image of the target image according to the cutting rule of the target cloud server to obtain the current cut image of the target image;

[0053] A cut image feedback unit, configured to feed back the current cut image of the target image to the user;

[0054] The image slicing cache unit is used to cache the current image slicing of the target image as the image corresponding to the access link of the target image location request.

[0055] A third aspect of the present application provides an electronic device, including:

[0056] memory and processor;

[0057] Wherein, the memory is used to store programs;

[0058] The processor is used to execute the program, and when the program is executed, it is specifically used to implement the unified picture management method as described in any one of the above.

[0059] In a fourth aspect, the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement the unified picture management method as described in any one of the above.

[0060] The present application provides a method for unified image management, which uniformly stores images of various business systems through a unified interface, so that correspondingly, a target image access request sent by a user through any business system can be received during the data access process. Then, it is determined whether the image corresponding to the access link of the target image access request is cached. If it is determined that the image corresponding to the access link of the target image orientation request is cached, the image corresponding to the access link of the cached target image orientation request is fed back to the user, so that the required image can be directly fed back without processing the image. If it is determined that the image corresponding to the access link of the target image access request is not cached, the target cloud server storing the target image is determined from the connected cloud servers based on the target image access request, and based on the image specification information in the access link of the target image access request, it is determined whether the image needs to be cut. If it is determined that the image does not need to be cut, the original image of the target image is obtained from the target cloud server and fed back to the user, and then the original image of the target image is cached as the image corresponding to the access link of the target image orientation request. If it is determined that the image needs to be cut, the current image cutting rule is converted into the image cutting rule of the target cloud server, so that the original image of the target image is cut according to the image cutting rule of the target cloud server to obtain the current image cutting of the target image, thereby achieving unified processing of the image and avoiding compatibility issues. The current image cutting of the target image is then fed back to the user, and the current image cutting of the target image is cached as the image corresponding to the access link of the target image orientation request, so as to facilitate subsequent direct access. Therefore, when each business acquires data, it directly acquires data through a unified interface, without requesting other businesses, and without processing the data every time, making data access simpler and more efficient, and data can be processed according to unified rules to avoid compatibility issues. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0062] Figure 1A schematic diagram of a multi-system architecture provided in an embodiment of the present application;

[0063] Figure 2 A flowchart of a method for unified image storage provided in an embodiment of the present application;

[0064] Figure 3 A flowchart of storing a current image to be stored in a cloud server is provided in an embodiment of the present application;

[0065] Figure 4 A flowchart of a method for adding and removing images from the online and offline pages provided in an embodiment of the present application;

[0066] Figure 5 A flowchart of a unified data management method provided in an embodiment of the present application;

[0067] Figure 6 A flowchart of a method for setting the cache time of an image provided in an embodiment of the present application;

[0068] Figure 7 A schematic diagram of the architecture of a unified image management device provided in an embodiment of the present application;

[0069] Figure 8 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0071] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0072] This application provides a unified image management method to solve the problem that the existing technology is relatively cumbersome and the storage and retrieval of data are incompatible.

[0073] In order to implement a unified image management method provided by this application, the embodiment of this application provides a multi-system architecture, such as Figure 1 As shown, the storage server gateway centrally connects various business systems to various cloud servers. Furthermore, an image library is set up in front of the storage service gateway to store image-related information and cloud server-related information, facilitating image upload and download. Furthermore, a message queue is set up to synchronize image status information with various business systems.

[0074] It should be noted that the unified picture management method provided by this application needs to be implemented based on the corresponding picture storage method. To this end, the embodiment of this application provides a unified picture storage method, such as Figure 2 Shown, including:

[0075] S201: Receive a current image file to be stored sent by a target business system.

[0076] The target business system is any business system. It should be noted that the business system mentioned in the embodiment of the present application is a business system that is connected to a unified storage service gateway for image data.

[0077] The current picture file to be stored includes at least the current picture to be stored and the file information of the current picture to be stored. Optionally, the file information of the current picture to be stored may include basic information of the current picture to be stored and information of the cloud server storing the current picture to be stored.

[0078] Specifically, when any business system needs to store data, it uploads image files through the unified interface provided by the image service.

[0079] S202: Perform hash calculation on the current image file to be stored to obtain an identifier corresponding to the current image to be stored.

[0080] It should be noted that in order to avoid repeated uploading and storage of pictures, in an embodiment of the present application, a hash calculation is performed on the picture file to obtain a unique identifier corresponding to each picture, and then the identifier can be used to determine whether the picture has been stored.

[0081] S203: Check whether there is an identifier corresponding to the current picture to be stored in the file index table.

[0082] It should be noted that in the embodiment of the present application, for images that have been uploaded and stored, their corresponding identifiers will be uniformly stored in the file index table, so deduplication can be performed by querying the file index table. Therefore, if the identifier corresponding to the image to be stored does not exist in the file index table, it means that the image to be stored has not yet been stored, so step S204 can be executed at this time. If the identifier corresponding to the image to be stored does exist in the file index table, it means that the image to be stored has already been stored, so there is no need to store it again.

[0083] Optionally, in another embodiment of the present application, after executing step S203, the following steps are further included:

[0084] If the file index table contains an identifier corresponding to the previously stored picture, the identifier corresponding to the currently stored picture in the file index table and the storage address of the currently stored picture are fed back to the target business system so that the user can understand the storage information of the currently stored picture, and can also determine whether the currently stored picture has actually been stored through the identifier and storage address.

[0085] S204: Based on the file information of the current picture to be stored, the current picture to be stored is stored in the cloud server indicated by the file information of the current picture to be stored.

[0086] Optionally, in another embodiment of the present application, a specific implementation of step S204 is as follows: Figure 3 Shown, including:

[0087] S301: Generate a current security token corresponding to the current picture to be stored based on the file information of the current picture to be stored.

[0088] The current security token corresponding to the current image to be stored is a security token of the cloud server to be uploaded generated for the current image to be stored. The cloud server to be uploaded refers to the cloud server indicated by the file information of the current image to be stored.

[0089] Specifically, a corresponding current security token can be generated based on the file name, file hash value, uploader, and other information in the file information. The current security token includes the key required to upload the file.

[0090] S302: Feedback the current security token corresponding to the current image to be stored to the target business system to trigger the target business system to use the current security token corresponding to the current image to be stored to store the current image to be stored in the cloud server to be uploaded.

[0091] Specifically, the target business system uses SDK to upload files.

[0092] S205: Record the identifier corresponding to the current picture to be stored and the storage address of the current picture to be stored in the file index table.

[0093] S206: Store the picture metadata in the file information of the current picture to be stored locally.

[0094] In order to facilitate subsequent data query and access, it is also necessary to store the file metadata information, such as file name, size, format, hash, etc., in a local database or cache or other storage medium after the file is uploaded.

[0095] S207: Based on the basic information of the current picture to be stored, generate a new picture message corresponding to the current picture to be stored.

[0096] Specifically, the basic information of the current image to be stored, such as file name, size, format, upload time, and uploader, is encapsulated into a message so that it can be fed back to each business system through the message queue.

[0097] S208: Send the newly added picture message corresponding to the current picture to be stored to the message queue, so as to feed back the newly added picture message corresponding to the current picture to be stored to each business system monitoring the message queue.

[0098] It should be noted that in the embodiment of the present application, a message queue is set up, and changes in the status of the image can be sent to the message queue. Each business system can monitor the message queue, so that when a message related to the image appears in the message queue, the corresponding message can be obtained in a timely manner and the corresponding image can be processed based on the received message.

[0099] Therefore, after adding a new picture to be stored, it is necessary to promptly inform each business system so that each business system can use the picture later.

[0100] S209: review the current picture to be stored, obtain the review result of the current picture to be stored, and feed back the review result of the current picture to be stored to each business system monitoring the message queue through the message queue.

[0101] It should be noted that the image must be reviewed to determine whether it is permitted for use. In existing technologies, each business system needs to connect to the review system for review. However, in the implementation of this application, this is no longer necessary for each business system to conduct a system review. Instead, the review is performed directly, and the review results are then fed back to the business systems listening to the message queue via the message queue.

[0102] Optionally, in another embodiment of the present application, after executing step S209, the upper and lower lines of the picture may be further executed. Figure 4 As shown, the embodiment of the present application provides a method for adding and removing images online, including:

[0103] S401: Determine whether the review result of the current image to be stored is passed.

[0104] If the audit result of the current image to be stored is approved, step S402 is executed. If the audit result of the current image to be stored is not approved, it means that the current image to be stored cannot be used, so there is no need to report the current image to be stored, so it is offlined, that is, step S404 is executed at this time.

[0105] S402: The current picture to be stored is put online, and the online message of the current picture to be stored is fed back to each business system monitoring the message queue through the message queue.

[0106] S403: Real-time monitoring to determine whether an offline instruction for the current image to be stored is received.

[0107] That is to say, in the embodiment of the present application, the uploaded picture can be offlined according to the demand. Therefore, when the offline instruction of the current picture to be stored is received, step S404 is executed.

[0108] S404: Delete the picture metadata of the current picture to be stored from the local computer, and delete the identifier and storage address corresponding to the current picture to be stored from the file index table.

[0109] S405: The current image to be stored is deleted from the corresponding cloud server, and the offline message of the current image to be stored is fed back to each business system monitoring the message queue through the message queue.

[0110] Based on the above-mentioned unified image storage method, the embodiment of the present application provides a unified data management method, such as Figure 5 As shown, the following steps are included:

[0111] S501: Receive a target image access request sent by a user through any business system.

[0112] The target image is any image that has been uploaded to the cloud server.

[0113] It should be noted that in the embodiment of the present application, each business system uploads images to the cloud for storage through a unified interface, and no matter which business system uploads the image, other business servers can initiate access requests by themselves without having to make requests to other business systems.

[0114] S502: Determine whether the image corresponding to the access link of the target image access request is cached.

[0115] It should be noted that in order to avoid repeated processing of data, simplify the data access method and speed up data access efficiency, the accessed data will also be cached in the embodiment of the present application.

[0116] Because access to an image stored in the cloud server is processed based on the specific access request and then fed back, the specific image fed back is actually different. In other words, not all access requests are for the original image. Therefore, even if the original image is directly used, the image still needs to be processed.

[0117] Therefore, in the embodiment of the present application, it is necessary to store the required information of the required pictures in the access link, specifically the picture specification information, that is, each access link corresponds to a specific feedback picture. Therefore, in the embodiment of the present application, the corresponding pictures are cached for each access link.

[0118] Therefore, if it is determined that the image corresponding to the access link of the target image access request is cached, it means that the image currently needs to be obtained is cached, so step S503 is executed at this time. If it is determined that the image corresponding to the access link of the target image access request is not cached, it is necessary to return to the source.

[0119] S503: Feedback the cached image corresponding to the access link requested by the target image location to the user.

[0120] S504: Based on the target image access request, determine the target cloud server storing the target image from the connected cloud servers.

[0121] Alternatively, if the CDN server does not have the requested image cached, it will need to retrieve the original image from the source. The CDN server will first determine whether the primary source is accessible. If so, it will use the primary source; otherwise, it will use the backup source.

[0122] S505: Based on the image specification information in the access link of the target image access request, determine whether image segmentation is required.

[0123] Specifically, based on the image specification information in the access link of the target image access request, it is determined whether the image being accessed is a cut image of the target image. If it is determined that the image being accessed is not a cut image of the target image, that is, the original image of the target image is being accessed, then cutting is not required, and step S506 is executed. If it is determined that the image being accessed is a cut image of the target image, then cutting is required, and step S508 is executed.

[0124] S506: Obtain the original image of the target image from the target cloud server and feed it back to the user.

[0125] S507: Cache the original image of the target image as the image corresponding to the access link of the target image location request.

[0126] It should be noted that, since the image corresponding to the access link requested by the target image location is not cached at this time, after the original image of the target image is returned, the cache is updated using the original image of the target image.

[0127] S508: Convert the current image slicing rule of the target cloud server into the image slicing rule of the target cloud server, so as to slice the original image of the target image according to the image slicing rule of the target cloud server to obtain the current image slicing rule of the target image.

[0128] In order to unify the image slicing rules of each cloud server and avoid image incompatibility issues, in this embodiment of the application, the image slicing service will convert its current image slicing rules into the image slicing rules of the target cloud server, so that the target cloud server can slicing images according to the unified rules. For example, the image slicing service will convert the "_800x600.jpg" in the link into the image slicing rules of the target cloud server.

[0129] S509: Feedback the current cut image of the target image to the user, and cache the current cut image of the target image as the image corresponding to the access link of the target image location request.

[0130] Optionally, in another embodiment of the present application, before caching the current slice of the target image as the image corresponding to the access link of the target image location request, the method further includes:

[0131] It is determined whether the number of requests to access the current slice of the target image within a preset historical time length from the current moment is greater than a preset number.

[0132] Among them, if it is determined that the number of requests to access the current cut of the target image within the historical preset time length from the current moment is greater than the preset number, the current cut of the target image will be cached as the image corresponding to the access link of the target image location request.

[0133] Since the access frequency of a cut image is usually relatively low, caching all the cut images in the cache will have little effect and will take up storage space. Therefore, in the embodiment of the present application, a cut image will only be cached when the access frequency within a period of time meets the requirements.

[0134] Considering that the cached image may only be accessed frequently at the current time, and will hardly be accessed in the future, in order to release the cache space in time, optionally, in another embodiment of the present application, after caching the image, the cache time of the image can also be set. Figure 6As shown, an embodiment of the present application provides a method for setting the cache time of an image, including:

[0135] S601: Determine the number of times a currently cached image has been accessed within a historical target time period.

[0136] The historical target time period is the historical time period of the specified duration closest to the current time.

[0137] S602: Determine a superposition coefficient according to the number of times the currently cached image has been accessed within a historical target time period.

[0138] Among them, the more times it is visited, the greater the superposition coefficient.

[0139] S603: Determine whether the currently cached image is an original image.

[0140] It should be noted that, since the access frequency of the original image is generally higher than that of the cut image, in the embodiment of the present application, separate settings are made for the original image and the cut image. Therefore, if it is determined that the currently cached image is the original image, step S604 is executed. If the currently cached image is not the original image, that is, if the currently cached image is a cut image, step S605 is executed.

[0141] S604: Add the first preset value to the superposition coefficient to obtain the current cache time.

[0142] S605: Add the superposition coefficient to the second preset value to obtain the current cache time.

[0143] The first preset value is greater than the second preset value.

[0144] S606: Set the cache period of the currently cached image to the current cache time.

[0145] The embodiment of the present application provides a method for unified image management, which uniformly stores images of various business systems through a unified interface, so that correspondingly, during the data access process, a target image access request sent by a user through any business system can be received. Then, it is determined whether the image corresponding to the access link of the target image access request is cached. If it is determined that the image corresponding to the access link of the target image orientation request is cached, the image corresponding to the access link of the cached target image orientation request is fed back to the user, so that the required image can be directly fed back without processing the image. If it is determined that the image corresponding to the access link of the target image access request is not cached, the target cloud server storing the target image is determined from the connected cloud servers based on the target image access request, and based on the image specification information in the access link of the target image access request, it is determined whether the image needs to be cut. If it is determined that the image does not need to be cut, the original image of the target image is obtained from the target cloud server and fed back to the user, and then the original image of the target image is cached as the image corresponding to the access link of the target image orientation request. If it is determined that the image needs to be cut, the current image cutting rule is converted into the image cutting rule of the target cloud server, so that the original image of the target image is cut according to the image cutting rule of the target cloud server to obtain the current image cutting of the target image, thereby achieving unified processing of the image and avoiding compatibility issues. The current image cutting of the target image is then fed back to the user, and the current image cutting of the target image is cached as the image corresponding to the access link of the target image orientation request, so as to facilitate subsequent direct access. Therefore, when each business acquires data, it directly acquires data through a unified interface, without requesting other businesses, and without processing the data every time, making data access simpler and more efficient, and data can be processed according to unified rules to avoid compatibility issues.

[0146] Another embodiment of the present application provides a unified image management device, such as Figure 7 Shown, including:

[0147] The first receiving unit 701 is configured to receive a target image access request sent by a user through any business system.

[0148] The first determining unit 702 is configured to determine whether a picture corresponding to the access link of the target picture access request is cached.

[0149] The cache data feedback unit 703 is configured to feed back the cached image corresponding to the access link of the target image location request to the user when it is determined that the image corresponding to the access link of the target image location request is cached.

[0150] The server determining unit 704 is configured to determine a target cloud server storing the target image from among the connected cloud servers based on the target image access request when it is determined that the image corresponding to the access link of the target image access request is not cached.

[0151] The second determining unit 705 is configured to determine whether image slicing is required based on image specification information in the access link of the target image access request.

[0152] The original image feedback unit 706 is used to obtain the original image of the target image from the target cloud server and feed it back to the user when it is determined that image cutting is not necessary.

[0153] The original image caching unit 707 is configured to cache the original image of the target image as the image corresponding to the access link of the target image location request.

[0154] The image cutting unit 708 is used to convert its own current image cutting rule into the image cutting rule of the target cloud server when it is determined that image cutting is required, so as to cut the original image of the target image according to the image cutting rule of the target cloud server to obtain the current image cutting of the target image.

[0155] The image cutting feedback unit 709 is used to feed back the current image cutting of the target image to the user.

[0156] The image slice cache unit 710 is configured to cache the current image slice of the target image as the image corresponding to the access link of the target image location request.

[0157] Optionally, in another embodiment of the present application, the apparatus for unified image management further includes:

[0158] The third judgment unit is used to judge whether the number of requests to access the current slice of the target image within a historical preset time length from the current moment is greater than a preset number.

[0159] Among them, if it is determined that the number of requests to access the current cut of the target image within the historical preset time length from the current moment is greater than the preset number, the cut cache unit executes the caching of the current cut of the target image as the image corresponding to the access link of the target image orientation request.

[0160] Optionally, in another embodiment of the present application, the apparatus for unified image management further includes:

[0161] The number determination unit is used to determine the number of times the currently cached image has been accessed within a historical target time period, wherein the historical target time period is a historical time period of a specified length closest to the current moment.

[0162] The coefficient determination unit is used to determine the superposition coefficient according to the number of times the currently cached image has been accessed within the historical target time period. The greater the number of times the image has been accessed, the greater the superposition coefficient.

[0163] The first accumulating unit is configured to add the superposition coefficient to the first preset value to obtain the current cache time when the currently cached image is the original image.

[0164] The second accumulating unit is configured to add the superposition coefficient to the second preset value to obtain the current cache time when the currently cached image is a cut image.

[0165] The first preset value is greater than the second preset value.

[0166] The setting unit is used to set the cache period of the currently cached image to the current cache time.

[0167] Optionally, in another embodiment of the present application, the apparatus for unified image management further includes:

[0168] The second receiving unit is configured to receive a current image file to be stored sent by a target business system, wherein the target business system is any business system. The current image file to be stored includes at least the current image to be stored and file information of the current image to be stored.

[0169] The calculation unit is used to perform hash calculation on the current image file to be stored to obtain an identifier corresponding to the current image to be stored.

[0170] The query unit is used to query whether there is an identifier corresponding to the current image to be stored in the file index table.

[0171] The picture storage unit is used to store the current picture to be stored in the cloud server indicated by the file information of the current picture to be stored based on the file information of the current picture to be stored when the identifier corresponding to the current picture to be stored does not exist in the file index table.

[0172] The recording unit is used to record the identifier corresponding to the current picture to be stored and the storage address of the current picture to be stored in the file index table.

[0173] The information storage unit is used to store the picture metadata in the file information of the current picture to be stored locally.

[0174] The message generating unit is used to generate a new picture message corresponding to the current picture to be stored based on the basic information of the current picture to be stored.

[0175] The sending unit is used to send the newly added picture message corresponding to the current picture to be stored to the message queue, so as to feed back the newly added picture message corresponding to the current picture to be stored to each business system monitoring the message queue.

[0176] The audit unit is used to audit the current picture to be stored, obtain the audit result of the current picture to be stored, and feed back the audit result of the current picture to be stored to each business system monitoring the message queue through the message queue.

[0177] Optionally, in another embodiment of the present application, the apparatus for unified image management further includes:

[0178] The picture information feedback unit is used to feed back the identifier corresponding to the current picture to be stored in the file index table and the storage address of the current picture to be stored to the target business system if the identifier corresponding to the current picture to be stored exists in the file index table.

[0179] Optionally, in the unified picture management device provided in another embodiment of the present application, the picture storage unit includes:

[0180] The token generation unit is used to generate a current security token corresponding to the current picture to be stored based on the file information of the current picture to be stored.

[0181] The current security token corresponding to the current image to be stored is a security token of the cloud server to be uploaded generated for the current image to be stored. The cloud server to be uploaded refers to the cloud server indicated by the file information of the current image to be stored.

[0182] The token feedback unit is used to feed back the current security token corresponding to the current image to be stored to the target business system to trigger the target business system to use the current security token corresponding to the current image to be stored to store the current image to be stored in the cloud server to be uploaded.

[0183] Optionally, in another embodiment of the present application, the apparatus for unified image management further includes:

[0184] The online unit is used to put the current picture to be stored online when the review result of the current picture to be stored is passed, and to feed back the online message of the current picture to be stored to various business systems monitoring the message queue through the message queue.

[0185] The deletion unit is used to delete the image metadata of the current image to be stored from the local computer if the audit result of the current image to be stored is not passed, or when an offline instruction for the current image to be stored is received, and delete the identifier and storage address corresponding to the current image to be stored from the file index table.

[0186] The offline unit is used to delete the current image to be stored from the corresponding cloud server, and feed back the offline message of the current image to be stored to each business system monitoring the message queue through the message queue.

[0187] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, and will not be repeated here.

[0188] Another embodiment of the present application provides an electronic device, such as Figure 8 Shown, including:

[0189] Memory 801 and processor 802 .

[0190] The memory 801 is used to store programs.

[0191] The processor 802 is used to execute the program stored in the memory 801. When the program is executed, it is specifically used to implement the unified picture management method provided in any one of the above embodiments.

[0192] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement the unified image management method provided in any of the above embodiments.

[0193] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0194] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0195] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for unified picture management, characterized in that: include: Receive target image access requests sent by users through any business system; Determine whether the image corresponding to the access link of the target image access request is cached; If it is determined that the image corresponding to the access link of the target image access request is cached, feeding back the cached image corresponding to the access link of the target image access request to the user; If it is determined that the image corresponding to the access link of the target image access request is not cached, then based on the target image access request, determining a target cloud server storing the target image from each connected cloud server; Determining whether image slicing is required based on image specification information in the access link of the target image access request; If it is determined that image cropping is not necessary, the original image of the target image is obtained from the target cloud server and fed back to the user; caching the original image of the target image as the image corresponding to the access link of the target image access request; If it is determined that image slicing is required, the current image slicing rule is converted into the image slicing rule of the target cloud server, so as to slice the original image of the target image according to the image slicing rule of the target cloud server to obtain the current image slicing of the target image; The current cut image of the target image is fed back to the user, and the current cut image of the target image is cached as the image corresponding to the access link of the target image access request.

2. The method according to claim 1, characterized in that Before caching the current slice of the target image as the image corresponding to the access link of the target image access request, the method further includes: Determine whether the number of requests to access the current cut of the target image within a historical preset time length from the current moment is greater than a preset number; wherein, if it is determined that the number of requests to access the current cut of the target image within a historical preset time length from the current moment is greater than a preset number, then execute the step of caching the current cut of the target image as the image corresponding to the access link of the target image access request.

3. The method according to claim 1, characterized in that Also includes: Determine the number of times the currently cached image has been accessed within a historical target time period; wherein the historical target time period is a historical time period of a specified length closest to the current moment; Determine an overlay coefficient based on the number of times the currently cached image has been accessed within a historical target time period; wherein the greater the number of times the image has been accessed, the greater the overlay coefficient; If the currently cached image is an original image, the first preset value is added to the superposition coefficient to obtain the current cache time; If the currently cached image is a cut image, the second preset value is added to the superposition coefficient to obtain the current cache time; wherein the first preset value is greater than the second preset value; The cache period of the currently cached image is set to the current cache time.

4. The method according to claim 1, wherein Also includes: Receiving a current image file to be stored sent by a target business system; wherein the target business system is any one of the business systems; the current image file to be stored includes at least the current image to be stored and file information of the current image to be stored; Performing a hash calculation on the current image file to be stored to obtain an identifier corresponding to the current image to be stored; Checking whether there is an identifier corresponding to the current image to be stored in the file index table; If the identification corresponding to the current picture to be stored does not exist in the query file index table, storing the current picture to be stored in the cloud server indicated by the file information of the current picture to be stored based on the file information of the current picture to be stored; Recording the identifier corresponding to the current image to be stored and the storage address of the current image to be stored in the file index table; Storing the image metadata in the file information of the current image to be stored locally; Based on the basic information of the current picture to be stored, generating a new picture message corresponding to the current picture to be stored; Sending the newly added picture message corresponding to the currently to-be-stored picture to the message queue, so as to feed back the newly added picture message corresponding to the currently to-be-stored picture to each of the business systems monitoring the message queue; The current picture to be stored is audited to obtain an audit result of the current picture to be stored, and the audit result of the current picture to be stored is fed back to each of the business systems monitoring the message queue through the message queue.

5. The method according to claim 4, characterized in that After querying the file index table to see whether there is an identifier corresponding to the current image to be stored, the method further includes: If the identifier corresponding to the current picture to be stored is found in the file index table, the identifier corresponding to the current picture to be stored in the file index table and the storage address of the current picture to be stored are fed back to the target business system.

6. The method according to claim 4, characterized in that The storing the current picture to be stored in the cloud server indicated by the file information of the current picture to be stored based on the file information of the current picture to be stored includes: Based on the file information of the current image to be stored, a current security token corresponding to the current image to be stored is generated; wherein the current security token corresponding to the current image to be stored is a security token of a cloud server to be uploaded generated for the current image to be stored; the cloud server to be uploaded refers to the cloud server indicated by the file information of the current image to be stored; The current security token corresponding to the current picture to be stored is fed back to the target business system to trigger the target business system to use the current security token corresponding to the current picture to be stored to store the current picture to be stored in the cloud server to be uploaded.

7. The method according to claim 4, characterized in that After reviewing the current image to be stored, obtaining the review result of the current image to be stored, and feeding back the review result of the current image to be stored to each of the business systems monitoring the message queue through the message queue, the method further includes: If the review result of the current picture to be stored is passed, the current picture to be stored is put online, and the online message of the current picture to be stored is fed back to each of the business systems monitoring the message queue through the message queue; If the audit result of the currently to-be-stored picture is not passed, or a delisting instruction is received for the currently to-be-stored picture, the picture metadata of the currently to-be-stored picture is deleted from the local computer, and the identifier and storage address corresponding to the currently to-be-stored picture are deleted from the file index table; The current image to be stored is deleted from the corresponding cloud server, and the offline message of the current image to be stored is fed back to each of the business systems monitoring the message queue through the message queue.

8. A unified picture management device, characterized in that: include: A first receiving unit is configured to receive a target image access request sent by a user through any business system; A first determining unit, configured to determine whether an image corresponding to the access link of the target image access request is cached; a cache data feedback unit, configured to feed back the cached image corresponding to the access link of the target image access request to the user when determining that the image corresponding to the access link of the target image access request is cached; A server determining unit, configured to, when determining that the image corresponding to the access link of the target image access request is not cached, determine a target cloud server storing the target image from among the connected cloud servers based on the target image access request; a second determining unit, configured to determine whether image slicing is required based on image specification information in the access link of the target image access request; An original image feedback unit, configured to obtain the original image of the target image from the target cloud server and feed it back to the user when it is determined that image cutting is not necessary; an original image caching unit, configured to cache the original image of the target image as the image corresponding to the access link of the target image access request; a cutting unit configured to, when determining that cutting is required, convert its own current cutting rule into the cutting rule of the target cloud server, so as to cut the original image of the target image according to the cutting rule of the target cloud server to obtain the current cut image of the target image; A cut image feedback unit, configured to feed back the current cut image of the target image to the user; The image slicing cache unit is used to cache the current image slicing of the target image as the image corresponding to the access link of the target image access request.

9. An electronic device, characterized in that: include: memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the unified picture management method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that Used to store a computer program, which, when executed, is used to implement the unified picture management method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Dynamic picture caching method and device, equipment and storage medium

    CN113849753A

  • Vehicle function picture generation method and device based on client and storage medium

    CN116450057A