A descriptor transmission method, device, equipment and storage medium

By building a descriptor database and quickly determining the target storage address, the problem of low descriptor management efficiency in multi-controller USB systems is solved, and faster response time and higher real-time performance are achieved.

CN118916307BActive Publication Date: 2024-12-27HEFEI HEXAGON SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411412577.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2024-12-27
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

In multi-controller USB systems, the prior art is difficult to effectively manage and store descriptors, resulting in extended device response time, reduced code execution efficiency, and increased the risk of enumeration failure.

Method used

Build a descriptor database, correspond to the descriptor with the storage address, determine the target storage address through requesting commands, and realize the rapid transmission and management of descriptors, avoiding the waste of time caused by step-by-step parsing of command fields.

Benefits of technology

Save code processing time, reduce the delay of the device responds to the host, improve the real-time nature of the system, prevent enumeration failure problems, and optimize data interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916307B_ABST
    Figure CN118916307B_ABST
Patent Text Reader

Abstract

The present invention discloses a descriptor transmission method, device, equipment and storage medium. It is applied to a USB multi-controller system, including: building a descriptor database; obtaining a request command, and determining the descriptor acquisition status of the request command; when the descriptor acquisition status is a descriptor acquisition request, determining the target storage address according to the request command, and performing descriptor transmission according to the descriptor database and the target storage address. By building a descriptor database and matching the descriptor with the storage address, centralized management of the descriptor can be achieved, reducing the overall code volume and also saving the system's memory space. When it is determined that the request command is a descriptor acquisition request, the target storage address can be quickly determined, and the descriptor required by the host can be located, avoiding the time waste caused by parsing the command field level by level, thereby reducing the response time, preventing the enumeration failure problem caused by the response timeout of the system during the enumeration process, and improving the real-time performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a descriptor transmission method, device, equipment and storage medium. Background Art

[0002] With the widespread application of USB technology, the types and number of USB devices are increasing, which puts higher requirements on the performance and efficiency of USB systems. In multi-controller systems, how to effectively store and manage descriptors and quickly respond to host requests has become an important issue.

[0003] In traditional USB devices, all descriptors are stored separately, that is, each descriptor occupies a piece of memory resource independently. After the host sends a request command to obtain a descriptor, the device determines the specific descriptor type requested by the host by peeling off and parsing the request command layer by layer.

[0004] However, in the existing technology, all descriptors need to occupy memory space separately. Due to the large number of descriptors, there are dozens of descriptors under a single controller with multiple configurations and multiple interfaces. It is even more complicated under multiple controllers because independent storage of descriptors is not conducive to the unified management of descriptors in the protocol stack. In addition, the device's command parsing for the host is too cumbersome. The existing technology's layer-by-layer parsing method not only reduces the code execution efficiency and greatly increases the device response time, but also redundant code will occupy additional code space. In a multi-controller system, data interaction is more frequent and the request response delay requirement is higher, otherwise there will be enumeration failure problems. Summary of the invention

[0005] The present invention provides a descriptor transmission method, device, equipment and storage medium, so as to uniformly manage all descriptors in a USB multi-controller system, save code processing time and reduce the time delay of the device responding to the host.

[0006] According to one aspect of the present invention, a descriptor transmission method is provided, which is applied to a USB multi-controller system, and the method comprises:

[0007] Constructing a descriptor database, wherein the descriptor database includes a correspondence between each descriptor and a storage address;

[0008] Obtaining a request command, and determining a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes an acquisition descriptor request and a non-acquisition descriptor request;

[0009] When the descriptor acquisition situation is a descriptor acquisition request, a target storage address is determined according to the request command, and the descriptor is transmitted according to the descriptor database and the target storage address.

[0010] Optionally, constructing a descriptor database includes: taking each USB controller as a target controller in turn, and determining a base address corresponding to the target controller; reading each descriptor corresponding to the target controller, and taking each descriptor in turn as a descriptor to be stored; defining attribute information of the descriptor to be stored, wherein the attribute information includes a descriptor type and a descriptor subtype; and constructing a descriptor database according to the attribute information and the base address.

[0011] Optionally, a descriptor database is constructed according to the attribute information and the base address, including: generating a first offset address according to the descriptor type and the base address, and generating a second offset address according to the descriptor subtype and the first offset address; adding the base address, the first offset address and the second offset address to generate a storage address for the descriptor to be stored; and storing each descriptor according to the corresponding storage address to generate a descriptor database.

