A homomorphic encryption-based intelligent retrieval method and system for video streams

By using homomorphic encryption technology to encrypt high-definition video streams at the video acquisition end, generating ciphertext frames and performing feature calculations to build a ciphertext index library, the security and efficiency issues of real-time cloud retrieval are solved, and efficient intelligent video stream retrieval is achieved.

CN122196232APending Publication Date: 2026-06-12BEIJING FUSION HSBC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610255910.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-03
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing technologies for real-time content retrieval of high-definition, high-frame-rate video streams in the cloud are subject to the risk of key or memory breaches. Furthermore, the decryption-re-encryption process doubles the computing power, making it difficult to support the concurrent operation of tens of thousands of cameras. In addition, the lack of cross-domain distance calculation protocols makes real-time retrieval impossible.

Method used

Homomorphic encryption technology is used to generate homomorphic public and private key fragments and evaluation keys at the video acquisition end. The original video frames are homomorphically encrypted one CTU at a time to generate ciphertext frames and calculate the frame difference. Homomorphic inference is performed using preset encryption model weights to generate high-dimensional ciphertext features and compress them into 512-dimensional compressed ciphertext features. A ciphertext semantic index library is constructed. After receiving plaintext retrieval samples, asymmetric distance calculation is performed in the ciphertext index library, and the user end decrypts the results.

Benefits of technology

It enables keyframe extraction, feature calculation, and millisecond-level retrieval without decryption, reducing bandwidth and storage requirements, lowering the client's computing power threshold, and supporting real-time retrieval of tens of thousands of high-definition video streams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122196232A_ABST
    Figure CN122196232A_ABST
Patent Text Reader

Abstract

The application discloses a homomorphic encryption-based intelligent video stream retrieval method and system. The method homomorphically encrypts video frames by CTU at the acquisition end, removes redundancy through plaintext thumbnail frame difference pre-screening, and only uploads significant ciphertext frames and primary features. The cloud end performs homomorphic reasoning using preset encryption model weights, obtains 512-dimensional compressed ciphertext features through encrypted principal component projection, and further constructs an encrypted inverted product quantization index. When a user searches, the cloud end converts plaintext query features into encrypted query vectors, performs asymmetric distance calculation in the ciphertext index, and returns a ciphertext ranking result. The user end uses a private key to decrypt the top-K plaintext frames. The method realizes millisecond-level retrieval without decryption, balances high throughput, low latency and strong privacy, and can be widely used in sensitive video scenes such as security, medical treatment and industrial vision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video stream processing technology, and in particular to a video stream intelligent retrieval method and system based on homomorphic encryption. Background Technology

[0002] With the widespread adoption of video streaming in security, healthcare, and industrial settings, a pressing compliance challenge has emerged: how to perform real-time content retrieval of high-definition, high-frame-rate video in the cloud while preventing sensitive footage from being exposed in plaintext. While the traditional "channel encryption + decryption followed by AI analysis" model can prevent eavesdropping, it requires complete decryption in the cloud before CNN feature extraction can be performed. If the key or memory is compromised, the entire database of historical footage can be retrieved in bulk. Furthermore, the decryption-re-encryption process doubles the computational cost, making it difficult to support concurrent access from tens of thousands of cameras.

[0003] In recent years, homomorphic encryption (FHE) technology has been attempted for "ciphertext domain AI reasoning," but existing research is still limited to offline reasoning for single images. When faced with a continuous 25 fps video stream, there are bottlenecks such as large redundancy in frame-by-frame ciphertext reasoning, high feature dimensionality expansion, and unutilized inter-frame correlation. Furthermore, there is a lack of a cross-domain distance calculation protocol between "plaintext retrieval examples and ciphertext features," making it impossible to directly port to real-time retrieval services. Summary of the Invention

[0004] Based on this, the embodiments of this application provide a video stream intelligent retrieval method and system based on homomorphic encryption, which can complete keyframe extraction, feature calculation, semantic indexing and millisecond-level retrieval without decryption throughout the process, while taking into account high throughput, low latency, high accuracy and strong privacy.

[0005] Firstly, a video stream intelligent retrieval method based on homomorphic encryption is provided, the method comprising:

