Edge computing-oriented AI gateway video efficient compression method

By extracting video image feature vectors in the edge computing AI gateway, deleting non-important images, and performing clustering and block coding replacement, the problem of low compression rate in existing technologies is solved and efficient video compression is achieved.

CN120676183AActive Publication Date: 2025-09-19BEIJING GUOWANG SHENGYUAN INTELLIGENT TERMINAL SCI & TECH CO LTD

Patent Information

Application Number
CN202511186592.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-09-19
Estimated Expiration
2045-08-25

AI Technical Summary

Technical Problem

Existing technologies have a low compression rate when compressing video data in edge computing AI gateways, especially when there are a large number of similar images in the video, resulting in redundant data retention.

Method used

By extracting the feature vector of the video image, deleting the non-important images, clustering and dividing them into blocks, and using the pixel difference to perform coding replacement, the H.264 video coding algorithm is finally used for compression.

Benefits of technology

It improves the video compression rate while ensuring the high fidelity of key content and reducing the video size and computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120676183A_ABST
    Figure CN120676183A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video compression, in particular to an edge computing-oriented AI gateway video efficient compression method. The method comprises the steps of obtaining a to-be-compressed target video; clustering all images in a target video to be compressed to obtain each cluster, obtaining a feature index value corresponding to each image in the cluster according to a difference index value between each image in the cluster and other images in the cluster, obtaining a block number parameter corresponding to the cluster according to the feature index value, and obtaining a block number parameter corresponding to the cluster; according to the block number parameter corresponding to the clustering cluster, dividing each image in the corresponding clustering cluster to obtain each sub-block on each image in the clustering cluster; and according to the pixel difference between any two sub-blocks in the clustering cluster, carrying out coding replacement on the sub-blocks on the image in the clustering cluster to obtain a replaced video, and compressing the replaced video to obtain compressed data. And the compression rate can be improved while the high fidelity of the key content is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video compression technology, and in particular to an efficient AI gateway video compression method for edge computing. Background Art

[0002] Currently, edge gateway devices with intelligent computing capabilities are typically deployed at the edge of the network near data sources (such as cameras and industrial equipment). This refers to the deployment of AI gateways for edge computing to achieve efficient compression of video data, thereby reducing resources such as bandwidth usage and storage overhead. However, when compressing video data in existing technologies, existing compression strategies are generally used to directly compress each frame of the video. However, this compression method results in a large amount of redundant data being retained, resulting in a low compression rate. For example, when there are a large number of similar images in a video, if existing compression algorithms are still used to independently encode and compress each frame, a large amount of redundant data will be generated, resulting in a low compression rate. Therefore, how to improve the compression effect of the video compression module built into the AI ​​gateway when compressing the collected video has become an urgent problem that needs to be solved. Summary of the Invention

[0003] In order to solve the above problems, the present invention provides an efficient AI gateway video compression method for edge computing. The technical solutions adopted are as follows: An embodiment of the present invention provides an efficient AI gateway video compression method for edge computing, comprising the following steps: Obtaining an initial video to be compressed, and extracting a feature vector corresponding to each image in the initial video to be compressed; Deleting unimportant images in the initial video to be compressed according to difference index values ​​between images in the initial video to be compressed, to obtain a target video to be compressed; Clustering all images in the target video to be compressed to obtain clusters; obtaining a characteristic index value corresponding to each image in the cluster based on a difference index value between each image in the cluster and the remaining images in the cluster, and obtaining a block quantity parameter corresponding to the cluster based on the characteristic index value; dividing each image in the corresponding cluster based on the block quantity parameter corresponding to the cluster to obtain each sub-block on each image in the cluster; According to the pixel difference between any two sub-blocks in the cluster, the sub-blocks on the image in the cluster are coded and replaced to obtain a replaced video, and the replaced video is compressed to obtain compressed data.

[0004] Beneficial effects: The present invention first obtains an initial video to be compressed and extracts feature vectors corresponding to each image in the initial video to be compressed; then, based on the difference index values ​​between the images in the initial video to be compressed, unimportant images in the initial video to be compressed are deleted to obtain a target video to be compressed; then, all images in the target video to be compressed are clustered to obtain clusters; based on the difference index values ​​between each image in the cluster and the rest of the images in the cluster, feature index values ​​corresponding to each image in the cluster are obtained; based on the feature index values, a block number parameter corresponding to the cluster is obtained; based on the block number parameter corresponding to the cluster, each image in the corresponding cluster is divided to obtain each sub-block on each image in the cluster; finally, based on the pixel difference between any two sub-blocks in the cluster, the sub-blocks on the image in the cluster are coded and replaced to obtain a replaced video, and the replaced video is compressed to obtain compressed data. Moreover, the present invention can improve the compression rate while ensuring the high fidelity of key content by dividing the image into blocks and coding and replacing the sub-blocks on the image in the cluster based on the pixel difference between the sub-blocks. BRIEF DESCRIPTION OF THE DRAWINGS