[0012] Optionally, determining the descriptor acquisition status of the request command includes: parsing the first specified field of the request command to generate a parsed value; judging whether the parsed value meets a preset condition, and if so, determining that the descriptor acquisition status is a descriptor acquisition request; otherwise, determining that the descriptor acquisition status is a non-descriptor acquisition request.

[0013] Optionally, determining the target storage address according to the request command includes: determining a request controller corresponding to the request command, and using the base address corresponding to the request controller as the target base address; parsing the second specified field of the request command to obtain target attribute information, wherein the target attribute information includes a target descriptor type and a target descriptor subtype; and determining the target storage address according to the target base address and the target attribute information.

[0014] Optionally, the target storage address is determined according to the target base address and the target attribute information, including: generating a first target offset address according to the target descriptor type and the target base address, generating a second target offset address according to the target descriptor subtype and the first target offset address; and adding the target base address, the first target offset address and the second target offset address to generate the target storage address.

[0015] Optionally, descriptor transmission is performed according to the descriptor database and the target storage address, including: determining whether the descriptor database contains the target storage address, and if so, extracting the target descriptor from the target storage address for transmission; otherwise, generating prompt information according to the target storage address.

[0016] According to another aspect of the present invention, a descriptor transmission device is provided, the device comprising:

[0017] A descriptor database construction module, used to construct a descriptor database, wherein the descriptor database includes a corresponding relationship between each descriptor and a storage address;

[0018] A request command acquisition module, used for acquiring a request command and determining a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes a descriptor acquisition request and a non-descriptor acquisition request;

[0019] The descriptor transmission module is used to determine the target storage address according to the request command when the descriptor acquisition situation is a descriptor acquisition request, and to perform descriptor transmission according to the descriptor database and the target storage address.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] at least one processor;

[0022] and a memory communicatively coupled to the at least one processor;

[0023] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a descriptor transmission method described in any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a descriptor transmission method described in any embodiment of the present invention when executed.

[0025] The technical solution of the embodiment of the present invention can realize the centralized management of descriptors by constructing a descriptor database and matching descriptors with storage addresses, thereby reducing the overall code volume and saving system memory space. When it is determined that the request command is a request to obtain a descriptor, the target storage address can be quickly determined, and the descriptor required by the host can be located, avoiding the time waste caused by parsing the command fields step by step, thereby reducing the response time, preventing the enumeration failure caused by the response timeout of the system during the enumeration process, and improving the real-time performance of the system.

[0026] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0028] Figure 1 is a flowchart of a descriptor transmission method provided according to Embodiment 1 of the present invention;

[0029] Figure 2 is a schematic diagram of the structure of a descriptor database provided according to the first embodiment of the present invention;

[0030] Figure 3 is a flowchart of another descriptor transmission method provided according to Embodiment 2 of the present invention;

[0031] Figure 4 is a structural diagram of a descriptor transmission device provided according to Embodiment 3 of the present invention;

[0032] Figure 5 It is a structural schematic diagram of an electronic device for implementing a descriptor transmission method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] Embodiment 1

[0036] Figure 1A flowchart of a descriptor transmission method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of managing all descriptors in a USB multi-controller system. The method can be executed by a descriptor transmission device, which can be implemented in the form of hardware and / or software. The descriptor transmission device can be configured in a USB multi-controller system. Figure 1 As shown, the method includes:

[0037] S110 , constructing a descriptor database, wherein the descriptor database includes a correspondence between each descriptor and a storage address.

[0038] Among them, the USB multi-controller system refers to a system containing multiple USB controllers, each of which can manage and control the connection and data transmission of a group of USB devices. Descriptors refer to information used to describe various characteristics and functions of USB devices, such as device type, configuration, endpoint characteristics, etc. The descriptor database refers to a collection used to store descriptors and their corresponding storage addresses for quick search and access. Storage addresses refer to specific codes used to identify data storage locations in the system.

[0039] Specifically, constructing a descriptor database means establishing a correspondence between each descriptor and a storage address to form a directory structure, so that when a request command is received, the storage location of the required descriptor can be quickly located, thereby improving the efficiency of data acquisition and retrieval.

[0040] Optionally, constructing a descriptor database includes: taking each USB controller as a target controller in turn, and determining a base address corresponding to the target controller; reading each descriptor corresponding to the target controller, and taking each descriptor in turn as a descriptor to be stored; defining attribute information of the descriptor to be stored, wherein the attribute information includes a descriptor type and a descriptor subtype; and constructing a descriptor database according to the attribute information and the base address.

