Mobile hard disk data transmission dynamic bandwidth allocation method based on USB4 protocol
By using fine-grained semantic feature parsing and dependency graph construction, combined with long short-term memory network to predict bandwidth requirements, the bandwidth of USB4 portable hard drives is dynamically allocated, solving the problems of insufficient task classification granularity and incomplete dependency relationships, and improving bandwidth utilization and data transmission efficiency.
Patent Information
- Application Number
- CN202510516138.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-04-23
AI Technical Summary
Existing USB4 portable hard drive bandwidth allocation technologies suffer from problems such as insufficient task classification granularity, incomplete dependency modeling, and missing predictive model dimensions, resulting in fluctuations in latency for real-time tasks, decreased throughput for high-reliability tasks, and low overall bandwidth utilization.
By analyzing the fine-grained semantic features of mobile hard drive transfer tasks, semantic vectors are generated, a data transfer task dependency graph is constructed, critical path weights are calculated, bandwidth demand is predicted by combining long short-term memory networks, and dynamic bandwidth allocation is achieved by using dynamic channel priority allocation and cache-aware scheduling.
It improved overall bandwidth utilization, resolved the bottlenecks of logical dependencies and resource contention between tasks, and enhanced the real-time performance and reliability of data transmission.
Smart Images

Figure CN120263757B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of bandwidth allocation, in particular to a dynamic bandwidth allocation method for mobile hard disk data transmission based on a USB4 protocol. BACKGROUND
[0002] With the commercialization of the USB4 protocol, its bandwidth allocation mechanism based on a dual-channel architecture (Isochronous and Bulk) provides a theoretical maximum of 80 Gbps throughput capacity for peripheral data transmission. Current mainstream mobile hard disks generally use a static bandwidth allocation strategy based on task priority, which allocably allocates Isochronous channel bandwidth to real-time streaming tasks and allocably allocates Bulk channel to bulk data transmission through a USB4 controller.
[0003] There are several research results in the field of dynamic bandwidth allocation in the academic field, such as an elastic bandwidth adjustment algorithm based on traffic prediction and a multi-objective optimization model combined with QoS level division. However, the above-mentioned USB4 mobile hard disk bandwidth allocation technology has problems such as insufficient task classification granularity, incomplete relationship modeling, and missing prediction model dimensions, resulting in real-time task delay fluctuations, high-reliability task throughput drops, and low overall bandwidth utilization. SUMMARY
[0004] In view of the above-mentioned existing problems, the present application is proposed.
[0005] Therefore, the present application provides a dynamic bandwidth allocation method for mobile hard disk data transmission based on a USB4 protocol to solve the problem of low overall bandwidth utilization.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides a dynamic bandwidth allocation method for mobile hard disk data transmission based on a USB4 protocol, which includes,
[0008] Analyzing the transmission task of the mobile hard disk, obtaining the fine-grained semantic features of the data transmission task, generating a semantic vector, the fine-grained semantic features including the file type and transmission purpose of the transmission task;
[0009] Based on the semantic vector of the data transmission task, a data transmission task dependency graph of the mobile hard disk is constructed, and the key path weight of each data transmission task is calculated;
[0010] Based on the key path weight and the semantic vector, combined with the real-time state information and the historical data transmission task state information of the mobile hard disk, the long short-term memory network is used to predict the bandwidth demand;
[0011] By obtaining the available bandwidth and channel occupancy of the USB4 protocol, dynamic channel priority allocation and cache-aware scheduling are used to dynamically allocate bandwidth for mobile hard drive data transfer tasks.
[0012] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for generating the semantic vector are as follows:
[0013] Data transmission tasks are classified based on their fine-grained semantic features.
[0014] Based on the sequential read rate requirements of mobile hard drives in high real-time task transmission scenarios, and combined with the Isochronous channel characteristics of the USB4 protocol, a real-time transmission rate threshold is determined.
[0015] Calculate the ratio of the average data transmission rate in the most recent period to the real-time transmission rate threshold, and use it as a real-time requirement indicator.
[0016] Based on the block size distribution of external hard drives in backup scenarios, and combined with the Bulk channel characteristics of the USB4 protocol, the typical block size for high-reliability tasks is determined, and the threshold for the typical block size for high-reliability tasks is determined.
[0017] Calculate the ratio of the block size of the transmitted file to the typical block size threshold for high-reliability tasks, and use it as a reliability requirement indicator.
[0018] Calculate the semantic score of the data transmission task based on real-time requirement indicators and reliability requirement indicators;
[0019] The semantic vector is composed of the semantic score of the data transmission task, the real-time requirement index, and the reliability requirement index, and is updated at a preset frequency.
[0020] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for constructing the data transmission task dependency graph of the mobile hard drive are as follows:
[0021] Obtain task information for data transmission tasks;
[0022] The task information includes task identifier, timestamp, data flow direction, initial priority, cache utilization rate, and channel utilization rate;
[0023] Examine the data flow, identify explicit dependencies, and calculate the weights of the explicit dependency edges;
[0024] Based on cache occupancy and channel occupancy, calculate cache contention intensity and bandwidth contention intensity, identify implicit dependencies, and calculate the weights of implicit dependency edges;
[0025] Each data transmission task is treated as a node, and the dependencies between data transmission tasks are treated as edges. A task dependency graph is constructed and its integrity is verified.
[0026] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for calculating the critical path weight of each data transmission task are as follows:
[0027] Based on the task dependency graph, the data volume, cache utilization rate and channel utilization rate of each data transmission task are obtained, and the comprehensive impact factor of each data transmission path is calculated.
[0028] Compare the comprehensive impact factors of each path and select the path with the largest comprehensive impact factor as the critical path;
[0029] Calculate the critical path weight based on the critical path and the total data volume of data transmission tasks on the critical path.
[0030] By querying the USB4 controller's data transfer task list, when a new task is detected, the task dependency graph is reconstructed, and the critical path is re-identified and its weight is calculated.
[0031] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for predicting bandwidth requirements are as follows:
[0032] Initialize a lightweight long short-term memory network structure;
[0033] Define a loss function, and update and optimize the network parameters using the Adam optimizer's lightweight long short-term memory by minimizing the loss function;
[0034] Historical data transfer task status information and actual bandwidth requirements are collected from the external hard drive logs, standardized, and concatenated into training time series vectors to train a lightweight long short-term memory network structure.
[0035] Input the time series vector into the output of the trained lightweight long short-term memory network to predict bandwidth requirements.
[0036] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for dynamically allocating bandwidth for mobile hard drive data transmission tasks are as follows:
[0037] Based on the semantic score and critical path weight of the data transmission task, set the channel priority allocation rules;
[0038] The initial bandwidth allocation is calculated by comprehensively considering the predicted bandwidth demand, data transmission task scheduling cycle, external hard drive performance, available bandwidth, and critical path weight.
[0039] Check for current channel cache overload and pause data transmission tasks with low critical path weights, then update available bandwidth;
[0040] Based on the updated available bandwidth, the bandwidth allocation is recalculated.
[0041] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for setting the channel priority allocation rules are as follows:
[0042] When the semantic score of a data transmission task is higher than the median semantic score of all data transmission tasks, the Isochronous channel is allocated preferentially.
[0043] When the critical path weight of a data transmission task is higher than the median critical path weight of all data transmission tasks, the Bulk channel is allocated preferentially.
[0044] As a preferred embodiment of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol described in this invention, the specific steps for updating the available bandwidth are as follows:
[0045] Based on queuing theory, a fixed critical point of cache overload is captured, and a cache threshold is set.
[0046] Compare the current channel's cache utilization rate with the cache threshold. If the current channel's cache utilization rate is greater than the cache threshold, it is determined that the cache is overloaded; otherwise, it is determined that the cache is normal.
[0047] Calculate the median value of the critical path weights for all data transmission tasks within the channel. When the buffer is overloaded, pause data transmission tasks with critical path weights below the median value and release bandwidth to available bandwidth.
[0048] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol as described in the first aspect of the present invention.
[0049] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the dynamic bandwidth allocation method for mobile hard disk data transmission based on the USB4 protocol as described in the first aspect of the present invention.
[0050] The beneficial effects of this invention are as follows: This invention parses metadata through SCSI commands and classifies task types to achieve accurate matching of task type and channel characteristics. By constructing a task dependency graph with explicit / implicit dependencies and combining it with dynamic calculation of critical path weights, it solves the logical dependency between indexing tasks and transmission tasks, as well as the resource contention bottleneck problem when multiple tasks are concurrent. The bandwidth secondary allocation mechanism based on dynamic priority rules improves the overall bandwidth utilization. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Fig. 1 This is a flowchart illustrating a dynamic bandwidth allocation method for data transfer from a portable hard drive based on the USB4 protocol.
[0053] Fig. 2 A flowchart for generating semantic vectors.
[0054] Fig. 3 A flowchart for constructing a data transfer task dependency graph for an external hard drive.
[0055] Fig. 4 A flowchart illustrating the dynamic allocation of bandwidth for data transfer tasks on a portable hard drive. Detailed Implementation
[0056] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0057] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0058] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0059] Reference Figs. 1-4This is one embodiment of the present invention, which provides a method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol, including the following steps:
[0060] S1. Analyze the transfer task of the external hard drive, obtain the fine-grained semantic features of the data transfer task, and generate a semantic vector. The fine-grained semantic features include the file type and transfer destination of the transfer task.
[0061] The SCSI commands of the USB4 protocol are used to parse the metadata of the external hard drive transfer task, and extract the file type and transfer destination.
[0062] Specifically, a standard SCSI command is sent to the external hard drive to obtain the file extension (such as ".mp4"), determine the file type, and at the same time, the SCSI MODE SENSE command is used to obtain the host transfer instructions, such as "play" or "backup", to determine the transfer destination;
[0063] Based on file type and transmission purpose, tasks are categorized into high real-time tasks (e.g., files such as ".mp4" and ".mkv" for video or audio playback), high reliability tasks (e.g., files such as ".bak" and ".sql" for data backup), and ordinary tasks (e.g., files such as ".txt" and ".zip" for daily copying).
[0064] The classification criteria are as follows: high real-time tasks require low-latency transmission to avoid playback stuttering; high-reliability tasks require high throughput and error-free transmission to ensure data integrity; and ordinary tasks have no strict performance requirements in order to save bandwidth.
[0065] Calculate the real-time performance requirements of the transmission task, with a value range of [value range missing]. For high real-time tasks, the real-time requirement index is set to 1, indicating that a low-latency channel should be prioritized. For ordinary files, the real-time requirement index is set to 0, indicating that there is no real-time requirement. For other cases, the real-time requirement index is calculated by using the SCSI READ CAPACITY command to obtain the average transfer rate within the most recent set period. The calculation formula is as follows:
[0066] ;
[0067] in, As a real-time requirement indicator, To set the average transmission rate within the most recent period, This is the real-time transmission rate threshold.
[0068] It should be noted that, based on the sequential read rate requirements of portable hard drives in high real-time task transmission scenarios, and combined with the Isochronous channel characteristics of the USB4 protocol, the real-time transmission rate threshold was determined. Specifically, in portable hard drive application scenarios, high real-time tasks are mainly video streaming playback or real-time editing (such as 1080p or 4K video), requiring low latency (<5ms) and stable bandwidth. The sequential read rate of the video stream depends on the video encoding standard (such as H.264 / H.265) and resolution. The Isochronous channel of the USB4 protocol is designed specifically for real-time data transmission, and the allocated bandwidth must match the video stream rate to avoid buffer overflow or playback stuttering, reflecting the minimum rate requirement of real-time tasks, while being higher than that of non-real-time tasks. By analyzing the sequential read rate distribution of portable hard drives in video streaming scenarios (such as 10-25MB / s for 1080p and 30-60MB / s for 4K), the median of the rate range was selected as the real-time transmission rate threshold, balancing the requirements of high and low resolutions, while being higher than the random access rate of ordinary file copying (usually <30MB / s), thus accurately distinguishing real-time tasks.
[0069] Calculate the reliability requirements index for the transmission task, with a value range of [value range missing]. For high-reliability tasks, the reliability requirement index is set to 1; for ordinary files, the reliability requirement index is set to 0. For other cases, the block size of the transferred file is obtained using the SCSI READ CAPACITY command, and the reliability requirement index is calculated using the following formula:
[0070] ;
[0071] in, As a reliability requirement indicator, The block size of the transferred file. This represents a typical block size threshold for high-reliability tasks.
[0072] It should be noted that, based on the block size distribution of external hard drives in backup scenarios and combined with the characteristics of the USB4 protocol's Bulk channel, the typical block size for high-reliability tasks is determined. Specifically, high-reliability tasks require high throughput (>100MB / s) and low error rate (<0.01%). Therefore, large block data transfer is used to reduce addressing overhead and improve efficiency, covering most high-reliability task transfer tasks. The USB4 protocol's Bulk channel is designed for high-throughput large block data, and the block size directly affects the transfer efficiency (large blocks reduce interruptions). By analyzing the block size distribution of data transfer tasks (e.g., system backup 1-4 MB, database backup 512 KB-8 MB), the lower limit of the block size range is selected as the threshold for the typical block size of high-reliability tasks.
[0073] Based on real-time performance and reliability requirements, the semantic score of the transmission task is calculated using the following formula:
[0074] ;
[0075] in, For semantic scoring of transmission tasks, For real-time weights, the range of values is... , For reliability weights, ;
[0076] The semantic vector is composed of the semantic score of the transmission task, the real-time requirement index, and the reliability requirement index. The semantic vector is updated by the USB4 controller at a preset frequency.
[0077] S2. Based on the semantic vector of the data transmission task, construct the data transmission task dependency graph of the mobile hard drive and calculate the critical path weight of each data transmission task.
[0078] The data transfer task list is queried through the USB4 controller, including high real-time tasks, high reliability tasks, ordinary tasks and index generation tasks, to obtain task information of the data transfer tasks, including task identifier, timestamp, data flow direction, initial priority, buffer utilization rate and channel utilization rate (read the Isochronous or Bulk channel utilization rate through the USB4 controller).
[0079] Among them, the index generation task is a pre-task for high real-time tasks, high reliability tasks, and ordinary tasks. It refers to the file index task generated by the mobile hard drive before data transmission, which provides data organization support for subsequent transmission. It is recognized by the USB4 controller and added to the task queue.
[0080] Specifically, the host initiates a data transfer task via SCSI commands (such as WRITE and MODE SELECT). Based on the transmission destination of the data transfer task, it submits an index generation task to the USB4 controller. The USB4 controller parses the SCSI command, identifies the index generation requirement, creates an index generation task, adds it to the task queue, and assigns task identifier, timestamp, data flow direction, initial priority, cache utilization, and channel utilization.
[0081] Each data transmission task is treated as a node, and the dependencies between data transmission tasks are treated as edges, to construct a task dependency graph, where the dependencies include explicit dependencies and implicit dependencies.
[0082] Specifically, iterate through the data transmission task list and compare the order of data transmission tasks based on the timestamps of each data transmission task in the list.
[0083] The data flow is checked to confirm explicit dependencies. Specifically, the timestamp and data flow direction fields of each data transmission task are extracted from the data transmission task list. The timestamp difference between the data transmission task and the index generation task is calculated. It is verified that the timestamp difference is less than the data transmission task scheduling period (USB4 frame interval). If it is less, the timestamp verification is passed; otherwise, it fails. Data flow direction matching verification is then performed, that is, checking whether the data flow direction field of the data transmission task contains the task identifier of the index generation task. If it does, the data flow direction matching verification is passed; otherwise, it fails. When both timestamp verification and data flow direction matching are satisfied, explicit dependencies are generated, and the weights of the explicit dependency edges are calculated using the following formula:
[0084] ;
[0085] in, The weights of the explicit dependent edges. The amount of data for the data transmission task. Generate the data volume for the index corresponding to the data transfer task;
[0086] It should be noted that when a portable hard drive (NTFS, exFAT) performs data transfer, it first needs to execute an index generation task (to generate a directory structure, such as an MFT table). Subsequent data transfer tasks depend on its output, which is reflected in the data flow in the task queue. The USB4 controller manages the data transfer task list through SCSI commands (such as WRITE and READ). The explicit dependencies between data transfer tasks are recorded through the logical block address (LBA) of the command description block (CDB) and the data flow field (32-bit task identifier pair). For example, the index generation task generates an index file, and the CDB of the high reliability task references the LBA of this index, forming an explicit dependency.
[0087] Based on cache utilization and channel utilization, cache contention intensity and bandwidth contention intensity are calculated to identify implicit dependencies. Specifically, the cache utilization and channel utilization of each data transfer task are read from the USB4 controller, and the cache contention intensity and bandwidth contention intensity between data transfer tasks are calculated as follows:
[0088] ;
[0089] ;
[0090] in, To determine cache contention intensity, and These are the cache utilization rates for data transmission task 1 and data transmission task 2, respectively. Bandwidth contention intensity, and These are the channel occupancy rates for data transmission task 1 and data transmission task 2, respectively.
[0091] when or When implicit dependencies are generated, the weights of the implicit dependency edges are calculated using the following formula:
[0092] ;
[0093] in, The weights of the implicitly dependent edges;
[0094] It should be noted that "1" and "2" in data transmission task 1 and data transmission task 2 do not refer to order or other meanings, but only indicate the distinction between two different data transmission tasks;
[0095] Furthermore, the USB4 controller manages cache and bandwidth, and task contention for cache and channels leads to performance bottlenecks. External hard drives are limited by cache and bandwidth, and high real-time tasks prioritize the Isochronous channel, which may reduce the Bulk channel bandwidth for high reliability tasks.
[0096] Explicit and implicit dependency edges are stored as adjacency lists to complete the construction of the task dependency graph and verify its integrity.
[0097] Specifically, a depth-first search is performed on the task dependency graph to check for cycles. Starting from each node, explicit and implicit dependency edges are recursively traversed, and the access paths are recorded. If a node is found to have been visited and is in the current path, it indicates a cycle. When a cycle is encountered, the implicit dependency edge with the lowest weight is removed to obtain a directed acyclic task dependency graph.
[0098] Based on the task dependency graph, the data volume, cache utilization, and channel utilization of each data transmission task are obtained. The comprehensive impact factor of each data transmission path is calculated, and the path with the largest comprehensive impact factor is selected as the critical path. The calculation formula is as follows:
[0099] ;
[0100] in, As a comprehensive impact factor, Indicates the first path The amount of data in each data transmission task For the first on the path Cache utilization of each data transfer task For the first on the path Channel occupancy rate for each data transmission task This is an index variable representing the number of data transfer tasks along the path.
[0101] The critical path weight is calculated based on the critical path and the total data volume of data transmission tasks on the critical path, using the following formula:
[0102] ;
[0103] in, For the first Critical path weights for each data transmission task For the first The initial priority of each data transmission task For the first The amount of data in each data transmission task Indicates the first The total amount of data transmitted on the critical path of each data transmission task. For the first Semantic scoring of each data transmission task For the first The cache utilization rate of each data transmission task on the critical path. For the first Channel occupancy rate of each data transmission task on the critical path. , and These are the influence coefficients of semantic score, cache utilization, and channel utilization on bandwidth allocation, with value ranges of [missing values]. , and ;
[0104] By querying the USB4 controller data transfer task list, new tasks are detected, the task dependency graph is reconstructed, and critical paths are re-identified and critical path weights are calculated.
[0105] Organize the critical path weights of all data transmission tasks, store them as a floating-point array of critical path weights in the order of task identifiers, and output them as the priority basis for bandwidth allocation.
[0106] S3. Based on critical path weights and semantic vectors, combined with real-time status information of the mobile hard drive and historical data transmission task status information, bandwidth requirements are predicted using a long short-term memory network.
[0107] Query the data volume, critical path weight, and semantic vector of data transmission tasks within a preset period in the USB4 controller data transmission task list;
[0108] Read real-time external hard drive status information within the same preset period, including hard drive performance, cache utilization, and channel utilization.
[0109] Specifically, the external hard drive performance is read via the SMART interface, in MB / s, representing the current read / write speed of the external hard drive. The cache utilization and channel utilization are read via the USB4 controller cache management interface.
[0110] Standardize (normalize) the data volume, critical path weight, semantic vector, and real-time status information of the data transfer tasks of the external hard drive within a preset period. (and concatenate them into a time series vector, which is then used as input to a lightweight long short-term memory network);
[0111] Collect historical data transfer task status information (including historical external hard drive status information, data volume, critical path weight, and semantic vector of historical data transfer tasks) and actual bandwidth requirements from the external hard drive logs, and standardize them to form a training time series vector.
[0112] Initialize a lightweight long short-term memory network structure;
[0113] Specifically, a lightweight long short-term memory network is configured, which includes a 1-layer recurrent neural network with 32 hidden units. The parameters of the lightweight long short-term memory network include the weight matrix and the bias vector.
[0114] Define a loss function, and optimize it by minimizing the loss function using the Adam optimizer's lightweight long short-term memory network parameters. The calculation formula is as follows:
[0115] ;
[0116] in, This represents the loss value for lightweight long short-term memory networks. The number of samples for training time series vectors, The index variable is the number of samples. For the predicted first Bandwidth requirements for training time series vectors For the first The actual bandwidth requirement for each training time series vector;
[0117] The lightweight long short-term memory network is trained by inputting time series vectors, performing forward propagation to calculate the hidden states, and outputting the predicted bandwidth requirement, as shown in the following formula:
[0118] ;
[0119] ;
[0120] in, For time steps The hidden state, This represents the hyperbolic tangent activation function. Here is the weight matrix of the hidden state. Let be the bias vector of the hidden state. For time steps The first input A training time series vector, For time steps The hidden state, The weight matrix of the output layer. This is the bias value for the output layer;
[0121] examine The scope, ensure If the bandwidth exceeds the maximum bandwidth range of the USB4 protocol, it indicates that... If there is an error, delete it; otherwise, keep it.
[0122] Once the lightweight long short-term memory network has completed training on all training time series vectors, training is paused.
[0123] Input a time series vector, predict bandwidth demand, iterate through all data transmission tasks, sort the predicted bandwidth demand by task identifier, and generate a floating-point array of bandwidth demand.
[0124] As data transmission proceeds, the actual bandwidth requirements and historical data transmission task status are periodically refreshed to update and train the lightweight long short-term memory network, generating a new floating-point array of bandwidth requirements.
[0125] S4. By obtaining the available bandwidth and channel occupancy of the USB4 protocol, dynamic channel priority allocation and cache-aware scheduling are used to dynamically allocate bandwidth for mobile hard drive data transfer tasks.
[0126] The total bandwidth is read through the bandwidth management interface of the USB4 controller, the USB4 controller register is accessed, the total bandwidth usage of all current tasks is queried, the allocated bandwidth is subtracted, and the difference is calculated as the available bandwidth.
[0127] Based on semantic scores and critical path weights, channel priority allocation rules are set;
[0128] Specifically, when the semantic score of a data transmission task is higher than the median of the semantic scores of all data transmission tasks, the Isochronous channel is allocated first; when the critical path weight of a data transmission task is higher than the median of the critical path weights of all data transmission tasks, the Bulk channel is allocated first.
[0129] Based on a comprehensive assessment of predicted bandwidth demand, data transmission task scheduling cycle, external hard drive performance, available bandwidth, and critical path weight, the initial allocated bandwidth is calculated using the following formula:
[0130] ;
[0131] in, For data transmission tasks The initial allocated bandwidth, The weights for predicting bandwidth demand range from 1 to 2. , For data transmission tasks Predicted bandwidth requirements For data transmission tasks The amount of data, For data transmission task scheduling cycle, Given the current performance of external hard drives, This represents the currently available bandwidth.
[0132] The cache status register can be queried through the USB4 controller cache management interface to read the current channel (Isochronous channel or Bulk channel) cache utilization rate.
[0133] Check if the current channel cache is overloaded and pause data transmission tasks with low critical path weights to free up bandwidth and relieve cache pressure;
[0134] Specifically, based on queuing theory, a fixed critical point of cache overload is captured, a cache threshold is set, and the cache status register is queried through the USB4 controller cache management interface to obtain the current channel cache occupancy rate of the channel (Bulk channel or Isochronous channel). The current channel cache occupancy rate is compared with the cache threshold. If the current channel cache occupancy rate is greater than the cache threshold, it is determined that the cache is overloaded; otherwise, it is determined that the cache is normal.
[0135] Calculate the median value of the critical path weights of all data transmission tasks within the channel. When the buffer is overloaded, suspend data transmission tasks whose critical path weights are below the median value, release bandwidth to available bandwidth, and complete the update of available bandwidth.
[0136] Based on the updated available bandwidth, the bandwidth allocation is recalculated.
[0137] This embodiment also provides a computer device applicable to the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol proposed in the above embodiment.
[0138] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0139] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0140] In summary, this invention parses metadata using SCSI commands and classifies task types to achieve accurate matching of task type and channel characteristics. By constructing a task dependency graph with explicit / implicit dependencies and dynamically calculating critical path weights, it solves the logical dependency between indexing and transmission tasks, as well as the resource contention bottleneck problem when multiple tasks are concurrent. The bandwidth secondary allocation mechanism based on dynamic priority rules improves the overall bandwidth utilization.
[0141] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol, characterized in that: include, The transfer task of the external hard drive is analyzed to obtain the fine-grained semantic features of the data transfer task and generate a semantic vector. The fine-grained semantic features include the file type and transfer destination of the transfer task. The specific steps for generating semantic vectors are as follows: Data transmission tasks are classified based on their fine-grained semantic features. Based on the sequential read rate requirements of mobile hard drives in high real-time task transmission scenarios, and combined with the Isochronous channel characteristics of the USB4 protocol, a real-time transmission rate threshold is determined. Calculate the ratio of the average data transmission rate in the most recent period to the real-time transmission rate threshold, and use it as a real-time requirement indicator. Based on the block size distribution of external hard drives in backup scenarios, and combined with the Bulk channel characteristics of the USB4 protocol, the typical block size for high-reliability tasks is determined, and the threshold for the typical block size for high-reliability tasks is determined. Calculate the ratio of the block size of the transmitted file to the typical block size threshold for high-reliability tasks, and use it as a reliability requirement indicator. Calculate the semantic score of the data transmission task based on real-time requirement indicators and reliability requirement indicators; The semantic score, real-time requirement index, and reliability requirement index of the data transmission task are combined into a semantic vector, which is then updated at a preset frequency. Based on the semantic vectors of data transmission tasks, a data transmission task dependency graph of the mobile hard drive is constructed, and the critical path weight of each data transmission task is calculated. Based on critical path weights and semantic vectors, combined with real-time status information of mobile hard drives and historical data transmission task status information, long short-term memory networks are used to predict bandwidth requirements. By obtaining the available bandwidth and channel occupancy of the USB4 protocol, dynamic channel priority allocation and cache-aware scheduling are used to dynamically allocate bandwidth for mobile hard drive data transfer tasks.
2. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 1, characterized in that: The specific steps for constructing the data transfer task dependency graph for the external hard drive are as follows. Obtain task information for data transmission tasks; The task information includes task identifier, timestamp, data flow direction, initial priority, cache utilization rate, and channel utilization rate; Examine the data flow, identify explicit dependencies, and calculate the weights of the explicit dependency edges; Based on cache occupancy and channel occupancy, calculate cache contention intensity and bandwidth contention intensity, identify implicit dependencies, and calculate the weights of implicit dependency edges; Each data transmission task is treated as a node, and the dependencies between data transmission tasks are treated as edges. A task dependency graph is constructed and its integrity is verified.
3. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 1, characterized in that: The specific steps for calculating the critical path weight for each data transmission task are as follows: Based on the task dependency graph, the data volume, cache utilization rate and channel utilization rate of each data transmission task are obtained, and the comprehensive impact factor of each data transmission path is calculated. Compare the comprehensive impact factors of each path and select the path with the largest comprehensive impact factor as the critical path; Calculate the critical path weight based on the critical path and the total data volume of data transmission tasks on the critical path. By querying the USB4 controller's data transfer task list, when a new task is detected, the task dependency graph is reconstructed, and the critical path is re-identified and its weight is calculated.
4. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 1, characterized in that: The specific steps for predicting bandwidth demand are as follows. Initialize the lightweight long short-term memory network structure; Define a loss function, and update and optimize the network parameters using the Adam optimizer's lightweight long short-term memory by minimizing the loss function; Historical data transfer task status information and actual bandwidth requirements are collected from the external hard drive logs, standardized, and concatenated into training time series vectors to train a lightweight long short-term memory network structure. Input the time series vector into the output of the trained lightweight long short-term memory network to predict bandwidth requirements.
5. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 1, characterized in that: The specific steps for dynamically allocating bandwidth for data transfer tasks on the external hard drive are as follows. Based on the semantic score and critical path weight of the data transmission task, set the channel priority allocation rules; The initial bandwidth allocation is calculated by comprehensively considering the predicted bandwidth demand, data transmission task scheduling cycle, external hard drive performance, available bandwidth, and critical path weight. Check for current channel cache overload and pause data transmission tasks with low critical path weights, then update available bandwidth; Based on the updated available bandwidth, the bandwidth allocation is recalculated.
6. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 5, characterized in that: The specific steps for setting the channel priority allocation rules are as follows. When the semantic score of a data transmission task is higher than the median semantic score of all data transmission tasks, the Isochronous channel is allocated preferentially. When the critical path weight of a data transmission task is higher than the median critical path weight of all data transmission tasks, the Bulk channel is allocated preferentially.
7. The method for dynamic bandwidth allocation of mobile hard drive data transmission based on the USB4 protocol as described in claim 5, characterized in that: The specific steps for updating available bandwidth are as follows. Based on queuing theory, a fixed critical point of cache overload is captured, and a cache threshold is set. Compare the current channel's cache utilization rate with the cache threshold. If the current channel's cache utilization rate is greater than the cache threshold, it is determined that the cache is overloaded; otherwise, it is determined that the cache is normal. Calculate the median value of the critical path weights for all data transmission tasks within the channel. When the buffer is overloaded, pause data transmission tasks with critical path weights below the median value and release bandwidth to available bandwidth.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the dynamic bandwidth allocation method for mobile hard drive data transmission based on the USB4 protocol as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the dynamic bandwidth allocation method for mobile hard disk data transmission based on the USB4 protocol as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-task data analysis method and device and storage medium
CN119847752A