[0006] At the video capture end, generate homomorphic public key, private key fragments and evaluation key, encrypt the original video frame by CTU to obtain ciphertext frame, calculate the frame difference on the plaintext thumbnail, and upload ciphertext frame and primary feature that are greater than the threshold.

[0007] Homomorphic inference is performed on the uploaded ciphertext frame using the pre-set encryption model weights to generate high-dimensional ciphertext features, which are then compressed into 512-dimensional compressed ciphertext features in one go through encryption principal component projection.

[0008] An encrypted inverted product quantization index is constructed using the compressed ciphertext features to form a ciphertext semantic index library;

[0009] After receiving a plaintext retrieval sample, the plaintext query features are extracted and an encrypted query vector is generated using a homomorphic public key. Asymmetric distance calculation is then performed in the ciphertext index to obtain the ciphertext ranking result.

[0010] The user terminal uses the private key to decrypt the ciphertext sorting results in fragments, obtains the plaintext Top-K video frames and their corresponding timestamps, and completes the retrieval.

[0011] Optionally, a homomorphic public key, private key fragments, and evaluation key are generated at the video capture end, specifically including:

[0012] The homomorphic public key, private key fragments, and evaluation key are generated by the trusted initialization center. The evaluation key includes a rotation key and a relinearization key. The rotation key is used to perform a channel-dimensional cyclic shift operation within the ciphertext domain, and the relinearization key is used to suppress ciphertext noise after homomorphic multiplication. The private key fragments are only distributed to the user end, and the cloud cannot obtain the complete private key throughout the process.

[0013] Optionally, in calculating the frame difference on the plaintext thumbnail, the frame difference calculation is performed after the low-resolution thumbnail is generated locally at the acquisition end. The absolute difference algorithm is used to sum and normalize the values ​​pixel by pixel. The primary features are extracted through the first three depthwise separable convolutional blocks of the cropped MobileNet-V3, and a fixed-length vector is output. This vector is then encapsulated together with the frame difference value into an upload data packet.

[0014] Optionally, homomorphic inference is performed on the uploaded ciphertext frame using preset encryption model weights. The homomorphic inference runs on the cloud-based FHE accelerator card. The preset encryption model weights are obtained by homomorphically encrypting the original floating-point model layer by layer. During inference, the ReLU activation function is replaced with a quadratic polynomial approximation, and a relinearization algorithm is called after each multiplication layer to suppress noise, ensuring that the ciphertext after the stacking of multiple network layers can still be correctly decrypted.

[0015] Optionally, the encrypted principal component projection matrix is ​​a floating-point PCA matrix obtained through offline training, which is then homomorphically encrypted element by element and pre-set in the cloud. The projection operation is implemented through homomorphic matrix multiplication, which maps the high-dimensional ciphertext features to a 512-dimensional low-dimensional ciphertext space in one go, while keeping the ciphertext state unchanged during the mapping process.

[0016] Optionally, the asymmetric distance calculation is performed in the cloud. The cloud first extracts query features from the plaintext side, then uses the homomorphic public key to generate an encrypted query vector, and then performs homomorphic multiplication and homomorphic addition with each encryption key in the encrypted index library to obtain the encrypted distance vector. The plaintext distance value does not need to be exposed throughout the process.

[0017] The asymmetric distance is calculated using the following formula:

[0018]

[0019] Determine the final output encryption distance value ,in, This represents the squared Euclidean distance to be calculated, which is the distance between the query vector q and the i-th codebook center. distance, Represents a homomorphic public key. It is a homomorphic encryption function that takes plaintext data as input and outputs ciphertext. The cloud can perform addition and multiplication operations on the ciphertext.

[0020] Optionally, the encrypted sorting result is encapsulated as a structured encrypted packet containing Top-K encrypted frames, encrypted distance, timestamp, and camera identifier. After receiving the packet, the user terminal uses its local private key to decrypt the entire packet data in segments. After decryption, a list of plaintext frames, plaintext distance, and corresponding timestamp are obtained, which can be used for local secondary sorting or playback.

[0021] Secondly, a video stream intelligent retrieval system based on homomorphic encryption is provided, the system comprising:

[0022] The video acquisition module is used to generate homomorphic public key, private key fragments and evaluation key, encrypt the original video frames one CTU homomorphically to obtain ciphertext frames, calculate the frame difference on the plaintext thumbnail, and upload ciphertext frames with a value greater than the threshold and primary features.

[0023] The processing module is used to perform homomorphic inference on the uploaded ciphertext frame using the preset encryption model weights, generate high-dimensional ciphertext features, and compress them into 512-dimensional compressed ciphertext features in one go through encryption principal component projection.

[0024] The construction module is used to construct an encrypted inverted product quantization index based on the compressed ciphertext features, forming a ciphertext semantic index library;

[0025] The extraction module is used to extract plaintext query features after receiving plaintext retrieval samples, generate encrypted query vectors using homomorphic public keys, perform asymmetric distance calculations in the ciphertext index, and obtain ciphertext ranking results.

[0026] On the user side, the private key is used to decrypt the ciphertext sorting results in fragments to obtain the plaintext Top-K video frames and their corresponding timestamps, thus completing the retrieval.

[0027] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described in the first aspect above.

[0028] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the methods described in the first aspect above.

[0029] The beneficial effects of the technical solutions provided in this application include at least the following:

[0030] (1) Feature extraction, index construction and similarity ranking can be achieved without decryption at any time. The original image and intermediate features are always in a homomorphic ciphertext state.

[0031] (2) By using two-stage dimensionality reduction, namely front-end frame difference pre-screening and encrypted principal component projection, redundant frames are discarded in the plaintext thumbnail stage, reducing the upload bandwidth; the high-dimensional ciphertext features are compressed to 512 dimensions while maintaining retrieval accuracy, and the ciphertext storage is reduced by an order of magnitude, enabling tens of thousands of high-definition video streams to be built and updated in real time on a standard GPU-FHE accelerator card cluster.

[0032] (3) The asymmetric distance calculation protocol allows users to submit retrieval samples in plaintext without the need to deploy a homomorphic encryption library locally, which lowers the client's computing power threshold; at the same time, the query vector and the index distance exist in ciphertext form throughout the process. Attached Figure Description

[0033] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0034] Figure 1 A flowchart illustrating the steps of an intelligent video stream retrieval method based on homomorphic encryption, provided in this application embodiment;

[0035] Figure 2 A system block diagram of a video stream intelligent retrieval method based on homomorphic encryption provided in this application embodiment;

[0036] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0038] In the description of this application, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, such as a process, method, system, product, or apparatus that includes a series of steps or units, not necessarily limited to those steps or units that are expressly listed, but may also include other steps or units that are not expressly listed but are inherent to these processes, methods, products, or apparatuses, or steps or units added based on further optimizations conceived in this application.

[0039] Please refer to Figure 1 The document illustrates a flowchart of a video stream intelligent retrieval method based on homomorphic encryption, provided in an embodiment of this application. This method may include the following steps:

[0040] S1 generates a homomorphic public key, private key fragments, and evaluation key at the video acquisition end. It then performs CTU-by-Current homomorphic encryption on the original video frames to obtain ciphertext frames. Finally, it calculates the frame difference on the plaintext thumbnail and uploads ciphertext frames and primary features that exceed the threshold.

[0041] In this step, a security chip is embedded in the video acquisition terminal. Upon initial startup, it requests a CKKS homomorphic public key pk, a user private key fragment sk_user, and an evaluation key ek containing a rotation key and a relinearization key from the remote key management center via the national cryptographic TLS protocol. The acquisition terminal divides the original 1080p YUV frame into 64×64 CTU blocks (in this application, CTU refers to Coding Tree Unit). It calls the homomorphic encryption kernel within the chip to perform CKKS encryption on each CTU with pk, generating a ciphertext frame C_frame. Simultaneously, the frame is reduced to a 160×120 thumbnail, and the absolute difference between the thumbnail and the previous frame is calculated pixel by pixel and normalized. If the difference is greater than a set threshold of 0.08, it is determined to be a scene change. The first three depthwise separable convolutional blocks of MobileNet-V3 are immediately used to extract 512-dimensional floating-point primary features f_plain. Finally, C_frame, f_plain, timestamp, and device ID are packaged and uploaded via TLS; otherwise, the data is discarded, saving more than 70% of uplink bandwidth.