[0005] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0006] Figure 1 This is a flow chart of an efficient AI gateway video compression method for edge computing in the present invention. DETAILED DESCRIPTION

[0007] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field fall within the scope of protection of the embodiments of the present invention.

[0008] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0009] This embodiment provides an efficient AI gateway video compression method for edge computing, which is described in detail as follows: like Figure 1 As shown in FIG, the efficient video compression method for the AI ​​gateway for edge computing includes the following steps: Step S001: obtain an initial video to be compressed, and extract the feature vector corresponding to each image in the initial video to be compressed; delete unimportant images in the initial video to be compressed according to the difference index values ​​between the images in the initial video to be compressed, to obtain a target video to be compressed.

[0010] The purpose of this embodiment is to improve the compression effect of video data, that is, to ensure the high fidelity of key content while effectively reducing the video volume. Therefore, this embodiment first needs to obtain the video to be compressed and record it as the initial video to be compressed. The initial video to be compressed in this embodiment is video data obtained in real time by the gateway device deployed at the edge of the network. The video data to be compressed mainly comes from the connected cameras, industrial monitoring terminals or other video acquisition devices. After that, the video compression module built into the AI ​​gateway will parse and efficiently compress the collected video, and transmit the compressed data in real time, cache it on the edge side, or upload it to cloud storage to reduce network bandwidth occupancy and storage pressure. That is, the subsequent video compression process of this embodiment is carried out in the video compression module built into the AI ​​gateway.

[0011] Furthermore, since directly using an existing compression method or compression strategy to compress the initial video to be compressed will result in a large amount of redundant data still being retained, that is, it will lead to a low compression ratio. In order to improve the compression ratio, this embodiment needs to first process the initial video to be compressed, that is, delete non-important images in the initial video to be compressed, thereby obtaining a target video to be compressed. Subsequently, the target video to be compressed is analyzed and compressed. The specific process of obtaining the target video to be compressed is as follows: First, feature extraction is performed on each frame image in the initial video to be compressed to obtain feature vectors corresponding to each image in the initial video to be compressed. In specific applications, the implementer can choose a method for extracting features from the image according to actual conditions. For example, existing methods such as convolutional neural networks can be used to extract features from the image. Since the process of extracting features from the image using existing methods such as convolutional neural networks is well known, it will not be described in detail in this embodiment.

[0012] After obtaining the feature vectors corresponding to each image in the initial video to be compressed, a difference index value between any two images is calculated based on the feature vectors corresponding to each image. The difference index value between any two images is the result of negative correlation mapping of the similarity between the feature vectors corresponding to the two images. For example, for images v1 and v2, which are not the same image, the cosine similarity between the feature vector corresponding to image v1 and the feature vector corresponding to image v2 is calculated, and a negative correlation mapping is performed on the cosine similarity between the feature vector corresponding to image v1 and the feature vector corresponding to image v2. The mapping result is recorded as the difference index value between images v1 and v2. Since the cosine similarity between vectors ranges from -1 to 1, and the closer it is to 1, the more similar it is, the constant 1 is selected in this embodiment to implement the negative correlation mapping of the cosine similarity. That is, the result of the constant 1-S is used as the difference index value between images v1 and v2, where S is the cosine similarity between the feature vector corresponding to image v1 and the feature vector corresponding to image v2.

[0013] Since the initial video to be compressed may contain video frames that are continuously repeated or have little variation, it is necessary to delete the non-important frames that may be continuously repeated or have little variation to reduce the size of the compressed video and the amount of subsequent calculations. Therefore, after obtaining the difference index value between the images, the non-important images in the initial video to be compressed are deleted according to the difference index value between the images in the initial video to be compressed to obtain the target video to be compressed. In this embodiment, the non-important images refer to images that are similar to other images or images with features of continuous repetition or little variation. Therefore, according to the difference index value between the images in the initial video to be compressed, the non-important images in the initial video to be compressed are deleted to obtain the target video to be compressed. The specific process is as follows: First, the initial video to be compressed is recorded as the first video, and then the images in the first video are marked, and it is determined whether there are images marked as unimportant in the first video. If so, all images marked as unimportant in the first video are deleted, and the deleted first video is recorded as the second video. Then, the images in the second video are continued to be marked, and it is determined whether there are images marked as unimportant in the second video. If so, all images marked as unimportant in the second video are deleted, and the deleted second video is recorded as the third video. Then, the images in the third video are continued to be marked, and it is determined whether there are images marked as unimportant in the third video. And so on, until there are no images marked as unimportant in the new video obtained, the deletion is stopped, and the new video obtained is recorded as the target video to be compressed. For example, if it is determined that there are no images marked as unimportant in the third video, then the third video can be directly used as the target video to be compressed.

