Interrupt transmission method, device, equipment, medium and program product

By using the frame count value as the time benchmark, the problems of USB endpoint interrupt transmission resource waste and inaccurate timing are solved, and more efficient and accurate interrupt transmission is achieved.

CN120670351APending Publication Date: 2025-09-19XIAN UNISOC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510554990.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In the prior art, a software timer needs to be set for each USB endpoint to interrupt transmission, resulting in resource waste and inaccurate timing.

Method used

The frame count value is used as the time base to determine whether to interrupt transmission through the target endpoint, reducing resource consumption and improving timing accuracy.

Benefits of technology

It reduces resource consumption, improves task processing efficiency and the accuracy of interrupt transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670351A_ABST
    Figure CN120670351A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interrupt transmission method and device, equipment, a medium and a program product. The method comprises the following steps: a universal serial bus (USB) host acquires a polling frame count value corresponding to at least one processing endpoint; determining the minimum count value in the polling frame count values corresponding to the at least one processing endpoint as a target polling frame count value, and determining the processing endpoint corresponding to the target polling frame count value as a target endpoint; when it is determined that the target polling frame count value is matched with the frame count value in the register, transmission is interrupted through the target endpoint and the USB device, and according to the polling interval corresponding to the target endpoint, the polling frame count value corresponding to the target endpoint is updated; the frame count value represents the number of frame start packets sent by the USB host. According to the method provided by the embodiment of the invention, the resource consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of communication technologies, and in particular to an interrupt transmission method, apparatus, device, medium, and program product. Background Art

[0002] During the interrupt transmission process, for each endpoint of the USB device, a Universal Serial Bus (USB) host can actively poll the USB device based on the interrupt interval corresponding to the endpoint to check whether the USB device has data to be transmitted.

[0003] In the related art, for each endpoint, the USB host can configure a software timer for the endpoint. When the timing duration reaches the interrupt interval, the software timer can use an interrupt method to trigger the USB host to interrupt the transmission to the USB device through the endpoint.

[0004] However, the method in the related art requires setting a software timer for each endpoint, which results in a problem of wasting resources. Summary of the Invention

[0005] The embodiments of the present application provide an interrupt transmission method, apparatus, device, medium, and program product, which can use the frame count value of a register as a time reference to determine whether to perform interrupt transmission through a target endpoint, thereby reducing resource consumption.

[0006] In a first aspect, an embodiment of the present application provides an interrupt transmission method, which is applied to a universal serial bus (USB) host. The method includes:

[0007] Obtaining a polling frame count value corresponding to at least one processing endpoint;

[0008] Determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint;

[0009] When it is determined that the target polling frame count value matches the frame count value in the register, interrupt transmission is performed with the USB device through the target endpoint, and the polling frame count value corresponding to the target endpoint is updated according to the polling interval corresponding to the target endpoint; the frame count value represents the number of frame start packets sent by the USB host.

[0010] In one implementation, obtaining a polling frame count value corresponding to at least one processing endpoint includes:

[0011] For any endpoint to be processed, when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value, the endpoint to be processed is determined as the processing endpoint;

[0012] Get the polling interval corresponding to the processing endpoint;

[0013] The sum of the preset frame count value and the polling interval corresponding to the processing endpoint is determined as the polling frame count value corresponding to the processing endpoint.

[0014] In one implementation, obtaining the polling interval corresponding to the processing endpoint includes:

[0015] Get the interrupt interval corresponding to the processing endpoint;

[0016] The polling interval corresponding to the processing endpoint is determined according to the interrupt interval corresponding to the processing endpoint and the speed type of the USB device.

[0017] In one implementation, updating the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint includes:

[0018] The sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint is determined as the polling frame count value corresponding to the target endpoint.

[0019] In one implementation, before determining the sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint as the polling frame count value corresponding to the target endpoint, the method includes:

[0020] The polling frame count value corresponding to the target endpoint is recorded as the previous polling frame count value.

[0021] In one implementation, when it is determined that the target polling frame count value matches the frame count value in the register, interrupt transmission is performed with the USB device through the target endpoint, and the polling frame count value corresponding to the target endpoint is updated according to the polling interval corresponding to the target endpoint, including:

[0022] Run the query thread and receive the target polling frame count value sent by the transmission thread;

[0023] Run the query thread, and when it is determined that the target polling frame count value matches the frame count value, trigger the transmission thread to perform interrupt transmission with the USB device through the target endpoint;

[0024] Run the transmission thread and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0025] In a second aspect, an embodiment of the present application provides an interrupt transmission device, which is applied to a universal serial bus (USB) host. The device includes:

[0026] An acquisition module, configured to acquire a polling frame count value corresponding to at least one processing endpoint;

[0027] a processing module, configured to determine a minimum count value among polling frame count values ​​corresponding to at least one processing endpoint as a target polling frame count value, and determine a processing endpoint corresponding to the target polling frame count value as a target endpoint;

[0028] The processing module is also used to interrupt the transmission with the USB device through the target endpoint when it is determined that the target polling frame count value matches the frame count value in the register, and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint; the frame count value represents the number of frame start packets sent by the USB host.

[0029] In one implementation, the acquisition module is specifically configured to:

[0030] For any endpoint to be processed, when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value, the endpoint to be processed is determined as the processing endpoint;

[0031] Get the polling interval corresponding to the processing endpoint;

[0032] The sum of the preset frame count value and the polling interval corresponding to the processing endpoint is determined as the polling frame count value corresponding to the processing endpoint.

[0033] In one implementation, the acquisition module is specifically configured to:

[0034] Get the interrupt interval corresponding to the processing endpoint;

[0035] The polling interval corresponding to the processing endpoint is determined according to the interrupt interval corresponding to the processing endpoint and the speed type of the USB device.

[0036] In one implementation, the processing module is specifically configured to:

[0037] The sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint is determined as the polling frame count value corresponding to the target endpoint.

[0038] In one implementation, the processing module is further configured to:

[0039] The polling frame count value corresponding to the target endpoint is recorded as the previous polling frame count value.

[0040] In one implementation, the processing module is specifically configured to:

[0041] Run the query thread and receive the target polling frame count value sent by the transmission thread;

[0042] Run the query thread, and when it is determined that the target polling frame count value matches the frame count value, trigger the transmission thread to perform interrupt transmission with the USB device through the target endpoint;

[0043] Run the transmission thread and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0044] In a third aspect, the present application provides a chip having a computer program stored thereon. When the computer program is executed by the chip, the method according to any one of the first aspects is implemented.

[0045] In a fourth aspect, the present application provides a chip module having a computer program stored thereon. When the computer program is executed by the chip module, the method according to any one of the first aspects is implemented.

[0046] In a fifth aspect, an embodiment of the present application provides a universal serial bus (USB) host, comprising: a memory and a processor;

[0047] Memory stores computer-executable instructions;

[0048] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to the first aspect.

[0049] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method of the first aspect.

[0050] In a seventh aspect, an embodiment of the present application provides a computer program product, comprising computer execution instructions, which, when executed by a processor, enable the method of the first aspect to be executed.

[0051] Embodiments of the present application provide an interrupt transmission method, apparatus, device, medium, and program product. In this method, a USB host can obtain a polling frame count value corresponding to at least one processing endpoint. The USB host can determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint. The USB host can perform an interrupt transmission with the USB device through the target endpoint when it determines that the target polling frame count value matches the frame count value in the register (the frame count value represents the number of frame start packets sent by the USB host), and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint. Compared to the related art, which requires consuming resources to set a software timer for each endpoint for timing, the embodiments of the present application can directly use the number of frame start packets sent by the USB host - the frame count value - as a time reference to measure whether an interrupt transmission is needed, thereby reducing resource consumption. In addition, compared to the related art, where the central processor in the USB host needs to frequently pause the current task to process the interrupt transmission triggered by the software timer due to the higher priority of the interrupt, the method of the embodiment of the present application uses a method of traversing the polling frame count values ​​corresponding to each processing endpoint, determining the minimum count value, and determining whether to trigger the USB host to interrupt transmission based on the minimum count value and the frame count value in the register, thereby improving the task processing efficiency of the USB host. In addition, compared to the related art method of using a software timer for timing, which has low timing accuracy and thus leads to inaccurate timing, the method of the embodiment of the present application uses the frame count value as the time reference, thereby improving the timing accuracy and thus improving the accuracy of interrupt transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0053] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0054] Figure 2a A flowchart of a first embodiment of an interrupt transmission method provided in an embodiment of the present application;

[0055] Figure 2b A schematic diagram of a scenario for determining a processing endpoint provided in an embodiment of the present application;

[0056] Figure 3 A flowchart of a second embodiment of an interrupt transmission method provided in an embodiment of the present application;

[0057] Figure 4a A flowchart of a third embodiment of an interrupt transmission method provided in an embodiment of the present application;

[0058] Figure 4b A schematic diagram of a USB host provided in an embodiment of the present application;

[0059] Figure 5 A schematic structural diagram of an interrupt transmission device provided by an exemplary embodiment of the present application;

[0060] Figure 6 A schematic diagram of the structure of the USB host provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0062] The terms "first," "second," "third," "fourth," etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential sequence. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations, are intended to cover non-exclusive inclusions, such as processes, methods, systems, products, or devices that include a series of steps or units are not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0063] In this application, "at least one" refers to one or more, and "a plurality" refers to two or more. Furthermore, in this application, "equal to" can be used in conjunction with "greater than" or "less than." When "equal to" and "greater than" are used together, the technical solution of "greater than" is adopted; when "equal to" and "less than" are used together, the technical solution of "less than" is adopted.

[0064] Glossary:

[0065] Universal Serial Bus (USB) host: A USB controller that controls the USB bus and manages communication with USB devices connected to the bus.

[0066] Interrupt transfer: The USB host actively polls the USB device at intervals not exceeding a certain value to check if it has data to transfer. Interrupt transfer is used for small batches of non-continuous data transfers and is typically used in applications with small data volumes and high real-time requirements, such as USB mouse, keyboard, and other human-computer interaction devices.

[0067] Interrupt interval: The bInterval field in the endpoint descriptor of the USB device records the value of the interrupt interval. For example, the interrupt interval can be 3.

[0068] Figure 1 For a schematic diagram of an application scenario provided by an embodiment of the present application, please see Figure 1 , the application scenario includes a USB host 10 and a USB device 20. The USB device 20 may include multiple endpoints (Endpoint, referred to as ep), exemplarily, Figure 1 The USB device 20 is shown to include ep1, ep2, ep3, and ep4.

[0069] In this application scenario:

[0070] With the Mentor USBIP (MUSBIP), a USB controller intellectual property (IP) core, the USB host can directly write the interrupt interval corresponding to each endpoint of the USB device into the hardware registers of each endpoint (such as the register that records the interrupt interval of the receiving endpoint (tx interval) and the register that records the interrupt interval of the transmitting endpoint (rx interval)). The hardware timer can count the time, and when the timer reaches the interrupt interval, it uses an interrupt to trigger the USB host (the central processing unit in the USB host), pausing the currently executing task and allowing data transmission.

[0071] However, for another USB controller IP core, DesignWare USB 2.0 IP (DWC2IP for short), the USB host does not have a hardware timer that matches the number of endpoints for timing, so a software timer is needed for timing.

[0072] In the related art, for each endpoint, the USB host configures a software timer for the endpoint to perform timing. When the timing duration reaches the interrupt interval, the software timer can use an interrupt method to trigger the USB host to interrupt transmission to the USB device through the endpoint.

