An adaptive prediction-based USB split transaction method and device

CN122594201APending Publication Date: 2026-08-18CIX TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611080933.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

对于响应较慢或响应规律较稳定的设备,主机在设备尚未准备好数据的微帧内仍会发起Complete-Split事务,从而容易产生大量未就绪响应,增加高速总线上的无效事务开销,并占用原本可用于其他高速传输的总线带宽

Benefits of technology

[0054]This disclosure provides an adaptive predictive USB Split transaction processing method and apparatus. By establishing and maintaining device response characteristic information for the target USB device, it determines the predictive scheduling timing of Complete-Split transactions based on information such as historical device response latency, prediction confidence level, and scheduling priority. Furthermore, it continuously updates the device response characteristic information based on the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594201A_ABST
    Figure CN122594201A_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of adaptive prediction formula USB Split transaction processing method and device, by establishing and maintaining equipment response characteristic information for target USB equipment, the prediction scheduling opportunity of Complete-Split transaction is determined based on equipment historical response delay, prediction trust degree and scheduling priority etc.Information, and according to actual response result, equipment response characteristic information is continuously updated, so that USB host controller can skip part of invalid polling microframe, and initiate Complete-Split transaction at the moment closer to the actual response completion of target equipment.It can reduce the high-speed bus bandwidth occupied by invalid Complete-Split transaction and unready response, reduce the scheduling and interrupt processing burden of host controller, improve the efficiency of Split transaction processing, and improve the overall response performance when low-speed or full-speed USB equipment communicates via high-speed hub.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of USB communication control technology, and more specifically, to an adaptive predictive USB Split transaction processing method and apparatus. Background Technology

[0002] USB, as a universal serial bus interface, is widely used for data communication between computers, embedded terminals, industrial control equipment, and various peripherals. In a USB 2.0 system, the high-speed host controller typically operates in high-speed transmission mode, while some peripherals connected downstream of the high-speed hub may still be low-speed or full-speed devices, such as mice, keyboards, game controllers, USB-to-serial devices, and audio devices. Because of the different communication rates between the high-speed bus and low-speed or full-speed devices, when the high-speed host controller needs to access low-speed or full-speed devices connected downstream of the high-speed hub, it usually requires the use of a transaction translator within the high-speed hub for rate conversion and transaction forwarding.

[0003] In the existing USB 2.0 communication mechanism, for the aforementioned cross-rate communication scenarios, the host typically uses Split transactions to complete the access. A Split transaction generally includes two phases: a Start-Split transaction and a Complete-Split transaction. However, existing Split transaction scheduling methods usually employ a relatively fixed polling strategy, that is, after the Start-Split transaction, Complete-Split transactions are initiated continuously or periodically according to a preset microframe order. While this method is simple to implement, it does not fully consider the response differences between different USB devices, different endpoints, different data transfer lengths, and different hub connection states. For devices with slower responses or more stable response patterns, the host may still initiate a Complete-Split transaction within a microframe before the device has prepared data, which can easily generate a large number of unready responses, increase the overhead of invalid transactions on the high-speed bus, and occupy bus bandwidth that could otherwise be used for other high-speed transmissions. Summary of the Invention

[0004] This disclosure provides at least one adaptive predictive USB Split transaction processing method and apparatus. By establishing and maintaining device response characteristic information for the target USB device, it determines the predictive scheduling timing of Complete-Split transactions based on information such as historical device response latency, prediction confidence level, and scheduling priority. Furthermore, it continuously updates the device response characteristic information based on the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

[0005] This disclosure provides an adaptive predictive USB Split transaction processing method, including:

[0006] When it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub, the device response feature information corresponding to the target USB device is obtained.

[0007] Based on the device response characteristic information, the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction is determined;

[0008] After sending a Start-Split transaction to the high-speed hub, a Complete-Split transaction is initiated according to the predicted Complete-Split scheduling timing to obtain the transaction response data returned by the target USB device via the transaction translator;

[0009] Based on the actual response results of this Split transaction, the device response feature information is updated so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.

[0010] In one optional implementation, the device response feature information includes device profile information;

[0011] The device profile information includes at least device identification information, port information, endpoint information, response latency statistics, predicted trust level information, and scheduling priority information;

[0012] The response latency statistics are used to characterize the historical microframe offset features of the target USB device after the Start-Split transaction to generate a valid Complete-Split response, and the prediction confidence information is used to characterize the reliability of Complete-Split scheduling prediction based on the response latency statistics.

[0013] In one optional implementation, obtaining device response feature information corresponding to the target USB device specifically includes:

[0014] Obtain the device address, endpoint address, hub port number, and device type information of the target USB device;

[0015] Based on the device address, endpoint address, hub port number, and device type information, query the corresponding device file information in the device file database;

[0016] When the corresponding device file information is found, the response latency statistics and predicted trust information in the device file information are read.

[0017] If no corresponding device file information is found, an initial device file is created for the target USB device, and the scheduling priority is determined based on the device type information of the target USB device.

[0018] In one optional implementation, based on the device response characteristic information, the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction is determined, specifically including:

[0019] Based on the predicted trust information, the Split transaction scheduling mode corresponding to the target USB device is determined;

[0020] Based on the Split transaction scheduling mode and the response delay statistics, the micro-frames for sending the Complete-Split transaction are determined.

[0021] The Split transaction scheduling modes include cold start scheduling mode, learning scheduling mode, and fully predictive scheduling mode.

[0022] In one optional implementation, determining the Split transaction scheduling mode corresponding to the target USB device specifically includes:

[0023] When the predicted trust information meets the first trust condition, a cold start scheduling mode is adopted, and a Complete-Split transaction is initiated after the Start-Split transaction according to a preset continuous polling strategy.

[0024] When the predicted trust information meets the second trust condition, the learning scheduling mode is adopted, and the Complete-Split transaction is initiated at least one microframe ahead of time based on the average response microframe information of the target USB device.

[0025] When the predicted trust information meets the third trust condition, the full prediction scheduling mode is adopted, and the target Complete-Split transmission microframe is determined based on the average response microframe information of the target USB device.

[0026] The trust level corresponding to the third trust level condition is higher than the trust level corresponding to the second trust level condition, and the trust level corresponding to the second trust level condition is higher than the trust level corresponding to the first trust level condition.

[0027] In one optional implementation, in the fully predictive scheduling mode, determining the target Complete-Split transmission microframe specifically includes:

[0028] Obtain the microframe information for the Start-Split transaction;

[0029] Based on the sending microframe information of the Start-Split transaction and the average response microframe information, determine the target Complete-Split sending microframe;

[0030] The window offset is determined based on the response fluctuation information in the response delay statistics.

[0031] Based on the target Complete-Split microframe and the window offset, a predictive scheduling window is determined, and a Complete-Split transaction is initiated within the microframe range corresponding to the predictive scheduling window.