[0014] Since the method for marking any video is the same, that is, the method for marking the image in the first video, the method for marking the image in the second video, and the method for marking the image in the third video are all the same, and for ease of understanding, this embodiment will be described below using the specific process of marking the image in the first video as an example, then the specific process of marking the image in the first video is: First, determine whether the important index value of the second frame image in the first video is greater than the preset important threshold value. If it is, continue to determine whether the important index value of the third frame image in the first video is greater than the preset important threshold value. If it is not, mark the third frame image in the first video as unimportant, and continue to determine whether the important index value of the fifth frame image in the first video is greater than the preset important threshold value. If it is, continue to determine whether the important index value of the sixth frame image in the first video is greater than the preset important threshold value. If it is not, mark the sixth frame image in the first video as unimportant, and continue to determine whether the important index value of the eighth frame image in the first video is greater than the preset important threshold value, and so on, until the marking is stopped when the second to last frame image in the first video is traversed.

[0015] It should be noted that, when the important index value of a certain frame image in a certain video is larger, the similarity between the frame image and the image of its adjacent frame is smaller, and the frame image has less characteristics of continuous repetition or small adjacent changes, which also indicates that the frame image is more important and should not be deleted. When the important index value of a certain frame image in a certain video is smaller, the similarity between the frame image and the image of its adjacent frame is larger, and the frame image has more characteristics of continuous repetition or small adjacent changes, which also indicates that the frame image is less important and should be deleted, so as to reduce the subsequent calculation amount and reduce the compression rate.

[0016] Since the method for obtaining the importance representation value of any image in any video is the same, and for ease of understanding, this embodiment will be described below using the process of obtaining the importance representation value of the second frame image in the first video as an example. The specific process of obtaining the importance representation value of the second frame image in the first video is: First, the difference index value between the first frame image in the first video and the second frame image in the first video is obtained, and recorded as the first index value. The difference index value between the second frame image in the first video and the third frame image in the first video is obtained, and recorded as the second index value. The average of the first index value and the second index value is calculated, and recorded as the importance representation value of the second frame image in the first video. That is, the method for obtaining the importance representation value of any frame image in any video is the same as the method for obtaining the importance representation value of the second frame image in the first video.

[0017] In this embodiment, the implementer needs to set a preset importance threshold according to actual conditions such as video type, picture change characteristics, and playback smoothness requirements. The smaller the preset importance threshold, the more frames are retained, the lower the compression rate is, but the playback continuity is guaranteed. The larger the preset importance threshold, the higher the compression rate is, but some frames with slight differences may be discarded, affecting the smooth playback experience of the video. For example, for a large number of static scenes and fixed surveillance videos with low playback smoothness requirements, there are many images that are continuously repeated or have small adjacent changes. In this case, the preset importance threshold can be set larger to remove a large number of redundant frames. For example, the preset importance threshold for such videos can be set to between 0.02 and 0.05. For a small number of dynamic scenes with traffic or pedestrians and smart traffic surveillance videos with medium playback smoothness requirements, motion frames need to be retained to avoid losing event details. Therefore, the preset importance threshold cannot be set too large. For example, the preset importance threshold for such videos can be set to 0 For conferences or live broadcasts with moderately dynamic scenes such as people speaking and medium or high requirements for playback smoothness, it is necessary to ensure the continuity of speech movements and reduce the visual sense of frame skipping. Therefore, the preset important threshold needs to be set relatively small, for example, the preset important threshold for such videos can be set to between 0.005 and 0.01. For sports events or sports videos with high-speed movement, fast scene changes, and high requirements for playback smoothness, high-fidelity retention is required to avoid affecting the details of the movement and the viewing experience. Therefore, the preset important threshold needs to be set to a smaller value, for example, the preset important threshold for such videos can be set to between 0.001 and 0.005. For film and television entertainment or short videos with frequent screen switching, many details, and extremely high requirements for playback smoothness, it is necessary to ensure consistency in image quality and visual experience. Therefore, the preset important threshold needs to be set to an extremely small value, for example, the preset important threshold for such videos can be set to less than 0.001.

[0018] Therefore, this embodiment can obtain the target video to be compressed through the above process.

[0019] Step S002: cluster all images in the target video to be compressed to obtain various clusters; obtain characteristic index values ​​corresponding to each image in the cluster based on the difference index values ​​between each image in the cluster and the remaining images in the cluster, and obtain the block number parameter corresponding to the cluster based on the characteristic index values; divide each image in the corresponding cluster based on the block number parameter corresponding to the cluster to obtain each sub-block on each image in the cluster.

[0020] After obtaining the target video to be compressed, in order to further improve the compression rate and reduce the size of the compressed video, this embodiment will cluster the images in the target video to be compressed, analyze the clustering results, and divide the images in the cluster clusters according to the analysis results. After the block division, the sub-blocks with the same pixels are coded and replaced, and then compressed after replacement. Since the sub-block areas that are coded and replaced do not need to participate in the compression, only the replaced codes need to be saved, so the purpose of improving the compression rate and reducing the size of the compressed video can be achieved. Therefore, based on the above description, it can be seen that this embodiment needs to cluster the images in the target video to be compressed to obtain various clusters. Then, the specific process of clustering the images in the target video to be compressed to obtain various clusters is as follows: First, the HDBSCAN clustering algorithm is used to cluster the images in the target video to be compressed to obtain various cluster clusters. Since the images in the same cluster cluster have certain similarities or repetitive features, this embodiment subsequently determines how to divide the images in each cluster by analyzing the number of repeated areas or the visibility of repeated features between the images in the cluster cluster, and replaces the repeated sub-blocks or sub-blocks with equal pixels after blocking. The HDBSCAN clustering algorithm is a density-based hierarchical clustering algorithm, which is an improved and extended version of the DBSCAN clustering algorithm. The clustering process of this clustering algorithm is a well-known technology and will not be repeated here. In addition, when clustering the images in the target video to be compressed, the metric distance between the images used for clustering is the difference index value between the images.

