A communication state monitoring system and method based on UVC protocol
Patent Information
- Application Number
- CN202511730693.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-11-24
AI Technical Summary
[0002]在基于UVC协议的设备通信领域,随着多设备协同应用场景的增多,现有技术在设备管理、资源分配及数据传输同步等方面存在明显局限;首先,传统UVC设备探测仅能获取基础设备信息,未兼顾扩展单元的唯一标识符、亮度调节范围等关键参数,导致设备能力评估不全面,无法为后续资源分配提供精准依据;其次,设备优先级判定缺乏系统化方案,未对带宽上限等定量参数与接口版本、视频解码能力等定性参数进行标准化处理,权重分配混乱,易造成UVC传输通道与设备能力不匹配,降低传输效率;
1、本发明通过全流程基于UVC设备实际能力与传输需求制定策略,实现设备、传输通道、带宽资源的最优适配,避免资源浪费或过载,最大化提升整体资源利用效率。
Smart Images

Figure CN121486404B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, specifically a communication status monitoring system and method based on the UVC protocol. Background Technology
[0002] In the field of device communication based on the UVC protocol, with the increasing number of multi-device collaborative application scenarios, existing technologies have significant limitations in terms of device management, resource allocation, and data transmission synchronization. First, traditional UVC device detection can only obtain basic device information, without taking into account key parameters such as the unique identifier of the extension unit and the brightness adjustment range, resulting in incomplete device capability assessment and an inability to provide accurate basis for subsequent resource allocation. Second, device priority determination lacks a systematic solution, and quantitative parameters such as bandwidth limits and qualitative parameters such as interface version and video decoding capabilities are not standardized, leading to chaotic weight allocation and a mismatch between UVC transmission channels and device capabilities, thus reducing transmission efficiency. Meanwhile, existing bandwidth management lacks a global pooling mechanism, fails to allocate bandwidth proportions according to device priority and transmission services, and does not reserve emergency resources, making it prone to bandwidth overload or waste. The clock synchronization system is incomplete, with no clear standard for master clock node selection, a lack of synchronization frequency and calibration mechanisms, and significant clock drift between devices, affecting data transmission timing consistency. Furthermore, the absence of priority transmission rules in data transmission leads to chaotic transmission order of LED control commands and video stream fragments. The receiving end lacks differentiated buffering, fragment retransmission, and efficient reassembly strategies, easily resulting in fragment loss and decoding failures, failing to guarantee stable real-time video stream output and making it difficult to meet the needs of multi-device collaborative monitoring scenarios. Summary of the Invention
[0003] The purpose of this invention is to provide a communication status monitoring system and method based on the UVC protocol to solve the problems raised in the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a communication status monitoring method based on the UVC protocol, the method comprising the following steps: Step S1: Obtain target devices that support UVC through the UVC extended detection protocol, collect device model, interface version, bandwidth limit, video decoding capability, and generate a device capability list. Step S1-1: The device starts the UVC extended detection protocol, calls the UsbManager interface to search for all connected USB devices in the local area network, filters out devices that support the UVC protocol through the UVC protocol, and triggers a single permission request. Step S1-2: After authorization, a UsbDeviceConnection object is established through UsbManager.openDevice. The device initiates control transmission to the object to read the device model, interface version, bandwidth limit, and video decoding capability. Step S1-3: Collect relevant parameters of the UVC extension unit, including the extension unit unique identifier, the globally unique identifier, and the brightness adjustment range; Steps S1-4: Systematically organize the device model, interface version, bandwidth limit, video decoding capability, and UVC extension unit related parameters to generate a device capability list. Comprehensive collection of core parameters and extended unit parameters of UVC-supporting equipment forms a structured equipment capability list, providing an accurate and complete equipment data foundation for subsequent priority determination, parameter configuration, and other processes, thus avoiding subsequent decision-making biases caused by missing equipment information.
[0005] Step S2: Based on the equipment capability list, set weight rules, calculate the equipment priority score according to the weight rules, divide the priority level, and allocate UVC transmission channels to the equipment according to the priority level. Step S2-1: Based on the equipment capability list, extract the parameters of the equipment capability list and divide the parameters in the equipment capability list into quantitative parameters and qualitative parameters. The quantitative parameters include the upper limit of bandwidth, and the qualitative parameters include interface version, video decoding capability, completeness of extension unit parameters, and equipment model compatibility. Step S2-2: For the quantitative parameters, standardize them using the min-max standardization formula, specifically as follows: ; In the formula, Here, x represents the standard score of a quantitative parameter, and x is the actual value of the upper limit of a device's bandwidth. min x is the minimum bandwidth limit for all access devices. max This represents the maximum bandwidth limit for all access devices. This is used to map the standardized results of the [0,1] interval to the [1,5] interval, ensuring that the score distribution meets the priority determination requirements; Step S2-3: For qualitative parameters, assign standard scores according to functional priority, specifically as follows: Interface version: 1.1 is worth 3 points, 1.5 is worth 4 points, and 2.0 is worth 5 points; Video decoding capability: Support for MJPEG+720P+15fps is 1 point, support for H.264+2K+30fps is 3 points, and support for H.265+4K+60fps is 5 points. Equipment model: Incompatible type: 3 points; General type: 4 points; Special type: 5 points; The standardized formula is used to convert the scores into standardized scores, specifically: ; In the formula, Let y be the standard score of a qualitative parameter, and y be the base score of a qualitative parameter of a certain device. min y is the minimum value of the basic score of this qualitative parameter for all access devices. max This represents the maximum base score for this qualitative parameter across all access devices. Step S2-4: Assign weights to the parameters in the equipment capacity list, specifically as follows: The bandwidth limit is weighted as x1, video decoding capability as x2, interface version as x3, and device model as x4. Standard scores for the device's quantitative and qualitative parameters are extracted, and priority scores are calculated as follows: ; In the formula, T is the priority score. The standard score for video decoding capability, As a standard score for interface version, The standard score for equipment model compatibility; Step S2-5: Extract the priority scores of the equipment, construct a priority score set, sort the priority scores in the priority score set in ascending order, and then use the three-part division method to divide the equipment priority level, P1 is the judgment equipment, P2 is the auxiliary equipment, and P3 is the backup equipment. Step S2-6: Collect the core parameters of all available UVC channels, including the channel bandwidth capacity limit, transmission delay baseline value, and historical stability coefficient; Step S2-7: Standardize the channel parameters, assign weights to the core parameters, and then use a weighted algorithm to calculate the channel priority score, specifically: ; In the formula, For channel priority score, The standard score for the upper limit of bandwidth capacity. The standard score is the baseline value for transmission delay. The standard score of the historical stability coefficient. Assuming a maximum weight for loan capacity, As the baseline value for transmission delay, The weight is the historical stability coefficient. Step S2-8: Use the trisection method to set the channel priority level according to the channel priority score, C1 is the high priority channel, C2 is the medium priority channel, and C3 is the low priority channel. Steps S2-9: P1 priority corresponds to C1 high priority channel, P2 priority corresponds to C2 medium priority channel, and C3 priority corresponds to low priority channel. Independent cache areas are matched and allocated for different priorities, and the cache areas are bound by the device MAC address.
[0006] By standardizing quantitative parameters, assigning qualitative parameters, and allocating weights, the priority of devices and UVC channels is accurately calculated, achieving level matching between devices and channels, binding independent buffer areas, ensuring dedicated transmission resources for high-priority devices, reducing resource contention between different devices, and improving the rationality of resource allocation. Step S3: Based on the device capability list and priority, set the video stream parameters, LED brightness control parameters, and global bandwidth pooling allocation to generate the encoding configuration file, control parameter table, and bandwidth allocation scheme. Step S3-1: Configure parameters according to the matching result of device priority and channel priority, specifically as follows: P1-C1: H.265 encoding, 4K resolution, 60fps, 15Mbps bitrate; P2-C2: H.264 encoding, 2K resolution, 30fps, 8Mbps bitrate; P3-C3: MJPEG encoding, 720P resolution, 15fps, 2Mbps bitrate; The encoding format, resolution, frame rate, and bit rate of each device are compiled into a structured document, which clarifies the correspondence between parameters and devices, baseline bandwidth, and priority, and is named the encoding configuration file. Step S3-2: Send an extension unit query request to the judgment device, auxiliary device and backup device to obtain the shared extension unit unique identifier, global unique identifier and brightness adjustment range of the devices. The extension unit unique identifier is the lighting control number of the extension unit. The global unique identifier is the exclusive identifier for communication between the device and the extension unit. The brightness adjustment range is the hardware brightness adjustment range supported by the extension unit. The hardware brightness adjustment range is a digital code that the device hardware can recognize, corresponding to the actual light intensity, and the range is [0, 255]. Step S3-3: Convert the hardware brightness adjustment range numerically, and convert the hardware brightness range through... Convert to the interval [0,100], where H is the target hardware brightness value, which is a digital code that the device hardware can directly recognize, with a value range of 0-255. max The maximum hardware brightness value is the maximum brightness code supported by the expansion unit. P is the intuitive brightness value, which is the brightness percentage displayed on the device's operating interface and ranges from 0 to 100. Step S3-4: After the judgment device, auxiliary device and backup device send a lighting control request to the expansion unit, an LED control command is generated. After the expansion unit receives the LED control command, it starts lighting. The brightness parameters of the lighting of the expansion unit controlled by different devices, the unique identifier of the expansion unit, and the globally unique identifier are collected to generate a control parameter table. Step S3-5: Collect the bandwidth limits of all connected UVC devices, establish a global bandwidth pool, and calculate the total bandwidth capacity. Specifically: The UVC devices that pass through steps S1 and S2 are recorded as valid devices. The bandwidth limits of all valid devices are collected, a set of bandwidth limits is constructed, and the set of bandwidth limits is summed to obtain the total bandwidth capacity. 10% of the total bandwidth capacity is allocated as emergency resources, and the remaining 90% is the basic bandwidth, thus generating the bandwidth allocation ratio; Step S3-6: Allocate basic bandwidth to devices, and set the basic bandwidth ratio as z1% for P1 level devices, z2% for P2 level devices, and z3% for P3 level devices according to device priority; Step S3-7: Compile the total bandwidth capacity, bandwidth allocation ratio, and basic bandwidth ratio of each priority device into a standardized document, named "Bandwidth Allocation Scheme".
[0007] Based on the differentiated configuration of video stream encoding parameters and LED brightness control parameters according to device-channel priority, a global bandwidth pool is established and emergency and basic resources are divided. This not only meets the transmission quality requirements of devices with different priorities, but also maximizes bandwidth utilization. Standardized documentation facilitates subsequent management and use.
[0008] Step S4: Establish a master-slave clock synchronization system, and coordinate the transmission of video stream segments and LED control commands according to priority levels to generate synchronization timestamps and transmission queue lists. Step S4-1: Select the devices with clock drift ≤1ms per minute, CPU utilization <40%, and network latency ≤20ms from the P1-C1 level devices as master clock nodes. The master clock node generates a synchronization timestamp every 50ms and sends synchronization data packets through the NTPv4 protocol. Step S4-2: After receiving the data, the device calculates the transmission delay by subtracting the sending timestamp from the receiving timestamp. It then calibrates the local clock using the master clock timestamp plus the transmission delay. The calibration result is fed back every 200ms. If the local clock drifts more than 3ms from the master clock, the master clock immediately sends three consecutive synchronization data packets to perform forced calibration. Step S4-3: Set the video stream segment size of the judgment device to m1, the video stream segment size of the auxiliary device to m2, and the video stream segment size of the backup device to m3; Step S4-4: Encapsulate each video stream segment. The video stream segment header uniformly encapsulates the device type identifier, device priority level, synchronization timestamp, total number of video stream segments, and current video stream segment sequence number. The device type identifier is identified as a judgment device, auxiliary device, or backup device. Step S4-5: Set device priority > synchronization timestamp as the sorting rule. P1-C1 level devices use instant transmission, C2-P2 level devices use 5 video stream fragments for batch transmission, and P3-C3 level devices use 10 video stream fragments for batch transmission. Step S4-6: When multiple devices send data simultaneously, the extension unit prioritizes receiving the LED control command and video stream segment of the judgment device. If the judgment device has no LED control command and video stream segment to transmit, it sequentially receives the LED control command and video stream segment of the auxiliary device and the backup device. The LED brightness control command carries a hardware quantization value H. Under the same device and the same timestamp, the LED brightness control command takes precedence over the video stream segment. Step S4-7: Record the transmission status of all video stream segments and LED control commands in real time, and construct a transmission queue list, wherein the transmission status is transmission success or transmission failure.
[0009] Establishing a master-slave clock synchronization system reduces clock drift across multiple devices, ensuring time consistency. Prioritizing transmission strategies improves the timeliness of critical data transmission. The transmission queue list records data status in real time, providing a clear basis for subsequent retransmission and optimization, and reducing transmission chaos.
[0010] Step S5: Based on the synchronization timestamp and transmission queue list, perform targeted data distribution, reception optimization, and video stream fragmentation and reassembly to generate a decoded video stream; Step S5-1: Read the core representation of each video stream segment and LED control instruction from the transmission queue list. The core representation includes device ID, device type, dedicated communication port, and priority level. Step S5-2: The video stream segments are sent to the target device via the dedicated communication port of the corresponding device; the LED control command is sent to the lighting control number of the expansion unit based on the expansion unit information in the control parameter table. Step S5-3: The receiving end sets the buffer window size differently according to the device's decoding speed in the encoding configuration file; Step S5-4: The receiving end discards the video stream segments that have timed out and have not been received. At the same time, it queries the transmission status of the corresponding video stream segment through the transmission queue list. If the transmission fails, it immediately sends a retransmission request to the device. If the transmission is successful, it continues to transmit the remaining video stream segments. Step S5-5: The receiving end uses a combination strategy of "pre-reading + sliding window" to extract and cache the next 3 video stream segments with the same device and timestamp while processing the current video stream segment; Steps S5-6: The receiving end sorts and reassembles all valid video stream fragments under the same device and the same timestamp according to the "synchronization timestamp, total number of video stream fragments, and current video stream fragment number" in the transmission queue list to form a complete video frame; Step S5-7: According to the encoding format of the corresponding device in the encoding configuration file, call the corresponding decoder to decode the complete video frame, and output the decoded video stream that can be displayed in real time through the Surface mechanism.
[0011] Targeted distribution ensures accurate delivery of data to the target device / extension unit; differentiated buffering and retransmission strategies at the receiving end, along with a "pre-read + sliding window" mechanism, reduce data loss and improve processing efficiency; sequential reassembly of fragments and matching decoding ensure the generation of a high-quality, real-time displayable video stream, thereby improving the final data output effect.
[0012] The system includes a device capability detection module, a priority determination and channel allocation module, a parameter configuration and bandwidth allocation module, a clock synchronization and cooperative transmission module, and a data distribution and video decoding module. The device capability detection module is used to filter target devices that support UVC through the UVC extended detection protocol, collect core device parameters and UVC extended unit parameters, and generate a device capability list after systematic organization. The priority determination and channel allocation module is used to calculate the device priority based on the device capability list, evaluate the UVC transmission channel priority, allocate the corresponding channel to the device through level matching, and bind an independent buffer area. The parameter configuration and bandwidth allocation module is used to configure video stream encoding parameters and LED brightness control parameters according to device and channel priorities, establish a global bandwidth pool and formulate an allocation scheme, and generate encoding configuration files, control parameter tables and bandwidth allocation schemes; The clock synchronization and collaborative transmission module is used to establish a master-slave clock synchronization system to calibrate the device clock, segment the video stream and collaboratively transmit the video stream and LED control commands according to priority, and generate synchronization timestamps and transmission queue lists; The data distribution and video decoding module is used to distribute data in a targeted manner according to the synchronization timestamp and transmission queue list, optimize the receiving strategy and reassemble video stream fragments, and call the corresponding decoder to decode and generate a video stream that can be displayed in real time.
[0013] The equipment capability detection module includes an equipment search and authorization unit and a capability parameter acquisition unit; The device search and authorization unit is used to search and filter UVC devices and request permissions to establish a connection. The capability parameter acquisition unit is used to collect and organize the core parameters and extended unit parameters of the equipment. The priority determination and channel allocation module includes a device priority calculation unit and a channel matching and allocation unit; The device priority calculation unit is used to standardize device parameters and calculate priority levels by weighting them. The channel matching and allocation unit is used to calculate channel priority and bind it to the cache area based on the device level.
[0014] The parameter configuration and bandwidth allocation module includes an encoding and control parameter unit and a global bandwidth allocation unit; The encoding and control parameter unit is used to set video encoding parameters and LED control parameters and generate corresponding documents; The global bandwidth allocation unit is used to establish a global bandwidth pool and formulate a hierarchical allocation scheme. The clock synchronization and collaborative transmission module includes a master-slave clock calibration unit and a stream and command transmission unit; The master-slave clock calibration unit is used to select the master clock node and calibrate the local clock of the slave device. The streaming and command transmission unit is used to segment the video stream and transmit data and LED control commands according to priority.
[0015] The data distribution and video decoding module includes a data-directed distribution unit and a video stream reconstruction and decoding unit; The data targeted distribution unit is used to target and distribute video streams and control commands according to the device identifier; The video stream reconstruction and decoding unit is used to optimize the receiving strategy and reconstruct decoded video frames in sequence.
[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention formulates strategies based on the actual capabilities and transmission requirements of UVC equipment throughout the entire process, achieving optimal matching of equipment, transmission channels, and bandwidth resources, avoiding resource waste or overload, and maximizing overall resource utilization efficiency.
[0017] 2. This invention controls the clock drift of multiple devices by building a master-slave clock synchronization system and adopts a hierarchical priority transmission strategy to ensure the time consistency of data transmission, ensure that highly important data is transmitted first, reduce congestion and delay, and improve transmission order and timeliness.
[0018] 3. This invention reduces data loss, improves processing efficiency, and ensures the generation of high-quality, real-time video streams by using targeted data distribution, receiver retransmission and pre-reading mechanisms, as well as sequential reassembly fragmentation and matching decoding processing methods. The entire process generates structured documents, which facilitates fault diagnosis and maintenance, and improves the reliability and manageability of the overall solution. Attached Figure Description
[0019] Figure 1This is a flowchart illustrating a communication status monitoring method based on the UVC protocol according to the present invention. Figure 2 This is a schematic diagram of the communication status monitoring system based on the UVC protocol according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1: As Figures 1-2 As shown, the present invention provides a technical solution, a communication status monitoring method based on the UVC protocol, the method comprising the following steps: Step S1: Obtain target devices that support UVC through the UVC extended detection protocol, collect device model, interface version, bandwidth limit, video decoding capability, and generate a device capability list. Step S1-1: The device starts the UVC extended detection protocol, calls the UsbManager interface to search for all connected USB devices in the local area network, filters out devices that support the UVC protocol through the UVC protocol, and triggers a single permission request. Step S1-2: After authorization, a UsbDeviceConnection object is established through UsbManager.openDevice. The device initiates control transmission to the object to read the device model, interface version, bandwidth limit, and video decoding capability. Step S1-3: Collect relevant parameters of the UVC extension unit, including the extension unit unique identifier, the globally unique identifier, and the brightness adjustment range; Steps S1-4: Systematically organize the device model, interface version, bandwidth limit, video decoding capability, and UVC extension unit related parameters to generate a device capability list. Comprehensive collection of core parameters and extended unit parameters of UVC-supporting equipment forms a structured equipment capability list, providing an accurate and complete equipment data foundation for subsequent priority determination, parameter configuration, and other processes, thus avoiding subsequent decision-making biases caused by missing equipment information.
[0022] Step S2: Based on the equipment capability list, set weight rules, calculate the equipment priority score according to the weight rules, divide the priority level, and allocate UVC transmission channels to the equipment according to the priority level. Step S2-1: Based on the equipment capability list, extract the parameters of the equipment capability list and divide the parameters in the equipment capability list into quantitative parameters and qualitative parameters. The quantitative parameters include the upper limit of bandwidth, and the qualitative parameters include interface version, video decoding capability, completeness of extension unit parameters, and equipment model compatibility. Step S2-2: For the quantitative parameters, standardize them using the min-max standardization formula, specifically as follows: ; In the formula, Here, x represents the standard score of a quantitative parameter, and x is the actual value of the upper limit of a device's bandwidth. min x is the minimum bandwidth limit for all access devices. max This represents the maximum bandwidth limit for all access devices. This is used to map the standardized results of the [0,1] interval to the [1,5] interval, ensuring that the score distribution meets the priority determination requirements; Step S2-3: For qualitative parameters, assign standard scores according to functional priority, specifically as follows: Interface version: 1.1 is worth 3 points, 1.5 is worth 4 points, and 2.0 is worth 5 points; Video decoding capability: Support for MJPEG+720P+15fps is 1 point, support for H.264+2K+30fps is 3 points, and support for H.265+4K+60fps is 5 points. Equipment model: Incompatible type: 3 points; General type: 4 points; Special type: 5 points; The standardized formula is used to convert the scores into standardized scores, specifically: ; In the formula, Let y be the standard score of a qualitative parameter, and y be the base score of a qualitative parameter of a certain device. min y is the minimum value of the basic score of this qualitative parameter for all access devices. max This represents the maximum base score for this qualitative parameter across all access devices. Step S2-4: Assign weights to the parameters in the equipment capacity list, specifically as follows: The bandwidth limit is weighted as x1, video decoding capability as x2, interface version as x3, and device model as x4. Standard scores for the device's quantitative and qualitative parameters are extracted, and priority scores are calculated as follows: ; In the formula, T is the priority score. The standard score for video decoding capability, As a standard score for interface version, The standard score for equipment model compatibility; Step S2-5: Extract the priority scores of the equipment, construct a priority score set, sort the priority scores in the priority score set in ascending order, and then use the three-part division method to divide the equipment priority level, P1 is the judgment equipment, P2 is the auxiliary equipment, and P3 is the backup equipment. Step S2-6: Collect the core parameters of all available UVC channels, including the channel bandwidth capacity limit, transmission delay baseline value, and historical stability coefficient; Step S2-7: Standardize the channel parameters, assign weights to the core parameters, and then use a weighted algorithm to calculate the channel priority score, specifically: ; In the formula, For channel priority score, The standard score for the upper limit of bandwidth capacity. The standard score is the baseline value for transmission delay. The standard score of the historical stability coefficient. Assuming a maximum weight for loan capacity, As the baseline value for transmission delay, The weight is the historical stability coefficient. Step S2-8: Use the trisection method to set the channel priority level according to the channel priority score, C1 is the high priority channel, C2 is the medium priority channel, and C3 is the low priority channel. Steps S2-9: P1 priority corresponds to C1 high priority channel, P2 priority corresponds to C2 medium priority channel, and C3 priority corresponds to low priority channel. Independent cache areas are matched and allocated for different priorities, and the cache areas are bound by the device MAC address.
[0023] By standardizing quantitative parameters, assigning qualitative parameters, and allocating weights, the priority of devices and UVC channels is accurately calculated, achieving level matching between devices and channels, binding independent buffer areas, ensuring dedicated transmission resources for high-priority devices, reducing resource contention between different devices, and improving the rationality of resource allocation. Step S3: Based on the device capability list and priority, set the video stream parameters, LED brightness control parameters, and global bandwidth pooling allocation to generate the encoding configuration file, control parameter table, and bandwidth allocation scheme. Step S3-1: Configure parameters according to the matching result of device priority and channel priority, specifically as follows: P1-C1: H.265 encoding, 4K resolution, 60fps, 15Mbps bitrate; P2-C2: H.264 encoding, 2K resolution, 30fps, 8Mbps bitrate; P3-C3: MJPEG encoding, 720P resolution, 15fps, 2Mbps bitrate; The encoding format, resolution, frame rate, and bit rate of each device are compiled into a structured document, which clarifies the correspondence between parameters and devices, baseline bandwidth, and priority, and is named the encoding configuration file. Step S3-2: Send an extension unit query request to the judgment device, auxiliary device and backup device to obtain the shared extension unit unique identifier, global unique identifier and brightness adjustment range of the devices. The extension unit unique identifier is the lighting control number of the extension unit. The global unique identifier is the exclusive identifier for communication between the device and the extension unit. The brightness adjustment range is the hardware brightness adjustment range supported by the extension unit. The hardware brightness adjustment range is a digital code that the device hardware can recognize, corresponding to the actual light intensity, and the range is [0, 255]. Step S3-3: Convert the hardware brightness adjustment range numerically, and convert the hardware brightness range through... Convert to the interval [0,100], where H is the target hardware brightness value, which is a digital code that the device hardware can directly recognize, with a value range of 0-255. max The maximum hardware brightness value is the maximum brightness code supported by the expansion unit. P is the intuitive brightness value, which is the brightness percentage displayed on the device's operating interface and ranges from 0 to 100. Step S3-4: After the judgment device, auxiliary device and backup device send a lighting control request to the expansion unit, an LED control command is generated. After the expansion unit receives the LED control command, it starts lighting. The brightness parameters of the lighting of the expansion unit controlled by different devices, the unique identifier of the expansion unit, and the globally unique identifier are collected to generate a control parameter table. Step S3-5: Collect the bandwidth limits of all connected UVC devices, establish a global bandwidth pool, and calculate the total bandwidth capacity. Specifically: The UVC devices that pass through steps S1 and S2 are recorded as valid devices. The bandwidth limits of all valid devices are collected, a set of bandwidth limits is constructed, and the set of bandwidth limits is summed to obtain the total bandwidth capacity. 10% of the total bandwidth capacity is allocated as emergency resources, and the remaining 90% is the basic bandwidth, thus generating the bandwidth allocation ratio; Step S3-6: Allocate basic bandwidth to devices, and set the basic bandwidth ratio as z1% for P1 level devices, z2% for P2 level devices, and z3% for P3 level devices according to device priority; Step S3-7: Compile the total bandwidth capacity, bandwidth allocation ratio, and basic bandwidth ratio of each priority device into a standardized document, named "Bandwidth Allocation Scheme".
[0024] Based on the differentiated configuration of video stream encoding parameters and LED brightness control parameters according to device-channel priority, a global bandwidth pool is established and emergency and basic resources are divided. This not only meets the transmission quality requirements of devices with different priorities, but also maximizes bandwidth utilization. Standardized documentation facilitates subsequent management and use.
[0025] Step S4: Establish a master-slave clock synchronization system, and coordinate the transmission of video stream segments and LED control commands according to priority levels to generate synchronization timestamps and transmission queue lists. Step S4-1: Select the devices with clock drift ≤1ms per minute, CPU utilization <40%, and network latency ≤20ms from the P1-C1 level devices as master clock nodes. The master clock node generates a synchronization timestamp every 50ms and sends synchronization data packets through the NTPv4 protocol. Step S4-2: After receiving the data, the device calculates the transmission delay by subtracting the sending timestamp from the receiving timestamp. It then calibrates the local clock using the master clock timestamp plus the transmission delay. The calibration result is fed back every 200ms. If the local clock drifts more than 3ms from the master clock, the master clock immediately sends three consecutive synchronization data packets to perform forced calibration. Step S4-3: Set the video stream segment size of the judgment device to m1, the video stream segment size of the auxiliary device to m2, and the video stream segment size of the backup device to m3; Step S4-4: Encapsulate each video stream segment. The video stream segment header uniformly encapsulates the device type identifier, device priority level, synchronization timestamp, total number of video stream segments, and current video stream segment sequence number. The device type identifier is identified as a judgment device, auxiliary device, or backup device. Step S4-5: Set device priority > synchronization timestamp as the sorting rule. P1-C1 level devices use instant transmission, C2-P2 level devices use 5 video stream fragments for batch transmission, and P3-C3 level devices use 10 video stream fragments for batch transmission. Step S4-6: When multiple devices send data simultaneously, the extension unit prioritizes receiving the LED control command and video stream segment of the judgment device. If the judgment device has no LED control command and video stream segment to transmit, it sequentially receives the LED control command and video stream segment of the auxiliary device and the backup device. The LED brightness control command carries a hardware quantization value H. Under the same device and the same timestamp, the LED brightness control command takes precedence over the video stream segment. Step S4-7: Record the transmission status of all video stream segments and LED control commands in real time, and construct a transmission queue list, wherein the transmission status is transmission success or transmission failure.
[0026] Establishing a master-slave clock synchronization system reduces clock drift across multiple devices, ensuring time consistency. Prioritizing transmission strategies improves the timeliness of critical data transmission. The transmission queue list records data status in real time, providing a clear basis for subsequent retransmission and optimization, and reducing transmission chaos.
[0027] Step S5: Based on the synchronization timestamp and transmission queue list, perform targeted data distribution, reception optimization, and video stream fragmentation and reassembly to generate a decoded video stream; Step S5-1: Read the core representation of each video stream segment and LED control instruction from the transmission queue list. The core representation includes device ID, device type, dedicated communication port, and priority level. Step S5-2: The video stream segments are sent to the target device via the dedicated communication port of the corresponding device; the LED control command is sent to the lighting control number of the expansion unit based on the expansion unit information in the control parameter table. Step S5-3: The receiving end sets the buffer window size differently according to the device's decoding speed in the encoding configuration file; Step S5-4: The receiving end discards the video stream segments that have timed out and have not been received. At the same time, it queries the transmission status of the corresponding video stream segment through the transmission queue list. If the transmission fails, it immediately sends a retransmission request to the device. If the transmission is successful, it continues to transmit the remaining video stream segments. Step S5-5: The receiving end uses a combination strategy of "pre-reading + sliding window" to extract and cache the next 3 video stream segments with the same device and timestamp while processing the current video stream segment; Steps S5-6: The receiving end sorts and reassembles all valid video stream fragments under the same device and the same timestamp according to the "synchronization timestamp, total number of video stream fragments, and current video stream fragment number" in the transmission queue list to form a complete video frame; Step S5-7: According to the encoding format of the corresponding device in the encoding configuration file, call the corresponding decoder to decode the complete video frame, and output the decoded video stream that can be displayed in real time through the Surface mechanism.
[0028] Targeted distribution ensures accurate delivery of data to the target device / extension unit; differentiated buffering and retransmission strategies at the receiving end, along with a "pre-read + sliding window" mechanism, reduce data loss and improve processing efficiency; sequential reassembly of fragments and matching decoding ensure the generation of a high-quality, real-time displayable video stream, thereby improving the final data output effect.
[0029] The system includes a device capability detection module, a priority determination and channel allocation module, a parameter configuration and bandwidth allocation module, a clock synchronization and cooperative transmission module, and a data distribution and video decoding module. The device capability detection module is used to filter target devices that support UVC through the UVC extended detection protocol, collect core device parameters and UVC extended unit parameters, and generate a device capability list after systematic organization. The priority determination and channel allocation module is used to calculate the device priority based on the device capability list, evaluate the UVC transmission channel priority, allocate the corresponding channel to the device through level matching, and bind an independent buffer area. The parameter configuration and bandwidth allocation module is used to configure video stream encoding parameters and LED brightness control parameters according to device and channel priorities, establish a global bandwidth pool and formulate an allocation scheme, and generate encoding configuration files, control parameter tables and bandwidth allocation schemes; The clock synchronization and collaborative transmission module is used to establish a master-slave clock synchronization system to calibrate the device clock, segment the video stream and collaboratively transmit the video stream and LED control commands according to priority, and generate synchronization timestamps and transmission queue lists; The data distribution and video decoding module is used to distribute data in a targeted manner according to the synchronization timestamp and transmission queue list, optimize the receiving strategy and reassemble video stream fragments, and call the corresponding decoder to decode and generate a video stream that can be displayed in real time.
[0030] The equipment capability detection module includes an equipment search and authorization unit and a capability parameter acquisition unit; The device search and authorization unit is used to search and filter UVC devices and request permissions to establish a connection. The capability parameter acquisition unit is used to collect and organize the core parameters and extended unit parameters of the equipment. The priority determination and channel allocation module includes a device priority calculation unit and a channel matching and allocation unit; The device priority calculation unit is used to standardize device parameters and calculate priority levels by weighting them. The channel matching and allocation unit is used to calculate channel priority and bind it to the cache area based on the device level.
[0031] The parameter configuration and bandwidth allocation module includes an encoding and control parameter unit and a global bandwidth allocation unit; The encoding and control parameter unit is used to set video encoding parameters and LED control parameters and generate corresponding documents; The global bandwidth allocation unit is used to establish a global bandwidth pool and formulate a hierarchical allocation scheme. The clock synchronization and collaborative transmission module includes a master-slave clock calibration unit and a stream and command transmission unit; The master-slave clock calibration unit is used to select the master clock node and calibrate the local clock of the slave device. The streaming and command transmission unit is used to segment the video stream and transmit data and LED control commands according to priority.
[0032] The data distribution and video decoding module includes a data-directed distribution unit and a video stream reconstruction and decoding unit; The data targeted distribution unit is used to target and distribute video streams and control commands according to the device identifier; The video stream reconstruction and decoding unit is used to optimize the receiving strategy and reconstruct decoded video frames in sequence.
[0033] Example 2: Quantitative parameters: Device A is 20Mbps, Device B is 15Mbps, and Device C is 10Mbps; Qualitative parameters: Equipment A is a dedicated type, B is a general type, and C is non-adaptable; After standardizing the quantitative parameters, equipment A is scored 5 points, equipment B is scored 3 points, and equipment C is scored 1 point. The qualitative parameters are assigned values as follows: Interface version: Device A is worth 5 points, Device B is worth 4 points, and Device C is worth 3 points; Decoding capability: Device A scores 5 points, Device B scores 3 points, and Device C scores 1 point; Model compatibility: Equipment A scores 5 points, Equipment B scores 4 points, Equipment C scores 3 points; With weights set as x1=0.4, x2=0.3, x3=0.2, and x4=0.1, the calculation yields: Equipment A: T=5 points, Equipment B: T=3.3 points, Equipment C: T=1.6 points; Given the set of priority scores [1.6, 3.3, 5], after trisecting: P1: Identify the device, 5 points, Device A; P2: Auxiliary equipment, 3.3 points, Equipment B; P3: Backup equipment, 1.6 points, Equipment C; Acquisition channel parameters: Channel 1: Bandwidth capacity limit 25Mbps, transmission latency 10ms, historical stability coefficient 0.95; Channel 2: Bandwidth capacity limit 20Mbps, transmission latency 15ms, historical stability coefficient 0.85; Channel 3: Maximum bandwidth capacity 15Mbps, transmission latency 20ms, historical stability coefficient 0.75; The priority of dividing the text into three equal parts is C1, C2, and C3. Perform device-channel matching: P1-C1, P2-C2, P3-C3; Match video parameters by priority: P1-C1: H.265 encoding, 4K resolution, 60fps, 15Mbps bitrate; P2-C2: H.264 encoding, 2K resolution, 30fps, 8Mbps bitrate; P3-C3: MJPEG encoding, 720P resolution, 15fps, 2Mbps bitrate; It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A communication status monitoring method based on the UVC protocol, characterized in that: The method includes the following steps: Step S1: Obtain target devices that support UVC through the UVC extended detection protocol, collect device model, interface version, bandwidth limit, video decoding capability, and generate a device capability list. Step S2: Based on the equipment capability list, set weight rules, calculate the equipment priority score according to the weight rules, divide the priority level, and allocate UVC transmission channels to the equipment according to the priority level. Step S3: Based on the device capability list and priority, set the video stream parameters, LED brightness control parameters, and global bandwidth pooling allocation to generate the encoding configuration file, control parameter table, and bandwidth allocation scheme. Step S4: Establish a master-slave clock synchronization system, and coordinate the transmission of video stream segments and LED control commands according to priority levels to generate synchronization timestamps and transmission queue lists. Step S5: Based on the synchronization timestamp and transmission queue list, perform targeted data distribution, reception optimization, and video stream fragmentation and reassembly to generate a decoded video stream; The specific steps of step S2 are as follows: Step S2-1: Based on the equipment capability list, extract the parameters of the equipment capability list and divide the parameters in the equipment capability list into quantitative parameters and qualitative parameters. The quantitative parameters include the upper limit of bandwidth, and the qualitative parameters are interface version, video decoding capability, completeness of extension unit parameters, and equipment model compatibility. Step S2-2: For the quantitative parameters, standardize them using the min-max standardization formula, specifically as follows: ; In the formula, Here, x represents the standard score of a quantitative parameter, and x is the actual value of the upper limit of a device's bandwidth. min x is the minimum bandwidth limit for all access devices. max This represents the maximum bandwidth limit for all access devices. This is used to map the standardized results of the [0,1] interval to the [1,5] interval, ensuring that the score distribution meets the priority determination requirements; Step S2-3: Assign standard scores to qualitative parameters based on functional priority; Convert to standard scores using standardized formulas; Step S2-4: Assign weights to the parameters in the equipment capacity list, specifically as follows: The bandwidth limit is weighted as x1, video decoding capability as x2, interface version as x3, and device model as x4. Standard scores for the device's quantitative and qualitative parameters are extracted, and priority scores are calculated as follows: ; In the formula, T is the priority score. The standard score for video decoding capability, As a standard score for interface version, The standard score for equipment model compatibility; Step S2-5: Extract the priority scores of the equipment, construct a priority score set, sort the priority scores in the priority score set in ascending order, and then use the three-part division method to divide the equipment priority level, P1 is the judgment equipment, P2 is the auxiliary equipment, and P3 is the backup equipment. Step S2-6: Collect the core parameters of all available UVC channels, including the channel bandwidth capacity limit, transmission delay baseline value, and historical stability coefficient; Step S2-7: Standardize the channel parameters, assign weights to the core parameters, and then use a weighted algorithm to calculate the channel priority score, specifically: ; In the formula, For channel priority score, The standard score for the upper limit of bandwidth capacity. The standard score is the baseline value for transmission delay. The standard score of the historical stability coefficient. Assuming a maximum weight for loan capacity, As the baseline value for transmission delay, The weight is the historical stability coefficient. Step S2-8: Use the trisection method to set the channel priority level according to the channel priority score, C1 is the high priority channel, C2 is the medium priority channel, and C3 is the low priority channel. Steps S2-9: P1 priority corresponds to C1 high priority channel, P2 priority corresponds to C2 medium priority channel, and C3 priority corresponds to low priority channel. Independent cache areas are matched and allocated for different priorities, and the cache areas are bound by the device MAC address.
2. The communication status monitoring method based on the UVC protocol according to claim 1, characterized in that: The specific steps of step S1 are as follows: Step S1-1: The device starts the UVC extended detection protocol, calls the UsbManager interface to search for all connected USB devices in the local area network, filters out devices that support the UVC protocol through the UVC protocol, and triggers a single permission request. Step S1-2: After authorization, a UsbDeviceConnection object is established through UsbManager.openDevice. The device initiates control transmission to the object to read the device model, interface version, bandwidth limit, and video decoding capability. Step S1-3: Collect relevant parameters of the UVC extension unit, including the extension unit unique identifier, the globally unique identifier, and the brightness adjustment range; Steps S1-4: Systematically organize the device model, interface version, bandwidth limit, video decoding capability, and UVC extension unit related parameters to generate a device capability list.
3. The communication status monitoring method based on the UVC protocol according to claim 1, characterized in that: The specific steps of step S3 are as follows: Step S3-1: Configure parameters according to the matching result of device priority and channel priority; The encoding format, resolution, frame rate, and bit rate of each device are compiled into a structured document, which clarifies the correspondence between parameters and devices, baseline bandwidth, and priority, and is named the encoding configuration file. Step S3-2: Send an extension unit query request to the judgment device, auxiliary device and backup device to obtain the shared extension unit unique identifier, global unique identifier and brightness adjustment range of the devices. The extension unit unique identifier is the lighting control number of the extension unit. The global unique identifier is the exclusive identifier for communication between the device and the extension unit. The brightness adjustment range is the hardware brightness adjustment range supported by the extension unit. The hardware brightness adjustment range is a digital code that the device hardware can recognize, corresponding to the actual light intensity, and the range is [0, 255]. Step S3-3: Convert the hardware brightness adjustment range numerically, and convert the hardware brightness range through... Convert to the interval [0,100], where H is the target hardware brightness value, which is a digital code that the device hardware can directly recognize, with a value range of 0-255. max The maximum hardware brightness value is the maximum brightness code supported by the expansion unit. P is the intuitive brightness value, which is the brightness percentage displayed on the device's operating interface and ranges from 0 to 100. Step S3-4: After the judgment device, auxiliary device and backup device send a lighting control request to the expansion unit, an LED control command is generated. After the expansion unit receives the LED control command, it starts lighting. The brightness parameters of the lighting of the expansion unit controlled by different devices, the unique identifier of the expansion unit, and the globally unique identifier are collected to generate a control parameter table. Step S3-5: Collect the bandwidth limits of all connected UVC devices, establish a global bandwidth pool, and calculate the total bandwidth capacity. Specifically: The UVC devices that pass through steps S1 and S2 are recorded as valid devices. The bandwidth limits of all valid devices are collected, a set of bandwidth limits is constructed, and the set of bandwidth limits is summed to obtain the total bandwidth capacity. 10% of the total bandwidth capacity is allocated as emergency resources, and the remaining 90% is the basic bandwidth, thus generating the bandwidth allocation ratio; Step S3-6: Allocate basic bandwidth to devices, and set the basic bandwidth ratio as z1% for P1 level devices, z2% for P2 level devices, and z3% for P3 level devices according to device priority; Step S3-7: Compile the total bandwidth capacity, bandwidth allocation ratio, and basic bandwidth ratio of each priority device into a standardized document, named "Bandwidth Allocation Scheme".
4. The communication status monitoring method based on the UVC protocol according to claim 1, characterized in that: The specific steps of step S4 are as follows: Step S4-1: Select the devices with clock drift ≤1ms per minute, CPU utilization <40%, and network latency ≤20ms from the P1-C1 level devices as master clock nodes. The master clock node generates a synchronization timestamp every 50ms and sends synchronization data packets through the NTPv4 protocol. Step S4-2: After receiving the data, the device calculates the transmission delay by subtracting the sending timestamp from the receiving timestamp. It then calibrates the local clock using the master clock timestamp plus the transmission delay. The calibration result is fed back every 200ms. If the local clock drifts more than 3ms from the master clock, the master clock immediately sends three consecutive synchronization data packets to perform forced calibration. Step S4-3: Set the video stream segment size of the judgment device to m1, the video stream segment size of the auxiliary device to m2, and the video stream segment size of the backup device to m3; Step S4-4: Encapsulate each video stream segment. The video stream segment header uniformly encapsulates the device type identifier, device priority level, synchronization timestamp, total number of video stream segments, and current video stream segment sequence number. The device type identifier is identified as a judgment device, auxiliary device, or backup device. Step S4-5: Set device priority > synchronization timestamp as the sorting rule. P1-C1 level devices use instant transmission, C2-P2 level devices use 5 video stream fragments for batch transmission, and P3-C3 level devices use 10 video stream fragments for batch transmission. Step S4-6: When multiple devices send data simultaneously, the extension unit prioritizes receiving the LED control command and video stream segment of the judgment device. If the judgment device has no LED control command and video stream segment to transmit, it sequentially receives the LED control command and video stream segment of the auxiliary device and the backup device. The LED brightness control command carries a hardware quantization value H. Under the same device and the same timestamp, the LED brightness control command takes precedence over the video stream segment. Step S4-7: Record the transmission status of all video stream segments and LED control commands in real time, and construct a transmission queue list, wherein the transmission status is transmission success or transmission failure.
5. The communication status monitoring method based on the UVC protocol according to claim 1, characterized in that: The specific steps of step S5 are as follows: Step S5-1: Read the core representation of each video stream segment and LED control instruction from the transmission queue list. The core representation includes device ID, device type, dedicated communication port, and priority level. Step S5-2: The video stream segments are sent to the target device via the dedicated communication port of the corresponding device; the LED control command is sent to the lighting control number of the expansion unit based on the expansion unit information in the control parameter table. Step S5-3: The receiving end sets the buffer window size differently according to the device's decoding speed in the encoding configuration file; Step S5-4: The receiving end discards the video stream segments that have timed out and have not been received. At the same time, it queries the transmission status of the corresponding video stream segment through the transmission queue list. If the transmission fails, it immediately sends a retransmission request to the device. If the transmission is successful, it continues to transmit the remaining video stream segments. Step S5-5: The receiving end uses a combination strategy of "pre-reading + sliding window" to extract and cache the next 3 video stream segments with the same device and timestamp while processing the current video stream segment; Steps S5-6: The receiving end sorts and reassembles all valid video stream fragments under the same device and the same timestamp according to the "synchronization timestamp, total number of video stream fragments, and current video stream fragment number" in the transmission queue list to form a complete video frame. Step S5-7: According to the encoding format of the corresponding device in the encoding configuration file, call the corresponding decoder to decode the complete video frame, and output the decoded video stream that can be displayed in real time through the Surface mechanism.
6. A communication status monitoring system based on the UVC protocol, used to execute the communication status monitoring method based on the UVC protocol as described in any one of claims 1-5, characterized in that: The system includes a device capability detection module, a priority determination and channel allocation module, a parameter configuration and bandwidth allocation module, a clock synchronization and cooperative transmission module, and a data distribution and video decoding module. The device capability detection module is used to filter target devices that support UVC through the UVC extended detection protocol, collect core device parameters and UVC extended unit parameters, and generate a device capability list after systematic organization. The priority determination and channel allocation module is used to calculate the device priority based on the device capability list, evaluate the UVC transmission channel priority, allocate the corresponding channel to the device through level matching, and bind an independent buffer area. The parameter configuration and bandwidth allocation module is used to configure video stream encoding parameters and LED brightness control parameters according to device and channel priorities, establish a global bandwidth pool and formulate an allocation scheme, and generate encoding configuration files, control parameter tables and bandwidth allocation schemes; The clock synchronization and collaborative transmission module is used to establish a master-slave clock synchronization system to calibrate the device clock, segment the video stream and collaboratively transmit the video stream and LED control commands according to priority, and generate synchronization timestamps and transmission queue lists; The data distribution and video decoding module is used to distribute data in a targeted manner according to the synchronization timestamp and transmission queue list, optimize the receiving strategy and reassemble video stream fragments, and call the corresponding decoder to decode and generate a video stream that can be displayed in real time.
7. A communication status monitoring system based on the UVC protocol according to claim 6, characterized in that: The equipment capability detection module includes an equipment search and authorization unit and a capability parameter acquisition unit; The device search and authorization unit is used to search and filter UVC devices and request permissions to establish a connection. The capability parameter acquisition unit is used to collect and organize the core parameters and extended unit parameters of the equipment. The priority determination and channel allocation module includes a device priority calculation unit and a channel matching and allocation unit; The device priority calculation unit is used to standardize device parameters and calculate priority levels by weighting them. The channel matching and allocation unit is used to calculate channel priority and bind it to the cache area based on the device level.
8. A communication status monitoring system based on the UVC protocol according to claim 6, characterized in that: The parameter configuration and bandwidth allocation module includes an encoding and control parameter unit and a global bandwidth allocation unit; The encoding and control parameter unit is used to set video encoding parameters and LED control parameters and generate corresponding documents; The global bandwidth allocation unit is used to establish a global bandwidth pool and formulate a hierarchical allocation scheme. The clock synchronization and collaborative transmission module includes a master-slave clock calibration unit and a stream and command transmission unit; The master-slave clock calibration unit is used to select the master clock node and calibrate the local clock of the slave device. The streaming and command transmission unit is used to segment the video stream and transmit data and LED control commands according to priority.
9. A communication status monitoring system based on the UVC protocol according to claim 6, characterized in that: The data distribution and video decoding module includes a data-directed distribution unit and a video stream reconstruction and decoding unit; The data targeted distribution unit is used to target and distribute video streams and control commands according to device identifiers; The video stream reconstruction and decoding unit is used to optimize the receiving strategy and reconstruct decoded video frames in sequence.
Citation Information
Patent Citations
Scene-based data transmission protocol adaptation method and device, and storage medium
CN118646811A
Distributed LED display screen collaborative management system and method
CN119937965A