[0042] S2 uses the pre-set encryption model weights to perform homomorphic inference on the uploaded ciphertext frame to generate high-dimensional ciphertext features, which are then compressed into 512-dimensional compressed ciphertext features in one go through encryption principal component projection.

[0043] In this step, after receiving the ciphertext frame, the cloud sends it to the pre-set "encrypted ResNet-50 first five blocks" weight file—the weights are homomorphically encrypted layer by layer from the original floating-point model and serialized for storage—and performs ciphertext domain convolution, batch normalization, and squared activation through the FPGA-FHE acceleration card to output an 8192-dimensional ciphertext feature C_feat; then, it calls the pre-set 512×8192 encrypted principal component matrix (each element is Enc(pk,p_ij)) and performs matrix-vector multiplication in the ciphertext state to obtain a 512-dimensional compressed ciphertext feature C_comp; after each layer of multiplication, relinearization and modulus reduction operations are automatically inserted to suppress noise growth.

[0044] S3 uses compressed ciphertext features to construct an encrypted inverted product quantization index, forming a ciphertext semantic index library.

[0045] The 512-dimensional compressed ciphertext feature C_comp is uniformly divided into 16 segments of 32-dimensional sub-vectors. 256 encrypted clustering centers Enc(pk,μ_i) are pre-generated in the cloud. For each sub-vector, the Euclidean distance to all centers is calculated in the ciphertext domain. The cluster ID with the smallest distance is selected as the 8-bit codeword, forming a total of 16-byte codeword vectors. At the same time, an encrypted inverted index is constructed to record the ciphertext frame ID and encrypted distance list corresponding to each cluster ID. The entire structure is stored in a distributed Redis cluster in the form of an encrypted semantic index, supporting concurrent insertion, deletion and query. The clustering centers and inverted index content always remain in ciphertext state.

[0046] S4. After receiving the plaintext retrieval sample, extract the plaintext query features and generate an encrypted query vector using a homomorphic public key. Perform asymmetric distance calculation in the ciphertext index to obtain the ciphertext ranking result.

[0047] When a user submits a plaintext image or short video, the cloud first extracts a 512-dimensional query feature q on the plaintext GPU using the same MobileNet-V3. Then, it calls a homomorphic public key kernel to encrypt q into a query vector Enc(pk,q). During the indexing phase, homomorphic multiplication and addition are performed on each cluster center Enc(pk,μ_i) in the inverted index to calculate the encrypted distance Enc(pk,d_i). The K clusters with the smallest distance are selected through a homomorphic comparison circuit, and the corresponding ciphertext frame list is retrieved. Finally, the encrypted Top-K result packet Enc(pk,Result) is encapsulated and returned to the user. Throughout the process, no plaintext distance or original features are exposed.

[0048] In this step, the asymmetric distance is calculated using the following formula:

[0049]

[0050] Determine the final output encryption distance value ,in, This represents the squared Euclidean distance to be calculated, which is the distance between the query vector q and the i-th codebook center. distance, Represents a homomorphic public key. This is a homomorphic encryption function. It takes plaintext data as input and outputs ciphertext. The cloud can then perform addition and multiplication operations on this ciphertext. Specifically:

[0051] q is the plaintext query feature vector with a dimension of 512, which is extracted from the plaintext side of the cloud based on the retrieval sample (image or short video) submitted by the user.

[0052] The i-th codebook center vector, with a dimension of 512, is obtained by offline K-means clustering and then homomorphically encrypted and pre-loaded into the cloud index library;

[0053] Let be the squared Euclidean distance to be calculated, representing the distance between the query vector q and the i-th codebook center. The distance;

[0054] It is a homomorphic public key used to encrypt plaintext data and is publicly available to the data acquisition terminal, cloud platform, and user terminal.

[0055] This is a homomorphic encryption function that takes plaintext data as input and outputs ciphertext. The cloud can then perform addition and multiplication operations on this ciphertext.

[0056] This is the ciphertext for summing the squares of each component of the query vector;

[0057] The ciphertext for the i-th codebook center is pre-calculated and stored in the index;