[0021] After obtaining each cluster, the characteristic index value corresponding to each image in each cluster is obtained based on the difference index value between each image in each cluster and the rest of the images in the cluster. The characteristic index value is used to reflect the number of repeated areas between images in the cluster or the obviousness of repeated features. The specific calculation process of the characteristic index value corresponding to each image in each cluster is as follows: For any image h in any cluster H, the set consisting of all images remaining in cluster H except image h is recorded as the set to be analyzed of image h, the set consisting of the difference index values ​​between image h and each image in the set to be analyzed of image h is recorded as the difference index value set corresponding to image h, and the mean of the difference index value set corresponding to image h is recorded as the corresponding feature index value of image h; and the specific calculation expression of the corresponding feature index value of image h is: in, is the characteristic index value corresponding to image h, M is the total number of images in the set to be analyzed for image h, is the difference index value between image h and the mth image in the set of images h to be analyzed. And The larger it is, the less similar the image h is to other images in cluster H. The smaller it is, the more similar the image h is to other images in cluster H.

[0022] After obtaining the characteristic index value corresponding to each image in each cluster, the uneven representation value of each cluster is obtained according to the difference between the characteristic index values ​​corresponding to the images in each cluster. The uneven representation value of the cluster and the mean of the characteristic index values ​​corresponding to all images in the cluster are the key to subsequently determining the number of blocks corresponding to the cluster. Then, the specific process of obtaining the uneven representation value of each cluster according to the difference between the characteristic index values ​​corresponding to the images in each cluster is as follows: For any cluster H: first obtain the feature difference corresponding to each image in the cluster H, and the feature difference corresponding to any image is the mean of the set composed of the absolute value of the difference between the feature index value corresponding to the image and the feature index value corresponding to each image in the set to be analyzed. That is, for any image h in any cluster H, the calculation expression of the feature difference corresponding to image h is ,in, is the characteristic index value corresponding to the mth image in the set of images to be analyzed of image h; then the mean of the characteristic differences corresponding to all images in cluster H is calculated and used as the uneven representation value of cluster H. That is, the expression of the uneven representation value of cluster H is: in, is the uneven representation value of cluster H, N is the total number of images in cluster H, is the feature difference corresponding to the nth image in cluster H; and The smaller it is, the more uniform the similarity distribution between images in cluster H is. The larger it is, the more uneven the similarity distribution between images in cluster H is.

[0023] After obtaining the uneven representation value of each cluster and the characteristic index value corresponding to each image in each cluster, the block number control coefficient corresponding to each cluster is obtained according to the uneven representation value of each cluster and the characteristic index value corresponding to each image in each cluster. The block number control coefficient corresponding to each cluster is the key to subsequently determining the block number parameter corresponding to the cluster. Then the specific process of the block number control coefficient corresponding to each cluster is as follows: for cluster H, calculate the mean of the characteristic index values ​​corresponding to all images in cluster H, and record it as the characteristic mean of cluster H. The product of the uneven representation value of cluster H and the characteristic mean of cluster H is used as the block number control coefficient corresponding to cluster H. The specific calculation expression of the block number control coefficient corresponding to cluster H is: in, is the control coefficient of the number of blocks corresponding to the cluster H, is the uneven representation value of cluster H, is the characteristic mean of cluster H; and when When the value is larger, the number of blocks corresponding to cluster H is larger. When the number of blocks corresponding to cluster H is larger, it means that the area of ​​the blocks divided when the image in cluster H is divided is smaller and the number of blocks divided is larger. On the contrary, when The smaller the value is, the smaller the number of blocks corresponding to cluster H is. The smaller the number of blocks corresponding to cluster H is, the larger the area of ​​the blocks is when the image in cluster H is divided into blocks, and the smaller the number of blocks is.

[0024] In addition, when When the value is larger, it means that the repeated positions between the images in the cluster H may be less or the repeated features are less obvious. Therefore, when dividing the blocks, the area of ​​the divided blocks should be smaller, that is, the number of divided blocks should be larger, so as to increase the number of sub-blocks that are subsequently replaced by encoding, thereby improving the compression rate. Consider The reason is that: when the calculated When it is larger, the probability that there is an image with less similarity to other images in the corresponding cluster is greater. At this time, if we do not consider , only based on to determine , will make it impossible to take into account images with less similarity to other images during subsequent segmentation and compression. That is, if we do not consider , only based on to determine This will result in fewer areas being replaced by encoding on images with less similarity to other images within the cluster, resulting in a lower compression rate. Need to consider , making As the size increases, When the value is larger, the area of ​​the divided blocks is smaller when the image in the cluster H is divided into blocks, and the number of divided blocks is greater, so as to increase the number of sub-blocks that are subsequently replaced by encoding, thereby improving the compression rate.