[0073] However, the method in the related art requires setting a software timer for each endpoint, which results in a problem of wasting resources.

[0074] Based on the above technical problems, an embodiment of the present application provides an interrupt transmission method, which directly uses the number of frame start packets sent by the USB host - the frame count value, as a time reference to determine whether to perform interrupt transmission through the target endpoint, thereby reducing resource consumption.

[0075] The technical solutions shown in this application are described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeated in different embodiments.

[0076] Figure 2a This is a flow chart of an embodiment of the present application's interrupt transmission method. Figure 2a , the method may include:

[0077] S201: Obtain a polling frame count value corresponding to at least one processing endpoint.

[0078] In this embodiment, the USB host may obtain a polling frame count value corresponding to at least one processing endpoint.

[0079] In one implementation:

[0080] A USB device includes multiple endpoints to be processed.

[0081] For any endpoint to be processed, the USB host can obtain a preset frame count value corresponding to the endpoint to be processed.

[0082] It should be noted that the preset frame count value refers to a frame count value preset by a user that triggers the USB host to determine the endpoint to be processed as the processing endpoint (the frame count value in the register).

[0083] The USB host may determine the endpoint to be processed as the processing endpoint when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value.

[0084] The USB host can obtain the polling interval corresponding to the processing endpoint.

[0085] The USB host may determine the sum of the preset frame count value corresponding to the processing endpoint and the polling interval corresponding to the processing endpoint as the polling frame count value corresponding to the processing endpoint.

[0086] It should be noted that the polling interval refers to the number of frame start packets between two interrupt transmissions by the USB host through the processing endpoint. In other words, the polling interval refers to the difference between two frame count values. One frame count value can be the frame count value in the register when the USB host performs an interrupt transmission through the processing endpoint. The other frame count value can be the frame count value in the register when the USB host last performs an interrupt transmission through the processing endpoint.

[0087] The following describes the reason why the USB host can determine the endpoint to be processed as the processing endpoint when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value.

[0088] The USB host includes a register (such as a host frame number (HFNUM) register), in which a frame count value is recorded.

[0089] The interval between two Start of Frame packets sent by the USB host can be 1 frame or 1 microframe. It should be noted that when the speed type of the USB device is high-speed, the interval between two Start of Frame packets sent by the USB host can be 1 microframe (1 microframe is 125 microseconds); when the speed type of the USB device is low-speed or full-speed, the interval between two Start of Frame packets sent by the USB host can be 1 frame (1 frame is 1 millisecond).

[0090] After sending a Start of Frame packet to a USB device, the USB host can increment the frame count by 1. In other words, the frame count represents the number of Start of Frame packets sent by the USB host. In other words, the frame count reflects the duration between the time the USB host sent its first Start of Frame packet and the current time (the duration is the product of the frame count and one frame (or one microframe)). Therefore, the USB host can use the frame count in the register as a time reference for timing.

[0091] In the case where the USB host can use the frame count value as a time reference for timing, the USB host can determine the endpoint to be processed as the processing endpoint when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value.

[0092] S202: Determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0093] In this embodiment, after obtaining the polling frame count value corresponding to at least one processing endpoint, the USB host may determine the minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint as the target polling frame count value.

[0094] In one implementation, the USB host may sort the polling frame count values ​​corresponding to the at least one processing endpoint in ascending order to obtain a sorting sequence number for each polling frame count value. The USB host may determine the polling frame count value with the smallest sorting sequence number as the target polling frame count value.

[0095] In addition, after determining the target polling frame count value, the USB host may determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0096] It should be noted that the USB host determines a pending endpoint as a processing endpoint and determines the polling frame count value corresponding to the processing endpoint when it determines that the preset frame count value corresponding to the pending endpoint matches the frame count value. Therefore, if the preset frame count values ​​corresponding to multiple pending endpoints are different, the USB host can determine each pending endpoint as a processing endpoint at different frame count values ​​and obtain the polling frame count value corresponding to the processing endpoint. In other words, the USB host obtains the polling frame count value corresponding to each processing endpoint at different times. After obtaining the polling frame count value corresponding to at least one processing endpoint, the USB host can directly determine the minimum count value among the polling frame count values ​​corresponding to all processing endpoints (the total number of processing endpoints is at least one) as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0097] Figure 2b A schematic diagram of a scenario for determining a processing endpoint provided in an embodiment of the present application. Figure 2b For example, the preset frame count value corresponding to ep1 is 20, the preset frame count value corresponding to ep2 is 30, the preset frame count value corresponding to ep3 is 40, and the preset frame count value corresponding to ep4 is 50:

[0098] The USB host may determine ep1 as a processing endpoint when the frame count value is 20 (the preset frame count value corresponding to ep1 matches the frame count value). The USB host may determine ep2 as a processing endpoint when the frame count value is 30 (the preset frame count value corresponding to ep2 matches the frame count value). The USB host may determine ep3 as a processing endpoint when the frame count value is 40 (the preset frame count value corresponding to ep3 matches the frame count value). The USB host may determine ep4 as a processing endpoint when the frame count value is 50 (the preset frame count value corresponding to ep4 matches the frame count value).

[0099] Based on the above, we can know that:

[0100] When the frame count value is greater than or equal to 20 and less than 30, the at least one processing endpoint includes ep1. The USB host may determine the minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint (the polling frame count value corresponding to ep1) as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0101] When the frame count value is greater than or equal to 30 and less than 40, the at least one processing endpoint includes ep1 and ep2. The USB host may determine the minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint (the polling frame count value corresponding to ep1 and the polling frame count value corresponding to ep2) as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0102] When the frame count value is greater than or equal to 40 and less than 50, the at least one processing endpoint includes ep1, ep2, and ep3. The USB host may determine the minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint (the polling frame count value corresponding to ep1, the polling frame count value corresponding to ep2, and the polling frame count value corresponding to ep3) as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0103] When the frame count value is greater than or equal to 50, the at least one processing endpoint includes ep1, ep2, ep3, and ep4. The USB host may determine a minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint (the polling frame count value corresponding to ep1, the polling frame count value corresponding to ep2, the polling frame count value corresponding to ep3, and the polling frame count value corresponding to ep4) as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0104] S203: When it is determined that the target polling frame count value matches the frame count value in the register, interrupt transmission is performed with the USB device through the target endpoint, and the polling frame count value corresponding to the target endpoint is updated according to the polling interval corresponding to the target endpoint.