[0041] Specifically, the system will take each USB controller as the target controller in turn, and determine the base address corresponding to each target controller as the starting position for subsequent reading of descriptors. Then for each target controller, read the corresponding descriptors, and define attribute information for each descriptor to be stored, including descriptor type and descriptor subtype. The descriptor type clarifies the type of descriptor, such as device descriptor, configuration descriptor, etc., and the descriptor subtype further subdivides the specific function of the descriptor. Finally, based on the descriptor attribute information and base address, a descriptor database can be constructed. Specifically, a suitable data structure, such as a table or array, can be used to store descriptors and related information. In the descriptor database, each descriptor is associated with the corresponding base address and attribute information.

[0042] In summary, by organizing and storing the correspondence between descriptors and storage addresses, the system can quickly locate the required descriptors when receiving relevant requests, thereby improving the efficiency of data access.

[0043] In a specific implementation, constructing a descriptor database requires first determining the type and subtype of the descriptor, such as a device descriptor, a configuration descriptor, an interface descriptor, and an endpoint descriptor, and understanding the specific subtypes they contain. Then, based on the type and subtype of the descriptor, a suitable database structure can be designed, including creating a data table to store different types of descriptors, and allocating enough storage space for the database to accommodate all possible descriptors and their related information. After the division is completed, the acquired descriptor data can be parsed, key information can be extracted, and it can be organized and stored according to the designed database structure. It should be noted that since the status of the USB device may change, such as a configuration change of the device or the connection of a new device, the descriptor information in the database needs to be updated regularly to maintain its validity.

[0044] Optionally, a descriptor database is constructed according to the attribute information and the base address, including: generating a first offset address according to the descriptor type and the base address, and generating a second offset address according to the descriptor subtype and the first offset address; adding the base address, the first offset address and the second offset address to generate a storage address for the descriptor to be stored; and storing each descriptor according to the corresponding storage address to generate a descriptor database.

[0045] Specifically, the system can generate a first offset address based on the descriptor type and the base address. The first offset address is an offset relative to the base address. The first offset address is calculated based on the descriptor type and the base address, and indicates the relative position of the descriptor type in the database. The descriptor subtype further subdivides the type of the descriptor. The second offset address is calculated based on the descriptor subtype on the basis of the first offset address, and more accurately determines the position of the descriptor in the database. Finally, by adding the base address, the first offset address and the second offset address, the final storage address of the descriptor can be obtained. Finally, by storing each descriptor according to the calculated storage address, a descriptor database can be constructed, in which each descriptor has a unique storage address that can be accessed and managed through this address.

[0046] For example, Figure 2 A structural schematic diagram of a descriptor database is provided for the first embodiment of the present invention. Figure 2 In the example, the descriptor is stored according to the following formula (1):

[0047] (1)

[0048] in, is the storage address of the descriptor x in the entire cache buffer of controller y, basey is the base address of controller y in the buffer, ArrayA and ArrayB are one-dimensional and two-dimensional arrays respectively, ArrayA represents the offset address of the type of descriptor x in the corresponding controller base address, and according to the different subtypes of the descriptor, ArrayB is the offset address of the subtype descriptor relative to ArrayA.

[0049] S120: Obtain a request command, and determine a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes an acquisition descriptor request and a non-acquisition descriptor request.

[0050] The request command refers to an instruction initiated by the host to perform a certain operation or obtain certain information. The descriptor acquisition status refers to the analysis result of the request command, judging whether the request command is for obtaining a descriptor or other operations unrelated to the descriptor.

[0051] Optionally, determining the descriptor acquisition status of the request command includes: parsing the first specified field of the request command to generate a parsed value; judging whether the parsed value meets a preset condition, and if so, determining that the descriptor acquisition status is a descriptor acquisition request; otherwise, determining that the descriptor acquisition status is a non-descriptor acquisition request.

[0052] Specifically, the system will parse the first specified field in the request command sent by the host to generate a parsed value to quickly determine whether it is a request to obtain a descriptor. The generated parsed value will then be compared and judged with the preset conditions. The preset conditions are set standards or thresholds for distinguishing between requests to obtain descriptors and non-descriptor requests. If the parsed value meets the preset conditions, it means that the purpose of the request command is to obtain a descriptor, and the descriptor acquisition situation is determined to be a request to obtain a descriptor. If the parsed value does not meet the preset conditions, the request command is not intended to obtain a descriptor, but other operations unrelated to the descriptor. At this time, it can be determined that the descriptor acquisition situation is a non-descriptor acquisition request.