[0025] After calculating the block quantity control coefficient corresponding to each cluster, the rounded-up value of the product of the block quantity control coefficient corresponding to the cluster and the preset block quantity coefficient is calculated and used as the block quantity parameter corresponding to the cluster. The value range of the block quantity control coefficient is 0 to 1. The product of the preset block quantity coefficient and the preset block quantity coefficient is the maximum number of blocks required on a single-frame image in this embodiment. The larger the block quantity parameter corresponding to the cluster, the smaller the area of ​​the blocks when the image in the corresponding cluster is divided, and the greater the number of blocks. In specific applications, the implementer needs to set it according to the actual conditions such as the required compression rate and computational complexity. For example, it can be set to 16. The larger the preset block quantity coefficient is, the higher the compression efficiency of the video data is, but the processing time and computational complexity are greater.

[0026] Therefore, this embodiment obtains the block number parameter corresponding to each cluster through the above process. After obtaining the block number parameter corresponding to the cluster, each image in the corresponding cluster is divided according to the block number parameter corresponding to each cluster, and each sub-block on each image in each cluster is obtained. The specific process is: for any image h in any cluster H, the block number parameter corresponding to the cluster H is recorded as C, and the image h is evenly divided into C×C small blocks, and the divided blocks are recorded as sub-blocks on the image h, and the length of each sub-block on the image h is The width of each sub-block is , where L1 is the length of image h, L2 is the width of image h, and the sub-blocks on image h do not intersect.

[0027] Therefore, this embodiment can obtain each sub-block on each image in the cluster through the above process.

[0028] Step S003 , performing coding replacement on the sub-blocks on the image in the cluster according to the pixel difference between any two sub-blocks in the cluster to obtain a replaced video, and compressing the replaced video to obtain compressed data.

[0029] After obtaining each sub-block on each image in each cluster, the sub-blocks on the image in each cluster are coded and replaced according to the pixel difference between any two sub-blocks in each cluster to obtain a replaced video. The replaced video is then compressed. Then, according to the pixel difference between any two sub-blocks in each cluster, the sub-blocks on the image in each cluster are coded and replaced to obtain a replaced video. The specific process is as follows: First, obtain all similar subblock sets corresponding to each cluster, as well as the representative subblocks and codes for each similar subblock set. The code for any subblock consists of the position of the image to which the corresponding subblock belongs in the target video to be compressed and the position of the corresponding subblock on the image to which the subblock belongs. That is, for any subblock g, if subblock g belongs to the yth subblock on the tth frame image of the target video to be compressed, then the code for subblock g is (t, y). Furthermore, the jth subblock on all images belonging to the same cluster has the same coordinate position on the corresponding image. That is, for cluster H, the coordinates of the center point of the jth subblock on image k1 in cluster H are the same as the coordinates of the center point of the jth subblock on image k2 in cluster H. Then, obtain the replaced images for each image in the target video to be compressed, and record the video composed of the replaced images of all images in the target video to be compressed as the replaced video.

[0030] In this embodiment, the specific process of obtaining all similar sub-block sets corresponding to each cluster and the representative sub-block of each similar sub-block set and encoding is as follows: For any cluster H: first, the set consisting of all sub-blocks on all images in cluster H is recorded as the comprehensive sub-block set corresponding to cluster H. Then, based on the pixel differences between the sub-blocks in the comprehensive sub-block set corresponding to cluster H, the set of all similar sub-blocks corresponding to cluster H is obtained. For any similar sub-block set E corresponding to cluster H, any sub-block in the similar sub-block set E is selected as the representative sub-block corresponding to the similar sub-block set E, and the encoding of the representative sub-block of the similar sub-block set E is recorded as the encoding corresponding to the similar sub-block set E. As another embodiment, any sub-block among all sub-blocks of the image in the similar sub-block set that is ranked most forward in the target video to be compressed can also be set as the representative sub-block of the corresponding similar sub-block set.