[0032] In one optional implementation, the device response characteristic information is updated based on the actual response result of this Split transaction, specifically including:

[0033] Receive the response result returned by the high-speed hub based on the Complete-Split transaction, the response result including valid data response, not ready response, error response or timeout response;

[0034] When the response result is a valid data response, the actual response microframe offset between the current Start-Split transaction and the valid Complete-Split response is recorded, and the sampling history window, average response microframe information, response fluctuation information and prediction confidence information are updated based on the actual response microframe offset.

[0035] When the response result is not ready, determine whether to continue initiating the Complete-Split transaction based on the current Split transaction scheduling mode;

[0036] When the response result is an error response or a timeout response, the abnormal event is recorded, and the predicted trust information corresponding to the target USB device is adjusted according to the abnormal event.

[0037] In one optional implementation, determining whether to continue initiating the Complete-Split transaction based on the current Split transaction scheduling mode specifically includes:

[0038] In cold start scheduling mode, Complete-Split transactions are initiated again in subsequent microframes according to the preset maximum number of retries;

[0039] In the learning-based scheduling mode, Complete-Split transactions are initiated again in subsequent microframes according to the number of learning retries, and the corresponding actual response microframe information is recorded.

[0040] In full prediction scheduling mode, it is determined whether the current microframe exceeds the latest microframe of the prediction scheduling window. If it does not exceed the latest microframe, the Complete-Split transaction is initiated in the subsequent microframe. If it exceeds the latest microframe, the prediction is determined to have failed, and the prediction confidence is reduced based on the prediction failure result.

[0041] In one optional implementation, the method further includes:

[0042] When multiple USB devices are waiting to initiate Complete-Split transactions within the same scheduling microframe, obtain the scheduling priority of each USB device and predict the Complete-Split scheduling timing.

[0043] Based on the scheduling priority and the predicted Complete-Split scheduling timing, multiple Complete-Split transactions to be initiated are sorted and merged to generate a batch of Complete-Split requests;

[0044] Send the batch Complete-Split request to the high-speed hub;

[0045] Receive the batch Complete-Split response returned by the high-speed hub, and determine the response result corresponding to each USB device based on the batch Complete-Split response.

[0046] This disclosure also provides an adaptive predictive USB Split transaction processing apparatus, comprising:

[0047] The feature acquisition module is used to acquire device response feature information corresponding to the target USB device when it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub;

[0048] The scheduling timing determination module is used to determine the predicted Complete-Split scheduling timing of the target USB device after sending a Start-Split transaction based on the device response characteristic information.

[0049] The transaction response acquisition module is used to send a Start-Split transaction to the high-speed hub, and then initiate a Complete-Split transaction according to the predicted Complete-Split scheduling time to obtain the transaction response data returned by the target USB device via the transaction translator.

[0050] The feature update module is used to update the device response feature information based on the actual response result of the current Split transaction, so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.

[0051] This disclosure also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the above-described adaptive predictive USB Split transaction processing method, or any possible implementation of the above-described adaptive predictive USB Split transaction processing method, are performed.

[0052] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the above-described adaptive predictive USB Split transaction processing method, or any possible implementation thereof.

[0053] This disclosure also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the above-described adaptive predictive USB Split transaction processing method, or the steps in any possible implementation of the above-described adaptive predictive USB Split transaction processing method.

[0054] This disclosure provides an adaptive predictive USB Split transaction processing method and apparatus. By establishing and maintaining device response characteristic information for the target USB device, it determines the predictive scheduling timing of Complete-Split transactions based on information such as historical device response latency, prediction confidence level, and scheduling priority. Furthermore, it continuously updates the device response characteristic information based on the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

[0055] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0057] Figure 1 A flowchart of an adaptive predictive USB Split transaction processing method provided by an embodiment of this disclosure is shown;

[0058] Figure 2 A schematic diagram of an adaptive predictive USB Split transaction processing apparatus provided in an embodiment of this disclosure is shown.

[0059] Figure 3 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0061] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0062] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0063] Research has revealed that in the existing USB 2.0 communication mechanism, for the aforementioned cross-rate communication scenarios, the host typically uses Split transactions to complete access. A Split transaction generally consists of two phases: a Start-Split transaction and a Complete-Split transaction. However, existing Split transaction scheduling methods usually employ a relatively fixed polling strategy, initiating Complete-Split transactions continuously or periodically according to a preset microframe order after the Start-Split transaction. While this method is simple to implement, it does not fully consider the response differences between different USB devices, different endpoints, different data transfer lengths, and different hub connection states. For devices with slower or more stable response patterns, the host may still initiate a Complete-Split transaction within a microframe before the device has prepared data, easily generating a large number of unready responses, increasing the overhead of invalid transactions on the high-speed bus, and consuming bus bandwidth that could otherwise be used for other high-speed transmissions.

[0064] Based on the above research, this disclosure provides an adaptive predictive USB Split transaction processing method and apparatus. By establishing and maintaining device response characteristic information for the target USB device, the predictive scheduling timing of Complete-Split transactions is determined based on information such as historical device response latency, prediction confidence level, and scheduling priority. The device response characteristic information is continuously updated according to the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

[0065] To facilitate understanding of this embodiment, a detailed description of the adaptive predictive USB Split transaction processing method disclosed in this disclosure is provided first. The execution entity of the adaptive predictive USB Split transaction processing method provided in this disclosure is generally a computer device with a certain computing capability. This computer device may include, for example, a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. In some possible implementations, this adaptive predictive USB Split transaction processing method can be implemented by the processor calling computer-readable instructions stored in memory.

[0066] See Figure 1 The diagram shows a flowchart of an adaptive predictive USB Split transaction processing method provided in an embodiment of this disclosure. The method includes steps S101 to S104, wherein:

[0067] S101. When it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub, the device response feature information corresponding to the target USB device is obtained.

[0068] In practice, before accessing a USB device connected to a downstream port of a high-speed hub, the USB host controller first determines whether the USB device is a target object that needs to complete communication through a Split transaction. After confirming that a Split transaction is required, it further reads or creates a response behavior record corresponding to the target USB device so that the timing of initiating a Complete-Split transaction can be determined based on the response behavior record.

[0069] Specifically, the USB host controller can identify the connection path and communication rate of the target USB device during the device enumeration phase, endpoint configuration phase, or specific transport transaction initiation phase. When it is detected that the target USB device is a low-speed USB device or a full-speed USB device connected downstream of the high-speed hub, and the target USB device and the USB host controller need to perform rate conversion and transaction forwarding via the transaction translator in the high-speed hub, it is determined that the target USB device needs to communicate via Split transactions.

