Image processing method, electronic equipment and storage medium
By receiving image access requests and finding the actual storage location, the problem of inaccessibility during image re-entry is solved, and real-time access to images is achieved.
Patent Information
- Application Number
- CN202510265336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-08-01
AI Technical Summary
During the process of re-entering the image to the cloud storage domain, the image cannot be accessed normally, resulting in real-time access failure.
By receiving image access requests, using logical positioning information to find the actual storage location from the configuration information, directly access the images in the cloud storage domain or local storage area, real-time access to the images is achieved.
Even during the image re-recording process, the real storage location of the image can be found to achieve real-time access to the image.
Smart Images

Figure CN120407278A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer science and technology, and particularly to an image processing method, an electronic device, and a storage medium. Background Art
[0002] With the development of image acquisition technology, data collectors such as front-end devices generally provide a cache backfilling function, that is, when the network returns to normal or the cloud storage domain returns to normal, the images stored locally are backfilled to the corresponding cloud storage domain. However, during the process of backfilling the images stored locally to the corresponding cloud storage domain, the images cannot be accessed normally. Only after the image backfilling is completed can the images be accessed normally, resulting in the inability to access images in real time. Summary of the Invention
[0003] The main technical problem to be solved by this application is to provide an image processing method, an electronic device, and a storage medium that can access images in real time.
[0004] To solve the above technical problem, one technical solution adopted by this application is to provide an image processing method, which includes: receiving an image access request, where the image access request includes the logical location information of the image to be accessed, and the image to be accessed is stored in the cloud storage domain or the local storage area of the front-end device. The cloud storage domain is used to store the images collected by the front-end device, and the local storage area is used to store backup images. The backup images are the images collected by the front-end device when a storage exception occurs in the cloud storage domain; finding, from the configuration information, the image storage location corresponding to the logical location information as the actual storage location of the image to be accessed; and accessing the image to be accessed from the cloud storage domain or the local storage area using the actual storage location.
[0005] To solve the above technical problem, another technical solution adopted by this application is: to provide an electronic device, which includes a memory and a processor. The memory stores program instructions, and the processor is used to execute the program instructions to implement the above-mentioned pattern processing method.
[0006] To solve the above technical problem, another technical solution adopted by this application is: to provide a computer-readable storage medium, which is used to store program instructions that can be executed to implement the above-mentioned pattern processing method.
[0007] In the above solution, upon receiving an image access request, where the image access request includes the logical location information of the image to be accessed. From the configuration information, the image storage location corresponding to the logical location information is found and used as the actual storage location of the image to be accessed. Using the actual storage location, the image to be accessed is accessed from the cloud storage domain or the local storage area. In this application, by finding the actual storage location of the image corresponding to the logical location information, the access request for the image is thus converted into an access request for the corresponding image in the local storage or the cloud storage domain, that is, the access to the image is achieved using the actual storage location. Then, even during the process of supplementary recording of the image, the true storage location of the image can be found, and the image access is achieved using the true storage location, thereby realizing real-time image access. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a flowchart of an embodiment of the image processing method provided by this application;
[0009] Figure 2 is a partial flowchart of a specific embodiment of the supplementary recording of backup images in the image processing method provided by this application;
[0010] Figure 3 is a partial flowchart of another specific embodiment of the supplementary recording of backup images in the image processing method provided by this application;
[0011] Figure 4 is a flowchart of a specific embodiment of the cloud storage status dynamic detection algorithm of the image processing method provided by this application;
[0012] Figure 5 is a flowchart of an embodiment of the pattern processing device provided by this application; <Q
[0013] Figure 6 is a framework diagram of an embodiment of the electronic device provided by this application;
[0014] Figure 7 is a framework diagram of an embodiment of the computer-readable storage medium provided by this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0015] To make the objectives, technical solutions and effects of this application clearer and more definite, the following further elaborates on this application with reference to the accompanying drawings and by way of examples.
[0016] It should be noted that in this text, the term "a number of" means at least one, and the terms "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. The term "and / or" simply describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in this text, the character " / " generally indicates that the related objects before and after are in an "or" relationship. In addition, the term "at least one" in this text means any one or any combination of at least two of multiple ones. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set composed of A, B, and C.
[0017] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of an embodiment of the image processing method provided by this application. It should be noted that if there are substantially the same results, this embodiment is not limited to Figure 1 the process sequence shown. As Figure 1 shown, this embodiment includes:
[0018] Step S11: Receive an image access request. Among them, the image access request includes the logical location information of the image to be accessed.
[0019] The image to be accessed is stored in the cloud storage domain or the local storage area of the front-end device. The cloud storage domain is used to store the images collected by the front-end device, and the local storage area is used to store backup images. The backup images are the images collected by the front-end device when there is a storage exception in the cloud storage domain.
[0020] The image access request can be the complete address of the image to be accessed, the resource address pointing to the image to be accessed from the page, or a special protocol address. Among them, the complete address of the image to be accessed usually starts with "http: / / " or "https: / / ", and the complete address of the image to be accessed contains all the information required to access the picture. The resource address pointing to the image to be accessed from the page usually starts with " / ", indicating the root directory of the website, or contains ". / " indicating the current directory, or ".. / " indicating the upper-level directory. The special protocol address, such as FTP (File Transfer Protocol), usually starts with "ftp: / / " and is used to directly access the files on the FTP server.
[0021] The logical location information can exist in the form of a partial path, query string, index number, or identifier in the image access request.
[0022] In one embodiment, the image access request is the complete address of the image to be accessed, and the logical location information of the image to be accessed is a partial path in the image access request.
[0023] For example, the image access request is https: / / ip:port / logic / image_traffic / abc.jpg, where image_traffic / abc.jpg is the logical location information and abc.jpg is the image to be accessed.
[0024] The front-end device refers to the front-end acquisition device, such as a camera, a sensor, etc. These devices are responsible for acquiring video, audio or other forms of signals at the scene and transmitting them to the cloud storage for storage.
[0025] The cloud storage includes at least one cloud storage domain, and the image to be accessed is stored in the corresponding cloud storage domain. Among them, the cloud storage domain is used to store the images acquired by the front-end device, and the images acquired by the front-end device at least include the image to be accessed. In one embodiment, different images to be accessed can be stored on the corresponding cloud storage domains according to the service type.
[0026] The local storage area of the front-end device can be the storage device in the front-end device. Among them, the local storage area is used to store the images acquired by the front-end device when a storage exception occurs in the cloud storage domain, that is, the local storage area is used to store backup images. For example, the SD card or hard disk in the front-end device is used to store backup images.
[0027] Step S12: Find the image storage location corresponding to the logical location information from the configuration information as the actual storage location of the image to be accessed.
[0028] The configuration information may include multiple sub-configuration information. In one embodiment, the configuration information includes logical configuration information, cloud configuration information, and local configuration information. Find the type of image storage area corresponding to the logical location information from the logical configuration information. In response to the current image storage area type being the cloud storage domain, find the image storage location corresponding to the logical location information from the cloud configuration information as the actual storage location of the image to be accessed. <*
[0029] In another embodiment, the configuration information includes logical configuration information, cloud configuration information, and local configuration information. Find the type of image storage area corresponding to the logical location information from the logical configuration information. In response to the current image storage area type being the local storage area, find the image storage location corresponding to the logical location information from the local configuration information as the actual storage location of the image to be accessed.
[0030] In one embodiment, the configuration information includes logical configuration information, cloud configuration information, and local configuration information. From the logical configuration information, find the type of image storage area corresponding to the logical positioning information. In response to the current image storage area type being the cloud storage domain, find the image storage location corresponding to the logical positioning information from the cloud configuration information as the actual storage location of the image to be accessed. In response to the current image storage area type being the local storage area, find the image storage location corresponding to the logical positioning information from the local configuration information as the actual storage location of the image to be accessed.
[0031] In a specific embodiment, the cloud configuration information may include multiple sub-configuration information. That is, the cloud configuration information may include the cloud configuration information corresponding to multiple cloud storage domains. From the cloud configuration information corresponding to multiple cloud storage domains, find the image storage location corresponding to the logical positioning information as the actual storage location of the image to be accessed. For example, the cloud storage includes three cloud storage domains A, B, and C, and the cloud configuration information includes the cloud configuration information corresponding to A, the cloud configuration information corresponding to B, and the cloud configuration information corresponding to C. Find the actual storage location of the image to be accessed from the cloud configuration information corresponding to A, the cloud configuration information corresponding to B, and the cloud configuration information corresponding to C. Of course, the cloud configuration information may also have only one sub-configuration information, which is not limited here.
[0032] The multiple sub-configuration information in the configuration information can record the same or different image information respectively to facilitate the search for the actual storage location of the image to be accessed. For example, the logical configuration information records the first image information, the cloud configuration information records the second image information, and the local configuration information records the third image information. Among them, at least part of the first image information, the second image information, and the third image information may be different. In a specific embodiment, the logical configuration information records the first image information corresponding to different logical positioning information, and the first image information includes the type of image storage area. The cloud configuration information records the second image information corresponding to different logical positioning information, and the local configuration information records the third image information corresponding to different logical positioning information. Both the second image information and the third image information include the image storage location. The logical positioning information recorded by the logical configuration information includes the logical positioning information recorded by the cloud configuration information and the logical positioning information recorded by the local configuration information.
[0033] The first image information, the second image information, and the third image information may also record image information representing image features. For example, image type, synchronization flag, deletion flag, etc. are not limited here and can be set according to actual requirements. In a specific embodiment, the first image information further includes at least one of the image creation time, the domain identifier of the cloud storage domain to which the image needs to be stored, the image type, and the synchronization flag, and the synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain. The second image information further includes at least one of the image creation time and the image type. The third image information further includes at least one of the image creation time, the image type, and the deletion flag, and the deletion flag indicates whether the corresponding image in the local storage area has been successfully locally deleted in the case of being backfilled to the cloud storage domain. Among them, the image creation time may be but is not limited to a timestamp.
[0034] In yet another specific embodiment, the logical configuration information, the cloud configuration information, and the local configuration information are in a table structure.
[0035] Illustrative examples are given in conjunction with Table 1, Table 2, and Table 3 below. Table 1 is the storage structure of the logical configuration information, Table 2 is the storage structure of the cloud configuration information corresponding to a cloud storage domain, and Table 3 is the storage structure of the local configuration information. In Table 1, logic_url is the logical positioning information, timestamp is the image creation time, region_id is the domain identifier of the cloud storage domain to which the image needs to be stored, imag e_type is the image type, storage_type is the image storage area type, and is_sync is the synchronization flag. In Table 2, logic_url is the logical positioning information, cloud_url is the image storage location, image_type is the image type, and timestamp is the image creation time. In Table 3, logic_url is the logical positioning information, local_url is the image storage location, image_type is the image type, timestamp is the image creation time, and del_tag is the deletion flag.
[0036] For example, the image access request is https: / / ip:port / logic / image_traffic / abc.jpg. Search for the image storage area type corresponding to the logic location information image_traffic / abc.jpg in the logic configuration information table 1, which is cloud (cloud storage domain). Search for the corresponding logic location information image_traffic / abc.jpg from the cloud configuration information corresponding to multiple cloud storage domains, and determine the cloud configuration information corresponding to the corresponding cloud storage domain (Table 2). Search in Table 2 for the image storage location corresponding to the logic location information image_traffic / abc.jpg, which is cloud_image_traffic / abc.jpg, and use cloud_image_traffic / abc.jpg as the actual storage location of the image abc.jpg to be accessed.
[0037] For another example, the image access request is https: / / ip:port / logic / image_animal / efg.jpg. Search for the image storage type corresponding to image_animal / efg.jpg in Table 1, which is local (local storage area). Search in Table 3 for the image storage location corresponding to image_animal / efg.jpg, which is local_image_traffic / abc.jpg, and use local_image_traffic / abc.jpg as the actual storage location of the image efg.jpg to be accessed.
[0038] Table 1
[0039]
[0040] Table 2
[0041] id logic_url cloud_url image_type timestamp 1 image_traffic / abc.jpg cloud_image_traffic / abc.jpg traffic 1727165550
[0042] Table 3
[0043] id logic_url local_url image_type timestamp del_tag 1 image_animal / efg.jpg local_image_traffic / abc.jpg animal 1727165471 0
[0044] Step S13: Use the actual storage location to access the image to be accessed from the cloud storage domain or the local storage area.
[0045] The image to be accessed can be directly accessed in the local storage area or the cloud storage domain according to the actual storage location, or the image to be accessed can be accessed in the programming environment using the actual storage location, etc. There is no limit here on how to access the image to be accessed from the cloud storage domain or the local storage area.
[0046] Considering that images of different business types or different time periods need to be stored in different storage domains for easy analysis. For at least some of the backup images in the local storage area, they can be supplemented and recorded into the corresponding cloud storage domain. In one embodiment, in response to the start of the supplementary recording task, at least some of the backup images in the local storage area are used as the images to be supplemented and recorded. The images to be supplemented and recorded are supplemented and recorded into the cloud storage domain. The configuration information is updated, and the images to be supplemented and recorded in the local storage area are deleted, where the image storage location corresponding to the images to be supplemented and recorded in the updated configuration information is updated to the cloud storage domain.
[0047] The above supplementary recording task can be a scheduled task or an unscheduled task, that is, the supplementary recording task can be a scheduled task or a manually started task, and there is no limitation here.
[0048] In a specific embodiment, updating the configuration information not only updates the image storage location, but also can update the image storage area type and synchronization flag in the logical configuration information. A new line is added to the cloud configuration information to store the corresponding images to be supplemented and recorded. The deletion flag in the local configuration information can be updated, or the corresponding line about the images to be supplemented and recorded in the local configuration information can be deleted. There is no limitation here.
[0049] One business type can correspond to one image type or multiple image types. The image type or the image creation time can be filtered to achieve the filtering of business types and time periods. In a specific embodiment, the configuration information includes logical configuration information, and the logical configuration information records the first image information corresponding to different logical positioning information. The first image information includes the first image attribute and the second image attribute. The first image attribute includes at least one of the image creation time, the domain identifier of the cloud storage domain where the image needs to be stored, and the image type. The second image attribute includes at least one of the image storage area type and the synchronization flag. The synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain. Based on the second image attribute, the backup images in the local storage area that have not been supplemented and recorded into the cloud storage domain are determined as candidate images. And, the specified range of at least one first image attribute input by the user is obtained. The candidate images whose first image attributes match the specified range are used as the images to be supplemented and recorded.
[0050] The above images to be supplemented and recorded can determine the corresponding cloud storage domain to be stored from the logical information. In a specific embodiment, the configuration information includes logical configuration information, and the logical configuration information records the domain identifier of the cloud storage domain where the image needs to be stored in the first image information corresponding to different logical positioning information. Each image to be supplemented and recorded is synchronized to the cloud storage domain pointed to by the corresponding domain identifier.
[0051] Combined Figure 2 and Figure 3 For example, Figure 2It is a partial flowchart of a specific embodiment of the backup image supplement for the image processing method provided by this application. Figure 3 It is a partial flowchart of another specific embodiment of the backup image supplement for the image processing method provided by this application.
[0052] Step S21: Traverse the synchronization flag in the logical configuration information. Step S22: Determine whether the synchronization flag is synchronized. If the determination result in step S22 is no, execute step S23: Use the backup image corresponding to the synchronization flag as a candidate image, and add the candidate image to the synchronization queue. If the determination result in step S22 is yes, execute step S21. After executing step S23, re-execute step S21.
[0053] Step S31: Traverse each candidate image in the synchronization queue. Step S32: Obtain the candidate image that matches the specified range of the image type or image creation time input by the user as the corresponding image to be supplemented. Step S33: Synchronize the image to be supplemented to the cloud storage domain pointed to by the corresponding domain identifier. Step S34: Update the configuration information and delete the image to be supplemented in the local storage area. Among them, in the updated configuration information, the image storage location corresponding to the image to be supplemented is updated to the cloud storage domain. After executing step S34, re-execute step S31.
[0054] Among them, step S21 and step S31 can start synchronously, or not synchronously. It can be set according to the actual situation. Step S21 can be re-executed regularly, or step S31 can be re-executed regularly. There is no limit here.
[0055] The images collected by the front-end device can determine the backup images that need to be stored in the local storage area through the cloud storage status dynamic detection algorithm. In one embodiment, when it is detected that there is a storage exception in the cloud storage domain, the current image storage mode is switched to the local storage mode. In the local storage mode, the images collected by the front-end device are used as backup images and stored in the local storage area.
[0056] In a specific embodiment, the cloud storage status dynamic detection algorithm is started by a timing task or manually, that is, detecting a storage exception in the cloud storage domain and subsequent steps are started by a timing task or manually. Among them, the timing task can set a default trigger time. For example, the default trigger time is 1 second. It is also possible not to use the default trigger time and manually set the trigger time of the timing task.
[0057] It is possible to determine whether there is a storage anomaly by detecting the real-time situation or status information of the cloud storage domain. Among them, the status information may include the status of the cloud storage domain or the connection status between the cloud storage domain and the front-end device. In a specific embodiment, a callback message indicating a failure to write to the cloud storage domain is received. Alternatively, the following detection tasks are periodically executed: detecting the status of the cloud storage domain and detecting the connection status between the front-end device and the cloud storage domain. In response to an anomaly in the status of the cloud storage domain or an anomaly in the connection status, it is determined that a storage anomaly has occurred in the cloud storage domain.
[0058] In yet another specific embodiment, after switching the current image storage mode to the local storage mode, in response to detecting that the cloud storage domain has resumed normal storage and the duration of the local storage mode is not less than a preset time, the current image storage mode is switched to the cloud storage mode. In the cloud storage mode, the images collected by the front-end device are stored in the cloud storage domain. Among them, the cloud storage domain is the cloud storage domain corresponding to the domain identifier of the cloud storage domain where the images need to be stored in the logical configuration information.
[0059] For example, the preset time can be set manually. When the preset time is 2 minutes, when it is detected that the cloud storage domain has resumed normal storage and the duration of the local storage mode is not less than 2 minutes, the current image storage mode is switched to the cloud storage mode.
[0060] The status of the cloud storage domain can be obtained by synthesizing multiple sub-states. In a specific embodiment, the status of each sub-service, data synchronization status, system capacity, and load in the cloud storage domain are detected to obtain the comprehensive status of the cloud storage domain. In response to the comprehensive status being characterized as an abnormal status, it is determined that the status of the cloud storage domain has an anomaly.
[0061] In yet another specific embodiment, the status of each sub-service can characterize the health status of each independent service component. The data synchronization status characterizes the synchronization of data between different storage nodes or different services. The system capacity characterizes the maximum load and storage capacity that can be tolerated. The load characterizes the current load situation. A threshold can be set for each of the above sub-states such as the system capacity. When the threshold is exceeded, the corresponding sub-state is characterized as abnormal. When at least one of the sub-states is abnormal, the comprehensive status is characterized as an abnormal status.
[0062] Combined with Figure 4 for example, Figure 4 is a schematic flowchart of a specific embodiment of the cloud storage status dynamic detection algorithm of the image processing method provided by this application. Among them, step S41 and step S43 can be regarded as the steps corresponding to two branches.
[0063] Step S41: In response to receiving a callback message indicating a failure in writing to the cloud storage domain, perform Step S42: Switch the current image storage mode to the local storage mode. After performing Step S42, perform Step S43.
[0064] Step S43: Periodically detect the status of the cloud storage domain and the connection status between the front-end device and the cloud storage domain. After performing Step S43, perform Step S44: Determine whether both the status of the cloud storage domain and the connection status between the front-end device and the cloud storage domain are normal. If the determination result in Step S44 is no, perform Step S42: Switch the current image storage mode to the local storage mode. If the determination result in Step S44 is yes, perform Step S45: Switch the current image storage mode to the cloud storage mode. After performing Step S45, re-perform Step S43.
[0065] It should be noted that after switching the current image storage mode to the local storage mode, perform Step S43. In response to the determination result in Step S44 being yes and the duration of the local storage mode being not less than a preset time, perform Step S45: Switch the current image storage mode to the cloud storage mode.
[0066] Considering that the storage space in the local storage area of the front-end device is fixed, before storing the backup image in the local storage area, the backup image can be preprocessed to reduce the size of the image data corresponding to the backup image, thereby increasing the storage capacity of the backup images that can be supplemented. In one embodiment, the backup image is compressed using a compression method matching the service type of the backup image. The compressed backup image is stored in the local storage area.
[0067] In a specific embodiment, the backup image can be compressed using cropping.
[0068] In yet another specific embodiment, the backup image can be compressed using format conversion.
[0069] In another specific embodiment, the backup image can be compressed using cropping and format conversion.
[0070] In another specific embodiment, in response to the service type of the backup image being the license plate type, crop the area of the backup image other than the license plate. In response to the service type of the backup image being the image type for mobile viewing, convert the backup image into a thumbnail. In response to the service type of the backup image being the feature extraction type, convert the backup image into a grayscale image. In response to the service type of the backup image being the image type that is not sensitive to image quality, convert the backup image into a lossy compression format.
[0071] Of course, when the backup image is of other service types, corresponding compression methods can also be used to compress the backup image, without limitation here.
[0072] Please refer to Figure 5 , Figure 5 FIG. is a schematic flowchart of an embodiment of the pattern processing device of the present application. The pattern processing device 500 includes an image access request receiving module 510, an image storage location module 520, and an image access module 530. The image access request receiving module 510 is configured to receive an image access request, where the image access request includes logical location information of the image to be accessed, and the image to be accessed is stored in a cloud storage domain or a local storage area of a front-end device. The cloud storage domain is used to store images collected by the front-end device, and the local storage area is used to store backup images, where the backup images are images collected by the front-end device when a storage exception occurs in the cloud storage domain. The image storage location module 520 is configured to find, from the configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed. The image access module 530 is configured to use the actual storage location to access the image to be accessed from the cloud storage domain or the local storage area.
[0073] In some embodiments, the configuration information includes logical configuration information, cloud configuration information, and local configuration information. When the image storage location module 520 executes to find, from the configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed, it includes: finding, from the logical configuration information, an image storage area type corresponding to the logical location information; in response to the current image storage area type being the cloud storage domain, finding, from the cloud configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed; in response to the current image storage area type being the local storage area, finding, from the local configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed.
[0074] In some embodiments, the logical configuration information records first image information corresponding to different logical location information, where the first image information includes an image storage area type; the cloud configuration information records second image information corresponding to different logical location information, and the local configuration information records third image information corresponding to different logical location information. Both the second image information and the third image information include an image storage location; the logical location information recorded in the logical configuration information includes the logical location information recorded in the cloud configuration information and the logical location information recorded in the local configuration information.
[0075] In some embodiments, the first image information further includes at least one of the image creation time, the domain identifier of the cloud storage domain to which the image needs to be stored, the image type, and the synchronization flag, where the synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain; the second image information further includes at least one of the image creation time and the image type; the third image information further includes at least one of the image creation time, the image type, and the deletion flag, where the deletion flag indicates whether the corresponding image in the local storage area has been successfully locally deleted in the case that it has been backfilled to the cloud storage domain.
[0076] In some embodiments, the logical configuration information, the cloud configuration information, and the local configuration information are in a table structure.
[0077] In some embodiments, the pattern processing device 500 further includes a to-be-backfilled image confirmation module, a backfilling module, and an updating module. The to-be-backfilled image confirmation module is configured to, in response to the start of a backfilling task, use at least some of the backup images in the local storage area as to-be-backfilled images. The backfilling module is configured to backfill the to-be-backfilled images to the cloud storage domain. The updating module is configured to update the configuration information and delete the to-be-backfilled images in the local storage area, where, in the updated configuration information, the image storage location corresponding to the to-be-backfilled images is updated to the cloud storage domain.
[0078] In some embodiments, the configuration information includes logical configuration information, and the logical configuration information records the first image information corresponding to different logical positioning information. The first image information includes a first image attribute and a second image attribute. The first image attribute includes at least one of the image creation time, the domain identifier of the cloud storage domain to which the image needs to be stored, and the image type. The second image attribute includes at least one of the image storage area type and the synchronization flag, where the synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain. When the to-be-backfilled image confirmation module executes using at least some of the backup images in the local storage area as to-be-backfilled images, it includes: based on the second image attribute, determining the backup images in the local storage area that have not been backfilled to the cloud storage domain as candidate images; and obtaining the specified range input by the user regarding at least one of the first image attributes; using the candidate images whose first image attributes match the specified range as the to-be-backfilled images;
[0079] In some embodiments, the configuration information includes logical configuration information, and the logical configuration information records the first image information corresponding to different logical positioning information. The first image information includes the domain identifier of the cloud storage domain to which the image needs to be stored. When the backfilling module executes backfilling the to-be-backfilled images to the cloud storage domain, it includes: synchronizing each to-be-backfilled image to the cloud storage domain pointed to by the corresponding domain identifier.
[0080] In some embodiments, the pattern processing device 500 further includes a storage mode switching module and a local storage module. The storage mode switching module is configured to detect a storage exception in the cloud storage domain and switch the current image storage mode to the local storage mode. The local storage module is configured to, in the local storage mode, use the images collected by the front-end device as backup images and store the backup images in the local storage area.
[0081] In some embodiments, the storage mode switching module, when detecting a storage exception in the cloud storage domain, includes: receiving a callback message indicating a write failure in the cloud storage domain; or periodically performing the following detection tasks: detecting the status of the cloud storage domain and the connection status between the front-end device and the cloud storage domain; and determining that a storage exception has occurred in the cloud storage domain in response to an abnormal status of the cloud storage domain or an abnormal connection status.
[0082] In some embodiments, the pattern processing device 500 further includes a cloud storage module. After the storage mode switching module switches the current image storage mode to the local storage mode, in response to detecting that the cloud storage domain has resumed normal storage and the duration of the local storage mode is not less than a preset time, the current image storage mode is switched to the cloud storage mode. The cloud storage module is configured to, in the cloud storage mode, store the images collected by the front-end device in the cloud storage domain.
[0083] In some embodiments, the storage mode switching module, when detecting the status of the cloud storage domain, includes: detecting the status of each sub-service, data synchronization status, system capacity, and load in the cloud storage domain to obtain the comprehensive status of the cloud storage domain; and determining that the status of the cloud storage domain is abnormal in response to the comprehensive status being characterized as an abnormal status.
[0084] In some embodiments, the local storage module, when storing the backup images in the local storage area, includes: compressing the backup images using a compression method matching the service type of the backup images; and storing the compressed backup images in the local storage area.
[0085] In some embodiments, the compression method includes at least one of cropping and format conversion.
[0086] In some embodiments, the local storage module, when compressing the backup images using a compression method matching the service type of the backup images, includes: cropping the area other than the license plate in the backup images in response to the service type of the backup images being the license plate type; converting the backup images into thumbnails in response to the service type of the backup images being the image type for mobile viewing; converting the backup images into grayscale images in response to the service type of the backup images being the feature extraction type; and converting the backup images into a lossy compression format in response to the service type of the backup images being the image type insensitive to image quality.
[0087] Please refer to Figure 6 , Figure 6 which is a schematic diagram of the framework of an embodiment of the electronic device of the present application. The electronic device 60 includes a memory 61 and a processor 62 that are coupled to each other. The processor 62 is configured to execute program instructions stored in the memory 61 to implement the steps in any of the above-described embodiments of the image processing method. In a specific implementation scenario, the electronic device 60 may include, but is not limited to, a microcomputer, a server. In addition, the electronic device 60 may also include mobile devices such as a laptop computer, a tablet computer, etc., which are not limited herein.
[0088] Specifically, the processor 62 is configured to control itself and the memory 61 to implement the steps in any of the above-described embodiments of the image processing method. The processor 62 may also be referred to as a CPU (Central Processing Unit). The processor 62 may be an integrated circuit chip having the ability to process signals. The processor 62 may also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 62 may be implemented jointly by integrated circuit chips.
[0089] Please refer to Figure 7 , Figure 7 which is a schematic diagram of the framework of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 70 stores program instructions 71 that can be run by a processor. The program instructions 71 are used to implement the steps in any of the above-described embodiments of the image processing method.
[0090] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0091] The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments. The same or similar parts can be referred to each other. For the sake of brevity, they will not be repeated herein.
[0092] In several embodiments provided by the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0093] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
Claims
1. An image processing method, characterized in that, The method includes: Receiving an image access request, where the image access request includes logical location information of an image to be accessed. The image to be accessed is stored in a cloud storage domain or a local storage area of a front-end device. The cloud storage domain is used to store images collected by the front-end device, and the local storage area is used to store backup images. The backup images are images collected by the front-end device when a storage exception occurs in the cloud storage domain; Looking up, from the configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed; Using the actual storage location to access the image to be accessed from the cloud storage domain or the local storage area.
2. The method according to claim 1, wherein The configuration information includes logical configuration information, cloud configuration information, and local configuration information; The looking up, from the configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed includes: Looking up, from the logical configuration information, an image storage area type corresponding to the logical location information; In response to the current image storage area type being the cloud storage domain, looking up, from the cloud configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed; and / or, In response to the current image storage area type being the local storage area, looking up, from the local configuration information, an image storage location corresponding to the logical location information as the actual storage location of the image to be accessed.
3. The method according to claim 2, wherein The logical configuration information records first image information corresponding to different logical location information. The first image information includes an image storage area type; the cloud configuration information records second image information corresponding to different logical location information, and the local configuration information records third image information corresponding to different logical location information. Both the second image information and the third image information include an image storage location; the logical location information recorded in the logical configuration information includes the logical location information recorded in the cloud configuration information and the logical location information recorded in the local configuration information.
4. The method according to claim 3, wherein The first image information further includes at least one of an image creation time, a domain identifier of a cloud storage domain to which the image needs to be stored, an image type, and a synchronization flag. The synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain; the second image information further includes at least one of an image creation time and an image type; the third image information further includes at least one of an image creation time, an image type, and a deletion flag. The deletion flag indicates whether the corresponding image in the local storage area has been successfully locally deleted in the case where it has been supplemented and recorded in the cloud storage domain; and / or, the logical configuration information, the cloud configuration information, and the local configuration information are in a table structure.
5. The method according to claim 1, wherein The method further includes: In response to the start of the supplementary recording task, at least part of the backup images in the local storage area are used as images to be supplemented; the images to be supplemented are supplemented into the cloud storage domain; the configuration information is updated, and the images to be supplemented in the local storage area are deleted, where in the updated configuration information, the image storage location corresponding to the images to be supplemented is updated to the cloud storage domain; and / or, When it is detected that there is a storage exception in the cloud storage domain, the current image storage mode is switched to the local storage mode; in the local storage mode, the images collected by the front-end device are used as backup images, and the backup images are stored in the local storage area.
6. The method according to claim 5, characterized in that, The configuration information includes logical configuration information, and the logical configuration information records first image information corresponding to different logical positioning information. The first image information includes a first image attribute and a second image attribute. The first image attribute includes at least one of the image creation time, the domain identifier of the cloud storage domain to which the image needs to be stored, and the image type. The second image attribute includes at least one of the image storage area type and the synchronization flag. The synchronization flag indicates whether the corresponding image has been stored in the cloud storage domain; The step of using at least part of the backup images in the local storage area as images to be supplemented includes: Based on the second image attribute, determining the backup images in the local storage area that have not been supplemented into the cloud storage domain as candidate images; and, Obtaining a specified range of at least one of the first image attributes input by the user; Using the candidate images whose first image attributes match the specified range as the images to be supplemented; and / or, the configuration information includes logical configuration information, and the logical configuration information records first image information corresponding to different logical positioning information, and the first image information includes the domain identifier of the cloud storage domain to which the image needs to be stored; the step of supplementing the images to be supplemented into the cloud storage domain includes: Synchronizing each of the images to be supplemented to the cloud storage domain pointed to by the corresponding domain identifier; and / or, the detection that there is a storage exception in the cloud storage domain includes: Receiving a callback message indicating a write failure in the cloud storage domain; or, Periodically performing the following detection tasks: detecting the status of the cloud storage domain and detecting the connection status between the front-end device and the cloud storage domain; in response to an exception in the status of the cloud storage domain or an exception in the connection status, determining that there is a storage exception in the cloud storage domain; and / or, after the current image storage mode is switched to the local storage mode, the method further includes; In response to detecting that the cloud storage domain has resumed normal storage and the duration of the local storage mode is not less than a preset time, switching the current image storage mode to the cloud storage mode; In the cloud storage mode, storing the images collected by the front-end device in the cloud storage domain; and / or, the step of storing the backup images in the local storage area includes: Compressing the backup images using a compression method that matches the service type of the backup images; Store the compressed backup image in the local storage area.
7. The method according to claim 6, wherein The detecting the status of the cloud storage domain includes: Detect the status of each sub-service, data synchronization status, system capacity and load in the cloud storage domain to obtain the comprehensive status of the cloud storage domain; In response to the comprehensive status being characterized as an abnormal status, determine that the status of the cloud storage domain is abnormal.
8. The method according to claim 6, characterized in that, The compression method includes at least one of cropping and format conversion; And / or, the compressing the backup image by using a compression method matching the service type of the backup image includes: In response to the service type of the backup image being a license plate type, crop the area other than the license plate in the backup image; In response to the service type of the backup image being an image type for mobile viewing, convert the backup image into a thumbnail; In response to the service type of the backup image being a feature extraction type, convert the backup image into a grayscale image; In response to the service type of the backup image being an image type insensitive to image quality, convert the backup image into a lossy compression format.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory stores program instructions, and the processor is configured to execute the program instructions to implement the image processing method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the image processing method according to any one of claims 1-8.