[0105] In this embodiment, after obtaining the target polling frame count value, the USB host may monitor the frame count value in the register.

[0106] The USB host can determine whether the target polling frame count value matches the frame count value in the register.

[0107] If not, the USB host continues to monitor the frame count value in the register until the USB host determines that the target polling frame count value matches the frame count value.

[0108] If so, the USB host can perform interrupt transmission with the USB device through the target endpoint.

[0109] After the USB host performs interrupt transmission with the USB device through the target endpoint, it can update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0110] In one implementation, the USB host may determine the sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint as the polling frame count value corresponding to the target endpoint.

[0111] In addition, in one implementation, the USB host may record the polling frame count value corresponding to the target endpoint as the previous polling frame count value before determining the sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint as the polling frame count value corresponding to the target endpoint. Recording the previous polling frame count value facilitates subsequent troubleshooting.

[0112] It should also be noted that after executing S203, the USB host can return to execute S201, so as to obtain a new polling frame count value corresponding to at least one new processing endpoint (when the polling frame count value corresponding to the target endpoint is updated, and / or there is at least one endpoint to be processed that is determined as a processing endpoint and the polling frame count value corresponding to the processing endpoint is obtained), and re-determine a new target polling frame count value from the polling frame count value corresponding to the new at least one processing endpoint, and when the new target polling frame count value matches the frame count value in the register, interrupt transmission is performed through the new target endpoint (the processing endpoint corresponding to the new target polling frame count value).

[0113] Beneficial effects of this embodiment: In this method, the USB host can obtain the polling frame count value corresponding to at least one processing endpoint. The USB host can determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint. The USB host can interrupt the transmission with the USB device through the target endpoint when it determines that the target polling frame count value matches the frame count value in the register (the frame count value represents the number of frame start packets sent by the USB host), and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint. Compared with the related art, which requires consuming resources to set a software timer for each endpoint for timing, the embodiment of the present application can directly use the number of frame start packets sent by the USB host - the frame count value, as the time reference to measure whether the target polling frame count value is reached at the current moment, thereby reducing resource consumption. In addition, compared to the related art, where the central processing unit in the USB host needs to frequently pause the current task to process the interrupt transmission triggered by the software timer using the interrupt method due to the higher priority of the interrupt, the method of the embodiment of the present application uses a method of traversing the polling frame count values ​​corresponding to each processing endpoint, determining the minimum count value, and determining whether to trigger the USB host to interrupt transmission based on the minimum count value and the frame count value, thereby improving the task processing efficiency of the USB host. In addition, compared to the related art method of using a software timer for timing, which has low timing accuracy and thus leads to inaccurate timing, the method of the embodiment of the present application uses the frame count value as the time reference, thereby improving the timing accuracy and thus improving the accuracy of interrupt transmission.

[0114] Figure 3 A flowchart of a second embodiment of an interrupt transmission method provided in an embodiment of the present application.

[0115] See Figure 3 , the method may include:

[0116] S301: For any endpoint to be processed, when it is determined that a preset frame count value corresponding to the endpoint to be processed matches a frame count value, the endpoint to be processed is determined as a processing endpoint.

[0117] In this embodiment, the USB device includes multiple endpoints to be processed. Exemplarily, the USB device includes 32 endpoints to be processed.

[0118] For any endpoint to be processed, the USB host can obtain a preset frame count value corresponding to the endpoint to be processed. In one implementation, the USB host can obtain a preset frame count value corresponding to the endpoint to be processed that is pre-entered by a user.

[0119] The USB host may determine the endpoint to be processed as the processing endpoint when it is determined that the preset frame count value matches the frame count value in the register.

[0120] Exemplarily, the endpoints to be processed include ep1, ep2, ep3, and ep4. The preset frame count value corresponding to ep1 is 20, the preset frame count value corresponding to ep2 is 30, the preset frame count value corresponding to ep3 is 40, and the preset frame count value corresponding to ep4 is 50.

[0121] The USB host may determine that the preset frame count value corresponding to ep1 matches the frame count value when the frame count value is 20. The USB host may determine ep1 as a processing endpoint.

[0122] The USB host may determine that the preset frame count value corresponding to ep2 matches the frame count value when the frame count value is 30. The USB host may determine ep2 as a processing endpoint.

[0123] The USB host may determine that the preset frame count value corresponding to ep1 matches the frame count value when the frame count value is 40. The USB host may determine ep3 as the processing endpoint.

[0124] The USB host may determine that the preset frame count value corresponding to ep2 matches the frame count value when the frame count value is 50. The USB host may determine ep4 as the processing endpoint.

[0125] S302: Obtain the polling interval corresponding to the processing endpoint.

[0126] In this embodiment, the USB host can obtain the polling interval corresponding to the processing endpoint.

[0127] In one implementation:

[0128] A USB host can obtain the interrupt interval corresponding to a processed endpoint. In one implementation, the USB device's device information includes an endpoint descriptor corresponding to each pending endpoint. The bInterval field in the endpoint descriptor records the interrupt interval corresponding to the pending endpoint. After determining the pending endpoint as a processing endpoint, the USB host can query the USB device's device information to obtain the interrupt interval corresponding to the processing endpoint.

[0129] The USB host can determine the polling interval corresponding to the processing endpoint according to the interrupt interval corresponding to the processing endpoint and the speed type of the USB device.