[0031] In this embodiment, the specific process of obtaining all similar sub-block sets corresponding to cluster H according to the pixel differences between sub-blocks in the comprehensive sub-block set corresponding to cluster H is as follows: First, any sub-block in the comprehensive sub-block set corresponding to the cluster H is selected as the first sub-block, and the set consisting of all sub-blocks except the first sub-block in the comprehensive sub-block set corresponding to the cluster H is recorded as the first subset, and then it is determined whether there is a sub-block with the same pixels as the first sub-block in the first subset. If not, any sub-block is selected from the first subset as the second sub-block, and the set consisting of all sub-blocks except the second sub-block in the first subset is recorded as the second subset, and it is determined whether there is a sub-block with the same pixels as the second sub-block in the second subset. If so, all sub-blocks with the same pixels as the second sub-block are obtained in the second subset, and all sub-blocks with the same pixels as the second sub-block obtained in the second subset are recorded as the second subset. The set consisting of the equal sub-blocks and the second sub-block is recorded as the first similar sub-block set corresponding to the cluster H. Then, any sub-block is selected from all the remaining sub-blocks in the second subset except all the pixel-equal sub-blocks of the second sub-block as the third sub-block, that is, the third sub-block belongs to the second subset but does not belong to the pixel-equal sub-block of the second sub-block. The set constructed by all the remaining sub-blocks in the second subset except all the pixel-equal sub-blocks of the second sub-block and the third sub-block is recorded as the third subset. Then, it is continued to be judged whether there is a pixel-equal sub-block of the third sub-block in the third subset. This is repeated until the new subset is an empty set and the judgment is stopped. All similar sub-block sets corresponding to the obtained cluster H are counted.

[0032] In this embodiment, the specific process of obtaining a sub-block with equal pixels in any sub-block is as follows: for sub-blocks b1 and b2 in the comprehensive sub-block set corresponding to cluster H, if sub-block b1 is not equal to sub-block b2: If the pixel difference value between sub-block b1 and sub-block b2 is 0, then sub-block b1 is determined to be a pixel-equal sub-block of sub-block b2, or sub-block b2 is determined to be a pixel-equal sub-block of sub-block b1; and the pixel difference value between sub-block b1 and sub-block b2 is 0, which means that the pixel values ​​at the same position on sub-block b1 and sub-block b2 are the same. In this embodiment, the pixel value is a color value or an RGB pixel value. For example, the total number of pixels in sub-block b1 and sub-block b2 is Z, and the pixel value of the u-th pixel point on sub-block b1 is , the pixel value of the u-th pixel on sub-block b2 is , the coordinate value of the u-th pixel on the sub-block b1 and the u-th pixel on the block b2 and their positions in the corresponding sub-blocks are the same, if The value of is 0, which means that the pixel difference between sub-block b1 and sub-block b2 is 0. If the value of is not 0, it indicates that the pixel difference value between sub-block b1 and sub-block b2 is not 0.

[0033] In this embodiment, the specific process of obtaining the replaced images of each image in the target video to be compressed is as follows: For any image A in the target video to be compressed: first determine whether the first sub-block on image A belongs to the similar sub-block set. If not, do not replace the first sub-block on image A, and continue to determine whether the second sub-block on image A belongs to the similar sub-block set. If so, obtain the similar sub-block set to which the second sub-block on image A belongs, and record it as the similar sub-block set F. Continue to determine whether the second sub-block on image A is the representative sub-block of the similar sub-block set F. If so, do not replace the second sub-block on image A. If not, replace the area corresponding to the second sub-block on image A with the code of the similar sub-block set F, and so on, until all sub-blocks on image A are traversed, and the image A that has completed the traversal is recorded as the replaced image of image A. For example, if only the fth sub-block on image A belongs to the similar sub-block set, and the fth sub-block is not the representative sub-block of the similar sub-block set to which the fth sub-block belongs, then the area corresponding to the fth sub-block on image A is replaced with the code of the similar sub-block set to which the fth sub-block belongs, and the replaced image A is the replaced image of image A. If all sub-blocks on image A do not belong to the similar sub-block set, then image A itself is the replaced image of image A. In addition, in all similar sub-block sets corresponding to all clusters, that is, in all similar sub-block sets, if there is a sub-block or contains a sub-block, then it indicates that the sub-block belongs to the similar sub-block set; and if there is a sub-block in a similar sub-block set, then it indicates that the sub-block belongs to the similar sub-block set or that the similar sub-block set contains the sub-block.

[0034] After obtaining the replaced video, the replaced video is compressed or the image on the replaced image is compressed to obtain compressed data; and this embodiment can select the existing H.264 video encoding algorithm to encode and compress the replaced video, and the process of encoding and compressing the video by the H.264 video encoding algorithm is a well-known technology, so this embodiment will not be described in detail.

[0035] The sub-block area replaced by the code does not need to participate in compression, and only the replaced code needs to be saved. That is, when the sub-block area replaced by the code is transmitted or stored, only the replaced code needs to be transmitted or stored. During recovery, the data obtained after decoding the compressed data of the sub-block corresponding to the code is the restored data of the sub-block replaced by the corresponding code. Moreover, due to the method of first performing code replacement on the same pixel sub-block and then compressing the replaced image or video in this embodiment, the compression rate can be improved and the high fidelity of key content can be guaranteed.

[0036] At this point, this embodiment has completed the efficient compression of AI gateway videos for edge computing.

