An adaptive hybrid coding and bandwidth allocation method and system for multi-stream video edge inference
By employing an adaptive hybrid encoding/decoding and bandwidth allocation method, and utilizing a deep reinforcement learning scheduler and quality transfer technology, the problems of low bandwidth utilization and poor accuracy fairness in multi-stream video edge inference are solved, achieving high-precision, low-latency multi-stream video analysis.
Patent Information
- Application Number
- CN202611326740.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-30
- Publication Date
- 2026-11-27
AI Technical Summary
Existing multi-stream video edge inference technologies suffer from low bandwidth utilization, poor multi-stream accuracy fairness, and an imbalance between inference performance and resource consumption, failing to meet the actual needs of real-time video analysis.
An adaptive hybrid encoding/decoding and bandwidth allocation method is adopted. Video frames are classified into three categories through a deep reinforcement learning agent scheduler. By utilizing a quality transfer mechanism and motion vector reuse technology, combined with a global bandwidth controller to dynamically adjust bandwidth resources, high-precision inference and high-throughput processing are achieved.
It achieves high precision, low latency, and fairness in multi-stream video analysis, significantly improving bandwidth utilization and reducing transmission latency and resource consumption.
Smart Images

Figure CN123185359A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image communication technology and relates to video analysis technology. Specifically, it relates to an adaptive hybrid encoding and decoding and bandwidth allocation method and system for multi-stream video edge inference. Background Technology
[0002] With the widespread adoption of high-definition cameras in surveillance, transportation, and other fields, the demand for real-time video analysis is surging. While the development of deep neural networks (DNNs) has significantly improved the inference accuracy of visual tasks, it has also placed stringent demands on computing resources. Due to the limited computing power of front-end cameras, distributed video analytics pipelines (VAPs) have become the mainstream solution. This involves offloading video frames captured at the front end to edge servers for inference processing, thus avoiding the privacy risks associated with cloud transmission and mitigating the impact of long-distance network outages.
[0003] However, existing distributed VAPs still face key technical bottlenecks in multi-stream contention scenarios: the contradiction between bandwidth resource constraints and inference performance is difficult to reconcile. High-precision video analytics relies on high-information-volume input data, but the transmission of high-definition video streams requires huge bandwidth costs—for example, when the inference accuracy of Faster R-CNN is improved from 540P to 1080P, the required network bandwidth increases by 3.7 times. In practical applications, the uplink bandwidth from the front-end camera to the edge server is often only one-tenth of the downlink bandwidth for video-on-demand. Limited bandwidth resources make it difficult for existing VAPs to guarantee the analysis quality of all streams when multiple streams are running concurrently.
[0004] To alleviate bandwidth pressure, existing technologies are mainly divided into two categories: front-end compression and back-end enhancement. Front-end compression saves bandwidth by filtering invalid frames or invalid content within frames, but excessive compression can lead to a significant decrease in inference accuracy. Back-end enhancement uses models such as super-resolution (SR) to improve the quality of compressed video, but it suffers from high computational overhead and high latency, especially in multi-stream scenarios. Deploying content-aware SR models for different streams can lead to frequent GPU switching, introducing significant latency overhead. In addition, traditional video streaming protocols (such as WebRTC and DASH) have insufficient bandwidth utilization in video analytics scenarios and are difficult to adapt to the dynamic needs of multi-stream concurrency.
[0005] More critically, existing bandwidth allocation strategies lack analytical capabilities, often employing uniform allocation methods that ignore the heterogeneity of different video streams. For example, video streams containing densely packed small targets are more sensitive to resolution and require more bandwidth to ensure accuracy. Uniform allocation severely impairs the inference performance of such streams, failing to achieve accuracy fairness among multiple streams. Furthermore, existing technologies fail to fully utilize the inherent information in video coding (such as motion vectors, residuals, and frame reference relationships). They either perform frame-by-frame enhancement, leading to resource waste, or simply compress, resulting in accuracy loss. It is difficult to balance accuracy, throughput, and latency in multi-stream video analysis under bandwidth constraints.
[0006] In summary, existing multi-stream video edge inference technologies suffer from problems such as low bandwidth utilization, poor multi-stream accuracy fairness, and an imbalance between inference performance and resource consumption, which cannot meet the actual needs of real-time video analysis. There is an urgent need for a technical solution that balances efficient bandwidth utilization and multi-stream performance optimization. Summary of the Invention
[0007] Purpose of the invention: To address the problems existing in the prior art, this invention proposes an adaptive hybrid encoding and decoding and bandwidth allocation method and system for multi-stream video edge inference, so as to simultaneously achieve the goals of high-precision inference, high-throughput processing, low transmission latency and fairness guarantee in multi-stream scenarios.
[0008] Technical solution: To achieve the above objectives, the technical solution of the present invention is as follows:
[0009] An adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference includes the following steps:
[0010] Step 1: After the front-end device acquires multi-stream video, it uses a scheduler based on a deep reinforcement learning agent and a hybrid encoder to classify the frames of each video stream into three categories, encodes them, and sends them to the edge server. The hybrid encoder dynamically adjusts the video bitrate and resolution based on the bandwidth allocation results, video content features, and bitstream information fed back by the edge server.
[0011] Step 2: The three types of frames undergo corresponding processing through three pipelines:
[0012] The first pipeline decodes the anchor frames encoded as high-definition frames, inputs them into the inference model, and caches the inference results.
[0013] The second pipeline decodes the compressed frames of non-anchor frames and reuses the high-definition features of anchor frames using the bitstream information and a quality transfer mechanism.
[0014] The third pipeline reuses inference results based on motion vectors of the bitstream for frames that do not require quality transfer.
[0015] Step 3: The edge server dynamically allocates bandwidth resources through the global bandwidth controller, taking into account the content characteristics of each video stream, inference accuracy requirements, and server load status; the bandwidth allocation results are fed back to the front-end device.
[0016] Furthermore, in step 1, the scheduler determines the classification of frames by setting an adaptive threshold. The classification problem is formulated as a Markov decision process, defining a quadruple.<S, A, R, P> Where S is the set of states, A is the set of actions, R is the set of rewards, and P is the state transition probability; State S includes keyframe content features, frame difference features, encoding parameters, bandwidth allocation, and server load; Action A is to set dual thresholds tr1 and tr2 for each video segment to achieve frame classification; Reward R includes the average inference accuracy of the video segment and the penalty when the latency exceeds the preset threshold.
[0017] Specifically, the frame classification includes the following process: when the frame difference feature is greater than tr1, it is determined to be the anchor frame corresponding to the first pipeline; when the frame difference feature is not greater than tr1, the frames with cumulative residuals greater than tr2 are determined to be the frames corresponding to the second pipeline, and the remaining frames are determined to be the frames corresponding to the third pipeline.
[0018] Specifically, the anchor frame is encoded into a high-definition frame using an nvJPEG image encoder, and the remaining frames are compressed using an H.264 video encoder.
[0019] Specifically, in step 2, the second pipeline utilizes the bitstream information and reuses the high-definition features of the anchor frame through a quality transfer mechanism, including:
[0020] (1) Locating reusable blocks in high-definition anchor frames based on the bitstream reference index;
[0021] (2) Scale the motion vector according to the target resolution magnification factor, and perform bilinear interpolation on the residual to achieve alignment;
[0022] (3) The processed high-definition block is superimposed with the residual and seamlessly attached to the non-anchor frame. After generating the enhanced frame, it is input into the inference model and the inference result is cached.
[0023] Specifically, in step 2, the reuse of inference results based on the motion vectors of the code stream includes:
[0024] (1) Extract the target detection box from the previous inference frame;
[0025] (2) Filter the static background and the noise motion vectors corresponding to outliers;
[0026] (3) Calculate the mean value of the motion vector within each target detection box, and shift the target detection box to the target position of the current uninferred frame according to the mean value, as the inference result of the current frame.
[0027] Furthermore, it also includes: extending the motion vector calculation region by a macroblock in each direction to adapt to the changes in bounding box size caused by target movement.
[0028] Furthermore, in step 3, the global bandwidth controller adopts a two-layer optimization approach. The upper layer optimizes bandwidth allocation with the goal of maximizing the fairness of multi-stream inference accuracy, while the lower layer optimizes the single-stream frame classification strategy under the allocated bandwidth constraints to meet end-to-end latency constraints.
[0029] Furthermore, when the network environment does not support the simultaneous transmission of high-definition frames and video streams, the hybrid encoder performs discrete cosine transform and entropy coding on the residuals of high-definition frames and low-resolution frames to supplement and enhance information embedded in the video stream transmission; the edge server extracts the residuals through the hybrid decoder, upsamples the low-resolution frames through bilinear interpolation, and then superimposes the residuals to recover the high-definition frames.
[0030] The present invention also provides a computer system, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference proposed in the present invention.
[0031] Beneficial effects:
[0032] 1. This invention avoids the accuracy loss and high computing power consumption of traditional super-resolution enhancement by using anchor frame high-definition transmission and quality transfer mechanism, and achieves high-precision target for multi-stream inference.
[0033] 2. This invention achieves high throughput processing by reusing the results of a three-level inference pipeline and efficiently utilizing the bandwidth of hybrid encoding and decoding, thereby distributing the resource overhead of single-stream transmission and inference.
[0034] 3. This invention avoids the inefficiencies of frame-by-frame enhancement and uniform bandwidth allocation by using DRL dynamic frame classification and bandwidth adaptation, thereby reducing end-to-end transmission and inference latency.
[0035] 4. This invention, through two-layer optimization of the global analytics-aware bandwidth controller, adapts to the heterogeneous characteristics of different video streams, ensures fairness in inference accuracy among multiple streams, and significantly improves bandwidth utilization. Attached Figure Description
[0036] Figure 1 This is a diagram of the overall architecture of the present invention.
[0037] Figure 2 This is a schematic diagram of the internal structure of a hybrid encoder.
[0038] Figure 3 This is a flowchart of the hybrid decoder and three-level inference pipeline.
[0039] Figure 4 A schematic diagram illustrating the principle of performing quality migration for pipe 2.
[0040] Figure 5 This is a schematic diagram of the neural network structure and input / output states of the DRL agent in a hybrid encoder.
[0041] Figure 6 The improved hybrid encoder structure and processing flowchart are shown in the diagram for scenarios that do not support high-definition frame separation transmission.
[0042] Figure 7 An improved hybrid decoder structure and processing flowchart for scenarios that do not support high-definition frame separation transmission. Detailed Implementation
[0043] The technical solutions provided by the present invention will be described in detail below with reference to specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention.
[0044] Figure 1 is an overall architecture diagram of the present invention, illustrating the collaborative logic of the front-end device, hybrid codec, and edge server, as well as the multi-stream data transmission path. Specifically, the present invention proposes an adaptive hybrid codec and bandwidth allocation method for multi-stream video edge inference, with the following specific implementation steps:
[0045] Step 1: After the front-end device acquires multi-stream video, it uses a hybrid encoder based on deep reinforcement learning (DRL) to classify the frames of each video stream into three categories. The hybrid encoder deployed on the front-end device integrates a deep reinforcement learning agent (DRLAgent) as a scheduler, and its structure is as follows: Figure 2 As shown, this illustrates the collaborative relationship between the video encoder, the DRL agent, and the image encoder. The core objective of the hybrid encoder is to balance single-stream inference accuracy and transmission efficiency under the bandwidth constraints allocated by the edge server, through adaptive frame classification and encoding parameter adjustments. Different frame classifications correspond to different encoding methods and inference pipelines, resulting in varying accuracy and latency, requiring fine-grained control to achieve global optimization.
[0046] This invention models the single-stream frame classification problem as an accuracy maximization optimization problem under delay constraints, mathematically expressed as follows:
[0047]
[0048] Where c represents one video stream (obtained from a single camera), which belongs to the video stream set C. This represents the set of frames in the single-stream video. express One frame in the video. Frame classification set ( (corresponding to three inference pipelines) For single-frame inference accuracy, This refers to the single-frame processing latency (including transmission, decoding, and inference time). This represents the set of bandwidths allocated to each video stream in C. Allocate bandwidth for stream c. This represents the end-to-end latency tolerance.
[0049] Because the search space for frame classification is large (where k is the number of frames per second in a single stream), directly finding the optimal solution is extremely difficult. This invention outputs dual thresholds through a DRL Agent. and Frame clustering is achieved, while lightweight features are extracted using inherent information from video coding (residuals, frame reference relationships) to reduce computational overhead. Specifically, edge feature differences are obtained by applying a Laplacian operator to the residuals, which saves 34% of feature extraction time compared to directly processing frame pixels, and these difference features are strongly correlated with inference accuracy.
[0050] To achieve adaptive threshold adjustment, the frame classification problem is transformed into a Markov Decision Process (MDP), defining a quadruple. , combined Figure 5 The data flow and implementation details of each parameter in the mid-frame classification decision are as follows:
[0051] State set S: includes keyframe content features, frame difference features, coding parameters, bandwidth allocation, and server load. Keyframe features are extracted through a VGG network and then reduced to 128 dimensions using PCA; frame difference features are the edge feature differences between the current frame and the previous inference frame; coding parameters include the current video bitrate (…). ) and resolution ( Bandwidth allocation is based on bandwidth feedback from the edge server. Server load is measured by the inference pipeline queue length. Characterization.
[0052] Action set A: Sets a double threshold for each video segment (1 second in length). and . Used for filtering anchor frames (pipeline 1), specifically, when the frame difference feature is greater than... The frame is identified as an anchor frame. The anchor frame is encoded into a high-definition frame and transmitted to the edge server. Used to filter non-anchor frames that require quality transfer (pipeline 2), specifically, when the frame difference feature is no greater than [value missing]. But the cumulative residual is greater than When the frame is in the middle, it is determined to be a non-anchor frame corresponding to pipe 2, and the remaining frames are assigned to pipe 3.
[0053] The reward set R is a combination of single-stream accuracy (i.e., the average inference accuracy of video segments) and latency penalty, expressed as follows:
[0054]
[0055] in, This represents the time index of the current video segment (i.e., the t-th video segment). Indicates the first The set of all video frames contained within a video segment. This indicates the total number of frames in the video segment. To balance the weights, For the delay penalty function (delay over) hour Otherwise, it is 0).
[0056] The state transition probability P is dynamically determined by network bandwidth fluctuations, changes in video content, and server load. Due to the high complexity and unknown nature of these environmental factors, this system adopts a model-free reinforcement learning (DRL) architecture. Instead of relying on explicit mathematical formulas for state transitions, it implicitly fits the state transition patterns of the environment and learns the optimal policy during the training process of interacting with the environment by constructing an Actor-Critic deep neural network.
[0057] The DRL Agent employs an Actor-Critic network architecture. Both the Actor and Critic networks are two-layer MLPs (128 units each), with ReLU activation function. The Adam optimizer learning rates are 0.005 and 0.01, respectively, and the reward discount factor is... The hybrid encoder performs frame classification based on the threshold output by the Agent, then compresses non-anchor frames using the H.264 video encoder (JM 19.0 version) and anchor frames using the nvJPEG image encoder. Simultaneously, it dynamically adjusts the bit rate (500-5000 kbps) and resolution (270p-1080p) based on the bandwidth allocation results, video content characteristics, and bitstream information fed back by the edge server.
[0058] Step 2: The three types of frames correspond to three inference pipelines and are processed accordingly by the hybrid decoder. The workflow of the hybrid decoder and the three-stage inference pipeline is as follows: Figure 3 As shown, this illustrates the decoding and inference processing paths for different frame types. This step specifically includes:
[0059] ① Pipeline 1 (Anchor Frame Inference): Passed through threshold The selected anchor frames (7%~8%) are encoded in high-definition and transmitted to the edge server. The edge server decodes the images and directly inputs them into the inference model (Faster R-CNN or YOLOv5). The inference results output by the model are cached locally on the server. The selection of anchor frames aims to maximize accuracy gain, prioritizing frames containing dense small targets or abrupt scene changes.
[0060] ② Pipeline 2 (Quality Transfer + Inference): After the non-anchor frames are decoded by the video decoder, the high-definition features of the anchor frames are reused through a quality transfer mechanism using bitstream information (such as frame reference relationships, motion vectors, and residuals). The specific steps are as follows (see attached). Figure 4 It demonstrates how to use bitstream information to transfer high-definition features from anchor frames to non-anchor frames.
[0061] (1) Locating reusable blocks in high-definition anchor frames based on the bitstream reference index;
[0062] (2) Scale the motion vector (MV) according to the target resolution magnification factor, and perform bilinear interpolation on the residual to achieve alignment;
[0063] (3) The processed high-definition block is superimposed with the residual and seamlessly attached to the non-anchor frame to generate an enhanced frame, which is then input into the inference model and the result is cached.
[0064] This process only adds the extra overhead of residual interpolation per frame, which is comparable to the time required for normal decoding.
[0065] ② Pipeline 3 (Inference Result Reuse): For frames that do not require quality transfer, inference result reuse is achieved using encoded MV, specifically including the following process:
[0066] (1) Extract the target detection box (Bbox) of the previous inference frame;
[0067] (2) Filter static background and noise MV corresponding to outliers (remove MV with a value of 0 or exceeding the mean + 0.8 times the standard deviation);
[0068] (3) Calculate the mean value of the MV within each Bbox, and offset the Bbox to the target position of the current uninferred frame according to the mean value, as the inference result of the current frame. To adapt to the change in Bbox size caused by target movement, expand the MV calculation area by a macroblock (16 pixels) in each direction to adapt to the change in bounding box size caused by target movement.
[0069] Step 3: The edge server, through a global bandwidth controller, dynamically allocates bandwidth resources based on the content characteristics of each video stream, inference accuracy requirements, and server load status to ensure fairness in inference accuracy across multiple streams. The specific implementation method is as follows:
[0070] The bandwidth controller deployed on the edge server adopts a soft Actor-Critic (SAC) DRL network, which maximizes multi-stream accuracy fairness and bandwidth utilization through two-layer optimization. The upper layer optimizes bandwidth allocation with the goal of maximizing multi-stream inference accuracy fairness, while the lower layer optimizes the single-stream frame classification strategy under the constraint of allocated bandwidth to meet end-to-end latency constraints.
[0071] Specifically, the implementation details of the MDP parameters for bandwidth allocation are as follows:
[0072] state This includes content features, bitstream characteristics, historical allocation results, inference performance, and anchor frame ratio for each stream. Content features are the average number of targets and the average target size, estimated from the inference results of the previous video segment; bitstream characteristics are the average residual (r), reflecting scene dynamics. In single-stream frame classification (lower-layer optimization), the cumulative residual from the previous inference frame to the current frame is used; while in global multi-stream bandwidth allocation on the server (upper-layer optimization), the average residual of this video stream in the current video segment is used. Historical allocation results are the bandwidth allocation vector from the previous allocation (r). Inference performance is the F1-score (acc) for each flow; anchor frame percentage is the frame percentage (p) for each flow's pipeline 1.
[0073] Action A: Output bandwidth allocation ratio for each stream (N is the number of streams), satisfying
[0074] (B represents the total available bandwidth).
[0075] award The objective is to minimize the reward value of all flows, i.e. This ensures fairness in multi-stream accuracy. Here, C represents the set of all video streams (acquired by multiple cameras); c represents a specific video stream within the set; and rc is the calculated single-stream reward value for that specific video stream c.
[0076] The DRL network implementation parameters for the bandwidth controller are as follows: the policy network is a four-layer MLP (256 units), the value network is a three-layer MLP, the Q-function network learning rate is 0.0003, the target update rate is 0.02, and the replay buffer size is [not specified]. The batch size is 128. Bandwidth allocation results are fed back to the front end via HTTP control messages. The message header includes the allocated bandwidth and queue length. The Curl tool is used for transmission, with an update interval of 10 seconds. The bandwidth allocation results are then fed back to the front-end device to adjust the hybrid encoding strategy.
[0077] Special scenario adaptation implementation: When the network environment does not support the simultaneous transmission of high-definition frames and video streams (e.g., some enterprise networks restrict specific protocols due to their firewalls, supporting only the transmission of video streams and not the direct transmission of high-definition frame images), the hybrid encoder first uses bilinear interpolation to upsample the low-resolution frames in the video stream to high-definition resolution; then, it calculates the residual between the original high-definition anchor frame and the upsampled frame, and embeds this residual into the H.264 bitstream transmission after DCT transformation and Huffman coding to supplement enhancement information (SEI), such as... Figure 6 As shown in the figure (which illustrates the encoding process of embedding anchor frame residuals into the SEI message of the video stream), the edge server first decodes the low-resolution frames from the video stream using a hybrid decoder and extracts the residual information contained in the SEI message; then, it uses bilinear interpolation to upsample the low-resolution frames to high-resolution; finally, it overlays the decoded residual data with the upsampled frames to reconstruct the final high-resolution anchor frame. Figure 7 As shown in the figure (which illustrates the decoding process of extracting residuals from SEI messages and using interpolation algorithms to recover high-definition anchor frames), this method can reduce the anchor frame transmission volume by 25% to 29%.
[0078] System overall deployment and implementation: The edge server adopts the Ubuntu 18.04 system, configured with an Intel Xeon Gold 6226R CPU and an NVIDIA RTX 3070 (8G) GPU; the front end uses a laptop terminal to simulate a camera, and captures video (30fps) based on DDS mode, integrating the WebRTC protocol to ensure real-time transmission; the WonderShaper tool is used to simulate the bandwidth fluctuation of the FCC broadband network trace; the inference model is pre-trained based on the COCO dataset and supports combination with the early exit strategy (the state input adds the model exit layer index).
[0079] This invention avoids the inefficiency of frame-by-frame enhancement and uniform bandwidth allocation by using anchor frame transmission, quality transfer, and two-layer optimization, significantly improving inference accuracy and bandwidth utilization, and effectively reducing transmission latency and computing power consumption.
[0080] The present invention also provides a computer system, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the adaptive hybrid encoding and decoding and bandwidth allocation method for multi-stream video edge inference proposed in the present invention.
[0081] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0083] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0084] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0085] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.
Claims
1. An adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference, characterized in that, Includes the following steps: Step 1: After the front-end device acquires multi-stream video, it uses a scheduler based on a deep reinforcement learning agent and a hybrid encoder to classify the frames of each video stream into three categories, encodes them, and sends them to the edge server. The hybrid encoder dynamically adjusts the video bitrate and resolution based on the bandwidth allocation results, video content features, and bitstream information fed back by the edge server. Step 2: The three types of frames undergo corresponding processing through three pipelines: The first pipeline decodes the anchor frames encoded as high-definition frames, inputs them into the inference model, and caches the inference results. The second pipeline decodes the compressed frames of non-anchor frames and reuses the high-definition features of anchor frames using the bitstream information and a quality transfer mechanism. The third pipeline reuses inference results based on motion vectors of the bitstream for frames that do not require quality transfer. Step 3: The edge server dynamically allocates bandwidth resources through the global bandwidth controller, taking into account the content characteristics of each video stream, inference accuracy requirements, and server load status; the bandwidth allocation results are fed back to the front-end device.
2. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, In step 1, the scheduler determines the classification of frames by setting an adaptive threshold. The classification problem is expressed as a Markov decision process, and a quadruple is defined.<S, A, R, P> Where S is the set of states, A is the set of actions, R is the set of rewards, and P is the state transition probability; State S includes keyframe content features, frame difference features, encoding parameters, bandwidth allocation, and server load; Action A is to set dual thresholds tr1 and tr2 for each video segment to achieve frame classification; Reward R includes the average inference accuracy of the video segment and the penalty when the latency exceeds the preset threshold.
3. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 2, characterized in that, The frame classification includes the following process: when the frame difference feature is greater than tr1, it is determined to be the anchor frame corresponding to the first pipeline; When the frame difference feature is no greater than tr1, the frames with a cumulative residual greater than tr2 are determined to be the frames corresponding to the second pipeline, and the remaining frames are determined to be the frames corresponding to the third pipeline.
4. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, The anchor frame is encoded into a high-definition frame using an nvJPEG image encoder, and the remaining frames are compressed using an H.264 video encoder.
5. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, In step 2, the second pipeline utilizes the bitstream information and reuses the high-definition features of the anchor frame through a quality transfer mechanism, including: (1) Locating reusable blocks in high-definition anchor frames based on the bitstream reference index; (2) Scale the motion vector according to the target resolution magnification factor, and perform bilinear interpolation on the residual to achieve alignment; (3) The processed high-definition block is superimposed with the residual and seamlessly attached to the non-anchor frame. After generating the enhanced frame, it is input into the inference model and the inference result is cached.
6. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, In step 2, the reuse of inference results based on the motion vectors of the code stream includes: (1) Extract the target detection box from the previous inference frame; (2) Filter the static background and the noise motion vectors corresponding to outliers; (3) Calculate the mean value of the motion vector within each target detection box, and shift the target detection box to the target position of the current uninferred frame according to the mean value, as the inference result of the current frame.
7. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 6, characterized in that, Also includes: The motion vector calculation region is expanded by a macroblock in each direction to accommodate changes in bounding box size caused by target movement.
8. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, In step 3, the global bandwidth controller adopts a two-layer optimization approach. The upper layer optimizes bandwidth allocation with the goal of maximizing the fairness of multi-stream inference accuracy, while the lower layer optimizes the single-stream frame classification strategy under the constraint of allocated bandwidth to meet end-to-end latency constraints.
9. The adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference according to claim 1, characterized in that, When the network environment does not support the simultaneous transmission of high-definition frames and video streams, the hybrid encoder performs discrete cosine transform and entropy coding on the residuals of high-definition frames and low-resolution frames to supplement and enhance information and embed it into the video stream transmission. The edge server extracts the residual through a hybrid decoder, upsamples the low-resolution frame using bilinear interpolation, and then superimposes the residual to recover the high-resolution frame.
10. A computer system comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the adaptive hybrid encoding / decoding and bandwidth allocation method for multi-stream video edge inference as proposed in any one of claims 1-9.