[0058] The ciphertext of the square of the center of the i-th codebook is pre-calculated and stored in the index;

[0059] The final output encrypted distance value is used directly for sorting the ciphertext field without decryption throughout the process.

[0060] S5: The user terminal uses the private key to decrypt the ciphertext sorting result in fragments, obtains the plaintext Top-K video frames and corresponding timestamps, and completes the retrieval.

[0061] After receiving the encrypted result packet, the user terminal uses the private key fragment sk_user in the local security chip to call the CKKS decryption core to decrypt Enc(pk,Result) element by element to obtain the plaintext frame ID list, plaintext distance value and corresponding timestamp; then, it pulls the original ciphertext C_frame of these frames from the cloud via HTTPS, and then uses sk_user to decrypt and restore it to YUV pixels. After hardware decoding, it is presented as a playable Top-K video clip; the decryption process is only completed in the trusted environment of the user terminal, and the cloud can never obtain the plaintext content, realizing an end-to-end "usable but invisible" retrieval experience.

[0062] like Figure 2 This application also provides a video stream intelligent retrieval system based on homomorphic encryption, which may include:

[0063] The video acquisition module is used to generate homomorphic public key, private key fragments and evaluation key, encrypt the original video frames one CTU homomorphically to obtain ciphertext frames, calculate the frame difference on the plaintext thumbnail, and upload ciphertext frames with a value greater than the threshold and primary features.

[0064] The processing module is used to perform homomorphic inference on the uploaded ciphertext frame using the preset encryption model weights, generate high-dimensional ciphertext features, and compress them into 512-dimensional compressed ciphertext features in one go through encryption principal component projection.

[0065] The construction module is used to construct an encrypted inverted product quantization index based on the compressed ciphertext features, forming a ciphertext semantic index library;

[0066] The extraction module is used to extract plaintext query features after receiving plaintext retrieval samples, generate encrypted query vectors using homomorphic public keys, perform asymmetric distance calculations in the ciphertext index, and obtain ciphertext ranking results.

[0067] On the user side, the private key is used to decrypt the ciphertext sorting results in fragments to obtain the plaintext Top-K video frames and their corresponding timestamps, thus completing the retrieval.

[0068] Specific limitations regarding the intelligent video stream retrieval system based on homomorphic encryption can be found in the limitations of the intelligent video stream retrieval method based on homomorphic encryption described above, and will not be repeated here. Each module in the aforementioned intelligent video stream retrieval system based on homomorphic encryption can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0069] In one embodiment, an electronic device is provided, which may be a computer, and its internal structure diagram may be as follows: Figure 3 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for intelligent retrieval of video stream data. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an intelligent video stream retrieval method.

[0070] Those skilled in the art will understand that, Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0071] In one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described intelligent video stream retrieval method based on homomorphic encryption.

[0072] In one embodiment of this application, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-described intelligent video stream retrieval method based on homomorphic encryption.

[0073] The computer-readable storage medium and computer program product provided in this embodiment are similar in implementation principle and technical effect to the above method embodiments, and will not be repeated here.

[0074] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.

[0075] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0076] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A video stream intelligent retrieval method based on homomorphic encryption, characterized in that, The method includes: At the video capture end, generate homomorphic public key, private key fragments and evaluation key, encrypt the original video frame by CTU to obtain ciphertext frame, calculate the frame difference on the plaintext thumbnail, and upload ciphertext frame and primary feature that are greater than the threshold. Homomorphic inference is performed on the uploaded ciphertext frame using the pre-set encryption model weights to generate high-dimensional ciphertext features, which are then compressed into 512-dimensional compressed ciphertext features in one go through encryption principal component projection. An encrypted inverted product quantization index is constructed using the compressed ciphertext features to form a ciphertext semantic index library; After receiving a plaintext retrieval sample, the plaintext query features are extracted and an encrypted query vector is generated using a homomorphic public key. Asymmetric distance calculation is then performed in the ciphertext index to obtain the ciphertext ranking result. The user terminal uses the private key to decrypt the ciphertext sorting results in fragments, obtains the plaintext Top-K video frames and their corresponding timestamps, and completes the retrieval.