[0037] To summarize, this embodiment first obtains an initial video to be compressed and extracts feature vectors corresponding to each image in the initial video to be compressed; then, according to the difference index values ​​between the images in the initial video to be compressed, unimportant images in the initial video to be compressed are deleted to obtain a target video to be compressed; then, all images in the target video to be compressed are clustered to obtain respective cluster clusters, and according to the difference index values ​​between each image in the cluster cluster and the remaining images in the cluster, feature index values ​​corresponding to each image in the cluster cluster are obtained, and according to the feature index values, a block number parameter corresponding to the cluster cluster is obtained, and according to the block number parameter corresponding to the cluster cluster, each image in the corresponding cluster cluster is divided to obtain each sub-block on each image in the cluster cluster; finally, according to the pixel difference between any two sub-blocks in the cluster cluster, the sub-blocks on the image in the cluster cluster are coded and replaced to obtain a replaced video, and the replaced video is compressed to obtain compressed data. Furthermore, this embodiment divides the image into blocks and performs encoding replacement on the sub-blocks on the image in the clusters according to the pixel differences between the sub-blocks before compression, thereby improving the compression rate while ensuring high fidelity of key content.

[0038] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. An efficient AI gateway video compression method for edge computing, characterized in that: The method comprises the following steps: Obtaining an initial video to be compressed, and extracting a feature vector corresponding to each image in the initial video to be compressed; Deleting unimportant images in the initial video to be compressed according to difference index values ​​between images in the initial video to be compressed, to obtain a target video to be compressed; The difference index value between any two images is the result of negative correlation mapping between the similarities between the feature vectors corresponding to the two images; Clustering all images in the target video to be compressed to obtain clusters; obtaining a characteristic index value corresponding to each image in the cluster based on a difference index value between each image in the cluster and the remaining images in the cluster, and obtaining a block quantity parameter corresponding to the cluster based on the characteristic index value; dividing each image in the corresponding cluster based on the block quantity parameter corresponding to the cluster to obtain each sub-block on each image in the cluster; According to the pixel difference between any two sub-blocks in the cluster, the sub-blocks on the image in the cluster are coded and replaced to obtain a replaced video, and the replaced video is compressed to obtain compressed data.

2. The efficient AI gateway video compression method for edge computing according to claim 1 is characterized in that: The method for obtaining the target video to be compressed includes: The initial video to be compressed is recorded as the first video, the images in the first video are marked, and it is determined whether there are images marked as unimportant in the first video. If so, all images marked as unimportant in the first video are deleted, and the deleted first video is recorded as the second video. The images in the second video are continued to be marked, and it is determined whether there are images marked as unimportant in the second video. If so, all images marked as unimportant in the second video are deleted, and the deleted second video is recorded as the third video. The images in the third video are continued to be marked, and it is determined whether there are images marked as unimportant in the third video. This process is repeated until the new video obtained does not contain any images marked as unimportant, and the deletion is stopped. The corresponding video is recorded as the target video to be compressed.

3. The efficient AI gateway video compression method for edge computing according to claim 2 is characterized in that: The method for marking an image in the first video includes: Determine whether the important index value of the second frame image in the first video is greater than the preset important threshold value. If it is, continue to determine whether the important index value of the third frame image in the first video is greater than the preset important threshold value. If it is not, mark the third frame image in the first video as unimportant, and continue to determine whether the important index value of the fifth frame image in the first video is greater than the preset important threshold value. If it is, continue to determine whether the important index value of the sixth frame image in the first video is greater than the preset important threshold value. If it is not, mark the sixth frame image in the first video as unimportant, and continue to determine whether the important index value of the eighth frame image in the first video is greater than the preset important threshold value, and so on, until the marking is stopped when the second to last frame image in the first video is traversed.

4. The efficient AI gateway video compression method for edge computing according to claim 3 is characterized in that: Methods for obtaining important indicator values ​​include: For the second frame image in the first video, the difference index value between the first frame image in the first video and the second frame image in the first video is recorded as the first index value, the difference index value between the second frame image in the first video and the third frame image in the first video is recorded as the second index value, and the average of the first index value and the second index value is recorded as the importance representation value of the second frame image in the first video; the method for obtaining the importance representation value of any frame image in any video is the same as the method for obtaining the importance representation value of the second frame image in the first video.

5. The efficient AI gateway video compression method for edge computing according to claim 1 is characterized in that: The method for obtaining the characteristic index value corresponding to each image in the cluster includes: For any image in any cluster, the set consisting of all images remaining in the cluster except the image is recorded as the set of images to be analyzed, the set consisting of the difference index values ​​between the image and each image in the set of images to be analyzed is recorded as the difference index value set corresponding to the image, and the mean of the difference index value set is recorded as the corresponding feature index value of the image.