[0070] The high-speed hub can be a hub conforming to the USB 2.0 high-speed communication specification, and the transaction translator is used to perform transaction conversion between the high-speed USB bus and low-speed or full-speed USB devices. The target USB device can be a low-speed mouse, a low-speed keyboard, a full-speed audio device, a full-speed sensor device, a USB-to-serial device, or other USB devices connected downstream of the high-speed hub that require split transaction access.

[0071] Here, after determining that the target USB device needs to communicate via Split transactions, the USB host controller obtains the device identification information and connection information of the target USB device. The device identification information may include at least one of the following: the target USB device's device address, manufacturer identifier, product identifier, device category, interface category, endpoint address, and endpoint transmission type; the connection information may include at least one of the following: the high-speed hub identifier where the target USB device is located, the hub port number, hub hierarchy information, and corresponding transaction translator information.

[0072] Furthermore, after obtaining the device identification information and connection information of the target USB device, the USB host controller can query the device profile information corresponding to the target USB device from a pre-set device profile database based on the device identification information and connection information. The device profile database can be located in the storage area of ​​the USB host controller, or it can be located in the driver layer, firmware layer, or operating system kernel layer of the host system. The device profile database is used to store response behavior data of different USB devices in historical Split transactions, and can be categorized and maintained according to device, endpoint, port, or data transmission length range.

[0073] In one specific implementation, the device response feature information includes device profile information, which at least includes device identification information, port information, endpoint information, response latency statistics, predicted trust information, and scheduling priority information. Specifically, the device identification information characterizes the identity of the target USB device, such as device address, manufacturer identifier, product identifier, or device category; the port information characterizes the downstream port of the high-speed hub to which the target USB device is connected; the endpoint information characterizes the target endpoint accessed by the current Split transaction; the response latency statistics characterize the historical microframe offset characteristics of the target USB device in generating a valid Complete-Split response after the Start-Split transaction; the predicted trust information characterizes the reliability of predicting the timing of the Complete-Split initiation based on the historical response latency statistics; and the scheduling priority information determines the scheduling order of different devices or endpoints when multiple Split transactions are concurrent or scheduled with similar microframes.

[0074] Furthermore, the response delay statistics may include at least one of the following: average response microframe information, fastest response microframe information, slowest response microframe information, response fluctuation information, historical sampling count, and sampling history window.

[0075] For example, the average response microframe information is used to indicate how many microframes the target USB device typically takes to produce a valid response after a Start-Split transaction in historical communications; the response fluctuation information is used to indicate the stability of the response latency; and the sampling history window is used to record the actual response microframe offset of the most recent Split transactions so that the response latency statistics can be dynamically updated using a sliding window method.

[0076] Furthermore, the prediction trust information may include at least one of the following: trust level, recent prediction hit count, consecutive prediction hit count, consecutive prediction failure count, and file maturity status. The trust level can be used to distinguish whether the target USB device is currently suitable for cold start scheduling, learning-in-process scheduling, or full prediction scheduling; the recent prediction hit count and consecutive prediction hit count can be used to evaluate the consistency between historical prediction Complete-Split scheduling timings and actual effective response microframes; the consecutive prediction failure count can be used to reduce the prediction trust when the device's response behavior changes, allowing the system to promptly revert to a more stable scheduling mode.

[0077] Here, when querying the device profile database, if the USB host controller finds device profile information that matches the target USB device, it reads the response latency statistics, predicted trust information, and scheduling priority information from that device profile information, and uses the read information as the device response characteristic information for this Split transaction. The matching can be based on one or more combinations of device address, manufacturer identifier, product identifier, endpoint address, and hub port number.

[0078] For example, different endpoints of the same USB device can be matched with different endpoint-level device files; in the scenario where the same device is re-inserted into the same hub port, historical device files can be matched based on manufacturer identifier, product identifier and port information; in the hub cascading scenario, the response characteristics under the corresponding connection path can be matched by further combining hub-level information.

[0079] Here, if the USB host controller does not find device profile information matching the target USB device, an initial device profile is created for the target USB device. When creating the initial device profile, the average response microframes corresponding to the target USB device can be set to a preset initial microframe value, the prediction confidence level can be set to the initial confidence level, the number of samplings, the number of consecutive prediction hits, and the number of consecutive prediction failures can be set to initial values, and the initial scheduling priority can be configured according to the device type of the target USB device.

[0080] For example, higher scheduling priorities can be configured for human-computer interface devices such as mice, keyboards, and game controllers; second-highest scheduling priorities can be configured for audio or video devices; and normal scheduling priorities can be configured for ordinary sensor devices, USB-to-serial devices, or other non-real-time devices.

[0081] In this way, even if the target USB device is a first-time connection device, the USB host controller can enter a controllable Split transaction scheduling process based on the initial device profile and gradually learn the response characteristics of the target USB device during subsequent communication.

[0082] In another implementation, the device response characteristic information can also be maintained separately according to data transmission length ranges. Since the response time of the target USB device may differ under different data transmission lengths, the USB host controller can further obtain the data transmission length of the current Split transaction when obtaining the device profile information corresponding to the target USB device, and select the response latency statistics under the corresponding length range based on the data transmission length.

[0083] For example, different average response microframe information and response fluctuation information can be maintained for small data volume transmission, medium data volume transmission, and large data volume transmission, respectively.

[0084] In another implementation, the device response characteristic information can also be maintained separately for each endpoint. For the same target USB device, different endpoints may have different data directions, transmission types, and response patterns. For example, the input and output endpoints of the same human-machine interface device may differ in response latency, and the control and data endpoints of an audio device may also have different response behaviors. Therefore, when acquiring device response characteristic information, the USB host controller can select the endpoint-level response characteristic information of the corresponding endpoint from the device file of the target USB device based on the endpoint address corresponding to the current Split transaction, thereby improving the accuracy of subsequent Complete-Split predictive scheduling.

[0085] S102. Based on the device response feature information, determine the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction.

[0086] In practice, after obtaining the historical response patterns and prediction reliability of the target USB device, the USB host controller no longer initiates Complete-Split transactions immediately or continuously after the Start-Split transaction in a fixed polling manner. Instead, it predicts the time point when the transaction translator completes communication with the target USB device and is ready to return response data based on the microframe offset between the target USB device's previous Start-Split transactions and valid Complete-Split responses. This determines the microframe or range of microframes to initiate the current Complete-Split transaction.

[0087] Specifically, after acquiring the device response characteristic information, the USB host controller can first read the response latency statistics and predicted confidence information. The response latency statistics may include at least one of the following: average response microframe information, fastest response microframe information, slowest response microframe information, response fluctuation information, and information from the sampling history window. The average response microframe information indicates how many microframes typically precede a valid response from the target USB device in historical Split transactions; the response fluctuation information indicates the stability of the target USB device's response latency; and the fastest and slowest response microframe information can be used to limit the achievable scheduling range of Complete-Split transactions. By reading the above information, the USB host controller can obtain the response latency distribution characteristics of the target USB device during historical communication.