2. The method according to claim 1, characterized in that, The video capture terminal generates homomorphic public key, private key fragments, and an evaluation key, specifically including: The homomorphic public key, private key fragments, and evaluation key are generated by the trusted initialization center. The evaluation key includes a rotation key and a relinearization key. The rotation key is used to perform a channel-dimensional cyclic shift operation within the ciphertext domain, and the relinearization key is used to suppress ciphertext noise after homomorphic multiplication. The private key fragments are only distributed to the user end, and the cloud cannot obtain the complete private key throughout the process.

3. The method according to claim 1, characterized in that, In the calculation of frame difference on plaintext thumbnails, the frame difference calculation is performed after a low-resolution thumbnail is generated locally at the acquisition end. The absolute difference algorithm is used to sum and normalize pixel by pixel. The primary features are extracted through the first three depthwise separable convolutional blocks of the cropped MobileNet-V3, and the output is a fixed-length vector, which is encapsulated together with the frame difference value into an upload data packet.

4. The method according to claim 1, characterized in that, In the process of performing homomorphic inference on the uploaded ciphertext frame using the pre-set encryption model weights, the homomorphic inference runs on the cloud FHE accelerator card. The pre-set encryption model weights are obtained by homomorphically encrypting the original floating-point model layer by layer. During inference, the ReLU activation function is replaced with a quadratic polynomial approximation, and a relinearization algorithm is called after each multiplication layer to suppress noise, ensuring that the ciphertext after the stacking of multiple networks can still be correctly decrypted.

5. The method according to claim 1, characterized in that, The encrypted principal component projection matrix is ​​a floating-point PCA matrix obtained through offline training, which is then pre-set to the cloud after element-wise homomorphic encryption. The projection operation is implemented through homomorphic matrix multiplication, which maps the high-dimensional ciphertext features to the 512-dimensional low-dimensional ciphertext space in one go, while keeping the ciphertext state unchanged during the mapping process.

6. The method according to claim 1, characterized in that, The asymmetric distance calculation is performed in the cloud. The cloud first extracts query features from the plaintext side, then uses the homomorphic public key to generate an encrypted query vector, and then performs homomorphic multiplication and homomorphic addition with each encryption key in the encrypted index library to obtain the encrypted distance vector. The plaintext distance value does not need to be exposed throughout the process. The asymmetric distance is calculated using the following formula: Determine the final output encryption distance value ,in, This represents the squared Euclidean distance to be calculated, which is the distance between the query vector q and the i-th codebook center. distance, Represents a homomorphic public key. It is a homomorphic encryption function that takes plaintext data as input and outputs ciphertext. The cloud can perform addition and multiplication operations on the ciphertext.

7. The method according to claim 1, characterized in that, The encrypted sorting result is encapsulated into a structured encrypted packet containing Top-K encrypted frames, encrypted distance, timestamp, and camera identifier. After receiving the packet, the user terminal uses its local private key to decrypt the entire packet data in segments. After decryption, a list of plaintext frames, plaintext distance, and corresponding timestamp are obtained, which can be used for local secondary sorting or playback.

8. A video stream intelligent retrieval system based on homomorphic encryption, characterized in that, The system includes: The video acquisition module is used to generate homomorphic public key, private key fragments and evaluation key, encrypt the original video frames one CTU homomorphically to obtain ciphertext frames, calculate the frame difference on the plaintext thumbnail, and upload ciphertext frames with a value greater than the threshold and primary features. The processing module is used to perform homomorphic inference on the uploaded ciphertext frame using the preset encryption model weights, generate high-dimensional ciphertext features, and compress them into 512-dimensional compressed ciphertext features in one go through encryption principal component projection. The construction module is used to construct an encrypted inverted product quantization index based on the compressed ciphertext features, forming a ciphertext semantic index library; The extraction module is used to extract plaintext query features after receiving plaintext retrieval samples, generate encrypted query vectors using homomorphic public keys, perform asymmetric distance calculations in the ciphertext index, and obtain ciphertext ranking results. On the user side, the private key is used to decrypt the ciphertext sorting results in fragments to obtain the plaintext Top-K video frames and their corresponding timestamps, thus completing the retrieval.

9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.