[0053] Exemplarily, the first designated field may be the bmRequest and bRequest fields, and the preset condition may be bmRequest&0x1F==0&req->bRequest==6, that is, the 5th bit of the 1st byte of the bmRequest field is equal to 0 and the second byte of the bRequest field is equal to 6, at which time the request command is determined to be a request to obtain a descriptor.

[0054] S130: When the descriptor acquisition situation is a descriptor acquisition request, determine a target storage address according to the request command, and perform descriptor transmission according to the descriptor database and the target storage address.

[0055] The target storage address refers to the specific storage location where the descriptor needs to be acquired or transferred, which is determined after analyzing the request command.

[0056] Optionally, descriptor transmission is performed according to the descriptor database and the target storage address, including: determining whether the descriptor database contains the target storage address, and if so, extracting the target descriptor from the target storage address for transmission; otherwise, generating prompt information according to the target storage address.

[0057] Specifically, the system will further confirm whether the specified target storage address exists in the descriptor database. If the target storage address is included in the descriptor database, the system will extract the target descriptor from the position corresponding to the target storage address, and then transmit the target descriptor through the corresponding transmission mechanism and channel. However, if the target storage address is not found in the descriptor database, it means that the current request cannot directly obtain the required descriptor from the existing descriptor database. In this case, the system will generate a prompt message based on the target storage address. The content of the prompt message may include informing the user or related program that the address does not exist in the descriptor database. Through the technical solution of this embodiment, the transmission of the descriptor can be effectively completed based on the descriptor database and the target storage address, or corresponding prompts can be provided when the transmission cannot be performed, so as to ensure the normal operation of the system and the accuracy of data processing.

[0058] The technical solution of the embodiment of the present invention can realize the centralized management of descriptors by constructing a descriptor database and matching descriptors with storage addresses, thereby reducing the overall code volume and saving system memory space. When it is determined that the request command is a request to obtain a descriptor, the target storage address can be quickly determined, and the descriptor required by the host can be located, avoiding the time waste caused by parsing the command fields step by step, thereby reducing the response time, preventing the enumeration failure caused by the response timeout of the system during the enumeration process, and improving the real-time performance of the system.

[0059] Embodiment 2

[0060] Figure 3 This is a flowchart of a descriptor transmission method provided in the second embodiment of the present invention. This embodiment adds a specific process of determining the target storage address according to the request command on the basis of the above-mentioned first embodiment. Among them, the specific contents of steps S210-S220 are roughly the same as steps S110-S120 in the first embodiment, so they will not be repeated in this embodiment. Figure 3 As shown, the method includes:

[0061] S210: Build a descriptor database, where the descriptor database includes a correspondence between each descriptor and a storage address.

[0062] Optionally, constructing a descriptor database includes: taking each USB controller as a target controller in turn, and determining a base address corresponding to the target controller; reading each descriptor corresponding to the target controller, and taking each descriptor in turn as a descriptor to be stored; defining attribute information of the descriptor to be stored, wherein the attribute information includes a descriptor type and a descriptor subtype; and constructing a descriptor database according to the attribute information and the base address.

[0063] Optionally, a descriptor database is constructed according to the attribute information and the base address, including: generating a first offset address according to the descriptor type and the base address, and generating a second offset address according to the descriptor subtype and the first offset address; adding the base address, the first offset address and the second offset address to generate a storage address for the descriptor to be stored; and storing each descriptor according to the corresponding storage address to generate a descriptor database.

[0064] S220: Obtain a request command, and determine a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes an acquisition descriptor request and a non-acquisition descriptor request.

[0065] Optionally, determining the descriptor acquisition status of the request command includes: parsing the first specified field of the request command to generate a parsed value; judging whether the parsed value meets a preset condition, and if so, determining that the descriptor acquisition status is a descriptor acquisition request; otherwise, determining that the descriptor acquisition status is a non-descriptor acquisition request.

[0066] S230: When the descriptor acquisition situation is a descriptor acquisition request, determine a request controller corresponding to the request command, and use a base address corresponding to the request controller as a target base address.

[0067] S240. Parse the second designated field of the request command to obtain target attribute information, wherein the target attribute information includes a target descriptor type and a target descriptor subtype.