[0088] Furthermore, the USB host controller can determine the Split transaction scheduling mode corresponding to the target USB device based on the predicted trust information. The Split transaction scheduling mode can include a cold start scheduling mode, a learning scheduling mode, and a full prediction scheduling mode. The cold start scheduling mode is suitable for scenarios where the target USB device is accessing for the first time, has insufficient historical sampling counts, low predicted trust, or has experienced a high number of recent prediction failures. The learning scheduling mode is suitable for scenarios where the target USB device has accumulated some historical response data but the response pattern has not yet reached a stable state. The full prediction scheduling mode is suitable for scenarios where the target USB device has relatively stable historical response latency, high predicted trust, and good continuous prediction hit rate.

[0089] In one specific implementation, the predicted trust information can be compared with preset trust conditions to determine the corresponding Split transaction scheduling mode. For example, when the predicted trust information meets the first trust condition, the cold start scheduling mode is determined to be used; when the predicted trust information meets the second trust condition, the learning scheduling mode is determined to be used; and when the predicted trust information meets the third trust condition, the fully predictive scheduling mode is determined to be used.

[0090] The trust level corresponding to the third trust level condition is higher than that corresponding to the second trust level condition, and the trust level corresponding to the second trust level condition is higher than that corresponding to the first trust level condition. These trust level conditions can be set according to actual system requirements, and can be determined comprehensively based on factors such as the number of samplings, the recent prediction hit rate, the number of consecutive prediction hits, and the number of consecutive prediction failures, rather than being limited to a single numerical threshold.

[0091] Here, in cold start scheduling mode, since the target USB device lacks sufficiently reliable historical response characteristics, the USB host controller can adopt a relatively conservative Complete-Split scheduling method. Specifically, after sending the Start-Split transaction, the USB host controller can initiate Complete-Split transactions in the following microframes according to a preset continuous polling strategy to obtain valid response data from the target USB device as quickly as possible.

[0092] Here, in the learning-based scheduling mode, since the target USB device already has some historical response latency statistics, but the prediction confidence level has not yet reached a high level, the USB host controller can adopt a trial-and-error predictive scheduling method. Specifically, the USB host controller can determine an expected response microframe based on the average response microframe information of the target USB device, and initiate a Complete-Split transaction at a preset microframe position before the expected response microframe.

[0093] For example, when historical response latency statistics indicate that the target USB device typically returns valid data several microframes after the Start-Split transaction, the USB host controller can skip some invalid polling microframes that are significantly earlier than the expected response microframe and start attempting a Complete-Split query closer to the expected response microframe.

[0094] Here, in the fully predictive scheduling mode, since the historical response patterns of the target USB device are relatively stable, the USB host controller can directly determine the predicted Complete-Split scheduling timing based on response latency statistics. Specifically, the USB host controller can obtain the transmission microframe information of this Start-Split transaction, and determine the target Complete-Split transmission microframe based on this transmission microframe information and the average response microframe information corresponding to the target USB device. The target Complete-Split transmission microframe can be understood as: the microframe from which the transaction translator is most likely to complete communication with the target USB device and return a valid response, based on historical statistical results.

[0095] Furthermore, after determining the target Complete-Split transmission microframe, the USB host controller can also determine a predictive scheduling window based on the response fluctuation information in the response latency statistics. Specifically, when the response fluctuation of the target USB device is small, it indicates that its historical response latency is relatively stable, and the predictive scheduling window can be set narrower, so that Complete-Split transactions are initiated more concentratedly near the target Complete-Split transmission microframe. When the response fluctuation of the target USB device is large, it indicates that its response latency has a certain degree of uncertainty, and the predictive scheduling window can be appropriately widened, allowing the USB host controller to attempt within a certain range before and after the target Complete-Split transmission microframe, thereby reducing the probability of prediction failure due to response fluctuation. The predictive scheduling window can include the earliest Complete-Split transmission microframe and the latest Complete-Split transmission microframe.

[0096] For example, in one implementation, the USB host controller can determine a predictive scheduling window based on the microframes sent in the Start-Split transaction, the average response microframes, and response fluctuation information. If the target USB device historically typically generates a valid response several microframes after the Start-Split transaction, and the response fluctuation is small, the USB host controller can use the positions corresponding to these microframes as the target Complete-Split microframes for transmission, and initiate Complete-Split transactions only at or near the target Complete-Split microframes. If the response fluctuation is large, a certain number of microframes can be reserved before and after the target Complete-Split microframes for testing.

[0097] In another implementation, the scheduling priority of the target USB device can be further considered when determining the predicted Complete-Split scheduling timing. For target USB devices with high real-time requirements, such as human-machine interface devices and audio devices, even if the prediction confidence level is high, the starting microframe of the scheduling window can be predicted in advance to reduce the risk of user-perceptible latency or audio / video data anomalies. For ordinary sensor devices, USB-to-serial devices, or other non-real-time devices, the Complete-Split scheduling timing can be determined more strictly according to the average response microframe and response fluctuation information to reduce the occupation of high-speed bus bandwidth.

[0098] In another implementation, when determining the predicted Complete-Split scheduling timing, the endpoint information and data transfer length corresponding to the current Split transaction can also be considered. For the same target USB device, the response latency of different endpoints may differ. Therefore, the USB host controller can select the response latency statistics corresponding to the currently accessed endpoint address for prediction. For transactions with different data transfer lengths, the time required for the transaction translator to complete low-speed or full-speed communication may also differ. Therefore, the USB host controller can select the average response microframe information and response fluctuation information within the corresponding data length range based on the data transfer length of the current transaction, thereby determining a predicted Complete-Split scheduling timing that better matches the characteristics of the current transaction.

[0099] It should be noted that in a hub cascading scenario, the target USB device may be connected to the USB host controller via multiple high-speed hubs. In this case, device response characteristics can reflect the end-to-end response latency of the target USB device under the current connection path. This end-to-end response latency includes the latency impact caused by the communication of multiple hubs and their transaction translators. When determining the predicted Complete-Split scheduling timing, the USB host controller can make predictions based on the device profile information corresponding to the current connection path, rather than solely estimating based on the device type of the target USB device itself. This avoids deviations in Complete-Split scheduling timing due to changes in hub hierarchy, port location, or connection path.

[0100] Furthermore, after determining the predicted Complete-Split scheduling opportunity, the USB host controller can write this scheduling opportunity into a transaction scheduling queue. The transaction scheduling queue can arrange the Complete-Split transactions to be executed according to the microframe order, and can sort multiple transactions to be executed by combining scheduling priority, predicted scheduling window, and available bus bandwidth. When the predicted Complete-Split scheduling opportunities of multiple target USB devices fall into the same microframe or adjacent microframes, the USB host controller can also provide a set of candidate transactions for subsequent batch Complete-Split merging processing.

