USB Virtual Serial Port Driver for Real-Time Data Upload
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The incompatibility between serial port and USB transfer speeds, along with conflicts between serial port data fragmentation and USB bulk transfer, result in poor timeliness and inefficiency in data transfer through USB virtual serial ports.
Innovation Solution
A method involving a virtual serial port driver that creates receiving and transmitting threads with USB BULK IN packets, submitting transactions asynchronously to the USB host driver, and using a caching and apply step to ensure timely data transfer by managing transactions in a queue, with a bit timer to coordinate data upload based on serial port baud rates.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If USB bulk transfer is used to achieve high-speed data transfer, then transfer speed is improved, but timeliness of serial port data is deteriorated due to bandwidth management conflicts
Solution Approach 1:
The patent segments the USB bulk transfer into multiple smaller packets (e.g., 64-byte endpoint size packets) rather than transferring large data blocks at once. This segmentation allows the USB virtual serial port to maintain frequent, small transactions that respect the serial port's timing requirements while still utilizing USB's high-speed capability. The receiving thread pre-sets multiple USB transactions with different lengths, enabling flexible packetization of data to balance speed and timeliness.
Solution Approach 2:
The patent implements dynamic adjustment of USB transaction parameters based on real-time conditions. The virtual serial port driver adjusts the batch endpoint size and transaction timing dynamically to match the serial port's actual data arrival rate and the USB bus's available bandwidth. This dynamic adaptation allows the system to optimize between transfer speed and timeliness by changing operational parameters rather than using fixed settings.
2Loss of time
If frequent USB bulk transfer transactions are initiated to improve real-time performance, then data timeliness is improved, but USB bandwidth occupancy increases causing conflicts with high-speed devices
Solution Approach 1:
The patent applies different quality characteristics to different parts of the data transfer process. Small packets are used for frequent transactions to maintain timeliness, while the batch endpoint size is optimized to minimize bandwidth occupancy. The system locally optimizes packet size and transmission frequency based on the specific needs of the serial port connection, allowing frequent small transactions without excessively consuming USB bandwidth, thus coexisting with high-speed devices.
Solution Approach 2:
The patent changes key parameters including batch endpoint size, packet length, and transaction frequency to optimize the balance between timeliness and bandwidth usage. By adjusting these parameters dynamically, the system can initiate frequent transactions for real-time performance while controlling overall bandwidth occupancy to avoid conflicts with other high-speed USB devices sharing the bus.
3Adaptability or versatility
If serial port data is fragmented to match USB transfer requirements, then compatibility is improved, but data transfer efficiency is reduced
Solution Approach 1:
The receiving thread pre-sets multiple USB transactions with different lengths before actual data transfer begins. This preliminary preparation of transaction configurations allows the system to efficiently handle data fragmentation without on-the-fly computation during data transfer. The pre-configured transactions enable rapid adaptation to varying data sizes while maintaining compatibility between serial port protocols and USB transfer mechanisms.
Solution Approach 2:
The patent uses virtual serial port drivers that create software-based serial port interfaces over USB connections. This virtual copying of the serial port interface allows the system to maintain serial port protocol compatibility while utilizing USB's superior transfer capabilities. The virtual driver layer translates between serial port framing and USB packet formats, enabling efficient data transfer without requiring physical hardware changes or sacrificing protocol compatibility.
Data Source
AI summary
A method and system for uploading data in real time via a USB virtual serial port, and a USB host includes: creating a receiving thread, and presetting a plurality of USB transactions being USB BULK IN packets, and a length requested to be uploaded, submitting the plurality of USB transactions to a USB host driver, and when the receiving thread receives a returned data packet, transmitting the returned data packet to a serial port application layer buffer, immediately applying for a new USB transaction, and submitting the new USB transaction to the USB host driver; and executing, a USB transaction ranked first in a USB transaction queue, when data sent by a USB device is received and the data meets the batch endpoint size, ending the USB transaction and returning a data packet to the receiving thread, and immediately executing next USB transaction in the USB transaction queue.