[0068] Specifically, when processing a request command, the system will first determine the request controller corresponding to the request command, and set the base address corresponding to the request controller as the target base address. Then the system will parse the second specified field in the request command. The second specified field can be a value field, and the high 8 bits of the value field can be used to identify the target descriptor type and target descriptor subtype that the host needs to obtain.

[0069] S250: Determine a target storage address according to the target base address and target attribute information.

[0070] Optionally, the target storage address is determined according to the target base address and the target attribute information, including: generating a first target offset address according to the target descriptor type and the target base address, generating a second target offset address according to the target descriptor subtype and the first target offset address; and adding the target base address, the first target offset address and the second target offset address to generate the target storage address.

[0071] Specifically, when determining the target storage address, the system generates a first target offset address according to formula (1), that is, according to the target descriptor type and the target base address. Then, based on the first target offset address, the system generates a second target offset address in combination with the target descriptor subtype. Finally, the system adds the target base address, the first target offset address, and the second target offset address to generate the target storage address.

[0072] S260: Perform descriptor transmission according to the descriptor database and the target storage address.

[0073] Optionally, descriptor transmission is performed according to the descriptor database and the target storage address, including: determining whether the descriptor database contains the target storage address, and if so, extracting the target descriptor from the target storage address for transmission; otherwise, generating prompt information according to the target storage address.

[0074] The technical solution of the embodiment of the present invention can realize the centralized management of descriptors by constructing a descriptor database and matching descriptors with storage addresses, thereby reducing the overall code volume and saving system memory space. When it is determined that the request command is a request to obtain a descriptor, the target storage address can be quickly determined, and the descriptor required by the host can be located, avoiding the time waste caused by parsing the command fields step by step, thereby reducing the response time, preventing the enumeration failure caused by the response timeout of the system during the enumeration process, and improving the real-time performance of the system.

[0075] Embodiment 3

[0076] Figure 4 This is a schematic diagram of the structure of a descriptor transmission device provided in Embodiment 3 of the present invention. Figure 4 As shown, the apparatus includes: a descriptor database construction module 310, which is used to construct a descriptor database, wherein the descriptor database includes a correspondence between each descriptor and a storage address;

[0077] A request command acquisition module 320, used to acquire a request command and determine a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes a descriptor acquisition request and a non-descriptor acquisition request;

[0078] The descriptor transmission module 330 is used to determine the target storage address according to the request command when the descriptor acquisition situation is a descriptor acquisition request, and perform descriptor transmission according to the descriptor database and the target storage address.

[0079] Optionally, the descriptor database construction module 310 specifically includes: a base address determination unit, used to: take each USB controller as a target controller in turn, and determine the base address corresponding to the target controller; a descriptor reading unit, used to: read each descriptor corresponding to the target controller, and take each descriptor in turn as a descriptor to be stored; an attribute information definition unit, used to: define attribute information of the descriptor to be stored, wherein the attribute information includes a descriptor type and a descriptor subtype; a descriptor database construction unit, used to: construct a descriptor database according to the attribute information and the base address.

[0080] Optionally, the descriptor database construction unit is specifically used to: generate a first offset address according to the descriptor type and the base address, and generate a second offset address according to the descriptor subtype and the first offset address; add the base address, the first offset address and the second offset address to generate a storage address for the descriptor to be stored; and store each descriptor according to the corresponding storage address to generate a descriptor database.

[0081] Optionally, the request command acquisition module 320 is specifically used to: parse the first specified field of the request command to generate a parsed value; determine whether the parsed value meets a preset condition, and if so, determine that the descriptor acquisition situation is a descriptor acquisition request; otherwise, determine that the descriptor acquisition situation is a non-descriptor acquisition request.

[0082] Optionally, the descriptor transmission module 330 specifically includes: a target base address determination unit, used to: determine the request controller corresponding to the request command, and use the base address corresponding to the request controller as the target base address; a target attribute information acquisition unit, used to: parse the second specified field of the request command to obtain target attribute information, wherein the target attribute information includes a target descriptor type and a target descriptor subtype; a target storage address determination unit, used to: determine the target storage address according to the target base address and the target attribute information.

[0083] Optionally, the target storage address determination unit is specifically used to: generate a first target offset address according to the target descriptor type and the target base address, generate a second target offset address according to the target descriptor subtype and the first target offset address; and add the target base address, the first target offset address and the second target offset address to generate the target storage address.

[0084] Optionally, the descriptor transmission module 330 specifically includes: a descriptor transmission unit, used to: determine whether the descriptor database contains the target storage address, if so, extract the target descriptor from the target storage address for transmission; otherwise, generate prompt information according to the target storage address.