[0130] In one implementation, when the speed type of the USB device is high speed, the USB host may determine that the polling interval corresponding to the processing endpoint is 2 binterval-1It should be noted that the polling interval refers to the number of frame start packets between two interrupt transmissions by the USB host through a processing endpoint. The polling interval can be 2 binterval-1 microframes. It should also be noted that binterval represents the value of the interrupt interval. It should also be noted that in one implementation, when the speed type of the USB device is high-speed type, binterval can be a positive integer greater than or equal to 1 and less than or equal to 16.

[0131] For example, Table 1 is a table of information about interruption intervals and polling intervals for processing endpoints.

[0132] As shown in Table 1, the USB host can obtain the interruption interval 3 corresponding to ep1. The USB host can determine that the polling interval corresponding to the processing endpoint is 4 based on the interruption interval 3 corresponding to ep1 and the high-speed speed type of the USB device.

[0133] The USB host can obtain the interruption interval 7 corresponding to ep2. The USB host can determine that the polling interval corresponding to ep2 is 64 according to the interruption interval 7 corresponding to ep2 and the high-speed type of the USB device.

[0134] The USB host can obtain the interruption interval 6 corresponding to ep3. The USB host can determine that the polling interval corresponding to ep3 is 32 according to the interruption interval 6 corresponding to ep3 and the high-speed type of the USB device.

[0135] The USB host can obtain the interruption interval 5 corresponding to ep4. The USB host can determine that the polling interval corresponding to ep4 is 16 according to the interruption interval 5 corresponding to ep4 and the high-speed type of the USB device.

[0136] Table 1 Processing endpoint interruption interval, polling interval information table

[0137] Processing endpoints Interruption interval Polling interval ep1 3 4 ep2 7 64 ep3 6 32 ep4 5 16

[0138] In one implementation, when the speed type of the USB device is a low-speed type or a full-speed type, the USB host can determine that the polling interval corresponding to the processing endpoint is binterval. It should be noted that the polling interval refers to the number of frame start packets that are separated by two interrupt transmissions by the USB host through a processing endpoint. The duration corresponding to the polling interval can be binterval frames. It should also be noted that binterval represents the numerical value of the interrupt interval. It should also be noted that in one implementation, when the speed type of the USB device is a low-speed type or a full-speed type, binterval can be a positive integer greater than or equal to 1 and less than or equal to 255.

[0139] S303: Determine the sum of the preset frame count value and the polling interval corresponding to the processing endpoint as the polling frame count value corresponding to the processing endpoint.

[0140] In this embodiment, after determining the polling interval corresponding to the processing endpoint, the USB host may determine the sum of the preset frame count value and the polling interval corresponding to the processing endpoint as the polling frame count value corresponding to the processing endpoint.

[0141] Illustratively, the USB host may determine that the polling frame count value corresponding to ep1 is 24, the USB host may determine that the polling frame count value corresponding to ep2 is 94, the USB host may determine that the polling frame count value corresponding to ep3 is 72, and the USB host may determine that the polling frame count value corresponding to ep4 is 66.

[0142] S304: Determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0143] In this embodiment, after determining the polling frame count value corresponding to at least one processing endpoint, the USB host can determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0144] It should be noted that the USB host determines the minimum count value among the polling frame count values ​​corresponding to all processing endpoints as the target polling frame count value.

[0145] The specific implementation process is the same as S202 and will not be repeated here.

[0146] S305: When it is determined that the target polling frame count value matches the frame count value in the register, interrupt transmission is performed with the USB device through the target endpoint, and the polling frame count value corresponding to the target endpoint is updated according to the polling interval corresponding to the target endpoint.

[0147] In this embodiment, the USB host can interrupt the transmission with the USB device through the target endpoint when it determines that the target polling frame count value matches the frame count value in the register, and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0148] The specific implementation process is the same as S203 and will not be repeated here.

[0149] In addition, it should be noted that after executing S305 , the USB host may return to execute S301 to determine whether a preset frame count value corresponding to the endpoint to be processed matches the frame count value, and then determine a new processing endpoint.

[0150] Beneficial effects of this embodiment: In this embodiment, the USB host can determine a pending endpoint as a processing endpoint if the preset frame count value corresponding to the pending endpoint matches the frame count value, and determine the sum of the preset frame count value corresponding to the processing endpoint and the polling interval as the polling frame count value corresponding to the processing endpoint. The method of this embodiment avoids directly determining all pending endpoints as processing endpoints, improves the accuracy of determining processing endpoints, and further improves the accuracy and efficiency of determining the target polling frame count value based on the polling frame count value corresponding to at least one processing endpoint.

[0151] Figure 4a This is a flow chart of the third embodiment of the interrupt transmission method provided by the present application. Figure 4a , the method may include:

[0152] S401: Run a transmission thread to obtain a polling frame count value corresponding to at least one processing endpoint.

[0153] In this embodiment, Figure 4b Schematic diagram of a USB host provided in an embodiment of the present application. Figure 4b As shown, the USB host can run a transfer thread and a query thread.

[0154] The USB host runs a transmission thread and can obtain a polling frame count value corresponding to at least one processing endpoint.

[0155] S402: Run a transmission thread, determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint.

[0156] In this embodiment, the USB host runs a transmission thread and determines the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value.

[0157] In one implementation, the USB host runs a transmission thread and sorts the polling frame count values ​​corresponding to at least one processing endpoint in ascending order to obtain a sorting sequence number for each polling frame count value. The USB host runs the transmission thread and determines the polling frame count value with the smallest sorting sequence number as the target polling frame count value.

[0158] In addition, the USB host runs a transmission thread and determines that the processing endpoint corresponding to the target polling frame count value is the target endpoint.

[0159] S403: Run the query thread and receive the target polling frame count value sent by the transmission thread.

