An image clustering method, a smart terminal, and a storage medium
By dividing the image queue into batch sets and recording the process status, the problem of data duplication and consistency caused by anomalies in image clustering tasks is solved, resulting in a faster processing flow and better data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2026-03-10
AI Technical Summary
Existing image clustering tasks are prone to repeated data loading and calculation when encountering abnormal situations, which prolongs the running time and causes consistency problems among multiple image data.
The images in the image queue are divided into multiple batch sets based on time order, images are pulled and clustered in batches, the process status is recorded, and the operation is rolled back in case of failure to ensure data consistency.
This reduces the number of image set fetching and clustering operations, optimizes process time, avoids data loss and duplicate output, and ensures data consistency.
Smart Images

Figure CN115205539B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image classification, and in particular to an image clustering method, an intelligent terminal, and a computer readable storage medium. BACKGROUND
[0002] Due to various abnormal reasons in the running process of the image clustering task, such as environment problems, data format protocol changes, and abnormal problems of file data output media, the task may be abnormal or failed. When the failed task is re-run, repeated loading and calculation of data may occur, thereby causing consistency problems of image data.
[0003] The current image clustering scheme directly selects to re-run the task and the entire process in response to various abnormal situations in the running process of the task. However, in some cases, the task may only be abnormal at a certain stage (such as when the file data is output). If the entire task is re-run, repeated loading, calculation, and output of data may occur, thereby causing the re-run task to have a long running time and easily causing consistency problems of multiple image data. SUMMARY
[0004] To solve the above problems, the present application provides an image clustering method, an intelligent terminal, and a computer readable storage medium, which can reduce the number of image set pulling and image clustering and avoid data loss or repeated output of data
[0005] One of the technical solutions adopted by the present application is an image clustering method, which comprises: obtaining an image queue, dividing the images in the image queue into multiple batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on the images in the at least one batch image set to obtain corresponding partition image files; wherein, in response to obtaining each partition image file, backing up the partition image file and recording a first process state; merging the multiple partition image files to obtain a total image file; wherein, in response to obtaining the total image file, backing up the total image file and recording a second process state.
[0006] Optionally, before obtaining the image queue, the method further comprises: obtaining multiple image data; parsing the multiple image data to obtain multiple images and feature information of the multiple images; wherein, the feature information comprises similarity information and space-time information of the multiple images; and adding the multiple images into the image queue based on time sequence.
[0007] Optionally, the pulling of the at least one batch of image sets from the image queue in time sequence comprises: sequentially pulling the at least one batch of image sets from the image queue based on the time sequence of the plurality of batches of image sets; and wherein, in response to each pulling of the at least one batch of image sets, recording the image offset position of the image queue.
[0008] Optionally, the image clustering of the images in the at least one batch of image sets to obtain the corresponding partition image archives comprises: sequentially clustering the images in the at least one batch of image sets based on the time sequence of the plurality of batches of image sets to obtain the plurality of partition image archives using the similarity information and the space-time information; and wherein, in the image clustering of the images, a locking process is performed.
[0009] Optionally, the method further comprises: in response to the failure of the sequential image clustering of the images in the at least one batch of image sets, determining, according to the first process state and the image offset position, one batch of image sets corresponding to the image clustering failure; rolling back the images in the corresponding one batch of image sets to re-perform the image clustering; or in response to the successful clustering of all the images in the at least one batch of image sets, determining whether the backup of all the partition image archives of the at least one batch of image sets is successful; and in response to the backup failure of one partition image archive, rolling back the one partition image archive to re-perform the backup.
[0010] Optionally, the method further comprises: in response to the failure of the aggregation of the plurality of partition image archives, determining, according to the second process state and the total image archive, whether one partition image archive corresponding to the aggregation failure is successfully aggregated; in response to the aggregation failure of the corresponding one partition image archive, rolling back the corresponding one partition image archive to re-perform the aggregation; or in response to the successful aggregation of all the partition image archives, determining whether the backup of the total image archive is successful; and in response to the backup failure of the total image archive, rolling back the total image archive to re-perform the backup.
[0011] Optionally, the method further comprises: obtaining an image archive output instruction; and sequentially outputting part of the partition image archives in the backup total image archive based on the time batch corresponding to the image archive output instruction; wherein, in response to each output of a partition image archive, re-backing up the partition image archive and recording a third process state, the third process state being used for image archive rollback in the event of a total image archive output failure.
[0012] Optionally, the method further comprises: obtaining an image archive deletion instruction; and sequentially deleting the partition image archives in the backup total image archive based on the time batch corresponding to the image archive deletion instruction.
[0013] Another technical scheme adopted by the present application is to provide an intelligent terminal, which comprises a processor and a memory connected with the processor; wherein the memory stores program data, and the processor calls the program data stored in the memory to execute the image clustering method as described above.
[0014] Another technical scheme adopted by the present application is to provide a computer readable storage medium, which stores program data, and the program data, when executed by a processor, is used to implement the image clustering method as described above.
[0015] The image clustering method provided by the present application comprises: obtaining an image queue, dividing images in the image queue into a plurality of batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on images in the at least one batch image set to obtain a corresponding partition image archive; wherein, in response to obtaining each partition image archive, the partition image archive is backed up and a first process state is recorded; and the plurality of partition image archives are aggregated to obtain a total image archive; wherein, in response to obtaining the total image archive, the total image archive is backed up and a second process state is recorded. Through the above manner, on the one hand, at least one batch of image sets are pulled and the images thereof are clustered into partition image archives, which can reduce the number of times of image set pulling and image clustering, and optimize the process. On the other hand, the obtained partition image archives and total image archives are respectively backed up and the process states are recorded, which can avoid the failure of the operation process to cause data loss or repeated output of data. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. Among them:
[0017] Figure 1 is a flowchart of a first embodiment of the trajectory classification method provided by the present application;
[0018] Figure 2 is a schematic diagram of an embodiment of dividing a plurality of batch image sets based on time sequence in the present application;
[0019] Figure 3 is a flowchart of a second embodiment of the trajectory classification method provided by the present application;
[0020] Figure 4 is a flowchart of an embodiment of making an image queue in the present application;
[0021] Figure 5 is a schematic diagram of an embodiment of the aggregated image archive in the present application;
[0022] Figure 6 is a schematic diagram of a third embodiment of the trajectory classification method provided by the present application;
[0023] Figure 7 is a schematic diagram of a fourth embodiment of the trajectory classification method provided by the present application;
[0024] Figure 8 is a schematic diagram of a fifth embodiment of the trajectory classification method provided by the present application;
[0025] Figure 9 is a schematic diagram of a sixth embodiment of the trajectory classification method provided by the present application;
[0026] Figure 10 is a schematic diagram of the structure of an intelligent terminal provided by the present application;
[0027] Figure 11 is a schematic diagram of the structure of an embodiment of the computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, rather than all the structures. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0029] The phrase "embodiment" in the present application means that the specific features, structures or characteristics described in combination with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0030] The steps in the embodiments of the present application do not necessarily have to be processed in the order described, and the steps can be selectively rearranged, deleted or added according to requirements. The step description in the embodiments of the present application is only an optional order combination, and does not represent all order combinations of the embodiments of the present application. The order of the steps in the embodiments cannot be considered as a limitation of the present application.
[0031] The term "and / or" in the embodiments of the present application refers to any and all possible combinations of one or more of the associated listed items. It should also be stated that when used in the present specification, "comprising" specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or components, and / or groups thereof.
[0032] The terms "first", "second", and the like in the present application are used to distinguish different objects, rather than to describe a particular order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or device.
[0033] In addition, although the terms "first", "second", and the like are used repeatedly in the present application to describe various operations (or various elements or various applications or various instructions or various thresholds), etc., these operations (or elements or applications or instructions or thresholds) should not be limited by these terms. These terms are only used to distinguish one operation (or element or application or instruction or threshold) from another operation (or element or application or instruction or threshold). For example, a first process state can be referred to as a second process state, and a second process state can also be referred to as a first process state, as long as the scope of the operations included by the two is different, without departing from the scope of the present application, and the first process state and the second process state are both a collection of various operation states, but they are not the same collection of operation states.
[0034] The intelligent terminal (such as a mobile terminal) of the embodiments of the present application can be implemented in various forms. Among them, the intelligent terminal can be a mobile terminal capable of storing image information and being accessed or transmitting image information, including devices such as image acquisition and identification devices (such as cameras and video recorders), mobile phones, smart phones, notebook computers, personal digital assistants (PDAs), tablet computers (PADs), etc. The intelligent terminal can also be a digital broadcast transmitter, a digital TV, a desktop computer, etc. capable of storing image information and being accessed or transmitting image information. In the following, it is assumed that the terminal is a mobile terminal. However, those skilled in the art will understand that the structure according to the embodiments of the present application can also be applied to terminals of the fixed type, in addition to elements specifically used for mobile purposes.
[0035] Referring to Figure 1 , Figure 1is a flowchart of a first embodiment of a trajectory classification method provided by the present application. The method comprises the following steps:
[0036] Step 11: Obtain an image queue, and divide the images in the image queue into a plurality of batch image sets based on time sequence.
[0037] Specifically, the image queue is obtained from an image database, wherein the images in the image queue are arranged in the order of the shooting time of the images.
[0038] Further, the images in the image queue are divided into a plurality of batch image sets according to the time sequence. Each batch image set represents a set of images in a time domain, and the time domains of two adjacent batch image sets are adjacent. The shooting time of each image in a batch image set is within the corresponding time domain.
[0039] Referring to Figure 2 , Figure 2 is a schematic diagram of an embodiment of dividing a plurality of batch image sets based on time sequence in the present application. In image queue A, all images are divided into five batch image sets based on time sequence. The time domain of the a batch image set is 9:01-10:00, the time domain of the b batch image set is 10:01-11:00, the time domain of the c batch image set is 10:01-12:00, the time domain of the d batch image set is 12:01-13:00, and the time domain of the e batch image set is 13:01-14:00.
[0040] Step 12: Pull at least one batch image set from the image queue based on time sequence.
[0041] Specifically, at least one batch image set is pulled from the image queue according to the time sequence of the plurality of batch image sets. In each pulling of the image set, at least one batch image set is pulled, and the time domains of the adjacent image sets in the at least one batch image set are adjacent. For example, in the image queue, there are 10 batch image sets, and they are pulled out in three times. In the first pulling, the first three batch image sets in the image queue are pulled out; in the second pulling, the fourth batch image set in the image queue is pulled out to the eighth batch image set; in the third pulling, the ninth batch image set in the image queue is pulled out to the tenth batch image set.
[0042] Step 13: Image clustering is performed on the images in the at least one batch image set to obtain a corresponding partition image archive.
[0043] Specifically, after each batch of image sets is pulled, the images in the at least one batch of image sets are clustered to obtain a corresponding partition image archive. Optionally, the images are clustered in a conventional manner, such as calculating the similarity of the images according to the Euclidean distance, Mahalanobis distance, etc. of the images to cluster the images.
[0044] In response to obtaining each partition image archive, the partition image archive is backed up, and the first process state is recorded.
[0045] Specifically, after a partition image archive is completed, the data in the partition image archive is backed up and stored in a storage medium. The first process state is recorded throughout the process, including the success or failure of the partition image archive production, and the success or failure of the partition image archive backup. It can be understood that when the images in the at least one batch of image sets are clustered, if the corresponding partition image archive is successfully obtained, the first process state is the success of the partition image archive production; or when the images in the at least one batch of image sets are clustered, if the corresponding partition image archive cannot be obtained, the first process state is the failure of the partition image archive production; or when the partition image archive is backed up, if the backup is successful, the first process state is the success of the partition image archive backup; or when the partition image archive is backed up, if the backup fails, the first process state is the failure of the partition image archive backup.
[0046] Step 14: The plurality of partition image archives are aggregated to obtain a total image archive.
[0047] Specifically, the plurality of partition image archives produced are sequentially aggregated according to the time domain in chronological order to obtain a total image archive.
[0048] In response to obtaining the total image archive, the total image archive is backed up, and the second process state is recorded.
[0049] Specifically, after the completion of the integrated image archive, the data in the integrated image archive is backed up and stored in a storage medium. The second process state is recorded throughout the entire process, including the success of the integrated image archive production or the failure of the integrated image archive production, and the success of the integrated image archive backup or the failure of the integrated image archive backup. Understandably, when the multiple partition image archives are aggregated, if the integrated image archive is successfully obtained, the second process state is the success of the integrated image archive production; or when the multiple partition image archives are aggregated, if the integrated image archive is not successfully obtained, the second process state is the failure of the integrated image archive production; or when the integrated image archive is backed up, if the backup is successful, the second process state is the success of the integrated image archive backup; or when the integrated image archive is backed up, if the backup fails, the second process state is the failure of the integrated image archive backup.
[0050] Unlike the prior art, the image clustering method provided by the embodiment includes: obtaining an image queue, dividing the images in the image queue into multiple batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; image clustering the images in the at least one batch image set to obtain corresponding partition image archives; wherein, in response to obtaining each partition image archive, backing up the partition image archive and recording a first process state; aggregating the multiple partition image archives to obtain an integrated image archive; wherein, in response to obtaining the integrated image archive, backing up the integrated image archive and recording a second process state. In this way, on the one hand, by pulling at least one batch of image sets and clustering the images in the image sets to form partition image archives, the number of image set pulling and image clustering can be reduced, thereby speeding up the time process of the flow. On the other hand, by respectively backing up the multiple partition image archives and the integrated image archive and recording the corresponding process state, data loss or repeated output of data caused by failure or abnormality of the operation process can be avoided, thereby ensuring the consistency of the data.
[0051] The above optional embodiments are combined and further optimized and expanded based on the above technical solutions to obtain the second embodiment of the trajectory classification method provided by the present application.
[0052] Referring to Figure 3 , Figure 3 is a flowchart of the second embodiment of the trajectory classification method provided by the present application, which includes:
[0053] Step 21: obtaining an image queue, dividing the images in the image queue into multiple batch image sets based on time sequence.
[0054] Wherein, step 21 is similar to step 11 in the above embodiments, which will not be repeated here.
[0055] The image queue in step 21 is created based on video data or image data, meaning that the image queue needs to be created before step 21.
[0056] Please see Figure 4 , Figure 4 This is a schematic flowchart of an embodiment of creating an image queue in this application.
[0057] Step a1: Acquire multiple image data.
[0058] The image data can be obtained through video segmentation, screenshots, or camera captures, etc.
[0059] Step a2: Analyze multiple image data to obtain multiple images and their feature information.
[0060] Specifically, the multiple image data are parsed using a parsing operator to obtain multiple images and their feature information. This feature information includes the image sharpness, coordinates, similarity information, and spatiotemporal information.
[0061] Optionally, based on the feature information of the multiple images, the images are divided into different image information streams, such as face streams, body streams, and vehicle streams. Each type of information stream contains images with the same property. For example, each image in a face stream contains a face, each image in a body stream contains a human body shape, and so on.
[0062] Step a3: Add multiple images to the image queue based on time order.
[0063] Specifically, based on the chronological order of the images captured in each image information stream, the images in that stream are sequentially filled into the image queue. One image queue corresponds to one type of image information stream.
[0064] Step 22: Based on the chronological order of multiple batches of image sets, pull at least one batch of image sets from the image queue multiple times.
[0065] Step 22 is similar to step 12 in the above embodiment, and will not be described again here.
[0066] Specifically, in response to each fetching of at least one batch of images, the image offset position of the image queue is recorded. The recorded image offset position is cached in a storage medium.
[0067] For example, there are 10 batch image sets in the image queue, and the 10 batch image sets are pulled out in 3 times. In the first pulling, the first 3 batch image sets in the image queue are pulled out in sequence, and the image offset position of the image queue at the end of the first pulling is recorded (i.e., the image offset position is the third batch image set); in the second pulling, the fourth batch image set in the image queue is pulled out in sequence to the eighth batch image set, and the image offset position of the image queue at the end of the second pulling is recorded (i.e., the image offset position is the eighth batch image set); in the third pulling, the ninth batch image set in the image queue is pulled out in sequence to the tenth batch image set, and the image offset position of the image queue at the end of the third pulling is recorded (i.e., the image offset position is the tenth batch image set).
[0068] Step 23: Based on the time sequence of pulling the at least one batch image set, the images in the at least one batch image set are sequentially clustered by using the similarity information and / or the space-time information to obtain a plurality of corresponding partition image archives.
[0069] Specifically, based on the time sequence of pulling the at least one batch image set, the images in the at least one batch image set are sequentially clustered according to the similarity information and / or the space-time information between the images in the image set to sequentially obtain the corresponding partition image archives.
[0070] For example, there are 10 batch image sets in the image queue, and the 10 batch image sets are pulled out in 3 times. In the first pulling, the first 3 batch image sets in the image queue are pulled out in sequence, and then the images in the first 3 batch image sets are clustered according to the similarity information and / or the space-time information between the images in the first 3 batch image sets to obtain the corresponding partition image archives of the first 3 batch image sets; in the second pulling, the fourth batch image set in the image queue is pulled out in sequence to the eighth batch image set, and then the images in the fourth to eighth batch image sets are clustered according to the similarity information and / or the space-time information between the images in the fourth to eighth batch image sets to obtain the corresponding partition image archives of the fourth to eighth batch image sets; in the third pulling, the ninth batch image set in the image queue is pulled out in sequence to the tenth batch image set, and then the images in the ninth to tenth batch image sets are clustered according to the similarity information and / or the space-time information between the images in the ninth to tenth batch image sets to obtain the corresponding partition image archives of the ninth to tenth batch image sets.
[0071] wherein, when performing image clustering on the images, a lock process is performed.
[0072] Specifically, when performing image clustering on a first at least one batch of image sets, a lock process is performed, when the image clustering on the first at least one batch of image sets is completed, an unlock process is performed; when performing image clustering on a second at least one batch of image sets, a lock process is performed, when the image clustering on the second at least one batch of image sets is completed, an unlock process is performed, and so on.
[0073] Step 24: aggregating the plurality of partition image files to obtain an aggregated image file.
[0074] wherein, step 24 is similar to step 14 in the above embodiment, which will not be repeated here.
[0075] wherein, in response to obtaining the aggregated image file, the aggregated image file is backed up, and a second process state is recorded.
[0076] Referring to Figure 5 , Figure 5is a schematic diagram of an embodiment of the integrated image archive in the present application. In the image queue A, all images therein are divided into five batch image sets based on the chronological order, namely, a batch image set, a batch image set, a batch image set, a batch image set and a batch image set. In the first pulling, the a and b batch image sets in the image queue are pulled out in sequence, and when the pulling is completed, the offset position of the b batch image set is recorded. Then, according to the similarity information and / or the space-time information between the images in the a and b batch image sets, the images in the a and b batch image sets are image clustered to obtain an ab partition image archive. When the ab partition image archive is obtained, the first progress state is recorded and the ab partition image archive is backed up. In the second pulling, the c batch image set in the image queue is pulled out, and when the pulling is completed, the offset position of the c batch image set is recorded. Then, according to the similarity information and / or the space-time information between the images in the c batch image set, the images in the c batch image set are image clustered to obtain a c partition image archive. When the c partition image archive is obtained, the first progress state is recorded and the c partition image archive is backed up. In the third pulling, the d and e batch image sets in the image queue are pulled out in sequence, and when the pulling is completed, the offset position of the e batch image set is recorded. Then, according to the similarity information and / or the space-time information between the images in the d and e batch image sets, the images in the d and e batch image sets are image clustered to obtain a de partition image archive. When the de partition image archive is obtained, the first progress state is recorded and the de partition image archive is backed up. Finally, the ab partition image archive, the c partition image archive and the de partition image archive are aggregated to obtain an integrated image archive, and the second progress state is recorded and the integrated image archive is backed up.
[0077] The above optional implementation is combined, and further optimized and expanded based on the above technical solution to obtain the third embodiment of the trajectory classification method provided in the present application.
[0078] Referring to Figure 6 , Figure 6 is a flowchart of the third embodiment of the trajectory classification method provided in the present application, which comprises:
[0079] Step 31: In response to the image clustering of the images in the at least one batch image set in sequence failing, determining a batch image set corresponding to the image clustering failure according to the first progress state and the image offset position.
[0080] Specifically, if the process fails when the images in the obtained multiple batches of image sets are sequentially subjected to image clustering, it is determined whether the image clustering of the image set in which the process fails or whether the image clustering of all the batches of image sets is successful according to the recorded first process state and the image offset position.
[0081] Step 32: rollback the images in the corresponding batch of image sets for image clustering again; or in response to the successful image clustering of the images in the batch of image sets, determine whether the backup of the partition image archives in the batch of image sets is successful.
[0082] Specifically, if it is determined that the image clustering of the corresponding batch of image sets fails, the images in the corresponding batch of image sets are rolled back for image clustering again; or it is determined whether the image clustering of all the batches of image sets is successful, and if not, it is determined in which batch of image sets the backup of the images fails.
[0083] Step 33: in response to the backup of the corresponding partition image archive failing, rollback the corresponding partition image archive for backup again.
[0084] Specifically, if it is determined that the backup of the corresponding batch of images fails, the corresponding partition image archive is rolled back for backup again.
[0085] The above optional implementation is combined, and based on the above technical solution, further optimization and expansion are made to obtain the fourth embodiment of the trajectory classification method provided by the present application.
[0086] Referring to Figure 7 , Figure 7 is a flowchart of the fourth embodiment of the trajectory classification method provided by the present application, and the method comprises:
[0087] Step 41: in response to the failure of the aggregation of the multiple partition image archives, determine whether the corresponding partition image archive that fails to aggregate is successfully aggregated according to the second process state and the aggregated image archive.
[0088] Specifically, if the process fails when the obtained multiple partition image archives are sequentially subjected to archive aggregation, it is determined whether the archive aggregation of the corresponding partition image archive fails or whether the archive aggregation of all the partition image archives is successful according to the recorded second process state and the aggregated image archive.
[0089] Step 42: in response to the failure of the aggregation of the corresponding partition image archive, rollback the corresponding partition image archive for aggregation again; or in response to the successful aggregation of all the partition image archives, determine whether the backup of the aggregated image archive is successful.
[0090] Specifically, if it is determined that the corresponding one of the partition image archives fails to be archived, the corresponding one of the partition image archives is rolled back to re-archive; or if it is determined that all the partition image archives are successfully archived, it is determined whether the backup of the integrated image archive fails.
[0091] Step 43: In response to the backup of the integrated image archive failing, the integrated image archive is rolled back to re-backup.
[0092] The above optional implementation is combined, and based on the above technical solution, further optimization and expansion are made to obtain the fifth embodiment of the trajectory classification method provided by the present application.
[0093] Referring to Figure 8 , Figure 8 is a flowchart of the fifth embodiment of the trajectory classification method provided by the present application, and the method comprises:
[0094] Step 51: An image archive output instruction is acquired.
[0095] The image archive output instruction is used to control the intelligent terminal to output the corresponding part or all of the partition image archives in the backup integrated image archive.
[0096] Step 52: Based on the time batch corresponding to the image archive output instruction, part or all of the partition image archives in the backup integrated image archive are sequentially output.
[0097] In response to each output of a partition image archive, the partition image archive is re-backed up, and a third process state is recorded, which is used to roll back the image archive when the integrated image archive output fails.
[0098] For example, in response to the output of part or all of the partition image archives in the backup integrated image archive failing, it is determined which partition image archive in the backup integrated image archive fails to output according to the re-backed up partition image archive and the third process state, and the partition image archive that fails to output is rolled back to re-output.
[0099] The above optional implementation is combined, and based on the above technical solution, further optimization and expansion are made to obtain the sixth embodiment of the trajectory classification method provided by the present application.
[0100] Referring to Figure 9 , Figure 9 is a flowchart of the sixth embodiment of the trajectory classification method provided by the present application, and the method comprises:
[0101] Step 61: An image archive deletion instruction is acquired.
[0102] The image archive deletion instruction is used to control the intelligent terminal to delete part or all of the partition image archives corresponding to the time batch in the backup integrated image archive.
[0103] Step 62: Delete the partition image archives in the backup integrated image archive in sequence based on the time batch corresponding to the image archive deletion instruction.
[0104] Compared with the prior art, the image clustering method provided by the embodiment includes: acquiring an image queue, dividing the images in the image queue into a plurality of batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on the images in the at least one batch image set to obtain a corresponding partition image archive; wherein, in response to obtaining each partition image archive, the partition image archive is backed up, and a first process state is recorded; the plurality of partition image archives are aggregated to obtain an integrated image archive; wherein, in response to obtaining the integrated image archive, the integrated image archive is backed up, and a second process state is recorded. Through the above manner, on the one hand, by pulling at least one batch of image sets and performing image clustering on the image sets to form a partition image archive in batches, the number of times of image set pulling and image clustering can be reduced, thereby accelerating the time process of the flow. On the other hand, the plurality of partition image archives and the integrated image archive obtained are respectively backed up, and the corresponding process states are recorded, which can avoid data loss or repeated output of data due to failure or abnormality of the operation process, thereby ensuring the consistency of the data. According to the image archive output instruction or the image archive deletion instruction, all or part of the corresponding partition image archives in the backup integrated image archive are output or deleted, which can simplify the flow and release the space.
[0105] Referring to Figure 10 , Figure 10 A structural schematic diagram of an intelligent terminal provided by the present application is provided, the intelligent terminal 100 includes a processor 101 and a memory 102 connected with the processor 101, wherein the memory 102 stores program data, and the processor 101 calls the program data stored in the memory 102 to execute the above-mentioned trajectory classification method.
[0106] Optionally, in an embodiment, the processor 101 is configured to execute program data to implement a method comprising: obtaining an image queue, dividing images in the image queue into a plurality of batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on images in the at least one batch image set to obtain a corresponding partition image archive; wherein, in response to obtaining each partition image archive, backing up the partition image archive and recording a first process state; and archiving the plurality of partition image archives to obtain a total image archive; wherein, in response to obtaining the total image archive, backing up the total image archive and recording a second process state.
[0107] The processor 101 can also be referred to as a CPU (Central Processing Unit). The processor 101 can be an electronic chip with signal processing capability. The processor 101 can also be a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application-Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor can be a microprocessor or any other conventional processor.
[0108] The memory 102 can be a memory stick, a TF card, etc., and can store all information in the intelligent terminal 100, including input raw data, computer programs, intermediate running results and final running results. It stores and retrieves information according to the location specified by the processor 101. With the memory 102, the intelligent terminal 100 has a memory function and can work normally. The memory 102 of the intelligent terminal 100 can be divided into main memory (internal memory) and auxiliary memory (external memory) according to its purpose, or it can be divided into external memory and internal memory. The external memory is usually a magnetic medium or an optical disc, etc., which can store information for a long time. The internal memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but only for temporary storage of programs and data. When the power is off or disconnected, the data will be lost.
[0109] In several embodiments provided in the present application, it should be understood that the disclosed method and device can be implemented in other ways. For example, the above-described implementation of the intelligent terminal 100 is only illustrative, for example, the way of dividing the images in the image queue into a plurality of batch image sets based on time sequence, the way of pulling at least one batch image set from the image queue based on time sequence, and the recording content of the first process state or the second process state, etc., which is only a collection method. In actual implementation, there can be another division method, for example, the plurality of partition image archives and the total image archive of the backup can be combined or can be archived into another system, or some features can be ignored or not executed.
[0110] In addition, each functional unit (such as the image queue database and the image archive backup database) in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically independently, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0111] Referring to Figure 11 , Figure 11 An embodiment of the structure of the computer readable storage medium provided in the present application is shown in the figure. The computer readable storage medium 110 stores program instructions 111 capable of realizing all the methods described above.
[0112] If the integrated unit of each functional unit in each embodiment of the present application is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in the computer readable storage medium 110. Based on this understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer readable storage medium 110 includes a plurality of instructions in one program instruction 111 to cause a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., which can also be a mobile terminal such as a mobile phone, a tablet computer, a wearable device, etc., or a desktop computer, etc.), or a processor to execute all or part of the steps of the method of each embodiment of the present application.
[0113] Optionally, in an embodiment, the program instructions 111, when executed by the processor, are used to realize the following method: obtaining an image queue, dividing the images in the image queue into a plurality of batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on the images in the at least one batch image set to obtain a corresponding partition image archive; wherein, in response to obtaining each partition image archive, backing up the partition image archive and recording a first process state; archiving the plurality of partition image archives to obtain a total image archive; wherein, in response to obtaining the total image archive, backing up the total image archive and recording a second process state.
[0114] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) having computer usable program code embodied therein.
[0115] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable storage media 110. The computer readable storage media 110 can be provided to a processor of a general purpose computer, special purpose computer, an embedded processor or other programmable data processing apparatus to produce a machine, such that the instructions that are produced in the computer readable storage media 110, when accessed by a processor of the computer or other programmable data processing apparatus, produce a machine implemented process that implements the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flow or flows and / or block or blocks. Figure 1 one or more functions specified in the flow or flows and / or block or blocks.
[0116] The computer readable storage media 110 can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that are executed on the computer or other programmable apparatus provide steps for implementing the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flow or flows and / or block or blocks. Figure 1 one or more functions specified in the flow or flows and / or block or blocks.
[0117] The computer readable storage media 110 can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that are executed on the computer or other programmable apparatus provide steps for implementing the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flow or flows and / or block or blocks. Figure 1 one or more functions specified in the flow or flows and / or block or blocks.
[0118] In an embodiment, the programmable data processing apparatus comprises a processor and a memory. The processor can also be referred to as a CPU (Central Processing Unit). The processor can be an electronic chip with the processing capability of signals. The processor can 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 can be a microprocessor or the processor can also be any conventional processor or the like.
[0119] The memory can be a memory stick, a TF card, etc., which stores and retrieves information according to the location specified by the processor. The memory can be classified into a main memory (internal memory) and an auxiliary memory (external memory) according to the use, or classified into an external memory and an internal memory. The external memory is usually a magnetic medium or an optical disc, etc., which can store information for a long time. The internal memory refers to a storage component on the motherboard, which is used to store data and programs currently being executed, but is only used to temporarily store programs and data, and the data will be lost when the power is turned off or disconnected.
[0120] The above description is only an embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation according to the content of the specification and drawings, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. An image clustering method characterized by, The method comprises: acquiring an image queue, and dividing images in the image queue into a plurality of batch image sets based on time sequence; pulling at least one batch image set from the image queue based on time sequence; performing image clustering on images in the at least one batch image set to obtain a corresponding partition image archive; wherein, in response to obtaining each partition image archive, backing up the partition image archive, and recording a first process state; aggregating a plurality of the partition image archives to obtain a total image archive; wherein, in response to obtaining the total image archive, backing up the total image archive, and recording a second process state, the second process state comprises whether the total image archive is successfully made or the total image archive fails to be made, and whether the total image archive is successfully backed up or the total image archive fails to be backed up; The method further comprises: in response to failing to aggregate the plurality of partition image archives, determining, according to the second process state and the total image archive, whether a corresponding one of the partition image archives fails to be aggregated; in response to the corresponding one of the partition image archives failing to be aggregated, rolling back the corresponding one of the partition image archives to re-aggregate; or in response to all of the partition image archives successfully being aggregated, determining whether the total image archive is successfully backed up; in response to the total image archive failing to be backed up, rolling back the total image archive to re-backup.
2. The image clustering method of claim 1, wherein, before the acquiring an image queue, the method further comprises: acquiring a plurality of image data; parsing the plurality of image data to obtain a plurality of images and feature information of the plurality of images; wherein, the feature information comprises similarity information and space-time information of the plurality of images; adding the plurality of images into the image queue based on time sequence.
3. The image clustering method of claim 2, wherein, the pulling at least one batch image set from the image queue based on time sequence comprises: pulling the at least one batch image set from the image queue based on time sequence in turn a plurality of times based on time sequence of the plurality of batch image sets; wherein, in response to each time the at least one batch image set is pulled, recording an image offset position of the image queue.
4. The image clustering method of claim 3, wherein, the performing image clustering on images in the at least one batch image set to obtain a corresponding partition image archive comprises: performing image clustering on the images in the at least one batch image set in turn a plurality of times based on time sequence of the at least one batch image set being pulled a plurality of times based on the similarity information and the space-time information to obtain a plurality of corresponding partition image archives; wherein, when the images are clustered, a locking process is performed.
5. The image clustering method of claim 3, wherein, the method further comprises: in response to the image clustering of the images in the at least one batch image set failing in sequence, determining one batch image set corresponding to the image clustering failure according to the first progress state and the image offset position; rolling back the images in the corresponding one batch image set for image clustering again; or in response to the image clustering of the at least one batch image set being successful, determining whether the backup of all the partition image archives of the at least one batch image set is successful; in response to one of the partition image archives failing in backup, rolling back the partition image archive corresponding to the backup failure for backup again.
6. The image clustering method of claim 1, further comprising: obtaining an image archive output instruction; outputting, based on a time batch corresponding to the image archive output instruction, part of the partition image archives in the backup total image archive in sequence; wherein, in response to each outputting one partition image archive, the partition image archive is backed up again, and a third progress state is recorded, the third progress state being used for image archive rollback in case of total image archive output failure.
7. The image clustering method of claim 1, further comprising: obtaining an image archive deletion instruction; deleting, based on a time batch corresponding to the image archive deletion instruction, the partition image archives in the backup total image archive in sequence. The intelligent terminal comprises a processor and a memory connected to the processor, wherein the memory stores program data, and the processor calls the program data stored in the memory to execute the image clustering method of any one of claims 1-7. The program instruction is executed to implement the image clustering method of any one of claims 1-7.
8. A smart terminal, characterized by 9. A computer-readable storage medium internally storing program instructions, characterized in that,
Citation Information
Patent Citations
Image clustering method, electronic equipment and storage medium
CN113869372A
Image file gathering method, image file gathering device and computer readable storage medium
CN113987243A