[0101] S103. After sending a Start-Split transaction to the high-speed hub, initiate a Complete-Split transaction according to the predicted Complete-Split scheduling timing to obtain the transaction response data returned by the target USB device via the transaction translator.

[0102] In practice, the USB host controller first notifies the transaction translator in the high-speed hub to communicate with the target USB device at low or full speed via a Start-Split transaction. After the transaction translator performs the corresponding communication, the USB host controller does not immediately query continuously according to fixed microframes. Instead, it initiates a Complete-Split transaction in the microframe when the transaction translator is expected to have completed or is close to completing the communication, according to the aforementioned predicted Complete-Split scheduling time, thereby obtaining the response data of the target USB device from the transaction translator.

[0103] Specifically, after determining that a Split transaction needs to be performed on the target USB device, the USB host controller first generates a Start-Split transaction based on the current transmission request. The Start-Split transaction may include information such as the high-speed hub port information where the target USB device resides, the device address of the target USB device, the target endpoint address, the transmission direction, the transaction type, and the data transmission length. Upon receiving the Start-Split transaction, the high-speed hub's transaction translator initiates the corresponding low-speed or full-speed communication to the target USB device on the low-speed or full-speed bus based on the port information and transaction parameters in the Start-Split transaction.

[0104] For example, for IN-direction transactions, the transaction translator can send an IN token to the target USB device to request the target USB device to return data; for OUT-direction transactions, the transaction translator can forward the data sent by the host to the target USB device and wait for the target USB device to complete the receipt confirmation.

[0105] Here, when sending a Start-Split transaction, the USB host controller can also record the microframe information of this Start-Split transaction. This microframe information serves as a time reference for subsequent Complete-Split scheduling and actual response latency statistics. Specifically, the USB host controller can record the microframe number, intra-frame offset, scheduling queue position, or microframe count value corresponding to the host controller's internal clock for the Start-Split transaction.

[0106] In this implementation, after the Start-Split transaction is sent, the transaction translator of the high-speed hub begins low-speed or full-speed communication with the target USB device. Since the response time of low-speed or full-speed devices is typically longer than the duration of a high-speed USB microframe, the transaction translator may need to wait for one or more microframes before obtaining the response data from the target USB device. In this embodiment, the USB host controller determines whether to wait and, at which microframe, to initiate the Complete-Split transaction based on the predicted Complete-Split scheduling timing, thereby avoiding invalid queries within microframes where the target USB device has clearly not yet completed its response.

[0107] Furthermore, the USB host controller can write the predicted Complete-Split scheduling timing into the transaction scheduling queue, and generate a Complete-Split transaction when the host controller schedules the corresponding microframe. The Complete-Split transaction is used to query whether the transaction translator in the high-speed hub has completed low-speed or full-speed communication with the target USB device, and requests the transaction translator to return the corresponding response result. The Complete-Split transaction can carry matching information such as target port information, device address, endpoint information, transaction direction, or transaction type corresponding to the Start-Split transaction, so that the high-speed hub can match the Complete-Split transaction with the previously received Start-Split transaction and the pending transaction status inside the transaction translator.

[0108] In one specific implementation, when the predicted Complete-Split scheduling timing is a single target microframe, the USB host controller can skip at least some microframes before the target microframe after the Start-Split transaction, and initiate a Complete-Split transaction when the target microframe is reached.

[0109] For example, if the device response characteristics indicate that the target USB device typically generates a valid response only after a predetermined number of microframes following the Start-Split transaction, the USB host controller may not initiate the Complete-Split transaction earlier than the predetermined number of microframes, but instead initiate a query for the target microframe corresponding to that predetermined number of microframes.

[0110] In another specific implementation, when the predicted Complete-Split scheduling timing manifests as a predicted scheduling window, the USB host controller can initiate a Complete-Split transaction within the microframe range corresponding to the predicted scheduling window. Specifically, the USB host controller can initiate the first Complete-Split transaction in the earliest microframe of the predicted scheduling window; if the high-speed hub returns a valid data response, the Split transaction is completed; if the high-speed hub returns a not ready response, the USB host controller can continue to initiate Complete-Split transactions in subsequent microframes within the predicted scheduling window until a valid data response is obtained, the latest microframe of the predicted scheduling window is reached, or a preset retry condition is met.

[0111] Here, after the Complete-Split transaction is sent, the USB host controller receives a response from the high-speed hub. This response may include a valid data response, a not-ready response, an error response, or a timeout response.

[0112] Among them, a valid data response indicates that the transaction translator has completed low-speed or full-speed communication with the target USB device and has received data or acknowledgment information returned by the target USB device; a not-ready response indicates that the transaction translator has not completed the corresponding communication or is not ready to return data; an error response indicates that an error occurred in the low-speed or full-speed communication, the target USB device returned an abnormal handshake, or the transaction translator detected a transmission error; and a timeout response indicates that the USB host controller did not receive a valid response from the high-speed hub for the Complete-Split transaction within a predetermined time.

[0113] Here, when the response result is a valid data response, the USB host controller extracts the transaction response data corresponding to the target USB device from the data packet returned by the high-speed hub, and submits the transaction response data to the upper-layer driver, USB protocol stack, or corresponding application processing flow. The transaction response data can be input data, status data, control transmission response data, endpoint data, or transaction completion confirmation information returned by the target USB device. Simultaneously, the USB host controller can record the microframe containing this valid Complete-Split response and, in conjunction with the microframe sent by the Start-Split transaction, determine the actual response microframe offset for subsequent updates to the device response characteristic information.

[0114] Here, when the response result is a not-ready response, the USB host controller can determine whether to continue initiating a Complete-Split transaction based on the current Split transaction scheduling mode and the predicted Complete-Split scheduling timing. Specifically, in cold-start scheduling mode, since the system needs to collect as much of the actual response behavior of the target USB device as possible, the USB host controller can continue to initiate Complete-Split transactions in subsequent microframes according to a preset maximum number of retries; in learning-based scheduling mode, the USB host controller can continue to initiate Complete-Split transactions in subsequent microframes according to the learning retries, and use the microframes corresponding to the not-ready response as part of the learning samples; in full-predictive scheduling mode, the USB host controller can determine whether the current microframe exceeds the latest microframe of the predictive scheduling window. If it does not exceed the window, it will continue to try in subsequent microframes; if it exceeds the predictive scheduling window and still does not obtain a valid data response, the current scheduling can be determined as a prediction failure.

[0115] It should be noted that when the response result is an error response or a timeout response, the USB host controller can execute an exception handling procedure. The exception handling procedure may include recording the error event, counting the number of errors, reducing the prediction trust level corresponding to the target USB device, rolling back to the learning scheduling mode or the cold start scheduling mode, and returning the error status to the upper-layer driver.