[0160] In this embodiment, the USB host runs a transfer thread and sends a target polling frame count value to the query thread. In one implementation, the USB host may also run a transfer thread and send the target endpoint corresponding to the target polling frame count value to the query thread. It is understood that the USB host runs a transfer thread and sends the identifier of the target endpoint to the query thread. The identifier of the target endpoint may be a serial number of the target endpoint or another identifier that reflects the identity information of the target endpoint.

[0161] Accordingly, the USB host runs a query thread to receive the target polling frame count value sent by the transmission thread. In one implementation, the USB host may also run a query thread to obtain the target endpoint sent by the transmission thread.

[0162] S404: Run the query thread, and when it is determined that the target polling frame count value matches the frame count value, trigger the transmission thread to perform interrupt transmission with the USB device through the target endpoint.

[0163] In this embodiment, the USB host runs a query thread, monitors the frame count value in the register, and determines whether the target polling frame count value matches the frame count value.

[0164] If not, the USB host runs the query thread and continues to monitor the frame count value in the register.

[0165] If so, the USB host runs the query thread, triggering the transfer thread to perform interrupt transfer with the USB device through the target endpoint.

[0166] In one implementation, the USB host runs a query thread and, upon determining that a target polling frame count value matches a frame count value in a register, sends a target endpoint identifier to the transfer thread. The USB host runs a transfer thread and, based on the target endpoint identifier, performs an interrupt transfer with the USB device via the target endpoint.

[0167] In one implementation, the USB host runs a query thread and, upon determining that the target polling frame count matches the frame count in the register, sends a transfer request to the transfer thread. The USB host runs a transfer thread and, in response to the transfer request, directly performs an interrupt transfer with the USB device via the target endpoint.

[0168] S405: Run the transmission thread and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0169] In this embodiment, after the interrupt transmission is performed with the USB device via the target endpoint, the USB host runs a transmission thread and updates the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0170] It should be noted that after executing S405 , the USB host may return to execute S401 .

[0171] Below, taking the USB device of high-speed type and including four endpoints to be processed, namely ep1, ep2, ep3 and ep4 as an example, the interrupt transmission process is illustrated according to the time sequence of the frame count value in the register increasing from 0 to 66.

[0172] For any pending endpoint, the USB host can run a transfer thread to obtain the preset frame count value corresponding to the pending endpoint. For example, the preset frame count value corresponding to ep1 is 20, the preset frame count value corresponding to ep2 is 30, the preset frame count value corresponding to ep3 is 40, and the preset frame count value corresponding to ep4 is 50.

[0173] When the frame count value reaches 20 (frame_count=20), the USB host runs the transmission thread. When it is determined that the preset frame count value (20) corresponding to the endpoint to be processed (ep1) matches the frame count value, the endpoint to be processed (ep1) is determined as the processing endpoint, and the polling interval (4) corresponding to ep1 is obtained. The sum of the preset frame count value corresponding to ep1 and the polling interval corresponding to ep1 is determined as the polling frame count value (24) corresponding to ep1. It should be noted that the polling interval corresponding to ep1 is determined by the USB host running the transmission thread based on the interrupt interval (3) corresponding to ep1 obtained and the speed type of the USB device.

[0174] Illustratively, Table 2 is an information table (1) of processing endpoints.

[0175] Table 2 Processing endpoint information table (1)

[0176] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 none 24

[0177] The USB host runs a transmission thread, determines the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint (the polling frame count value (24) corresponding to ep1) as the target polling frame count value (24), and determines the processing endpoint (ep1) corresponding to the target polling frame count value as the target endpoint.

[0178] The USB host runs the query thread to obtain the target polling frame count value (24) sent by the transmission thread.

[0179] When the frame count value is 24 (frame_count=24), the USB host runs the query thread, and when it determines that the target polling frame count value (24) matches the frame count value, it triggers the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0180] The USB host runs a transmission thread, and after interrupting the transmission with the USB device through the target endpoint (ep1), records the polling frame count value corresponding to the target endpoint (ep1) as the previous polling frame count value (24) according to the polling interval (4) corresponding to the target endpoint (ep1).

[0181] The USB host runs a transmission thread and updates the polling frame count value corresponding to the target endpoint (ep1) according to the polling interval (4) corresponding to the target endpoint (ep1) to obtain the polling frame count value (28) corresponding to ep1.

[0182] For example, Table 3 is the information table (II) of the processing endpoint.

[0183] Table 3 Processing endpoint information table (II)

[0184] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 24 28

[0185] The USB host runs a transmission thread and, after updating a polling frame count value corresponding to at least one processing endpoint (here, updating the polling frame count value corresponding to ep1), can obtain a polling frame count value corresponding to at least one processing endpoint. The USB host runs a transmission thread and can determine a minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint (the polling frame count value (28) corresponding to ep1) as a target polling frame count value, and determine the processing endpoint (ep1) corresponding to the target polling frame count value as a target endpoint.

[0186] The USB host runs the query thread to obtain the target polling frame count value (28) sent by the transmission thread.

[0187] When the frame count value is 28 (frame_count=28), the USB host runs the query thread, and when it is determined that the target polling frame count value (28) matches the frame count value (28), the transmission thread is triggered to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0188] The USB host runs a transmission thread, and after interrupting the transmission with the USB device through the target endpoint (ep1), records the polling frame count value corresponding to the target endpoint as the previous polling frame count value (28) according to the polling interval (4) corresponding to the target endpoint.

[0189] The USB host runs a transmission thread and updates the polling frame count value corresponding to the target endpoint (ep1) according to the polling interval (4) corresponding to the target endpoint (ep1) to obtain the polling frame count value (32) corresponding to ep1.

[0190] For example, Table 4 is an information table (III) of processing endpoints.

[0191] Table 4 Processing endpoint information table (3)

[0192] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 28 32