6. The efficient AI gateway video compression method for edge computing according to claim 5, characterized in that: The method for obtaining the block quantity parameter corresponding to the cluster includes: For any cluster cluster, obtain the characteristic difference value corresponding to each image in the cluster cluster, and use the mean of the characteristic difference values ​​corresponding to all images in the cluster cluster as the uneven representation value of the cluster cluster, and record the mean of the characteristic index values ​​corresponding to all images in the cluster cluster as the characteristic mean of the cluster cluster. Use the product of the uneven representation value of the cluster cluster and the characteristic mean of the cluster cluster as the block number control coefficient corresponding to the cluster cluster, and round up the product of the block number control coefficient corresponding to the cluster cluster and the preset block number coefficient as the block number parameter corresponding to the cluster cluster. The characteristic difference value corresponding to any image is the mean of the set formed by the absolute value of the difference between the characteristic index value corresponding to the image and the characteristic index value corresponding to each image in the set of images to be analyzed.

7. The efficient AI gateway video compression method for edge computing according to claim 1, characterized in that: The method of dividing each image in the corresponding cluster according to the block number parameter corresponding to the cluster to obtain each sub-block on each image in the cluster includes: For any image in any cluster, the block number parameter corresponding to the cluster is recorded as C, and the image is evenly divided into C×C small blocks, which are recorded as sub-blocks on the image.

8. The efficient AI gateway video compression method for edge computing according to claim 1, characterized in that: The method of performing coding replacement on sub-blocks on an image in the cluster according to a pixel difference between any two sub-blocks in the cluster to obtain a replaced video includes: Obtaining a set of similar sub-blocks corresponding to each cluster and a representative sub-block and code of the similar sub-block set, wherein the code of any sub-block is composed of a position of an image to which the corresponding sub-block belongs in the target video to be compressed and a position of the corresponding sub-block on the image to which the corresponding sub-block belongs; For any image A in the target video to be compressed: determine whether the first sub-block on the image A belongs to the similar sub-block set; if not, do not replace the first sub-block; continue to determine whether the second sub-block on the image A belongs to the similar sub-block set; if so, determine whether the second sub-block is a representative sub-block of the similar sub-block set; if so, do not replace the second sub-block; if not, replace the area corresponding to the second sub-block with the code of the similar sub-block set to which the second sub-block belongs, and so on, until all sub-blocks on the image A are traversed, and the image A that has completed the traversal is recorded as the replaced image of the image A; A video composed of replaced images of all images in the target video to be compressed is recorded as a replaced video.

9. The efficient AI gateway video compression method for edge computing according to claim 8, characterized in that: The method of obtaining the similar sub-block sets corresponding to each cluster and the representative sub-blocks and encoding of the similar sub-block sets includes: For any cluster, the set consisting of all sub-blocks on all images in the cluster is recorded as the comprehensive sub-block set corresponding to the cluster. According to the pixel differences between the sub-blocks in the comprehensive sub-block set corresponding to the cluster, all similar sub-block sets corresponding to the cluster are obtained. Any sub-block in the similar sub-block set is selected as the representative sub-block corresponding to the similar sub-block set, and the encoding of the representative sub-block of the similar sub-block set is recorded as the encoding of the corresponding similar sub-block set.

10. The efficient AI gateway video compression method for edge computing according to claim 9, characterized in that: The method of obtaining all similar sub-block sets corresponding to the cluster according to pixel differences between sub-blocks in the comprehensive sub-block set corresponding to the cluster comprises: Select any sub-block in the comprehensive sub-block set as the first sub-block, and record the set of sub-blocks remaining in the comprehensive sub-block set except the first sub-block as the first subset, determine whether there is a sub-block with the same pixels as the first sub-block in the first subset, if not, continue to select any sub-block in the first subset as the second sub-block, and record the set of sub-blocks remaining in the first subset except the second sub-block as the second subset, determine whether there is a sub-block with the same pixels as the second sub-block in the second subset, if so, set all pixels of the second sub-block in the second subset to be the same. The set consisting of the equal sub-blocks and the second sub-block is recorded as the first similar sub-block set corresponding to the cluster, and any sub-block is selected from the remaining sub-blocks in the second subset except the sub-blocks with equal pixels in the second sub-block as the third sub-block. The set consisting of the remaining sub-blocks in the second subset except the sub-blocks with equal pixels in the second sub-block and the third sub-block is recorded as the third subset, and the determination is continued as to whether there is a sub-block with equal pixels in the third sub-block in the third subset. This process is repeated until the obtained new subset is an empty set, and all the obtained similar sub-block sets corresponding to the cluster are counted. For sub-block b1 and sub-block b2 in the comprehensive sub-block set, if the pixel difference value between the sub-block b1 and the sub-block b2 is 0, it is determined that the sub-block b1 is a pixel-equal sub-block of sub-block b2, and the sub-block b2 is a pixel-equal sub-block of the sub-block b1.

Citation Information

Patent Citations

  • Image steganography based on texture fusion feature block matching and large embedding rate product code

    CN115049715A

  • Group connection data processing method and system

    CN117676136A

  • Image compression method and device based on random singular value decomposition, equipment and medium

    CN120378636A

  • System and method for compressing video using deep learning

    US10771807B1

Cited By

  • Digital scanner imaging management method based on big data

    CN121054200A

  • Management platform with audio and video local storage management function

    CN121397241A

  • A management platform with audio and video local storage management function

    CN121397241B