[0085] The technical solution of the embodiment of the present invention can realize the centralized management of descriptors by constructing a descriptor database and matching descriptors with storage addresses, thereby reducing the overall code volume and saving system memory space. When it is determined that the request command is a request to obtain a descriptor, the target storage address can be quickly determined, and the descriptor required by the host can be located, avoiding the time waste caused by parsing the command fields step by step, thereby reducing the response time, preventing the enumeration failure caused by the response timeout of the system during the enumeration process, and improving the real-time performance of the system.

[0086] A descriptor transmission device provided in an embodiment of the present invention can execute a descriptor transmission method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0087] Embodiment 4

[0088] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0089] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0090] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0091] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a descriptor transmission method.

[0092] In some embodiments, a descriptor transmission method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the descriptor transmission method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a descriptor transmission method in any other appropriate manner (e.g., by means of firmware).

[0093] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0094] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0097] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A descriptor transmission method, applied to a USB multi-controller system, characterized in that: include: Constructing a descriptor database, wherein the descriptor database includes a correspondence between each descriptor and a storage address; Obtaining a request command, and determining a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes an acquisition descriptor request and a non-acquisition descriptor request; When the descriptor acquisition situation is a descriptor acquisition request, determining a target storage address according to the request command, and performing descriptor transmission according to the descriptor database and the target storage address; Wherein, determining the target storage address according to the request command includes: Determine a request controller corresponding to the request command, and use a base address corresponding to the request controller as a target base address; Parsing a second designated field of the request command to obtain target attribute information, wherein the target attribute information includes a target descriptor type and a target descriptor subtype; The target storage address is determined according to the target base address and the target attribute information.

2. The method according to claim 1, characterized in that The constructing of the descriptor database comprises: Taking each USB controller as a target controller in turn, and determining a base address corresponding to the target controller; Reading each descriptor corresponding to the target controller, and taking each descriptor in turn as a descriptor to be stored; Defining attribute information of the descriptor to be stored, wherein the attribute information includes a descriptor type and a descriptor subtype; A descriptor database is constructed according to the attribute information and the base address.

3. The method according to claim 2, characterized in that The step of constructing a descriptor database according to the attribute information and the base address includes: Generate a first offset address according to the descriptor type and the base address, and generate a second offset address according to the descriptor subtype and the first offset address; Adding the base address, the first offset address and the second offset address to generate a storage address of the descriptor to be stored; Each descriptor is stored according to a corresponding storage address to generate the descriptor database.

4. The method according to claim 1, characterized in that The determining of the descriptor acquisition status of the request command includes: Parsing a first designated field of the request command to generate a parsed value; Determine whether the parsed value satisfies a preset condition, and if so, determine that the descriptor acquisition condition is a descriptor acquisition request; Otherwise, it is determined that the descriptor acquisition situation is a non-descriptor acquisition request.

5. The method according to claim 1, characterized in that The determining the target storage address according to the target base address and the target attribute information includes: Generate a first target offset address according to the target descriptor type and the target base address, and generate a second target offset address according to the target descriptor subtype and the first target offset address; The target base address, the first target offset address, and the second target offset address are added to generate the target storage address.

6. The method according to claim 1, characterized in that The performing descriptor transmission according to the descriptor database and the target storage address comprises: determining whether the target storage address is included in the descriptor database, and if so, extracting the target descriptor from the target storage address for transmission; Otherwise, prompt information is generated according to the target storage address.

7. A descriptor transmission device, applied to a USB multi-controller system, characterized in that: include: A descriptor database construction module, used to construct a descriptor database, wherein the descriptor database includes a correspondence between each descriptor and a storage address; A request command acquisition module, used for acquiring a request command and determining a descriptor acquisition status of the request command, wherein the descriptor acquisition status includes an acquisition descriptor request and a non-acquisition descriptor request; A descriptor transmission module, used for determining a target storage address according to the request command when the descriptor acquisition situation is a descriptor acquisition request, and performing descriptor transmission according to the descriptor database and the target storage address; Among them, the descriptor transmission module specifically includes: a target base address determination unit, used to: determine the request controller corresponding to the request command, and use the base address corresponding to the request controller as the target base address; a target attribute information acquisition unit, used to: parse the second specified field of the request command to obtain target attribute information, wherein the target attribute information includes a target descriptor type and a target descriptor subtype; a target storage address determination unit, used to: determine the target storage address according to the target base address and the target attribute information.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 6.

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