[0116] In one alternative implementation, when there are multiple USB devices waiting to initiate Complete-Split transactions within the same scheduling microframe, the USB host controller can also sort and merge the multiple Complete-Split transactions based on the predicted Complete-Split scheduling timing and scheduling priority corresponding to each USB device.

[0117] Specifically, the USB host controller can scan the Complete-Split transaction scheduling queue within the current microframe to identify the transactions to be queried corresponding to multiple target USB devices, and sort them according to device type, endpoint priority, prediction window urgency, or historical trust level. When the merging conditions are met, the USB host controller can generate a batch Complete-Split request and send the batch Complete-Split request to the high-speed hub to simultaneously query the transaction translator response status corresponding to multiple target USB devices.

[0118] Furthermore, the batch Complete-Split request may include information on the number of devices to be queried, as well as port identifiers, endpoint identifiers, or transaction identifiers corresponding to the multiple target USB devices. Upon receiving the batch Complete-Split request, the high-speed hub can check the response status of the corresponding target USB device in the transaction translator based on the multiple queried objects contained within it, and generate a batch Complete-Split response.

[0119] Here, the batch Complete-Split response may include a response bitmap and device response data corresponding to the valid bits in the response bitmap. After parsing the response bitmap, the USB host controller can determine whether the transaction corresponding to each target USB device has prepared valid data, and process valid data responses, incomplete responses, or abnormal responses accordingly. Therefore, when multiple low-speed or full-speed devices simultaneously have Complete-Split query requests, the number of individual Complete-Split transactions on the high-speed bus can be reduced.

[0120] In another implementation, the USB host controller can also determine the current scheduling status of the high-speed bus before initiating a Complete-Split transaction. If there are high-priority high-speed transactions, periodic transmission transactions, or other transmission tasks that require priority bandwidth within the current microframe, the USB host controller can fine-tune the microframe for initiating the Complete-Split transaction, provided that it does not exceed the range allowed by the predictive scheduling window.

[0121] For example, for target USB devices with a wide prediction scheduling window and low scheduling priority, their Complete-Split transactions can be postponed to subsequent microframes within the window; for human-machine interface devices or devices whose prediction window is about to end, Complete-Split transactions can be initiated in the current microframe first.

[0122] S104. Based on the actual response result of this Split transaction, update the device response feature information so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.

[0123] In practice, after completing a Split transaction, the USB host controller not only submits the transaction response data returned by the target USB device to the upper-layer driver, but also uses the actual response between the Start-Split and Complete-Split transactions within this Split transaction as new learning samples to correct the device profile information corresponding to the target USB device. By continuously updating the device response characteristic information, the USB host controller can make the predicted scheduling timing of subsequent Complete-Split transactions more closely match the actual response patterns of the target USB device.

[0124] Specifically, after initiating a Complete-Split transaction, the USB host controller can determine the actual completion status of this Split transaction based on the response returned by the high-speed hub. The actual response may include at least one of a valid data response, a not-ready response, an error response, and a timeout response.

[0125] Among them, a valid data response indicates that the transaction translator of the high-speed hub has completed low-speed or full-speed communication with the target USB device and is able to return the response data of the target USB device to the USB host controller; an unready response indicates that the transaction translator has not completed the corresponding communication or has not prepared the response data; an error response indicates that a transmission error occurred during communication in the transaction translator, the target USB device, or the connection path; and a timeout response indicates that the USB host controller did not receive a valid response from the high-speed hub within a predetermined time.

[0126] Here, when a valid data response is received for the current Split transaction, the USB host controller can record the microframe information of the Start-Split transaction and the microframe information of the valid Complete-Split response, and determine the actual response microframe offset based on the difference between the two. This actual response microframe offset represents the actual number of microframes elapsed between the USB host controller sending the Start-Split transaction and the high-speed hub's transaction translator returning a valid Complete-Split response. This actual response microframe offset can serve as a valid learning sample for the current Split transaction, used to update the response latency statistics of the target USB device.

[0127] Furthermore, the USB host controller can write the actual response microframe offset into the sampling history window corresponding to the target USB device. The sampling history window is used to store the actual response microframe offsets of the target USB device's most recent Split transactions. Whenever a new actual response microframe offset is obtained, it can be written into the sampling history window, and the oldest historical sampling data can be deleted or overwritten, so that the sampling history window can reflect the recent response behavior of the target USB device.

[0128] After updating the sampling history window, the USB host controller can redetermine the response latency statistics based on the updated sampling history window. The response latency statistics may include at least one of the following: average response microframe information, fastest response microframe information, slowest response microframe information, and response fluctuation information.

[0129] For example, the average response microframe information can be determined based on the offsets of multiple actual response microframes within the sampling history window to characterize the typical response time of the target USB device in the near future; the slowest and fastest response microframe information can be determined based on the maximum and minimum values ​​within the sampling history window to characterize the response latency range; and the response fluctuation information can be determined based on the dispersion of each actual response microframe offset relative to the average response microframe within the sampling history window to characterize whether the response latency of the target USB device is stable.

[0130] Simultaneously, the USB host controller can update the prediction confidence information based on the matching between the actual response microframe offset and the predicted Complete-Split scheduling timing. Specifically, it can determine whether the actual response microframe offset falls within the predicted scheduling window, or whether the deviation between it and the target Complete-Split transmission microframe is within a preset allowable range.

[0131] Here, if the actual response microframe offset falls within the predicted hit range, it indicates that the Complete-Split scheduling timing determined based on the device response feature information is largely consistent with the actual response state of the target USB device. The USB host controller can increase or maintain the prediction confidence level corresponding to the target USB device and increase the number of consecutive prediction hits. If the actual response microframe offset does not fall within the predicted hit range, it indicates that there is a deviation between the predicted scheduling and the actual response. The USB host controller can decrease the prediction confidence level corresponding to the target USB device and update the number of consecutive prediction failures or reset the number of consecutive prediction hits.

[0132] In one specific implementation, the prediction confidence information can be determined based on the prediction hit rate of the most recent Split transactions. For example, the USB host controller can maintain a hit record of the most recent Split transactions in the device profile information. After each Split transaction is completed, a hit flag is generated based on whether the actual response microframe offset falls within the prediction hit range, and the prediction confidence is determined based on the hit record. When there are many hits in the most recent Split transactions, it indicates that the response behavior of the target USB device is stable and the prediction result is reliable, and the prediction confidence can be gradually increased. When there are many misses in the most recent Split transactions, it indicates that the response behavior of the target USB device may have changed or the original prediction parameters are no longer applicable, and the prediction confidence can be gradually decreased. Thus, the Split transaction scheduling mode can adaptively switch between cold start scheduling mode, learning scheduling mode, and full prediction scheduling mode.