[0193] The USB host runs a transmission thread, and after updating the polling frame count value corresponding to at least one processing endpoint (here, the polling frame count value corresponding to ep1 is updated), determines the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint (the polling frame count value (32) corresponding to ep1) as the target polling frame count value (32), and determines the processing endpoint (ep1) corresponding to the target polling frame count value as the target endpoint.

[0194] The USB host runs the query thread to obtain the target polling frame count value (32) sent by the transmission thread.

[0195] When the frame count value reaches 30 (frame_count=30), the USB host runs the transmission thread. Upon determining that the preset frame count value (30) corresponding to the pending endpoint, ep2, matches the frame count value (30), the USB host determines the pending endpoint, ep2, as the processing endpoint. The USB host runs the transmission thread and can determine the polling frame count value (94) corresponding to the processing endpoint (ep2). It should be noted that, at this point, both ep1 and ep2 are processing endpoints.

[0196] For example, Table 5 is an information table (four) of processing endpoints.

[0197] Table 5 Processing endpoint information table (IV)

[0198] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 28 32 ep2 7 64 none 94

[0199] The USB host runs a transmission thread, and after updating the polling frame count value corresponding to at least one processing endpoint (here, the polling frame count value corresponding to ep2 is attributed to the polling frame count value corresponding to at least one processing endpoint), the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint (the polling frame count value (32) corresponding to ep1 and the polling frame count value (94) corresponding to ep2) is determined as the target polling frame count value (32), and the processing endpoint (ep1) corresponding to the target polling frame count value is determined as the target endpoint.

[0200] The USB host runs the query thread to obtain the target polling frame count value (32) sent by the transmission thread.

[0201] When the frame count value is 32 (frame_count=32), the USB host runs the query thread, and when it determines that the target polling frame count value (32) matches the frame count value, it triggers the transmission thread to interrupt the transmission with the USB device through the target endpoint (ep1).

[0202] When the frame count value reaches 36 (frame_count=36), the USB host runs the query thread, triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0203] When the frame count reaches 40 (frame_count=40), the USB host runs the transfer thread and determines the pending endpoint, ep3, as the processing endpoint. The USB host runs the transfer thread and determines the polling frame count (72) corresponding to ep3. It should be noted that at this point, ep1, ep2, and ep3 are all processing endpoints.

[0204] In addition, when the frame count value reaches 40 (frame_count=40), the USB host runs the query thread, triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0205] For example, Table 6 is an information table (five) of processing endpoints.

[0206] Table 6 Processing endpoint information table (V)

[0207] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 40 44 ep3 6 32 none 72 ep2 7 64 none 94

[0208] At the moment when the frame count value is 44 and the moment when the frame count value is 48, the USB host runs the query thread, triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0209] When the frame count value reaches 50, the USB host runs the transmission thread, determines the pending endpoint - ep4 as the processing endpoint, and determines the polling frame count value (66) corresponding to ep4. It should be noted that at this time, ep1, ep2, ep3, and ep4 are all processing endpoints.

[0210] For example, Table 7 is an information table (six) of processing endpoints.

[0211] Table 7 Processing endpoint information table (VI)

[0212] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 48 52 ep4 5 16 none 66 ep3 6 32 none 72 ep2 7 64 none 94

[0213] At the moment when the frame count value is 52, the moment when the frame count value is 56, the moment when the frame count value is 60, and the moment when the frame count value is 64, the USB host runs the query thread, triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep1).

[0214] When the frame count value is 66, the USB host runs the query thread, triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint (ep4).

[0215] In addition, the USB host runs the transmission thread, and after interrupting the transmission with the USB device through the target endpoint (ep4), the polling frame count value corresponding to the target endpoint (ep4) is recorded as the previous polling frame count value (66) according to the polling interval (16) corresponding to the target endpoint (ep4).

[0216] The USB host runs the transmission thread and updates the polling frame count value corresponding to the target endpoint (ep4) according to the polling interval (16) corresponding to the target endpoint (ep4) to obtain the polling frame count value (82) corresponding to ep4. For example, Table 8 is the information table (VII) for processing the endpoint.

[0217] Table 8 Processing endpoint information table (VII)

[0218] Processing endpoints Interruption interval Polling interval Last polling frame count value Polling frame count value ep1 3 4 64 68 ep3 6 32 none 72 ep4 5 16 66 82 ep2 7 64 none 94

[0219] Beneficial effects of this embodiment: In this embodiment, the USB host runs a transmission thread to obtain a polling frame count value corresponding to at least one processing endpoint. The USB host runs a transmission thread to determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determines that the processing endpoint corresponding to the target polling frame count value is the target endpoint. The USB host runs a query thread to obtain the target polling frame count value sent by the transmission thread. The USB host runs a query thread, and when it is determined that the target polling frame count value matches the frame count value, it triggers the transmission thread to perform an interrupt transmission with the USB device through the target endpoint. The USB host runs a transmission thread to update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint. In the embodiment of the present application, the transmission thread and the query thread are used to execute the interrupt transmission process, thereby reducing the resource consumption of the central processing unit.

[0220] Figure 5 This is a schematic diagram of the structure of an interrupt transmission device provided by an exemplary embodiment of the present application. The interrupt transmission device 50 is applied to a universal serial bus USB host. Figure 5 The interrupt transmission device 50 includes an acquisition module 51 and a processing module 52, wherein:

[0221] An acquisition module 51 is configured to acquire a polling frame count value corresponding to at least one processing endpoint;

[0222] The processing module 52 is configured to determine the minimum count value among the polling frame count values ​​corresponding to at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint;

[0223] The processing module 52 is further used to interrupt the transmission with the USB device through the target endpoint when it is determined that the target polling frame count value matches the frame count value in the register, and to update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint; the frame count value represents the number of frame start packets sent by the USB host.

[0224] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0225] In one implementation, the acquisition module 51 is specifically configured to:

[0226] For any endpoint to be processed, when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value, the endpoint to be processed is determined as the processing endpoint;

[0227] Get the polling interval corresponding to the processing endpoint;

[0228] The sum of the preset frame count value and the polling interval corresponding to the processing endpoint is determined as the polling frame count value corresponding to the processing endpoint.

[0229] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0230] In one implementation, the acquisition module 51 is specifically configured to:

[0231] Get the interrupt interval corresponding to the processing endpoint;

[0232] The polling interval corresponding to the processing endpoint is determined according to the interrupt interval corresponding to the processing endpoint and the speed type of the USB device.

[0233] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0234] In one implementation, the processing module 52 is specifically configured to:

[0235] The sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint is determined as the polling frame count value corresponding to the target endpoint.

[0236] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0237] In one implementation, the processing module 52 is further configured to:

[0238] The polling frame count value corresponding to the target endpoint is recorded as the previous polling frame count value.

[0239] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0240] In one implementation, the processing module 52 is specifically configured to:

[0241] Run the query thread and receive the target polling frame count value sent by the transmission thread;

[0242] Run the query thread, and when it is determined that the target polling frame count value matches the frame count value, trigger the transmission thread to perform interrupt transmission with the USB device through the target endpoint;

[0243] Run the transmission thread and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint.

[0244] The interrupt transmission device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0245] The present application also provides a chip, which can be a fifth generation mobile communication technology (5G) chip.

[0246] A computer program is stored on the chip, and when the computer program is executed by the chip, the method of the above method embodiment is implemented.

[0247] The embodiment of the present application further provides a chip module. It is understandable that the chip module can be a 5G chip module.

[0248] The chip module stores a computer program, and when the computer program is executed by the chip module, the method of the above method embodiment is implemented.

[0249] Figure 6This is a schematic diagram of the structure of the USB host provided in an embodiment of the present application. It can be understood that the USB host can be a 5G chip module.

[0250] See Figure 6 The USB host 60 may include a processor 61 and a memory 62. Exemplarily, the processor 61 and the memory 62 are interconnected via a bus 63.

[0251] Memory 62 stores computer-executable instructions;

[0252] The processor 61 executes the computer-executable instructions stored in the memory 62 , so that the processor 61 performs the method shown in the above method embodiment.

[0253] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-mentioned method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0254] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the method of the above-mentioned method embodiment is implemented.

[0255] Accordingly, an embodiment of the present application may also provide a computer program product, including computer-executable instructions. When the computer-executable instructions are executed by a processor, the method shown in the above method embodiment is executed.

[0256] These computer-executable instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0257] These computer-executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0258] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations.

[0259] In this application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". In this application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In this application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

Claims

1. An interrupt transmission method, characterized in that: Applied to a universal serial bus (USB) host, the method comprises: Obtaining a polling frame count value corresponding to at least one processing endpoint; Determine the minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint as the target polling frame count value, and determine the processing endpoint corresponding to the target polling frame count value as the target endpoint; When it is determined that the target polling frame count value matches the frame count value in the register, interrupt transmission is performed with the USB device through the target endpoint, and the polling frame count value corresponding to the target endpoint is updated according to the polling interval corresponding to the target endpoint; the frame count value represents the number of frame start packets sent by the USB host.

2. The method according to claim 1, characterized in that The obtaining of a polling frame count value corresponding to at least one processing endpoint includes: For any endpoint to be processed, when it is determined that the preset frame count value corresponding to the endpoint to be processed matches the frame count value, determining the endpoint to be processed as the processing endpoint; Obtaining the polling interval corresponding to the processing endpoint; The sum of the preset frame count value and the polling interval corresponding to the processing endpoint is determined as the polling frame count value corresponding to the processing endpoint.

3. The method according to claim 2, characterized in that The obtaining of the polling interval corresponding to the processing endpoint includes: Obtaining an interruption interval corresponding to the processing endpoint; The polling interval corresponding to the processing endpoint is determined according to the interrupt interval corresponding to the processing endpoint and the speed type of the USB device.

4. The method according to any one of claims 1 to 3, characterized in that The updating of the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint includes: The sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint is determined as the polling frame count value corresponding to the target endpoint.

5. The method according to claim 4, characterized in that Before determining the sum of the polling interval corresponding to the target endpoint and the polling frame count value corresponding to the target endpoint as the polling frame count value corresponding to the target endpoint, the method includes: The polling frame count value corresponding to the target endpoint is recorded as the previous polling frame count value.

6. The method according to any one of claims 1 to 5, characterized in that When it is determined that the target polling frame count value matches the frame count value in the register, interrupting the transmission with the USB device through the target endpoint, and updating the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint, including: Running a query thread to receive the target polling frame count value sent by the transmission thread; Running the query thread, and triggering the transmission thread to perform interrupt transmission with the USB device through the target endpoint when it is determined that the target polling frame count value matches the frame count value; The transmission thread is run, and a polling frame count value corresponding to the target endpoint is updated according to a polling interval corresponding to the target endpoint.

7. An interrupt transmission device, characterized in that: Applicable to a universal serial bus (USB) host, the device comprises: An acquisition module, configured to acquire a polling frame count value corresponding to at least one processing endpoint; a processing module, configured to determine a minimum count value among the polling frame count values ​​corresponding to the at least one processing endpoint as a target polling frame count value, and determine a processing endpoint corresponding to the target polling frame count value as a target endpoint; The processing module is further configured to, upon determining that the target polling frame count value matches the frame count value in the register, interrupt transmission with the USB device through the target endpoint, and update the polling frame count value corresponding to the target endpoint according to the polling interval corresponding to the target endpoint; the frame count value represents the number of frame start packets sent by the USB host.

8. A universal serial bus (USB) host, characterized in that: include: memory and processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The method comprises computer-executable instructions, which, when executed by a processor, enable the method according to any one of claims 1 to 6 to be performed.