[0133] Here, when the current Split transaction returns a not-ready response, the USB host controller can update the device response characteristic information based on the microframe position where the not-ready response occurred. If the not-ready response occurs before the prediction scheduling window or during the probing phase before the target Complete-Split sends a microframe, it can be used as reference information that the target USB device is not yet ready to respond, adjusting subsequent retry microframes or the learning scheduling strategy. If the not-ready response occurs within the prediction scheduling window, the USB host controller can continue to initiate Complete-Split transactions in subsequent microframes and update the response latency statistics based on the final valid response microframe after obtaining a valid data response. If not-ready responses continue to be returned after the prediction scheduling window ends, it can be determined that the Complete-Split prediction has failed, and the prediction confidence level of the target USB device will be reduced.

[0134] Furthermore, when multiple consecutive Split transactions fail to predict the outcome, the USB host controller can roll back the scheduling mode of the target USB device. For example, if the target USB device was originally in full predictive scheduling mode, but the number of consecutive prediction failures reaches a preset failure threshold, the prediction confidence level of the target USB device can be reduced to a lower level, and the scheduling mode of subsequent Split transactions can be switched to learning scheduling mode. If significant deviations continue to occur in learning scheduling mode, it can be further switched to cold start scheduling mode to re-collect the actual response data of the target USB device through a more conservative continuous polling strategy.

[0135] Here, when the current Split transaction returns an error response or a timeout response, the USB host controller can record the abnormal event and adjust the device response characteristics based on the abnormal event. The abnormal event may include the target USB device returning an incorrect handshake, the high-speed hub not returning the expected response, an abnormal transaction translator state, a Complete-Split transaction timeout, or an endpoint stopping response. For intermittent abnormalities, the USB host controller can record the number of abnormalities and appropriately reduce the prediction confidence level; for continuous or severe abnormalities, the USB host controller can mark the device file corresponding to the target USB device as unstable and temporarily roll back subsequent Split transactions to cold start scheduling mode or learning scheduling mode.

[0136] In another implementation, the USB host controller can also detect whether the response behavior of the target USB device has changed based on the actual response results. Specifically, the actual response microframe offset can be compared with the average response microframe information before the update. When the deviation between the two exceeds a preset change threshold, it is determined that the response behavior of the target USB device has changed significantly. Changes in response behavior may be caused by changes in the target USB device's operating state, changes in the length of transmitted data, changes in endpoint state, changes in hub cascading state, or changes in bus load. After detecting a change in response behavior, the USB host controller can reduce the weight of historical sampled data in the response latency statistics, or reduce the influence of old data in the sampling history window, so that the new actual response results can influence subsequent predictive scheduling more quickly.

[0137] In another implementation, if device response characteristic information is maintained separately for each endpoint, the USB host controller can update only the endpoint-level response characteristic information of the corresponding endpoint based on the endpoint address of the current split transaction, without affecting the response characteristic information of other endpoints of the same target USB device. For example, for the input and output endpoints of the same USB device, if the current split transaction only accesses the input endpoint, then only the average response microframe, response fluctuation information, and predicted confidence level corresponding to the input endpoint are updated.

[0138] In another implementation, if the device response characteristic information is maintained separately according to data transmission length intervals, the USB host controller can update the actual response microframe offset to the response latency statistics of the corresponding data transmission length interval based on the data transmission length of the current split transaction. For example, for a split transaction corresponding to a small data volume transmission, the actual response result is updated to the sampling history window of the small data volume interval; for a split transaction corresponding to a large data volume transmission, the actual response result is updated to the sampling history window of the large data volume interval.

[0139] When a target USB device disconnects, the USB host controller can also perform offline maintenance on the device's response characteristics. Specifically, when a change in the high-speed hub port status is detected and the target USB device is confirmed to be disconnected, the device profile information corresponding to the target USB device can be marked as offline, while retaining its response latency statistics and predicted trust level information. If the system supports persistent storage, the device profile information can also be written to non-volatile memory. In this way, when the same USB device is subsequently reconnected, the USB host controller can match historical device profiles based on device identification information, port information, or endpoint information, and continue to use historical response characteristics after appropriate weighting, thereby shortening the relearning process.

[0140] When the target USB device is reconnected, the USB host controller can restore and downgrade the historical device profile. Specifically, if a historical device profile is matched based on the device identification information and connection path information, historical response latency statistics can be read, and the historical predicted trust level can be reduced by a preset ratio and used as the initial predicted trust level after reconnection. This downgrading process takes into account potential changes in the target USB device's operating environment, hub path, or bus load after reconnection.

[0141] This disclosure provides an adaptive predictive USB Split transaction processing method. By establishing and maintaining device response characteristic information for the target USB device, it determines the predictive scheduling timing of Complete-Split transactions based on information such as historical device response latency, prediction confidence level, and scheduling priority. Furthermore, it continuously updates the device response characteristic information based on the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

[0142] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0143] Based on the same inventive concept, this disclosure also provides an adaptive predictive USB Split transaction processing device corresponding to the adaptive predictive USB Split transaction processing method. Since the principle of the device in this disclosure for solving the problem is similar to the adaptive predictive USB Split transaction processing method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0144] Please see Figure 2 , Figure 2 This is a schematic diagram of an adaptive predictive USB Split transaction processing apparatus provided in an embodiment of this disclosure. Figure 2 As shown in the embodiments of this disclosure, the adaptive predictive USB Split transaction processing apparatus 200 includes:

[0145] The feature acquisition module 210 is used to acquire device response feature information corresponding to the target USB device when it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub.

[0146] The scheduling timing determination module 220 is used to determine the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction based on the device response characteristic information.

[0147] The transaction response acquisition module 230 is used to send a Start-Split transaction to the high-speed hub, and then initiate a Complete-Split transaction according to the predicted Complete-Split scheduling time to obtain the transaction response data returned by the target USB device via the transaction translator.

[0148] The feature update module 240 is used to update the device response feature information according to the actual response result of the current Split transaction, so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.

[0149] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0150] This disclosure provides an adaptive predictive USB Split transaction processing apparatus. By establishing and maintaining device response characteristic information for the target USB device, it determines the predictive scheduling timing of Complete-Split transactions based on information such as historical device response latency, prediction confidence level, and scheduling priority. Furthermore, it continuously updates the device response characteristic information based on the actual response results, enabling the USB host controller to skip some invalid polling microframes and initiate Complete-Split transactions closer to the actual completion of the target device's response. This reduces the high-speed bus bandwidth occupied by invalid Complete-Split transactions and unready responses, lowers the scheduling and interrupt handling burden on the host controller, improves Split transaction processing efficiency, and enhances the overall response performance of low-speed or full-speed USB devices communicating via high-speed hubs.

[0151] Corresponding to Figure 1 The adaptive predictive USB Split transaction processing method in this disclosure also provides an electronic device 300, such as... Figure 3 The diagram shown is a structural schematic of an electronic device 300 provided in an embodiment of this disclosure, including:

[0152] Processor 31, memory 32, and bus 33; memory 32 is used to store execution instructions, including main memory 321 and external memory 322; the main memory 321, also called internal memory, is used to temporarily store the computational data in processor 31, as well as the data exchanged with external memory 322 such as hard disk. Processor 31 exchanges data with external memory 322 through main memory 321. When the electronic device 300 is running, processor 31 and memory 32 communicate through bus 33, enabling processor 31 to execute... Figure 1 The steps of the adaptive predictive USB Split transaction processing method.

[0153] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the adaptive predictive USB Split transaction processing method described in the above-described method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0154] This disclosure also provides a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, they can perform the steps of the adaptive predictive USBSplit transaction processing method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0155] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0156] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0157] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0158] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0159] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0160] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for adaptive prediction USB split transaction, characterized in that, include: When it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub, the device response feature information corresponding to the target USB device is obtained. Based on the device response characteristic information, the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction is determined; After sending a Start-Split transaction to the high-speed hub, a Complete-Split transaction is initiated according to the predicted Complete-Split scheduling timing to obtain the transaction response data returned by the target USB device via the transaction translator; Based on the actual response results of this Split transaction, the device response feature information is updated so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.

2. The method of claim 1, wherein, The device response characteristic information includes device profile information; The device profile information includes at least device identification information, port information, endpoint information, response latency statistics, predicted trust level information, and scheduling priority information; The response latency statistics are used to characterize the historical microframe offset features of the target USB device after the Start-Split transaction to generate a valid Complete-Split response, and the prediction confidence information is used to characterize the reliability of Complete-Split scheduling prediction based on the response latency statistics.

3. The method of claim 2, wherein, Obtaining device response feature information corresponding to the target USB device specifically includes: Obtain the device address, endpoint address, hub port number, and device type information of the target USB device; Based on the device address, endpoint address, hub port number, and device type information, query the corresponding device file information in the device file database; When the corresponding device file information is found, the response latency statistics and predicted trust information in the device file information are read. If no corresponding device file information is found, an initial device file is created for the target USB device, and the scheduling priority is determined based on the device type information of the target USB device.

4. The method of claim 2, wherein, Based on the device response characteristic information, the predicted Complete-Split scheduling timing of the target USB device after sending the Start-Split transaction is determined, specifically including: Based on the predicted trust information, the Split transaction scheduling mode corresponding to the target USB device is determined; Based on the Split transaction scheduling mode and the response delay statistics, the micro-frames for sending the Complete-Split transaction are determined. The Split transaction scheduling modes include cold start scheduling mode, learning scheduling mode, and fully predictive scheduling mode.

5. The method of claim 4, wherein, Determining the Split transaction scheduling mode corresponding to the target USB device specifically includes: When the predicted trust information meets the first trust condition, a cold start scheduling mode is adopted, and a Complete-Split transaction is initiated after the Start-Split transaction according to a preset continuous polling strategy. When the predicted trust information meets the second trust condition, the learning scheduling mode is adopted, and the Complete-Split transaction is initiated at least one microframe ahead of time based on the average response microframe information of the target USB device. When the predicted trust information meets the third trust condition, the full prediction scheduling mode is adopted, and the target Complete-Split transmission microframe is determined based on the average response microframe information of the target USB device. The trust level corresponding to the third trust level condition is higher than the trust level corresponding to the second trust level condition, and the trust level corresponding to the second trust level condition is higher than the trust level corresponding to the first trust level condition.

6. The method of claim 5, wherein, In the fully predictive scheduling mode, determining the target Complete-Split microframe to be sent specifically includes: Obtain the microframe information for the Start-Split transaction; Based on the sending microframe information of the Start-Split transaction and the average response microframe information, determine the target Complete-Split sending microframe; The window offset is determined based on the response fluctuation information in the response delay statistics. Based on the target Complete-Split microframe and the window offset, a predictive scheduling window is determined, and a Complete-Split transaction is initiated within the microframe range corresponding to the predictive scheduling window.

7. The method of claim 1, wherein, Based on the actual response results of this Split transaction, the device response characteristic information is updated, specifically including: Receive the response result returned by the high-speed hub based on the Complete-Split transaction, the response result including valid data response, not ready response, error response or timeout response; When the response result is a valid data response, the actual response microframe offset between the current Start-Split transaction and the valid Complete-Split response is recorded, and the sampling history window, average response microframe information, response fluctuation information and prediction confidence information are updated based on the actual response microframe offset. When the response result is not ready, determine whether to continue initiating the Complete-Split transaction based on the current Split transaction scheduling mode; When the response result is an error response or a timeout response, the abnormal event is recorded, and the predicted trust information corresponding to the target USB device is adjusted according to the abnormal event.

8. The method of claim 7, wherein, Determine whether to continue initiating the Complete-Split transaction based on the current Split transaction scheduling mode, specifically including: In cold start scheduling mode, Complete-Split transactions are initiated again in subsequent microframes according to the preset maximum number of retries; In the learning-based scheduling mode, Complete-Split transactions are initiated again in subsequent microframes according to the number of learning retries, and the corresponding actual response microframe information is recorded. In full prediction scheduling mode, it is determined whether the current microframe exceeds the latest microframe of the prediction scheduling window. If it does not exceed the latest microframe, the Complete-Split transaction is initiated in the subsequent microframe. If it exceeds the latest microframe, the prediction is determined to have failed, and the prediction confidence is reduced based on the prediction failure result.

9. The method of claim 1, wherein, The method further includes: When multiple USB devices are waiting to initiate Complete-Split transactions within the same scheduling microframe, obtain the scheduling priority of each USB device and predict the Complete-Split scheduling timing. Based on the scheduling priority and the predicted Complete-Split scheduling timing, multiple Complete-Split transactions to be initiated are sorted and merged to generate a batch of Complete-Split requests; Send the batch Complete-Split request to the high-speed hub; Receive the batch Complete-Split response returned by the high-speed hub, and determine the response result corresponding to each USB device based on the batch Complete-Split response.

10. An adaptive predictive USB split transaction apparatus, comprising: include: The feature acquisition module is used to acquire device response feature information corresponding to the target USB device when it is detected that the target USB device needs to perform Split transaction communication through the transaction translator of the high-speed hub; The scheduling timing determination module is used to determine the predicted Complete-Split scheduling timing of the target USB device after sending a Start-Split transaction based on the device response characteristic information. The transaction response acquisition module is used to send a Start-Split transaction to the high-speed hub, and then initiate a Complete-Split transaction according to the predicted Complete-Split scheduling time to obtain the transaction response data returned by the target USB device via the transaction translator. The feature update module is used to update the device response feature information based on the actual response result of the current Split transaction, so that subsequent Split transactions can be adaptively scheduled based on the updated device response feature information.