[go: up one dir, main page]

CN115658586A - Resource management chip, method, electronic device and readable storage medium - Google Patents

Resource management chip, method, electronic device and readable storage medium Download PDF

Info

Publication number
CN115658586A
CN115658586A CN202211385060.0A CN202211385060A CN115658586A CN 115658586 A CN115658586 A CN 115658586A CN 202211385060 A CN202211385060 A CN 202211385060A CN 115658586 A CN115658586 A CN 115658586A
Authority
CN
China
Prior art keywords
data
hub
buffer
chip
bus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211385060.0A
Other languages
Chinese (zh)
Other versions
CN115658586B (en
Inventor
王鹏
朱英澍
翁阿曼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211385060.0A priority Critical patent/CN115658586B/en
Publication of CN115658586A publication Critical patent/CN115658586A/en
Application granted granted Critical
Publication of CN115658586B publication Critical patent/CN115658586B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Bus Control (AREA)

Abstract

An embodiment of the present invention provides a resource management chip, including: a device controller, a hub, a plurality of bus devices, a plurality of first buffers, and an access controller; the hub comprises a plurality of ports and a plurality of first endpoints; the device controller is used for receiving the resource acquisition instruction, allocating bus equipment for receiving data, and configuring a corresponding port and a first endpoint for the bus equipment; the bus device includes a plurality of second endpoints; the bus equipment is used for sending the received data to the corresponding first buffer through the second endpoint; the first buffer is used for storing data and transmitting the data to the hub under the control of the access controller; the hub is used for receiving data through the first endpoint and outputting the data to the outside of the chip under the control of the access controller; and the access controller is used for receiving the control instruction sent by the device controller and controlling data transmission between the first buffer and the hub and between the hub and the outside of the chip according to the control instruction.

Description

资源管理芯片、方法、电子设备及可读存储介质Resource management chip, method, electronic device and readable storage medium

技术领域technical field

本发明属于计算机技术领域,特别是涉及一种资源管理芯片、方法、电子设备及可读存储介质。The invention belongs to the technical field of computers, and in particular relates to a resource management chip, a method, electronic equipment and a readable storage medium.

背景技术Background technique

通用串行总线(Universal Serial Bus,USB)自推出以来,在计算机、复杂终端、网络基础设施等领域被广泛应用,成为本世纪的标准扩展接口和必备接口之一。最新的USB协议已经发展到USB 4.0版本,目前计算机等智能设备与外界的数据交互以USB接口和网络两种方式为主。Since its launch, the Universal Serial Bus (USB) has been widely used in the fields of computers, complex terminals, and network infrastructure, and has become one of the standard expansion interfaces and necessary interfaces in this century. The latest USB protocol has been developed to the USB 4.0 version. At present, the data interaction between smart devices such as computers and the outside world is mainly through the USB interface and the network.

现有技术中,服务器或交换机等大型网络设备,在USB总线上的设备侧,USB设备包括单一功能和多功能的USB设备。但是,无论是单一功能还是多功能的USB设备,设备的功能及相关配置在出厂时已经固化,因此,存在USB设备硬件上功能单一、资源不能分配的问题。In the prior art, for large-scale network devices such as servers or switches, on the device side on the USB bus, the USB devices include single-function and multi-function USB devices. However, whether it is a USB device with a single function or a multi-function, the functions and related configurations of the device have been solidified at the time of delivery. Therefore, there is a problem that the hardware of the USB device has a single function and resources cannot be allocated.

发明内容Contents of the invention

本发明提供一种资源管理方法、装置、电子设备及可读存储介质,以便解决USB设备硬件上功能单一、资源不能分配的问题。The present invention provides a resource management method, device, electronic equipment and readable storage medium in order to solve the problem of single function and unallocated resources on the hardware of the USB equipment.

为了解决上述技术问题,本发明是这样实现的:In order to solve the problems of the technologies described above, the present invention is achieved in that:

第一方面,本发明提供一种资源管理芯片,所述芯片包括:设备控制器、集线器、多个总线设备、多个第一缓冲器和访问控制器;In a first aspect, the present invention provides a resource management chip, the chip comprising: a device controller, a hub, multiple bus devices, multiple first buffers, and an access controller;

所述集线器包括多个端口和多个第一端点;the hub includes a plurality of ports and a plurality of first endpoints;

所述设备控制器用于接收资源获取指令,并根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的端口和第一端点;其中,所述总线设备通过所述端口接入所述集线器;The device controller is configured to receive a resource acquisition instruction, allocate a bus device for receiving data according to the resource acquisition instruction, and configure a corresponding port and a first endpoint for the bus device; wherein, the bus device accessing the hub through the port;

所述总线设备包括多个第二端点;所述总线设备用于将接收到的数据通过所述第二端点发送给对应的第一缓冲器;The bus device includes a plurality of second endpoints; the bus device is used to send the received data to the corresponding first buffer through the second endpoints;

所述第一缓冲器用于存储所述数据,以及,在所述访问控制器控制下将所述数据发送给所述集线器;the first buffer is used to store the data, and send the data to the hub under the control of the access controller;

所述集线器用于通过所述第一端点接收所述数据,以及,在所述访问控制器控制下将所述数据输出到所述芯片外部;The hub is used to receive the data through the first endpoint, and output the data to the outside of the chip under the control of the access controller;

所述访问控制器用于接收所述设备控制器发送的控制指令,并根据所述控制指令控制所述第一缓冲器和所述集线器之间,以及所述集线器和所述芯片外部之间进行数据传输。The access controller is configured to receive a control instruction sent by the device controller, and control data transfer between the first buffer and the hub, and between the hub and the outside of the chip according to the control instruction. transmission.

可选的,所述设备控制器包括第一寄存器、第二寄存器以及第三寄存器;Optionally, the device controller includes a first register, a second register, and a third register;

所述第一寄存器用于查询各所述总线设备和所述集线器的当前状态,以及,根据所述资源获取指令设置用于接收数据的总线设备、所述总线设备对应的端口和第一端点;The first register is used to query the current state of each of the bus devices and the hub, and set the bus device for receiving data, the port corresponding to the bus device, and the first endpoint according to the resource acquisition instruction ;

所述第二寄存器用于向所述访问控制器发送第一控制指令,使得所述访问控制器根据所述第一控制指令打开指定的数据传输通道;The second register is used to send a first control instruction to the access controller, so that the access controller opens a specified data transmission channel according to the first control instruction;

所述第三寄存器用于为各总线设备分别设置对应的第一缓冲器,以及查询各所述第一缓冲器的当前状态。The third register is used to respectively set corresponding first buffers for each bus device, and query the current state of each first buffer.

可选的,所述总线设备包括第一接口;其中,所述第一接口包括第二控制端点,所述第二端点设置在所述第一接口中;Optionally, the bus device includes a first interface; wherein, the first interface includes a second control endpoint, and the second endpoint is set in the first interface;

所述第二控制端点用于在所述第一寄存器控制下控制所述第二端点接收数据,以及,将所述数据发送给对应的第一缓冲器;The second control endpoint is used to control the second endpoint to receive data under the control of the first register, and send the data to the corresponding first buffer;

所述第一寄存器还用于根据所述资源获取指令设置所述第一接口的数据传输类型,使得所述第一接口通过所述第二端点接收所述数据传输类型的数据;其中,所述数据传输类型为视频控制类型、视频传输类型、串口传输类型、网络传输类型和人机交互类型中的任一种。The first register is also used to set the data transmission type of the first interface according to the resource acquisition instruction, so that the first interface receives data of the data transmission type through the second endpoint; wherein, the The data transmission type is any one of video control type, video transmission type, serial port transmission type, network transmission type and human-computer interaction type.

可选的,所述集线器还包括第一控制端点和第二缓冲器;Optionally, the hub further includes a first control endpoint and a second buffer;

所述第一控制端点用于在所述第一寄存器控制下控制所述第一端点接收所述第一缓冲器发送的数据,并通过所述第一端点将所述数据发送给所述第二缓冲器进行存储;The first control endpoint is used to control the first endpoint to receive the data sent by the first buffer under the control of the first register, and send the data to the storing in the second buffer;

所述第二缓冲器用于接收并存储各所述第一端点发送的数据,以及,根据所述访问控制器发送的第二控制指令将所述数据发送到所述芯片外部。The second buffer is used to receive and store data sent by each of the first endpoints, and send the data to the outside of the chip according to a second control instruction sent by the access controller.

可选的,所述第二缓冲器包括帧链表和数据链表;Optionally, the second buffer includes a frame linked list and a data linked list;

所述数据链表用于缓存所述总线设备通过所述第一缓冲器发送给所述集线器的数据;The data linked list is used to cache the data sent by the bus device to the hub through the first buffer;

所述帧链表用于确定所述集线器当前待传输的数据,以及,根据所述第二控制指令将所述待传输的数据发送到所述芯片外部。The frame link list is used to determine the data to be transmitted by the hub, and send the data to be transmitted to the outside of the chip according to the second control instruction.

可选的,所述帧链表是一个指针数组,所述帧链表的任一指针指向所述数据链表中的一个数据;Optionally, the frame linked list is an array of pointers, and any pointer of the frame linked list points to a data in the data linked list;

所述帧链表还用于根据所述第二控制指令设置当前帧内待传输的各类型数据包的占比,以及,在发送完当前帧的数据后根据下一指针从所述数据链表中获取下一帧的待传输数据,并将所述指针更新到所述设备控制器中进行存储。The frame linked list is also used to set the ratio of various types of data packets to be transmitted in the current frame according to the second control instruction, and obtain from the data linked list according to the next pointer after sending the data of the current frame data to be transmitted in the next frame, and update the pointer to the device controller for storage.

可选的,所述访问控制器包括多个传输通道、通道选择模块和总线仲裁器;Optionally, the access controller includes multiple transmission channels, a channel selection module and a bus arbiter;

所述多个传输通道各自具有通道编号和相应的通道优先级;Each of the plurality of transmission channels has a channel number and a corresponding channel priority;

所述通道选择模块用于根据所述设备控制器发送的第一控制指令打开所述第一控制指令指定的传输通道;其中,所述第一控制指令包括所需打开的传输通道的通道编号;The channel selection module is used to open the transmission channel specified by the first control command according to the first control command sent by the device controller; wherein, the first control command includes the channel number of the transmission channel to be opened;

所述总线仲裁器用于在多个传输通道的通道优先级相同的情况下,根据通道编号对各传输通道进行排序,并依据排序顺序控制各传输通道进行数据传输。The bus arbiter is used to sort the transmission channels according to the channel numbers when the channel priorities of the multiple transmission channels are the same, and control the transmission channels to perform data transmission according to the sort order.

可选的,所述第一缓冲器包括路由逻辑模块、共享传输缓冲器和专用传输缓冲器;Optionally, the first buffer includes a routing logic module, a shared transmission buffer and a dedicated transmission buffer;

所述路由逻辑模块用于解析所述总线设备发送数据的数据包类型,并过滤不符合预设规定的数据包,以确定所述总线设备发送的数据为符合第一时延要求的第一数据或符合第二时延要求的第二数据;The routing logic module is used to analyze the data packet type of the data sent by the bus device, and filter the data packets that do not meet the preset requirements, so as to determine that the data sent by the bus device is the first data that meets the first delay requirement or the second data meeting the second delay requirement;

所述共享传输缓冲器用于接收所述路由逻辑模块路由来的所述第一数据,以及,在所述访问控制器控制下将所述第一数据发送给所述集线器;The shared transmission buffer is used to receive the first data routed by the routing logic module, and send the first data to the hub under the control of the access controller;

所述专用传输缓冲器用于接收所述路由逻辑模块路由来的所述第二数据,以及,在所述访问控制器控制下将所述第二数据发送给所述集线器。The dedicated transmission buffer is used to receive the second data routed by the routing logic module, and send the second data to the hub under the control of the access controller.

第二方面,本发明提供一种资源管理方法,应用于如上任一所述的资源管理芯片,所述方法包括:In a second aspect, the present invention provides a resource management method, which is applied to the resource management chip as described above, and the method includes:

向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点;Sending a resource acquisition instruction to a device controller, controlling the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and configuring a corresponding hub port and a first endpoint for the bus device;

通过所述设备控制器控制所述总线设备接收所述数据,以及将所述数据通过第二端点发送给对应的第一缓冲器;controlling the bus device to receive the data through the device controller, and sending the data to the corresponding first buffer through the second endpoint;

通过所述设备控制器控制所述第一缓冲器接收并存储所述总线设备发送来的数据;controlling the first buffer to receive and store data sent by the bus device through the device controller;

通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据输出到所述芯片外部。The device controller sends a control instruction to the access controller, controls the access controller to control the first buffer to send the data to the hub according to the control instruction, and controls the hub to pass through the first Endpoints receive the data and output the data outside the chip.

可选的,所述资源获取指令根据远程客户端对所述芯片的外接设备发送的远程访问指令生成;在所述远程访问指令表征所述远程客户端向所述外接设备发送数据的情况下,所述向设备控制器发送资源获取指令之前,所述方法还包括:Optionally, the resource acquisition instruction is generated according to the remote access instruction sent by the remote client to the external device of the chip; when the remote access instruction indicates that the remote client sends data to the external device, Before sending the resource acquisition instruction to the device controller, the method further includes:

通过运行于所述芯片之上的资源管理程序接收所述远程客户端发送的远程数据包;receiving the remote data packet sent by the remote client through a resource management program running on the chip;

通过所述资源管理程序将所述远程数据包发送给运行于所述芯片之上的数据传输程序进行解析及处理,以获得第一数据包;sending the remote data packet to a data transmission program running on the chip for parsing and processing through the resource management program, so as to obtain a first data packet;

所述向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点,包括:The sending a resource acquisition instruction to the device controller, controlling the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and configuring a corresponding hub port and a first endpoint for the bus device, include:

所述资源管理程序通过运行于所述芯片之上的芯片驱动程序向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点;The resource management program sends a resource acquisition instruction to the device controller through a chip driver running on the chip, controls the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and, for The bus device is configured with a corresponding hub port and a first endpoint;

所述通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给式所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据输出到所述芯片外部,包括:Sending a control instruction to the access controller through the device controller, controlling the access controller to control the first buffer to send the data to the hub according to the control instruction, and controlling the hub receiving the data through the first endpoint and outputting the data to the outside of the chip, including:

通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据传输给所述外接设备,以实现所述远程客户端对所述外接设备的远程访问。The device controller sends a control instruction to the access controller, controls the access controller to control the first buffer to send the data to the hub according to the control instruction, and controls the hub to pass through the first The endpoint receives the data and transmits the data to the external device, so as to realize the remote access of the remote client to the external device.

可选的,在所述远程访问指令表征所述外接设备向所述远程客户端发送数据的情况下,所述向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点,包括:Optionally, in the case where the remote access instruction indicates that the external device sends data to the remote client, the sending a resource acquisition instruction to the device controller controls the device controller to obtain data according to the resource acquisition instruction Allocating a bus device for receiving data, and configuring a corresponding hub port and a first endpoint for the bus device, including:

所述资源管理程序通过所述芯片驱动程序向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点;The resource management program sends a resource acquisition instruction to the device controller through the chip driver, controls the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and configures a corresponding bus device for the bus device The hub port and first endpoint of the

所述通过所述设备控制器控制所述总线设备接收所述数据,以及将所述数据通过第二端点发送给对应的第一缓冲器,包括:The controlling the bus device to receive the data through the device controller, and sending the data to the corresponding first buffer through the second endpoint includes:

通过所述设备控制器控制所述总线设备接收所述外接设备的中央处理器发送的本地数据包,以及将所述本地数据包通过第二端点发送给对应的第一缓冲器进行存储;Controlling the bus device by the device controller to receive the local data packet sent by the central processor of the external device, and sending the local data packet to the corresponding first buffer through the second endpoint for storage;

所述通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给式所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据输出到所述芯片外部,包括:Sending a control instruction to the access controller through the device controller, controlling the access controller to control the first buffer to send the data to the hub according to the control instruction, and controlling the hub receiving the data through the first endpoint and outputting the data to the outside of the chip, including:

通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据传输给所述数据传输程序;The device controller sends a control instruction to the access controller, controls the access controller to control the first buffer to send the data to the hub according to the control instruction, and controls the hub to pass through the first an endpoint receives said data and transmits said data to said data transfer program;

所述通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据传输给所述数据传输程序之后,所述方法还包括:Sending a control instruction to the access controller through the device controller, controlling the access controller to control the first buffer to send the data to the hub according to the control instruction, and controlling the hub to pass through After the first endpoint receives the data and transmits the data to the data transmission program, the method further includes:

通过所述数据传输程序对所述本地数据包进行解析及处理,以获得第二数据包,并将所述第二数据包发送给所述资源管理程序;Analyzing and processing the local data packet through the data transmission program to obtain a second data packet, and sending the second data packet to the resource management program;

通过所述资源管理程序将所述第二数据包发送给所述远程客户端,以实现所述远程客户端对所述外接设备的远程访问。The second data packet is sent to the remote client through the resource management program, so as to realize the remote access of the remote client to the external device.

第三方面,本发明提供一种电子设备,包括如上中任一所述的资源管理芯片。In a third aspect, the present invention provides an electronic device, including any one of the above resource management chips.

第四方面,本发明提供一种可读存储介质,当所述存储介质中的指令由电子设备的芯片执行时,使得电子设备能够执行如上任一所述的资源管理方法。In a fourth aspect, the present invention provides a readable storage medium. When the instructions in the storage medium are executed by the chip of the electronic device, the electronic device can execute the resource management method described above.

本发明实施例提供的资源管理芯片,可以通过芯片中的设备控制器动态分配用于接收数据的总线设备,以及,为总线设备配置对应的集线器端口和第一端点,使得芯片的多个总线设备、集线器的多个端口和多个第一端点在硬件上动态可配,可以根据需求通过设备控制器进行灵活配置,实现多种不同的功能,一定程度上解决USB实体设备的资源固化,硬件上功能单一、资源不能分配的问题。此外,在芯片中设置多个总线设备各自对应的第一缓冲器,可以为总线设备附加数据缓存区域,从而增加芯片的数据存储能力。另外,设备控制器可以通过访问控制器控制第一缓冲器将存储的数据发送给集线器,以及,控制集线器将存储的数据输出到芯片外部。这样,由访问控制器来控制第一缓冲器和集线器之间,以及集线器和芯片外部之间进行数据传输,可以更好地协调芯片内多个总线设备、集线器的多个端口和多个第一端点,也为提高芯片的整体数据传输效率提供硬件基础。The resource management chip provided by the embodiment of the present invention can dynamically allocate the bus device for receiving data through the device controller in the chip, and configure the corresponding hub port and the first endpoint for the bus device, so that the multiple buses of the chip The multiple ports and multiple first endpoints of devices and hubs can be dynamically configured on the hardware, and can be flexibly configured through the device controller according to requirements to achieve a variety of different functions, and to a certain extent solve the resource curing of USB physical devices. The hardware has a single function and cannot allocate resources. In addition, setting the first buffer corresponding to each of the multiple bus devices in the chip can add a data buffer area for the bus device, thereby increasing the data storage capacity of the chip. In addition, the device controller can control the first buffer to send the stored data to the hub through the access controller, and control the hub to output the stored data to the outside of the chip. In this way, the access controller controls the data transmission between the first buffer and the hub, and between the hub and the outside of the chip, which can better coordinate multiple bus devices in the chip, multiple ports of the hub, and multiple first buffers. The endpoint also provides a hardware foundation for improving the overall data transmission efficiency of the chip.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是本发明实施例提供的一种资源管理芯片的结构图;FIG. 1 is a structural diagram of a resource management chip provided by an embodiment of the present invention;

图2是现有技术中USB总线的拓扑图;Fig. 2 is the topological diagram of USB bus in the prior art;

图3是现有技术中USB设备的内部逻辑示意图;FIG. 3 is a schematic diagram of the internal logic of a USB device in the prior art;

图4是本发明实施例提供的另一种资源管理芯片的结构图;FIG. 4 is a structural diagram of another resource management chip provided by an embodiment of the present invention;

图5是现有技术中USB协议的时间片示意图;FIG. 5 is a schematic diagram of a time slice of the USB protocol in the prior art;

图6是本发明实施例的DMA控制逻辑的示意图;FIG. 6 is a schematic diagram of a DMA control logic according to an embodiment of the present invention;

图7是本发明实施例提供的又一种资源管理芯片的结构图;FIG. 7 is a structural diagram of another resource management chip provided by an embodiment of the present invention;

图8是本发明实施例提供的一种资源管理方法的步骤流程图;FIG. 8 is a flowchart of steps of a resource management method provided by an embodiment of the present invention;

图9是本发明实施例提供的服务器或交换机远程访问的示意图;FIG. 9 is a schematic diagram of remote access to a server or switch provided by an embodiment of the present invention;

图10是本发明实施例提供的一种电子设备的结构图。Fig. 10 is a structural diagram of an electronic device provided by an embodiment of the present invention.

附图标记:Reference signs:

设备控制器10;集线器20;总线设备30;第一缓冲器40;访问控制器50;端口201;第一端点202;第二端点301;第一寄存器101;第二寄存器102;第三寄存器103。Device controller 10; hub 20; bus device 30; first buffer 40; access controller 50; port 201; first endpoint 202; second endpoint 301; first register 101; second register 102; third register 103.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图1是本发明实施例提供的一种资源管理芯片的结构图,所述芯片包括:设备控制器10、集线器20、多个总线设备30、多个第一缓冲器40和访问控制器50;所述集线器20包括多个端口201和多个第一端点202;所述设备控制器10用于接收资源获取指令,并根据所述资源获取指令分配用于接收数据的总线设备30,以及,为所述总线设备30配置对应的端口201和第一端点202;其中,所述总线设备30通过所述端口201接入所述集线器20;所述总线设备30包括多个第二端点301;所述总线设备30用于将接收到的数据通过所述第二端点301发送给对应的第一缓冲器40;所述第一缓冲器40用于存储所述数据,以及,在所述访问控制器50控制下将所述数据发送给所述集线器20;所述集线器20用于通过所述第一端点202接收所述数据,以及,在所述访问控制器50控制下将所述数据输出到所述芯片外部;所述访问控制器50用于接收所述设备控制器10发送的控制指令,并根据所述控制指令控制所述第一缓冲器40和所述集线器20之间,以及所述集线器20和所述芯片外部之间进行数据传输。1 is a structural diagram of a resource management chip provided by an embodiment of the present invention, the chip includes: a device controller 10, a hub 20, a plurality of bus devices 30, a plurality of first buffers 40, and an access controller 50; The hub 20 includes a plurality of ports 201 and a plurality of first endpoints 202; the device controller 10 is configured to receive a resource acquisition instruction, and allocate a bus device 30 for receiving data according to the resource acquisition instruction, and, Configuring corresponding ports 201 and first endpoints 202 for the bus device 30; wherein, the bus device 30 accesses the hub 20 through the port 201; the bus device 30 includes a plurality of second endpoints 301; The bus device 30 is used to send the received data to the corresponding first buffer 40 through the second endpoint 301; the first buffer 40 is used to store the data, and, in the access control The data is sent to the hub 20 under the control of the access controller 50; the hub 20 is used to receive the data through the first endpoint 202, and output the data under the control of the access controller 50 to the outside of the chip; the access controller 50 is used to receive the control instruction sent by the device controller 10, and control the connection between the first buffer 40 and the hub 20 according to the control instruction, and the Data transmission is performed between the hub 20 and the outside of the chip.

本发明实施例中,设备控制器10通过芯片内部的电路与集线器20、多个总线设备30、多个第一缓冲器40和访问控制器50进行连接。设备控制器10可以对集线器20、多个总线设备30、多个第一缓冲器40和访问控制器50进行通用的逻辑设置,并对集线器20、多个总线设备30进行状态查询。设备控制器10可以对访问控制器50发出控制指令,控制访问控制器50控制集线器20、多个总线设备30、多个第一缓冲器40进行芯片内部和芯片外接设备之间的数据交互。In the embodiment of the present invention, the device controller 10 is connected to the hub 20 , multiple bus devices 30 , multiple first buffers 40 and the access controller 50 through circuits inside the chip. The device controller 10 can perform common logic settings on the hub 20 , multiple bus devices 30 , multiple first buffers 40 and the access controller 50 , and perform status inquiries on the hub 20 and multiple bus devices 30 . The device controller 10 can issue control instructions to the access controller 50, and control the access controller 50 to control the hub 20, multiple bus devices 30, and multiple first buffers 40 to perform data interaction between the internal chip and external devices connected to the chip.

本发明实施例中,集线器20包括多个端口201和多个第一端点202。设备控制器10用于接收到运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的中央处理器(Central Processing Unit,CPU)之上的软件发送的资源获取指令,根据资源获取指令分配用于接收数据的总线设备30,以及为该总线设备30配置对应的端口201和第一端点202。其中,多个总线设备30通过集线器20的多个端口201分别接入集线器20中。设备控制器10可以通过为总线设备30配置集线器20的端口201和第一端点202,形成模拟“插入”动作,使得总线设备30与集线器20建立实际通信连接,总线设备30可以通过端口201访问到集线器20,集线器20的第一端点202可以接收该总线设备30发送来的数据。In the embodiment of the present invention, the hub 20 includes multiple ports 201 and multiple first endpoints 202 . The device controller 10 is used to receive a resource acquisition instruction sent by software running on the chip or a software running on the central processing unit (Central Processing Unit, CPU) of the computer device attached to the chip, and according to the resource acquisition instruction A bus device 30 for receiving data is allocated, and a corresponding port 201 and a first endpoint 202 are configured for the bus device 30 . Wherein, multiple bus devices 30 are respectively connected to the hub 20 through multiple ports 201 of the hub 20 . The device controller 10 can configure the port 201 and the first endpoint 202 of the hub 20 for the bus device 30 to form a simulated "insert" action, so that the bus device 30 and the hub 20 establish an actual communication connection, and the bus device 30 can be accessed through the port 201 To the hub 20 , the first endpoint 202 of the hub 20 can receive the data sent by the bus device 30 .

本发明实施例中,总线设备30包括多个第二端点301,第二端点301是总线设备30中的最小可寻址单元,对应总线设备30硬件上的一个数据缓冲区,第二端点301用来接收和发送数据。第二端点301可以是一个单字节或4字节32位的缓存,此处仅是举例说明,本发明实施例不做限制。总线设备30用于通过第二端点301接收芯片外部发送来的数据,并将接收到的数据通过第二端点301发送给对应的第一缓冲器40。总线设备30中的多个第二端点301中有数据时,可以实时将数据发送到该总线设备30对应的第一缓冲器40中进行存储。设备控制器10在芯片初始化时为多个总线设备30配置各自对应的第一缓冲器40,即通过在第一缓冲器40与对应的总线设备30之间建立地址映射,使得第一缓冲器40与对应的总线设备30绑定,从而可以接收总线设备30通过第二端点301发送的数据。In the embodiment of the present invention, the bus device 30 includes a plurality of second endpoints 301, the second endpoint 301 is the smallest addressable unit in the bus device 30, corresponding to a data buffer on the hardware of the bus device 30, and the second endpoint 301 uses to receive and send data. The second endpoint 301 may be a single-byte or 4-byte 32-bit buffer, which is only an example here, and is not limited by this embodiment of the present invention. The bus device 30 is used to receive data sent from outside the chip through the second terminal 301 , and send the received data to the corresponding first buffer 40 through the second terminal 301 . When there is data in the plurality of second endpoints 301 in the bus device 30, the data may be sent to the first buffer 40 corresponding to the bus device 30 in real time for storage. The device controller 10 configures corresponding first buffers 40 for multiple bus devices 30 during chip initialization, that is, by establishing address mapping between the first buffers 40 and the corresponding bus devices 30, so that the first buffers 40 Bind with the corresponding bus device 30 so as to receive the data sent by the bus device 30 through the second endpoint 301 .

本发明实施例中,多个第一缓冲器40在硬件上是一个随机存取存储器(randomaccess memory,RAM)分成了多个区域,一个区域作为一个第一缓冲器40,第一缓冲器40比第二端点301具有更多的存储空间,可以比第二端点301存放更多的数据。第一缓冲器40用于存储对应的总线设备30通过第二端点301发送来的数据。当第一缓冲器40接收到来自访问控制器50的数据传输指令时,可以根据数据传输指令将存储的数据中相应的数据路由到集线器20中总线设备30对应的第一端点20上。In the embodiment of the present invention, the plurality of first buffers 40 is a random access memory (random access memory, RAM) divided into multiple regions in hardware, one region is used as a first buffer 40, and the first buffer 40 is larger than The second endpoint 301 has more storage space and can store more data than the second endpoint 301 . The first buffer 40 is used for storing data sent by the corresponding bus device 30 through the second endpoint 301 . When the first buffer 40 receives a data transmission instruction from the access controller 50, it can route corresponding data in the stored data to the first endpoint 20 corresponding to the bus device 30 in the hub 20 according to the data transmission instruction.

本发明实施例中,集线器20包括多个端口201,可以支持多个总线设备30接入,集线器20可以对接入的多个总线设备30进行管理,监测总线设备30的热插拔事件。集线器20用于通过第一端点202接收总线设备30通过第一缓冲器发送来的数据。其中,第一端点202是集线器20中的最小可寻址单元,对应集线器20上的一个数据缓冲区,第一端点202用来接收和发送数据。第一端点202可以是一个单字节或4字节32位的缓存,此处仅是举例说明,本发明实施例不做限制。集线器20中的多个第一端点202中有数据时,可以实时将数据发送到集线器20的数据缓存区域中进行存储。当集线器20接收到来自访问控制器50的数据传输指令时,可以根据数据传输指令将存储在数据缓存区域中的数据输出到芯片外部。In the embodiment of the present invention, the hub 20 includes a plurality of ports 201, which can support the access of multiple bus devices 30, and the hub 20 can manage the connected multiple bus devices 30, and monitor hot plug events of the bus devices 30. The hub 20 is used for receiving the data sent by the bus device 30 through the first buffer through the first endpoint 202 . Wherein, the first endpoint 202 is the smallest addressable unit in the hub 20, corresponding to a data buffer on the hub 20, and the first endpoint 202 is used to receive and send data. The first endpoint 202 may be a single-byte or 4-byte 32-bit buffer, which is only used for illustration and not limited by this embodiment of the present invention. When there is data in the multiple first endpoints 202 in the hub 20, the data may be sent to the data cache area of the hub 20 in real time for storage. When the hub 20 receives a data transmission instruction from the access controller 50, it can output the data stored in the data cache area to the outside of the chip according to the data transmission instruction.

本发明实施例中,当访问控制器50接收到设备控制器10发送的控制指令后,根据控制指令所表征的数据传输要求控制第一缓冲器40将存储的数据发送给集线器20,以及集线器20将存储的数据输出到芯片外部。In the embodiment of the present invention, after the access controller 50 receives the control instruction sent by the device controller 10, it controls the first buffer 40 to send the stored data to the hub 20 according to the data transmission requirement represented by the control instruction, and the hub 20 Output the stored data to the outside of the chip.

例如,本发明实施例的资源管理芯片可以是现场可编程门阵列芯片(FieldProgrammable Gate Array,FPGA),FPGA芯片内部实现的USB功能逻辑(USB IP)可以包括:一个USB设备控制器、一个USB集线器(USB hub)、多个USB总线设备、多个第一缓冲器40和访问控制器50。其中,第一缓冲器40可以是先进先出存储器(First Input First Output,FIFO),访问控制器50可以是直接访问控制器(Direct Memory Access,DMA)。其中,USB集线器可以包括六个向下的端口201和15个第一端点202,可以支持最多六个USB总线设备通过端口分别接入USB集线器进行管理。USB设备可以包括15个第二端点301。其中,本发明实施例的第一端点202和第二端点301可以是可编程端点,可编程端点支持批量传输(Bulktransfer)、控制传输(Control transfer)、同步传输(Isochronous transfer)和中断传输(Interrupt transfer)全部四种数据传输类型,还支持参数动态可调,如数据传输的最大传输包大小、轮询时间间隔等参数。For example, the resource management chip in the embodiment of the present invention can be a Field Programmable Gate Array chip (Field Programmable Gate Array, FPGA), and the USB function logic (USB IP) implemented inside the FPGA chip can include: a USB device controller, a USB hub (USB hub), a plurality of USB bus devices, a plurality of first buffers 40 and an access controller 50 . Wherein, the first buffer 40 may be a first-in-first-out memory (First Input First Output, FIFO), and the access controller 50 may be a direct access controller (Direct Memory Access, DMA). Wherein, the USB hub can include six downward ports 201 and 15 first endpoints 202, and can support up to six USB bus devices connected to the USB hub through the ports for management. The USB device may include 15 second endpoints 301 . Wherein, the first endpoint 202 and the second endpoint 301 of the embodiment of the present invention may be programmable endpoints, and the programmable endpoints support bulk transfer (Bulk transfer), control transfer (Control transfer), isochronous transfer (Isochronous transfer) and interrupt transfer ( Interrupt transfer) all four types of data transmission, and also supports dynamic adjustment of parameters, such as the maximum transmission packet size of data transmission, polling interval and other parameters.

需要说明的是,USB作为一种高速传输总线,需要承载多种业务类型的数据包传输,为了充分利用其带宽,USB协议中,从带宽、时延、完整性校验三个角度出发,将数据包分成了4种传输类型:控制传输、同步传输、中断传输、批量传输。其中,控制传输用于传输突发的、非周期性的数据,传输数据量小,对带宽、时延要求不高,但要求数据必须正确,因此需要完整性校验;同步传输用于传输等时数据,数据量大,对带宽、时延要求高,但不要求数据必须正确,比如摄像头;中断传输用于传输数据量小的实时数据,对时延要求高,且要求数据必须正确,比如键盘、鼠标;批量传输用于传输大数据量的存储类数据,时延要求不高,但要求数据必须正确,比如U盘。It should be noted that, as a high-speed transmission bus, USB needs to carry data packet transmission of various types of services. In order to make full use of its bandwidth, in the USB protocol, the Data packets are divided into 4 transfer types: control transfer, isochronous transfer, interrupt transfer, and bulk transfer. Among them, the control transmission is used to transmit bursty and non-periodic data, the transmission data volume is small, and the bandwidth and delay requirements are not high, but the data must be correct, so the integrity check is required; the synchronous transmission is used for transmission, etc. Real-time data, with a large amount of data, has high requirements on bandwidth and delay, but does not require the data to be correct, such as a camera; interrupt transmission is used to transmit real-time data with a small amount of data, has high requirements on delay, and requires the data to be correct, such as Keyboard, mouse; batch transfer is used to transfer large amount of storage data, the delay requirement is not high, but the data must be correct, such as U disk.

本发明实施例提供的资源管理芯片,可以通过芯片中的设备控制器10动态分配用于接收数据的总线设备30,以及,为总线设备30配置对应的端口201和第一端点202,使得芯片的多个总线设备30、集线器的多个端口201和多个第一端点202在硬件上动态可配,可以根据需求通过设备控制器进行灵活配置,实现多种不同的功能,一定程度上解决USB实体设备的资源固化,硬件上功能单一、资源不能分配的问题。此外,在芯片中设置多个总线设备30各自对应的第一缓冲器40,可以为总线设备30附加数据缓存区域,从而增加芯片的数据存储能力。另外,设备控制器10可以通过控制访问控制器50控制第一缓冲器40将存储的数据发送给集线器20,以及,控制集线器20将存储的数据输出到芯片外部。这样,由访问控制器来控制第一缓冲器40和集线器20之间,以及集线器20和芯片外部之间进行数据传输,可以更好地协调芯片内多个总线设备30、集线器的多个端口201和多个第一端点202,也为提高芯片的整体数据传输效率提供了硬件基础。The resource management chip provided by the embodiment of the present invention can dynamically allocate the bus device 30 for receiving data through the device controller 10 in the chip, and configure the corresponding port 201 and the first endpoint 202 for the bus device 30, so that the chip The multiple bus devices 30, the multiple ports 201 of the hub, and the multiple first endpoints 202 are dynamically configurable on the hardware, and can be flexibly configured through the device controller according to requirements, so as to realize various functions and solve the problem to a certain extent. The resources of the USB physical device are solidified, the hardware has a single function, and the resources cannot be allocated. In addition, setting the first buffer 40 corresponding to each of the multiple bus devices 30 in the chip can add a data buffer area for the bus device 30, thereby increasing the data storage capacity of the chip. In addition, the device controller 10 can control the first buffer 40 to send the stored data to the hub 20 by controlling the access controller 50 , and control the hub 20 to output the stored data to the outside of the chip. In this way, the access controller controls the data transmission between the first buffer 40 and the hub 20, and between the hub 20 and the outside of the chip, which can better coordinate multiple bus devices 30 and multiple ports 201 of the hub in the chip. and multiple first endpoints 202 also provide a hardware basis for improving the overall data transmission efficiency of the chip.

需要说明的是,现有技术中,USB总线拓扑包含的必选组件有:USB控制器和根集线器(root hub)。其中,根集线器一般集成在USB控制器内部,根集线器包含的可选组件有:最多5级的非根集线器(hub)以及形式各样的USB设备。USB控制器及根集线器是主机侧的硬件实现,用于发起USB请求块(USB Request Block,URB)请求以及检测USB设备的热拔插事件。目前的USB控制器标准包括:OHCI接口标准(Open Host Controller Interface,OHCI)、EHCI接口标准(Enhanced Host Controller Interface,EHCI)和XHCI接口标准(eXtensible Host Controller Interface,XHCI),分别支持USB1.1,USB2.0,以及USB3.0协议。作为USB总线上的设备侧实现,USB设备的一个功能逻辑被称为一个功能(function)。单一功能的USB设备,只包含一个function,如U盘、鼠标等。多功能的USB设备硬件设计上有两种实现方式,一种被称为复合设备(compound device),内部由一个hub以及与之绑定的多个function组成。另一种被称为组合设备(composite device),内部直接由多个相互独立的function组成,同时通过接口关联描述符(Interface Association Descriptor,IAD)加以组织。现有的USB产品,无论是单一function的USB设备,还是compound device,又或者是composite device,其功能都是在出厂时固化,比如U盘只支持存储功能,USB串口只支持串口通信功能。It should be noted that, in the prior art, the required components included in the USB bus topology are: a USB controller and a root hub (root hub). Wherein, the root hub is generally integrated inside the USB controller, and the optional components included in the root hub include: non-root hubs (hubs) of up to five levels and various USB devices. The USB controller and the root hub are hardware implementations on the host side, and are used to initiate a USB request block (USB Request Block, URB) request and detect a hot plug event of a USB device. The current USB controller standards include: OHCI interface standard (Open Host Controller Interface, OHCI), EHCI interface standard (Enhanced Host Controller Interface, EHCI) and XHCI interface standard (eXtensible Host Controller Interface, XHCI), respectively supporting USB1.1, USB2.0, and USB3.0 protocol. As the device side implementation on the USB bus, one functional logic of the USB device is called a function. A single-function USB device contains only one function, such as U disk, mouse, etc. There are two ways to realize the multifunctional USB device hardware design. One is called a compound device, which is composed of a hub and multiple functions bound to it. The other is called a composite device, which is directly composed of multiple independent functions internally, and is organized through an Interface Association Descriptor (IAD). Existing USB products, whether it is a single-function USB device, a compound device, or a composite device, have their functions fixed at the factory. For example, the U disk only supports the storage function, and the USB serial port only supports the serial communication function.

图2是现有技术中USB总线的拓扑图,如图2所示,第一层是主机和根集线器,根集线器一般集成在USB控制器中,根集线器可以包括最多5级的非根集线器以及形式各样的USB设备,USB设备的一个功能逻辑被称为一个功能。图2中第二层至第六层包括五级的非根集线器:集线器2至集线器7,第三层至第六层还包括USB设备多个功能,第六层的集线器7和第七层的功能可以组成一个复合设备。Figure 2 is a topology diagram of the USB bus in the prior art, as shown in Figure 2, the first layer is the host and the root hub, the root hub is generally integrated in the USB controller, the root hub can include up to 5 levels of non-root hubs and For various USB devices, a function logic of a USB device is called a function. In Figure 2, the second to sixth layers include five levels of non-root hubs: hub 2 to hub 7, the third to sixth layers also include multiple functions of USB devices, the sixth layer hub 7 and the seventh layer Functions can be composed into a composite device.

需要说明的是,本发明实施例提供的资源管理芯片通过集线器20和多个总线设备30可以实现一种设备侧资源动态可配的复合设备。USB协议中,将设备内部资源进一步细化为3个层级,包含配置(Configuration)、接口(Interface)和端点(Endpoint)。一个Interface表示USB设备的一个基本功能逻辑,在USB协议中,也被称为一个function,当USB设备具备多个功能时,它会包含多个Interface。多个Interface组合在一起,称为一个Configuration,不同的Configuration使设备表现出不同的功能组合。Endpoint是USB设备中最小的可寻址单元,对应硬件上的一个数据缓冲区,用来存放和发送USB数据,一个Interface可以包含多个Endpoint。图3是现有技术中USB设备的内部逻辑示意图,如图3所示,设备包括配置0和配置1两种功能组合,配置0包括接口0和接口1两种功能,配置1包括接口0、接口1和接口2三种功能,每个接口下包括1或2个端点,用来存放和发送USB数据。It should be noted that the resource management chip provided by the embodiment of the present invention can implement a composite device with dynamically configurable resources on the device side through the hub 20 and multiple bus devices 30 . In the USB protocol, the internal resources of the device are further subdivided into three levels, including configuration (Configuration), interface (Interface) and endpoint (Endpoint). An Interface represents a basic functional logic of a USB device. In the USB protocol, it is also called a function. When a USB device has multiple functions, it will contain multiple Interfaces. A combination of multiple Interfaces is called a Configuration, and different Configurations make the device display different combinations of functions. Endpoint is the smallest addressable unit in a USB device, corresponding to a data buffer on the hardware, used to store and send USB data, and an Interface can contain multiple Endpoints. Figure 3 is a schematic diagram of the internal logic of the USB device in the prior art. As shown in Figure 3, the device includes two function combinations of configuration 0 and configuration 1, configuration 0 includes two functions of interface 0 and interface 1, and configuration 1 includes interface 0, Interface 1 and interface 2 have three functions, and each interface includes 1 or 2 endpoints, which are used to store and send USB data.

图4是本发明实施例提供的另一种资源管理芯片的结构图,所述芯片包括:集线器20、多个总线设备30、多个第一缓冲器40、访问控制器50、第一寄存器101、第二寄存器102以及第三寄存器103;所述集线器20包括多个端口201和多个第一端点202;所述第一寄存器101用于查询各所述总线设备30和所述集线器20的当前状态,以及,根据所述资源获取指令设置用于接收数据的总线设备30、所述总线设备30对应的端口201和第一端点202;所述第二寄存器102用于向所述访问控制器50发送第一控制指令,使得所述访问控制器50根据所述第一控制指令打开指定的数据传输通道;所述第三寄存器103用于为各总线设备30分别设置对应的第一缓冲器40,以及查询各所述第一缓冲器40的当前状态;其中,所述总线设备30通过所述端口201接入所述集线器20;所述总线设备30包括多个第二端点301;所述总线设备30用于将接收到的数据通过所述第二端点301发送给对应的第一缓冲器40;所述第一缓冲器40用于存储所述数据,以及,在所述访问控制器50控制下将所述数据发送给所述集线器20;所述集线器20用于通过所述第一端点202接收所述数据,以及,在所述访问控制器50控制下将所述数据输出到所述芯片外部;所述访问控制器50用于接收所述第二寄存器102102发送的第一控制指令,并根据所述第一控制指令控制所述第一缓冲器40和所述集线器20之间,以及所述集线器20和所述芯片外部之间进行数据传输。4 is a structural diagram of another resource management chip provided by an embodiment of the present invention, the chip includes: a hub 20, a plurality of bus devices 30, a plurality of first buffers 40, an access controller 50, and a first register 101 , the second register 102 and the third register 103; the hub 20 includes a plurality of ports 201 and a plurality of first endpoints 202; the first register 101 is used to inquire about each of the bus devices 30 and the hub 20 The current state, and the bus device 30 for receiving data, the port 201 corresponding to the bus device 30 and the first endpoint 202 are set according to the resource acquisition instruction; the second register 102 is used to provide the access control The device 50 sends a first control instruction, so that the access controller 50 opens a specified data transmission channel according to the first control instruction; the third register 103 is used to set the corresponding first buffer for each bus device 30 40, and query the current status of each of the first buffers 40; wherein, the bus device 30 accesses the hub 20 through the port 201; the bus device 30 includes a plurality of second endpoints 301; the The bus device 30 is used to send the received data to the corresponding first buffer 40 through the second endpoint 301; the first buffer 40 is used to store the data, and, in the access controller 50 The data is sent to the hub 20 under the control; the hub 20 is used to receive the data through the first endpoint 202, and, under the control of the access controller 50, output the data to the outside the chip; the access controller 50 is configured to receive the first control instruction sent by the second register 102102, and control the connection between the first buffer 40 and the hub 20 according to the first control instruction, And data transmission is performed between the hub 20 and the outside of the chip.

需要说明的是,关于集线器20、多个总线设备30、多个第一缓冲器40、访问控制器50、端口201、第一端点202和第二端点301的说明可以参考上述资源管理芯片的详细说明,此处不再赘述。It should be noted that, for the description of the hub 20, multiple bus devices 30, multiple first buffers 40, access controller 50, port 201, first endpoint 202, and second endpoint 301, reference may be made to the resource management chip above. Detailed description will not be repeated here.

本发明实施例中,通过第一寄存器101、第二寄存器102以及第三寄存器103对芯片的整体资源进行配置和管理。其中,第一寄存器101用于通用逻辑的设置和状态查询,可以查询各总线设备30和集线器20的当前状态。在接收到运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件发送的资源获取指令后,可以根据资源获取指令设置用于接收数据的总线设备30,以及为该总线设备30配置对应的集线器端口201和第一端点202,形成模拟插入动作,使得总线设备30与集线器20建立实际通信连接,总线设备30可以通过端口201访问到集线器20,集线器20的第一端点202可以接收该总线设备30发送来的数据。In the embodiment of the present invention, the overall resources of the chip are configured and managed through the first register 101 , the second register 102 and the third register 103 . Among them, the first register 101 is used for general logic setting and status query, and can query the current status of each bus device 30 and hub 20 . After receiving the resource acquisition instruction sent by the software running on the chip or the software running on the CPU of the computer device attached to the chip, the bus device 30 for receiving data can be set according to the resource acquisition instruction, and for The bus device 30 configures the corresponding hub port 201 and the first end point 202 to form a simulated plug-in action, so that the bus device 30 establishes an actual communication connection with the hub 20, and the bus device 30 can access the hub 20 through the port 201, and the first terminal of the hub 20 An endpoint 202 can receive data sent by the bus device 30 .

本发明实施例中,第二寄存器102用于向访问控制器50发送第一控制指令,使得访问控制器50根据第一控制指令打开指定的数据传输通道,按照第一控制指令所表征的数据传输要求控制第一缓冲器40将存储的数据发送给集线器20,以及集线器20将存储的数据输出到芯片外部。第三寄存器103用于在芯片初始化时为多个总线设备30配置各自对应的第一缓冲器40,即通过在第一缓冲器40与对应的总线设备30之间建立地址映射,使得第一缓冲器40与对应的总线设备30绑定,从而可以接收总线设备30通过第二端点301发送的数据。第三寄存器103还用于查询各第一缓冲器40的当前状态,支持USB2.0协议高速模式特有的因特网探索流(Packet Internet Groper Flow,PING Flow),以响应USB主机控制器主动查询USB设备当前是否空闲的请求,在实际发送数据传输请求前,判定USB设备是否准备好接收数据,可以为软件优化提供硬件支持。In the embodiment of the present invention, the second register 102 is used to send the first control instruction to the access controller 50, so that the access controller 50 opens the specified data transmission channel according to the first control instruction, and transmits data according to the first control instruction. It is required to control the first buffer 40 to send the stored data to the hub 20, and the hub 20 to output the stored data to the outside of the chip. The third register 103 is used to configure the corresponding first buffers 40 for multiple bus devices 30 during chip initialization, that is, by establishing address mapping between the first buffers 40 and the corresponding bus devices 30, the first buffer The device 40 is bound to the corresponding bus device 30 so as to receive data sent by the bus device 30 through the second endpoint 301 . The third register 103 is also used to inquire about the current state of each first buffer 40, and supports the unique Internet exploration flow (Packet Internet Groper Flow, PING Flow) of the high-speed mode of the USB2. For the current idle request, before actually sending the data transmission request, determine whether the USB device is ready to receive data, which can provide hardware support for software optimization.

本发明实施例提供的资源管理芯片,可以通过芯片中的第一寄存器101动态分配用于接收数据的总线设备30,以及,为总线设备30配置对应的端口201和第一端点202,使得芯片的多个总线设备30、集线器的多个端口201和多个第一端点202在硬件上动态可配,可以根据需求通过设备控制器进行灵活配置,实现多种不同的功能,一定程度上解决USB实体设备的资源固化,硬件上功能单一、资源不能分配的问题。此外,在芯片中设置多个总线设备30各自对应的第一缓冲器40,可以为总线设备30附加数据缓存区域,从而增加芯片的数据存储能力。另外,第二寄存器102可以通过控制访问控制器50控制第一缓冲器40将存储的数据发送给集线器20,以及,控制集线器20将存储的数据输出到芯片外部。这样,由访问控制器来控制第一缓冲器40和集线器20之间,以及集线器20和芯片外部之间进行数据传输,可以更好地协调芯片内多个总线设备30、集线器的多个端口201和多个第一端点202。第三寄存器103可以通过查询各第一缓冲器40的当前状态,在实际发送数据传输请求前,判定USB设备是否准备好接收数据,可以为提高芯片的整体数据传输效率提供硬件基础。The resource management chip provided by the embodiment of the present invention can dynamically allocate the bus device 30 for receiving data through the first register 101 in the chip, and configure the corresponding port 201 and the first endpoint 202 for the bus device 30, so that the chip The multiple bus devices 30, the multiple ports 201 of the hub, and the multiple first endpoints 202 are dynamically configurable on the hardware, and can be flexibly configured through the device controller according to requirements, so as to realize various functions and solve the problem to a certain extent. The resources of the USB physical device are solidified, the hardware has a single function, and the resources cannot be allocated. In addition, setting the first buffer 40 corresponding to each of the multiple bus devices 30 in the chip can add a data buffer area for the bus device 30, thereby increasing the data storage capacity of the chip. In addition, the second register 102 can control the access controller 50 to control the first buffer 40 to send the stored data to the hub 20 , and control the hub 20 to output the stored data to the outside of the chip. In this way, the access controller controls the data transmission between the first buffer 40 and the hub 20, and between the hub 20 and the outside of the chip, which can better coordinate multiple bus devices 30 and multiple ports 201 of the hub in the chip. and a plurality of first endpoints 202 . The third register 103 can determine whether the USB device is ready to receive data by querying the current status of each first buffer 40 before actually sending the data transmission request, which can provide a hardware basis for improving the overall data transmission efficiency of the chip.

可选的,所述总线设备30包括第一接口;其中,所述第一接口包括第二控制端点,所述第二端点301设置在所述第一接口中;所述第二控制端点用于在所述第一寄存器101控制下控制所述第二端点301接收数据,以及,将所述数据发送给对应的第一缓冲器40;所述第一寄存器101还用于根据所述资源获取指令设置所述第一接口的数据传输类型,使得所述第一接口通过所述第二端点301接收所述数据传输类型的数据;其中,所述数据传输类型为视频控制类型、视频传输类型、串口传输类型、网络传输类型和人机交互类型中的任一种。Optionally, the bus device 30 includes a first interface; wherein, the first interface includes a second control endpoint, and the second endpoint 301 is set in the first interface; the second control endpoint is used for Control the second endpoint 301 to receive data under the control of the first register 101, and send the data to the corresponding first buffer 40; the first register 101 is also used to acquire instructions according to the resource Set the data transmission type of the first interface so that the first interface receives the data of the data transmission type through the second endpoint 301; wherein, the data transmission type is video control type, video transmission type, serial port Any of transmission type, network transmission type, and human-computer interaction type.

本发明实施例中,一个接口表示任一总线设备的一个基本功能逻辑,一个接口可以包括多个端点。本发明实施例的总线设备30包括一个接口即第一接口,表示总线设备30具备一种功能逻辑。本发明实施例的总线设备30可以具有视频控制、视频传输、串口传输、网络传输和人机交互中的任一种功能,本发明实施例对此不做限制。第一接口可以包括一个第二控制端点和多个第二端点301,第二控制端点用于控制多个第二端点301接收数据,以及,将数据发送给总线设备30对应的第一缓冲器40。In the embodiment of the present invention, an interface represents a basic functional logic of any bus device, and an interface may include multiple endpoints. The bus device 30 in the embodiment of the present invention includes an interface, that is, a first interface, which means that the bus device 30 has a functional logic. The bus device 30 in the embodiment of the present invention may have any function of video control, video transmission, serial port transmission, network transmission and human-computer interaction, which is not limited in the embodiment of the present invention. The first interface may include a second control endpoint and a plurality of second endpoints 301, the second control endpoint is used to control the plurality of second endpoints 301 to receive data, and send data to the first buffer 40 corresponding to the bus device 30 .

例如,本发明实施例的资源管理芯片的USB集线器可以包括六个向下的端口201和15个第一端点202,可以支持最多六个USB总线设备通过端口分别接入USB集线器进行管理。其中,每个USB总线设备包括一个第一接口和最多15个第二端点301,第一接口可以是可编程接口,每个第一接口可以对应一种功能逻辑。这样本发明实施例的资源管理芯片可以具有6个可编程接口,分别用于UVC视频控制、视频传输、CDC串口传输/ACM、CDC(ECM)网络传输和两组人机接口设备(Human Interface Device,HID)。相比于固态化的USB设备,可编程接口可以支持自身参数动态调整,如可以灵活设置绑定的端口数量、是否启用交替设置等,并且可通过USB设备控制器进行接口动态组合形成功能组合即配置,也可以通过USB设备控制器模拟触发插入或拔出的USB集线器动作。For example, the USB hub of the resource management chip in the embodiment of the present invention may include six downward ports 201 and 15 first endpoints 202, and may support up to six USB bus devices connected to the USB hub through the ports for management. Wherein, each USB bus device includes a first interface and a maximum of 15 second endpoints 301, the first interface may be a programmable interface, and each first interface may correspond to a function logic. In this way, the resource management chip of the embodiment of the present invention can have 6 programmable interfaces, which are respectively used for UVC video control, video transmission, CDC serial port transmission/ACM, CDC (ECM) network transmission and two groups of Human Interface Devices (Human Interface Devices). , HID). Compared with solid-state USB devices, the programmable interface can support dynamic adjustment of its own parameters, such as the flexible setting of the number of bound ports, whether to enable alternate settings, etc., and the interface can be dynamically combined through the USB device controller to form a functional combination. configuration, and can also be simulated by the USB device controller to trigger the action of plugging or unplugging a USB hub.

本发明实施例中,第一寄存器101还用于根据资源获取指令设置第一接口的数据传输类型,即为总线设备30设置功能,使得总线设备30可以具有视频控制、视频传输、串口传输、网络传输和人机交互中的任一种功能。在第一寄存器101控制下,第一接口可以通过第二端点301接收相应的数据传输类型的数据;其中,数据传输类型为视频控制、视频传输、串口传输、网络传输和人机交互中的任一种。In the embodiment of the present invention, the first register 101 is also used to set the data transmission type of the first interface according to the resource acquisition instruction, that is, to set the function for the bus device 30, so that the bus device 30 can have video control, video transmission, serial port transmission, network Any function in transmission and human-computer interaction. Under the control of the first register 101, the first interface can receive data of the corresponding data transmission type through the second endpoint 301; wherein, the data transmission type is any of video control, video transmission, serial port transmission, network transmission and human-computer interaction A sort of.

本发明实施例的总线设备30包括第一接口;其中,所述第一接口包括第二控制端点,所述第二端点设置301在所述第一接口中;所述第二控制端点用于在所述第一寄存器101控制下控制所述第二端点301接收数据,以及,将所述数据发送给对应的第一缓冲器40;所述第一寄存器101还用于根据所述资源获取指令设置所述第一接口的数据传输类型,使得所述第一接口通过所述第二端点301接收所述数据传输类型的数据;其中,所述数据传输类型为视频控制类型、视频传输类型、串口传输类型、网络传输类型和人机交互类型中的任一种。这样,使得本发明实施例的芯片可以具有多种功能的总线设备30,进一步地,可以通过第一寄存器101根据实际的需求对多个总线设备30进行动态分配,解决总线设备资源固化、功能单一,不能灵活配置的问题。The bus device 30 of the embodiment of the present invention includes a first interface; wherein, the first interface includes a second control endpoint, and the second endpoint is set 301 in the first interface; the second control endpoint is used for The first register 101 controls the second endpoint 301 to receive data, and sends the data to the corresponding first buffer 40; the first register 101 is also used to set according to the resource acquisition instruction The data transmission type of the first interface, so that the first interface receives the data of the data transmission type through the second endpoint 301; wherein, the data transmission type is video control type, video transmission type, serial port transmission Any of the types, network transmission types, and human-computer interaction types. In this way, the chip of the embodiment of the present invention can have bus devices 30 with multiple functions. Further, the first register 101 can be used to dynamically allocate multiple bus devices 30 according to actual needs, so as to solve the problem of bus device resource solidification and single function. , the problem that cannot be flexibly configured.

可选的,所述集线器20还包括第一控制端点和第二缓冲器;所述第一控制端点用于在所述第一寄存器101控制下控制所述第一端点202接收所述第一缓冲器40发送的数据,并通过所述第一端点202将所述数据发送给所述第二缓冲器进行存储;所述第二缓冲器用于接收并存储各所述第一端点202发送的数据,以及,根据所述访问控制器50发送的第二控制指令将所述数据发送到所述芯片外部。Optionally, the hub 20 further includes a first control endpoint and a second buffer; the first control endpoint is used to control the first endpoint 202 to receive the first buffer under the control of the first register 101. The data sent by the buffer 40, and send the data to the second buffer through the first endpoint 202 for storage; the second buffer is used to receive and store each data sent by the first endpoint 202 data, and, according to the second control instruction sent by the access controller 50, send the data to the outside of the chip.

本发明实施例中,集线器20可以包括默认的控制端点即第一控制端点和第二缓冲器。第二缓冲器在硬件上是一个缓存区域,第二缓冲器比第一端点202具有更多的存储空间,可以比第一端点202存放更多的数据。第二缓冲器用于接收并存储第一缓冲器40通过各第一端点202发送来的数据。当第二缓冲器接收到访问控制器50发送的第二控制指令后,可以根据第二控制指令所表征的数据传输要求将相应的数据发送到芯片外部。可选的,本发明实施例的集线器20还可以包括状态中断输入端点,状态中断输入端点用于表征该端点是输入类型,表示当前数据传输的方向是总线设备至芯片外接的主机。In the embodiment of the present invention, the hub 20 may include a default control endpoint, that is, a first control endpoint and a second buffer. The second buffer is a cache area in hardware. The second buffer has more storage space than the first endpoint 202 and can store more data than the first endpoint 202 . The second buffer is used to receive and store the data sent by the first buffer 40 through each first endpoint 202 . After receiving the second control instruction sent by the access controller 50, the second buffer may send corresponding data to the outside of the chip according to the data transmission requirement represented by the second control instruction. Optionally, the hub 20 in this embodiment of the present invention may also include a status interrupt input endpoint, which is used to indicate that the endpoint is an input type, indicating that the direction of current data transmission is from the bus device to the host connected to the chip.

例如,USB集线器可以包括一个第一控制端点、一个状态中断输入端点、最多15个第一端点202和一个第二缓冲器。其中,第二缓冲器可以是FIFO存储器。USB集线器可以通过FPGA芯片对外的4个USB引脚,经USB线缆挂接到外接计算机设备CPU内部的USB主机控制器下。For example, a USB hub may include a first control endpoint, a status interrupt input endpoint, up to 15 first endpoints 202 and a second buffer. Wherein, the second buffer may be a FIFO memory. The USB hub can be connected to the USB host controller inside the CPU of the external computer device through the 4 external USB pins of the FPGA chip through the USB cable.

本发明实施例提供的集线器20,可以通过第一控制端点控制第一端点202方便地实现第一缓冲器40和第二缓冲器之间的数据传输,设置第二缓冲器可以为集线器20附加数据缓存区域,从而增加芯片的数据存储能力。此外,第二缓冲器在访问控制器50控制下,可以方便地实现芯片和外接设备的数据传输,可以为提高芯片的整体数据传输效率提供了硬件基础。The hub 20 provided by the embodiment of the present invention can conveniently realize the data transmission between the first buffer 40 and the second buffer by controlling the first endpoint 202 through the first control endpoint, and setting the second buffer can be added to the hub 20 The data cache area, thereby increasing the data storage capacity of the chip. In addition, under the control of the access controller 50, the second buffer can conveniently realize the data transmission between the chip and the external device, and can provide a hardware basis for improving the overall data transmission efficiency of the chip.

可选的,所述第二缓冲器包括帧链表和数据链表;所述数据链表用于缓存所述总线设备30通过所述第一缓冲器40发送给所述集线器20的数据;所述帧链表用于确定所述集线器20当前待传输的数据,以及,根据所述第二控制指令将所述待传输的数据发送到所述芯片外部。Optionally, the second buffer includes a frame linked list and a data linked list; the data linked list is used to cache the data sent by the bus device 30 to the hub 20 through the first buffer 40; the frame linked list It is used for determining the data to be transmitted currently by the hub 20, and sending the data to be transmitted to the outside of the chip according to the second control instruction.

需要说明的是,为满足多种类型的数据在同一条共享通路上传输,USB协议从时间维度上把数据传输分成了多个时间片,每个时间片称为一个帧或微帧,每个帧内最高80%的时间,用于优先传输对时延要求高的数据,例如中断传输和同步传输类型的数据,在余下的时间内再传输对时延要求不高的数据,例如控制传输和批量传输类型的数据。It should be noted that, in order to meet the transmission of multiple types of data on the same shared channel, the USB protocol divides data transmission into multiple time slices from the time dimension. Each time slice is called a frame or microframe. Up to 80% of the time in the frame is used to preferentially transmit data with high latency requirements, such as interrupt transmission and synchronous transmission type data, and transmit data with low latency requirements in the remaining time, such as control transmission and Bulk transfer type of data.

本发明实施例的第二缓冲器包括两级链表,第一级是数据链表,第二级是帧链表。其中,帧链表用于确定集线器20当前时间片内待传输的数据,以及根据访问控制器50的第二控制指令在每个帧最高80%的时间内优先传输中断传输和同步传输类型的数据,在余下的时间内再传输控制传输和批量传输类型的数据,将待传输的数据发送到芯片外部。The second buffer in the embodiment of the present invention includes a two-level linked list, the first level is a data linked list, and the second level is a frame linked list. Wherein, the frame linked list is used to determine the data to be transmitted in the current time slice of the hub 20, and according to the second control instruction of the access controller 50, the interrupt transmission and synchronous transmission types of data are preferentially transmitted in each frame at most 80% of the time, In the remaining time, data of control transfer and bulk transfer type are transferred, and the data to be transferred is sent to the outside of the chip.

图5是现有技术中USB协议的时间片示意图,如图5所示,全速或低速帧的时间片大小为1毫秒,每一帧包括全速等时数据有效负载。高速微帧的时间片大小为125微秒,在USB2.0协议中,高速微帧的刻度是全速帧的1/8,每一帧包括高速等时数据有效负载,在一个每一帧包括全速等时数据有效负载中最高80%的时间内优先传输中断传输和同步传输类型的数据,在余下的时间内再传输控制传输和批量传输类型的数据。FIG. 5 is a schematic diagram of a time slice of the USB protocol in the prior art. As shown in FIG. 5 , the time slice size of a full-speed or low-speed frame is 1 millisecond, and each frame includes a full-speed isochronous data payload. The time slice size of the high-speed micro-frame is 125 microseconds. In the USB2.0 protocol, the scale of the high-speed micro-frame is 1/8 of the full-speed frame. Each frame includes high-speed isochronous data payloads, and each frame includes full-speed In the maximum 80% of the isochronous data payload, interrupt transfer and isochronous transfer type data are transmitted preferentially, and control transfer and bulk transfer type data are transmitted in the remaining time.

本发明实施例的第二缓冲器通过帧链表和数据链表可以满足总线协议对数据传输时间片的要求,这样可以使得本发明实施例的芯片具有更好的兼容性和实用价值,也可以为提高芯片的整体数据传输效率提供了硬件基础。The second buffer of the embodiment of the present invention can meet the requirements of the bus protocol to the data transmission time slice through the frame linked list and the data linked list, which can make the chip of the embodiment of the present invention have better compatibility and practical value, and can also improve The chip's overall data transfer efficiency provides the hardware foundation.

可选的,所述帧链表是一个指针数组,所述帧链表的任一指针指向所述数据链表中的一个数据;所述帧链表还用于根据所述第二控制指令设置当前帧内待传输的各类型数据包的占比,以及,在发送完当前帧的数据后根据下一指针从所述数据链表中获取下一帧的待传输数据,并将所述指针更新到所述设备控制器中进行存储。Optionally, the frame linked list is an array of pointers, and any pointer of the frame linked list points to a piece of data in the data linked list; the frame linked list is also used to set the current frame to be stored according to the second control instruction The proportion of each type of data packets transmitted, and, after sending the data of the current frame, obtain the data to be transmitted of the next frame from the data link list according to the next pointer, and update the pointer to the device control stored in the device.

本发明实施例中,帧链表是一个指针数组,包括多个指针。帧链表中的各指针分别指向数据链表中的多个数据。帧链表在接收到访问控制器50发送的第二控制指令后,可以根据第二控制指令设置当前帧内待传输的各类型数据包的占比,确定当前帧最高80%的时间内优先传输中断传输和同步传输类型的数据,在余下的时间内再传输控制传输和批量传输类型的数据。在当前帧启动传输后,帧链表可以准备下一帧需要发送的数据,即通过指针从数据链表中选择指定的需要传输的数据,并将选择出的数据对应的指针发送给设备控制器中帧链表对应的寄存器。In the embodiment of the present invention, the frame linked list is an array of pointers, including multiple pointers. Each pointer in the frame linked list points to a plurality of data in the data linked list respectively. After receiving the second control instruction sent by the access controller 50, the frame linked list can set the proportion of various types of data packets to be transmitted in the current frame according to the second control instruction, and determine the priority transmission interruption within 80% of the current frame. Transfer and isochronous transfer types of data, and control transfer and bulk transfer type data for the remainder of the time. After the transmission of the current frame is started, the frame link list can prepare the data to be sent in the next frame, that is, select the specified data to be transmitted from the data link list through the pointer, and send the pointer corresponding to the selected data to the frame in the device controller The register corresponding to the linked list.

本发明实施例的帧链表通过各指针可以合理地安排数据发送的顺序和类型,方便地实现总线协议对数据传输时间片的要求。The frame linked list in the embodiment of the present invention can reasonably arrange the sequence and type of data transmission through each pointer, and conveniently realize the requirement of the bus protocol on the time slice of data transmission.

可选的,所述访问控制器50包括多个传输通道、通道选择模块和总线仲裁器;所述多个传输通道各自具有通道编号和相应的通道优先级;所述通道选择模块用于根据所述设备控制器发送的第一控制指令打开所述第一控制指令指定的传输通道;其中,所述第一控制指令包括所需打开的传输通道的通道编号;所述总线仲裁器用于在多个传输通道的通道优先级相同的情况下,根据通道编号对各传输通道进行排序,并依据排序顺序控制各传输通道进行数据传输。Optionally, the access controller 50 includes multiple transmission channels, a channel selection module, and a bus arbiter; each of the multiple transmission channels has a channel number and a corresponding channel priority; The first control instruction sent by the device controller opens the transmission channel specified by the first control instruction; wherein, the first control instruction includes the channel number of the transmission channel to be opened; the bus arbiter is used for multiple When the channel priorities of the transmission channels are the same, the transmission channels are sorted according to the channel numbers, and the transmission channels are controlled to perform data transmission according to the sort order.

本发明实施例中,访问控制器50可以包括多个存储设备类型的传输通道,运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件可以在芯片初始化时设置各传输通道的优先级,本发明实施例的访问控制器可以支持最多四档优先级设置。在通道选择模块接收到设备控制器10中访问控制器相关的寄存器发送的第一控制指令后,首先由运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件进行软件阶段的仲裁,确定第一控制指令指定打开的传输通道的优先级,并根据通道优先级打开指定的传输通道。在软件阶段的仲裁出现多个传输通道的通道优先级相同的情况下,总线仲裁器可以根据通道编号对相同优先级的各传输通道进行排序,确定较低编号的传输通道比较高编号的传输通道具备更高的传输优先级,并依据排序顺序控制各传输通道进行数据传输。In the embodiment of the present invention, the access controller 50 may include a plurality of storage device-type transmission channels, and the software running on the chip or the software running on the CPU of the computer device connected to the chip can be set when the chip is initialized. For the priority of each transmission channel, the access controller in the embodiment of the present invention can support up to four priority settings. After the channel selection module receives the first control instruction sent by the register related to the access controller in the device controller 10, at first the software running on the chip or the software running on the CPU of the computer device connected to the chip Carry out arbitration in the software stage, determine the priority of the transmission channel designated to be opened by the first control instruction, and open the designated transmission channel according to the channel priority. In the case of the same channel priority of multiple transmission channels in the arbitration of the software stage, the bus arbiter can sort the transmission channels of the same priority according to the channel number, and determine that the transmission channel with a lower number is better than the transmission channel with a higher number. It has a higher transmission priority, and controls each transmission channel for data transmission according to the sort order.

例如,本发明实施例的访问控制器50可以是DMA控制器,DMA控制器可以包括8个存储设备(memory-device)类型的DMA传输通道,运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件可以通过USB设备控制器给出的DMA相关寄存器,控制通道选择模块打开指定的传输通道。总线仲裁器可以根据DMA传输请求的优先级,优先传输指定传输通道的数据。For example, the access controller 50 in the embodiment of the present invention can be a DMA controller, and the DMA controller can include 8 memory-device type DMA transmission channels, and the software running on the chip or running on the chip The software on the CPU of the connected computer device can control the channel selection module to open the specified transmission channel through the DMA related register provided by the USB device controller. The bus arbiter can preferentially transmit the data of the specified transmission channel according to the priority of the DMA transmission request.

需要说明的是,为了满足USB数据带宽及业务响应速度的要求,本发明实施例的芯片包括DMA控制逻辑,用于在USB设备对应的硬件FIFO和内存之间传输数据。DMA控制器可以直接挂接在32位高级高性能总线(Advanced High Performance Bus,AHB),支持全部4G总线地址访问。需要注意的是,软件业务上实时使用的FIFO数量可能大于DMA传输通道数量,因此,运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件可以在传输通道申请失败时重新发起DMA传输请求。It should be noted that, in order to meet the requirements of USB data bandwidth and service response speed, the chip in the embodiment of the present invention includes DMA control logic for transferring data between the hardware FIFO corresponding to the USB device and the internal memory. The DMA controller can be directly connected to the 32-bit Advanced High Performance Bus (AHB), and supports all 4G bus address access. It should be noted that the number of FIFOs used in real time in software services may be greater than the number of DMA transmission channels. Therefore, the software running on the chip or the software running on the CPU of the computer device connected to the chip can apply for Re-initiate DMA transfer request on failure.

本发明实施例中,访问控制器50通过通道选择模块和总线仲裁器可以方便地控制多个传输通道中的数据传输,根据各传输通道的编号和优先级合理地安排总线上的数据传输顺序,可以为提高芯片的整体传输效率提供硬件支持。In the embodiment of the present invention, the access controller 50 can conveniently control the data transmission in multiple transmission channels through the channel selection module and the bus arbiter, and reasonably arrange the data transmission sequence on the bus according to the number and priority of each transmission channel, It can provide hardware support for improving the overall transmission efficiency of the chip.

图6是本发明实施例的DMA控制逻辑的示意图,如图6所示,DMA控制器包括多个传输通道、通道选择模块和总线仲裁器,DMA控制器的多个传输通道可以与多个FIFO建立连接,设备控制器中与DMA控制器相关的寄存器可以与通道选择模块和总线仲裁器建立连接,通道选择模块可以根据设备控制器发送的第一控制指令打开指定的传输通道,总线仲裁器在收到硬件仲裁的控制指令后,可以根据通道编号对相同优先级的各传输通道进行排序,确定较低编号的传输通道比较高编号的传输通道具备更高的传输优先级,并依据排序顺序通过通道选择模块控制各传输通道进行数据传输,使得DMA控制器可以在设备控制器的控制下在FIFO与芯片外接设备的内存之间进行数据传输。Fig. 6 is the schematic diagram of the DMA control logic of the embodiment of the present invention, as shown in Fig. 6, DMA controller comprises a plurality of transmission channels, channel selection module and bus arbiter, and a plurality of transmission channels of DMA controller can be connected with a plurality of FIFOs To establish a connection, the registers related to the DMA controller in the device controller can establish a connection with the channel selection module and the bus arbiter, the channel selection module can open the specified transmission channel according to the first control command sent by the device controller, and the bus arbiter is in the After receiving the control command of the hardware arbitration, the transmission channels of the same priority can be sorted according to the channel number, and it is determined that the transmission channel with a lower number has a higher transmission priority than the transmission channel with a higher number, and passes through according to the sorting order. The channel selection module controls each transmission channel to perform data transmission, so that the DMA controller can perform data transmission between the FIFO and the memory of the chip external device under the control of the device controller.

可选的,所述第一缓冲器40包括路由逻辑模块、共享传输缓冲器和专用传输缓冲器;所述路由逻辑模块用于解析所述总线设备30发送数据的数据包类型,并过滤不符合预设规定的数据包,以确定所述总线设备30发送的数据为符合第一时延要求的第一数据或符合第二时延要求的第二数据;所述共享传输缓冲器用于接收所述路由逻辑模块路由来的所述第一数据,以及,在所述访问控制器50控制下将所述第一数据发送给所述集线器20;所述专用传输缓冲器用于接收所述路由逻辑模块路由来的所述第二数据,以及,在所述访问控制器50控制下将所述第二数据发送给所述集线器20。Optionally, the first buffer 40 includes a routing logic module, a shared transmission buffer and a dedicated transmission buffer; the routing logic module is used to analyze the packet type of the data sent by the bus device 30, and filter the data packets that do not meet the A predetermined data packet is preset to determine that the data sent by the bus device 30 is the first data meeting the first delay requirement or the second data meeting the second delay requirement; the shared transmission buffer is used to receive the The first data routed by the routing logic module, and, under the control of the access controller 50, the first data is sent to the hub 20; the dedicated transmission buffer is used to receive the routing logic module route the incoming second data, and, under the control of the access controller 50, send the second data to the hub 20.

本发明实施例的路由逻辑模块可以解析总线设备30发送数据的数据包类型,还可以通过判断数据包类型过滤不合法的数据包。其中,数据包类型包括控制传输、同步传输、中断传输、批量传输四种传输类型。其中,控制传输和批量传输类型的数据包在传输时对时延的要求低,可以将总线设备30发送数据中对时延的要求低也即符合第一时延要求的数据,确定为第一数据,第一数据由共享传输缓冲器进行传输。其中,同步传输和中断传输类型的数据包在传输时对时延的要求高,可以将总线设备30发送数据中对时延的要求高也即符合第二时延要求的数据,确定为第二数据,第二数据由专用传输缓冲器进行传输。The routing logic module in the embodiment of the present invention can analyze the data packet type of the data sent by the bus device 30, and can also filter illegal data packets by judging the data packet type. Among them, the data packet type includes four transmission types: control transmission, synchronous transmission, interrupt transmission, and batch transmission. Among them, the data packets of the control transmission and bulk transfer types have low requirements on time delay during transmission, and the data sent by the bus device 30 can be determined as the first data that has low requirements on time delay, that is, meets the first time delay requirement. Data, the first data is transmitted by the shared transmission buffer. Wherein, the data packets of the synchronous transmission and interrupt transmission types have high requirements on time delay during transmission, and the data sent by the bus device 30 to the time delay requirements can be high, that is, data that meets the second time delay requirement, can be determined as the second time delay requirement. data, and the second data is transmitted by a dedicated transmission buffer.

例如,第一缓冲器40可以是FIFO存储器,则第一缓冲器40可以包括FIFO路由逻辑模块、共享传输FIFO和专用传输FIFO。可选的,运行于芯片之上的软件或者是运行于芯片挂接的计算机设备的CPU之上的软件可以通过USB设备管理器中FIFO相关的寄存器,设置这部分FIFO的类型、大小、FIFO中断的触发阈值等参数。For example, the first buffer 40 may be a FIFO memory, and then the first buffer 40 may include a FIFO routing logic module, a shared transmission FIFO and a dedicated transmission FIFO. Optionally, the software running on the chip or the software running on the CPU of the computer device connected to the chip can set the type, size and FIFO interrupt of this part of the FIFO through the FIFO-related registers in the USB device manager. The trigger threshold and other parameters.

本发明实施例的第一缓冲器40通过路由逻辑模块、共享传输缓冲器和专用传输缓冲器可以方便地解析数据包类型、过滤不符合预设规定的数据包,以及根据数据包的类型合理地选择共享传输缓冲器和专用传输缓冲器分别传输相应的数据,使得本发明实施例的芯片可以满足总线协议中关于数据传输类型的要求,可以承载多种业务类型的数据包传输,充分地利用带宽。The first buffer 40 of the embodiment of the present invention can conveniently analyze the data packet type, filter the data packets that do not meet the preset regulations through the routing logic module, the shared transmission buffer and the dedicated transmission buffer, and reasonably Select the shared transmission buffer and the dedicated transmission buffer to transmit corresponding data respectively, so that the chip of the embodiment of the present invention can meet the requirements of the data transmission type in the bus protocol, can carry the data packet transmission of various business types, and fully utilize the bandwidth .

需要说明的是,本发明实施例的设备管理器10可以支持数据包发送失败时自动重试机制,USB设备控制器硬件上支持校验每一帧完整数据驱动到总线上的字节数,当实际的帧数据字节数与之不符时,则不会把当前帧在数据链表上对应的数据从链表中删除,而帧链表中的数据会被清除。同时,通过状态寄存器通知软件层的驱动,驱动将这帧数据重新加入到调度队列,并在随后的某一合适时间点,重新组成一帧新的数据,即更新帧链表。本发明实施例的设备管理器10还可以支持USB远程唤醒功能,远程唤醒功能可以在绑定HID人机交互接口时使用。当USB总线空闲,USB主机控制器会进入暂停状态时,远程的键盘或鼠标可以通过远程唤醒功能唤醒USB主机控制器,使主机控制器从暂停状态恢复到待机状态。It should be noted that the device manager 10 of the embodiment of the present invention can support an automatic retry mechanism when the data packet transmission fails, and the USB device controller hardware supports checking the number of bytes driven by each frame of complete data on the bus. When the actual number of frame data bytes does not match it, the data corresponding to the current frame on the data link list will not be deleted from the linked list, and the data in the frame linked list will be cleared. At the same time, the driver of the software layer is notified through the status register, and the driver re-adds this frame of data to the scheduling queue, and at an appropriate point in time, recomposes a new frame of data, that is, updates the frame linked list. The device manager 10 in the embodiment of the present invention can also support a USB remote wake-up function, and the remote wake-up function can be used when binding the HID human-computer interaction interface. When the USB bus is idle and the USB host controller enters the suspend state, the remote keyboard or mouse can wake up the USB host controller through the remote wake-up function, so that the host controller returns from the suspend state to the standby state.

图7是本发明实施例的又一资源管理芯片的结构图,如图7所示,芯片包括USB设备控制器,USB集线器,USB设备,DMA控制器调度,第一缓冲器的FIFO路由逻辑模块、共享传输FIFO和专用传输FIFO,USB集线器的帧链表和数据链表。其中,USB设备控制器包括DMA控制器寄存器、控制及状态寄存器和FIFO控制寄存器。USB设备包括多个第二端口1至X,USB集线器包括多个端口0至X以及多个第一端点1至X。其中,帧链表和数据链表在USB集线器的第二缓冲器中。在本发明实施例的资源管理芯片可以是PCB电路板,设备控制器通过芯片上的电路使得DMA控制器寄存器与DMA控制器相连接,使得控制及状态寄存器与USB设备和USB集线器相连接,使得FIFO控制寄存器与第一缓冲器和USB集线器中的第二缓冲器相连接。USB集线器可以通过多个第二端点分别与数据链表中的各数据缓冲区建立通信连接。帧链表的指针指向数据链表中的一个数据。Fig. 7 is a structural diagram of another resource management chip according to an embodiment of the present invention. As shown in Fig. 7, the chip includes a USB device controller, a USB hub, a USB device, DMA controller scheduling, and a FIFO routing logic module of the first buffer , Shared transmission FIFO and dedicated transmission FIFO, frame linked list and data linked list of USB hub. Among them, the USB device controller includes DMA controller registers, control and status registers and FIFO control registers. The USB device includes a plurality of second ports 1 to X, and the USB hub includes a plurality of ports 0 to X and a plurality of first endpoints 1 to X. Wherein, the frame linked list and the data linked list are in the second buffer of the USB hub. The resource management chip in the embodiment of the present invention can be a PCB circuit board, and the device controller connects the DMA controller register with the DMA controller through the circuit on the chip, so that the control and status registers are connected with the USB device and the USB hub, so that The FIFO control register is connected with the first buffer and the second buffer in the USB hub. The USB hub can respectively establish a communication connection with each data buffer in the data link list through a plurality of second endpoints. The pointer of the frame linked list points to a piece of data in the data linked list.

需要说明的是,本发明的资源管理芯片通过动态可配的USB接口和端点,可以获得USB资源可动态申请释放的效果,以解决USB实体设备资源固化、不能按产品需求灵活配置的问题。同时,本发明的资源管理芯片提供芯片级的USB资源集,为片上USB设备之间的协同配合提供硬件支持,并且基于FIFO硬件配合软件驱动算法,以提高USB总线和设备的整体传输效率。在此基础上,基于FPGA芯片的USB资源池采用模块化设计,具有良好的可扩展性,可根据具体项目产品需求,裁剪FPGA芯片上的USB资源,灵活设置总USB资源量以及多种USB资源组合,使得USB资源够用且不浪费。It should be noted that, through the dynamically configurable USB interface and endpoints, the resource management chip of the present invention can obtain the effect that USB resources can be applied for and released dynamically, so as to solve the problem that USB physical device resources are fixed and cannot be flexibly configured according to product requirements. At the same time, the resource management chip of the present invention provides a chip-level USB resource set, provides hardware support for the cooperation between on-chip USB devices, and cooperates with software-driven algorithms based on FIFO hardware to improve the overall transmission efficiency of the USB bus and devices. On this basis, the USB resource pool based on the FPGA chip adopts a modular design and has good scalability. According to the specific project product requirements, the USB resources on the FPGA chip can be cut, and the total amount of USB resources and various USB resources can be flexibly set. Combination, so that USB resources are sufficient and not wasted.

图8是本发明实施例提供的一种资源管理方法的步骤流程图,如图8所示,一种资源管理方法,应用于如上任一所述的芯片,所述方法包括:Fig. 8 is a flow chart of the steps of a resource management method provided by an embodiment of the present invention. As shown in Fig. 8, a resource management method is applied to any of the chips described above, and the method includes:

步骤601、向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点。Step 601: Send a resource acquisition instruction to the device controller, control the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and configure a corresponding hub port and a first endpoint for the bus device .

步骤602、通过所述设备控制器控制所述总线设备接收所述数据,以及将所述数据通过第二端点发送给对应的第一缓冲器。Step 602: Control the bus device to receive the data through the device controller, and send the data to the corresponding first buffer through the second endpoint.

步骤603、通过所述设备控制器控制所述第一缓冲器接收并存储所述总线设备发送来的数据。Step 603: The device controller controls the first buffer to receive and store the data sent by the bus device.

步骤604、通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据输出到所述芯片外部。Step 604: Send a control instruction to the access controller through the device controller, control the access controller to control the first buffer to send the data to the hub according to the control instruction, and control the hub receiving the data through the first endpoint and outputting the data to the outside of the chip.

本发明实施例中,运行于芯片之上的资源管理程序可以向设备控制器发送资源获取指令,设备管理器根据资源获取指令所指示的数据传输需求分配用于接收数据的总线设备,以及,为总线设备配置对应的集线器端口和第一端点。使得该总线设备与集线器通过端口形成模拟“插入”动作,建立实际通信连接,总线设备可以通过端口访问到集线器,集线器的第一端点可以接收该总线设备发送来的数据。例如,资源管理程序可以向设备控制器发送串口传输资源获取指令,控制设备控制器分配用于接收串口日志的总线设备,以及,为总线设备配置对应的集线器端口和第一端点。In the embodiment of the present invention, the resource management program running on the chip can send a resource acquisition instruction to the device controller, and the device manager allocates a bus device for receiving data according to the data transmission requirements indicated by the resource acquisition instruction, and, for The bus device is configured with a corresponding hub port and a first endpoint. The bus device and the hub form a simulated "plug-in" action through the port to establish an actual communication connection, the bus device can access the hub through the port, and the first end point of the hub can receive the data sent by the bus device. For example, the resource management program may send a serial port transmission resource acquisition instruction to the device controller, control the device controller to allocate a bus device for receiving serial port logs, and configure a corresponding hub port and first endpoint for the bus device.

本发明实施例中,运行于芯片之上的资源管理程序可以通过设备管理器控制总线设备和集线器在远程客户端和芯片的外接设备之间传输数据,以实现远程客户端对芯片的外接设备的远程访问。其中,本地CPU通过USB线及USB协议栈向本发明实施例的资源管理芯片发送URB数据包,资源管理程序可以通过设备管理器驱动控制总线设备和集线器接收URB数据包,并将URB数据包发送给资源管理程序,资源管理程序负责解析URB数据包并将其重新封装成网络数据包,并通过网络协议栈及网络通路传输给远端的客户端。资源管理程序在接收到远程客户端发送的网络数据包后,由运行于芯片上的各类驱动和协议栈进行解析和重新打包,把裸数据给到本发明实施例的资源管理芯片,资源管理芯片再打包成URB数据包。资源管理程序可以通过设备管理器驱动控制总线设备和集线器将URB数据包通过USB线及USB协议栈发送给芯片外接设备的本地CPU。In the embodiment of the present invention, the resource management program running on the chip can control the bus device and the hub to transmit data between the remote client and the external device of the chip through the device manager, so as to realize the connection between the remote client and the external device of the chip. remote access. Wherein, the local CPU sends the URB data packet to the resource management chip of the embodiment of the present invention through the USB line and the USB protocol stack, and the resource management program can drive and control the bus device and the hub to receive the URB data packet through the device manager, and send the URB data packet For the resource management program, the resource management program is responsible for parsing the URB data packet and repackaging it into a network data packet, and transmitting it to the remote client through the network protocol stack and network path. After the resource management program receives the network data packet sent by the remote client, it is analyzed and repackaged by various drivers and protocol stacks running on the chip, and the raw data is given to the resource management chip of the embodiment of the present invention. Resource management The chips are then packaged into URB packets. The resource management program can drive and control the bus device and the hub through the device manager to send the URB data packet to the local CPU of the chip external device through the USB cable and the USB protocol stack.

本发明实施例中,通过向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点。可以根据需求通过设备控制器对芯片资源进行灵活配置,实现多种不同的功能。通过所述设备控制器控制所述总线设备接收所述数据,以及将所述数据通过第二端点发送给对应的第一缓冲器;通过所述设备控制器控制所述第一缓冲器接收并存储所述总线设备发送来的数据;通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据输出到所述芯片外部。这样,可以更好地协调芯片内多个总线设备、集线器的多个端口和多个第一端点,提高芯片的整体数据传输效率。In the embodiment of the present invention, by sending a resource acquisition instruction to the device controller, the device controller is controlled to allocate a bus device for receiving data according to the resource acquisition instruction, and configure the bus device with a corresponding hub port and first endpoint. Chip resources can be flexibly configured through the device controller according to requirements to realize various functions. Control the bus device to receive the data through the device controller, and send the data to the corresponding first buffer through the second endpoint; control the first buffer to receive and store the data through the device controller The data sent by the bus device; the device controller sends a control instruction to the access controller, and controls the access controller to control the first buffer to send the data to the hub according to the control instruction , and controlling the hub to receive the data through the first endpoint and output the data to the outside of the chip. In this way, multiple bus devices in the chip, multiple ports of the hub and multiple first endpoints can be better coordinated, and the overall data transmission efficiency of the chip can be improved.

可选的,所述资源获取指令根据远程客户端对所述芯片的外接设备发送的远程访问指令生成;在所述远程访问指令表征所述远程客户端向所述外接设备发送数据的情况下,所述向设备控制器发送资源获取指令之前,所述方法还包括:Optionally, the resource acquisition instruction is generated according to the remote access instruction sent by the remote client to the external device of the chip; when the remote access instruction indicates that the remote client sends data to the external device, Before sending the resource acquisition instruction to the device controller, the method further includes:

步骤605、通过运行于所述芯片之上的资源管理程序接收所述远程客户端发送的远程数据包。Step 605: Receive the remote data packet sent by the remote client through the resource management program running on the chip.

步骤606、通过所述资源管理程序将所述远程数据包发送给运行于所述芯片之上的数据传输程序进行解析及处理,以获得第一数据包。Step 606: Send the remote data packet to a data transmission program running on the chip for parsing and processing through the resource management program, so as to obtain a first data packet.

步骤601包括以下步骤:Step 601 includes the following steps:

步骤6011、所述资源管理程序通过运行于所述芯片之上的芯片驱动程序向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点。Step 6011, the resource management program sends a resource acquisition instruction to the device controller through the chip driver program running on the chip, and controls the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, And, configuring a corresponding hub port and a first endpoint for the bus device.

步骤604包括以下步骤:Step 604 includes the following steps:

步骤6041、通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据传输给所述外接设备,以实现所述远程客户端对所述外接设备的远程访问。Step 6041: Send a control instruction to the access controller through the device controller, control the access controller to control the first buffer to send the data to the hub according to the control instruction, and control the hub receiving the data through the first endpoint and transmitting the data to the external device, so as to realize the remote access of the remote client to the external device.

本发明实施例中,运行于芯片之上的资源管理程序可以接收远程客户端发送的远程访问指令,并根据远程访问指令生成资源获取指令。其中,远程访问指令可以包括进行用户安全级别验证、动态调整设备资源、文件加密传输,此处仅是举例说明,本发明实施例对此不做限制。其中,动态调整设备资源包括指定设备插入或拔出,以及调整指定设备的参数。例如,资源管理程序以服务器的角色接收远程个人计算机(Personal Computer,PC)发送的客户机请求,请求访问服务器的串口日志。In the embodiment of the present invention, the resource management program running on the chip can receive the remote access instruction sent by the remote client, and generate a resource acquisition instruction according to the remote access instruction. Wherein, the remote access instruction may include user security level verification, dynamic adjustment of device resources, and file encrypted transmission, which are only illustrated here, and are not limited in this embodiment of the present invention. Wherein, dynamically adjusting device resources includes inserting or removing a specified device, and adjusting parameters of the specified device. For example, the resource management program receives a client request sent by a remote personal computer (Personal Computer, PC) in the role of a server, and requests to access the serial port log of the server.

本发明实施例中,在所述远程访问指令表征远程客户端向外接设备发送数据的情况下,资源管理程序接收远程客户端发送的远程数据包,由运行于芯片上数据传输程序对远程数据包进行解析和重新打包,以获得第一数据包。资源管理程序可以通过运行于芯片之上的芯片驱动程序向设备控制器发送资源获取指令,控制设备控制器分配用于接收数据的总线设备,以及,为总线设备配置对应的集线器端口和第一端点。总线设备在设备控制器控制下接收资源管理程序发送的第一数据包,并将第一数据包通过第二端点发送给第一缓冲器进行存储。其中,芯片驱动程序包括设备管理器驱动。In the embodiment of the present invention, in the case where the remote access instruction indicates that the remote client sends data to the external device, the resource management program receives the remote data packet sent by the remote client, and the remote data packet is processed by the data transmission program running on the chip. Parse and repack to obtain the first packet. The resource management program can send a resource acquisition instruction to the device controller through the chip driver running on the chip, control the device controller to allocate a bus device for receiving data, and configure the corresponding hub port and first end for the bus device point. The bus device receives the first data packet sent by the resource management program under the control of the device controller, and sends the first data packet to the first buffer through the second endpoint for storage. Wherein, the chip driver includes a device manager driver.

本发明实施例中,资源管理程序可以通过设备管理器驱动控制设备管理器,向访问控制器发送第一数据传输指令。访问控制器接收到第一数据传输指令,根据第一数据传输指令控制第一缓冲器将第一数据包发送给集线器。集线器通过第一端点接收第一缓冲器发送的第一数据包,并将第一数据包存储到第二缓冲器中。在访问控制器的控制下,集线器将第一数据包通过第二缓冲器中数据链表和帧链表发送给外接设备的本地中央处理器,以实现远程客户端对外接设备的远程访问。In the embodiment of the present invention, the resource management program may drive and control the device manager through the device manager, and send the first data transmission instruction to the access controller. The access controller receives the first data transmission instruction, and controls the first buffer to send the first data packet to the hub according to the first data transmission instruction. The hub receives the first data packet sent by the first buffer through the first endpoint, and stores the first data packet into the second buffer. Under the control of the access controller, the hub sends the first data packet to the local central processing unit of the external device through the data linked list and the frame linked list in the second buffer, so as to realize the remote access of the remote client to the external device.

本发明实施例中,在远程访问指令表征远程客户端向外接设备发送数据的情况下,通过分配的总线设备和集线器的端口和第一端点,可以方便地将远程客户端发送的数据发送给芯片的外接设备。此外,访问控制器通过控制第一缓冲器和集线器可以提高芯片的数据传输效率,使得远程客户端获得更好的访问效果。In the embodiment of the present invention, in the case that the remote access instruction indicates that the remote client sends data to the external device, the data sent by the remote client can be conveniently sent to the Chip peripherals. In addition, the access controller can improve the data transmission efficiency of the chip by controlling the first buffer and the hub, so that the remote client can obtain better access effect.

可选的,在所述远程访问指令表征所述外接设备向所述远程客户端发送数据的情况下,步骤601还可以包括以下步骤:Optionally, when the remote access instruction indicates that the external device sends data to the remote client, step 601 may also include the following steps:

步骤6012、所述资源管理程序通过所述芯片驱动程序向设备控制器发送资源获取指令,控制所述设备控制器根据所述资源获取指令分配用于接收数据的总线设备,以及,为所述总线设备配置对应的集线器端口和第一端点。Step 6012, the resource management program sends a resource acquisition instruction to the device controller through the chip driver, controls the device controller to allocate a bus device for receiving data according to the resource acquisition instruction, and provides the bus The device configuration corresponds to the hub port and the first endpoint.

步骤602可以包括以下步骤:Step 602 may include the following steps:

步骤6021、通过所述设备控制器控制所述总线设备接收所述外接设备的本地中央处理器发送的本地数据包,以及将所述本地数据包第二端点发送给对应的第一缓冲器进行存储。Step 6021: Control the bus device through the device controller to receive the local data packet sent by the local CPU of the external device, and send the second end point of the local data packet to the corresponding first buffer for storage .

步骤604还可以包括以下步骤:Step 604 may also include the following steps:

步骤6042、通过所述设备控制器向访问控制器发送控制指令,控制所述访问控制器根据所述控制指令控制所述第一缓冲器将所述数据发送给所述集线器,以及控制所述集线器通过第一端点接收所述数据并将所述数据传输给所述数据传输程序。Step 6042: Send a control instruction to the access controller through the device controller, control the access controller to control the first buffer to send the data to the hub according to the control instruction, and control the hub The data is received through the first endpoint and transmitted to the data transmission program.

步骤6042之后,所述方法还包括:After step 6042, the method also includes:

步骤607、通过所述数据传输程序对所述本地数据包进行解析及处理,以获得第二数据包,并将所述第二数据包发送给所述资源管理程序。Step 607: Analyze and process the local data packet through the data transmission program to obtain a second data packet, and send the second data packet to the resource management program.

步骤608、通过所述资源管理程序将所述第二数据包发送给所述远程客户端,以实现所述远程客户端对所述外接设备的远程访问。Step 608: Send the second data packet to the remote client through the resource management program, so as to realize the remote access of the remote client to the external device.

本发明实施例中,在远程访问指令表征外接设备向远程客户端发送数据的情况下,资源管理程序可以通过芯片驱动程序向设备控制器发送资源获取指令,控制设备控制器分配用于接收数据的总线设备,以及,为总线设备配置对应的集线器端口和第一端点。总线设备在设备控制器控制下接收芯片外接设备的本地中央处理器向资源管理芯片发送的本地数据包,并将本地数据包通过第二端点发送给第一缓冲器进行存储。In the embodiment of the present invention, in the case that the remote access command indicates that the external device sends data to the remote client, the resource management program can send a resource acquisition command to the device controller through the chip driver, and control the device controller to allocate the data for receiving data. A bus device, and a corresponding hub port and a first endpoint are configured for the bus device. Under the control of the device controller, the bus device receives the local data packet sent by the local CPU of the chip external device to the resource management chip, and sends the local data packet to the first buffer through the second endpoint for storage.

本发明实施例中,资源管理程序可以通过设备管理器驱动控制设备管理器,向访问控制器发送第二数据传输指令。访问控制器接收到第二数据传输指令,根据第二数据传输指令控制第一缓冲器将本地数据包发送给集线器。集线器通过第一端点接收第一缓冲器发送的本地数据包,并将本地数据包存储器第二缓冲器中。在访问控制器的控制下,集线器将本地数据包通过第二缓冲器中数据链表和帧链表发送给数据传输程序。数据传输程序负责解析本地数据包并将其重新封装成网络数据包,并在资源管理程序控制下通过网络协议栈及网络通路传输给远程客户端,以实现所述远程客户端对所述外接设备的远程访问。In the embodiment of the present invention, the resource management program may drive and control the device manager through the device manager, and send the second data transmission instruction to the access controller. The access controller receives the second data transmission instruction, and controls the first buffer to send the local data packet to the hub according to the second data transmission instruction. The hub receives the local data packet sent by the first buffer through the first endpoint, and stores the local data packet in the second buffer. Under the control of the access controller, the hub sends the local data packet to the data transmission program through the data linked list and the frame linked list in the second buffer. The data transmission program is responsible for parsing the local data packet and repackaging it into a network data packet, and transmits it to the remote client through the network protocol stack and network path under the control of the resource management program, so as to realize the connection between the remote client and the external device. remote access.

本发明实施例中,在远程访问指令表征外接设备向所述远程客户端发送数据的情况下,通过分配的总线设备和集线器的端口和第一端点,可以方便地将芯片的外接设备发送的数据发送给远程客户端。此外,访问控制器通过控制第一缓冲器和集线器可以提高芯片的数据传输效率,使得远程客户端获得更好的访问效果。In the embodiment of the present invention, in the case that the remote access command indicates that the external device sends data to the remote client, through the allocated bus device, the port and the first endpoint of the hub, the data sent by the external device of the chip can be conveniently Data is sent to the remote client. In addition, the access controller can improve the data transmission efficiency of the chip by controlling the first buffer and the hub, so that the remote client can obtain better access effect.

图9是本发明实施例的服务器或交换机远程访问的示意图,如图9所示,远程访问功能整体上分为三部分,左侧部分对应被远程访问的服务器或交换机,自上而下,分别是用户空间的USB定制化用户程序,内核空间的USB设备驱动、USB核心层和USB主机控制器驱动,以及板级硬件的CPU硬件实体,其中COU包括USB主机控制器。中间部分自下而上,分别是FPGA芯片内部实现的USB IP和网络IP,运行于FPGA之上的Linux内核中的USB功能驱动、USB抽象层、USB控制驱动,网卡,以及用户空间的USB资源管理程序。右侧则是访问服务器或交换机的远程PC。远程访问功能的管理调度由运行于FPGA之上的USB资源管理程序负责,USB资源管理程序的主要作用描述如下:第一、以服务器的角色,接收远程PC的客户机请求,这些请求包括:进行用户安全级别验证、动态调整指定的USB资源、文件加密传输等。第二、转发本地CPU和远程PC之间的交互数据,实现远程PC对本地服务器或交换机的访问。其中,本地CPU通过USB线及USB协议栈向其发送URB数据包,USB资源管理程序负责解析URB数据包并将其重新封装成网络数据包,通过网络协议栈及网络通路传输给远端的客户端。远程访问功能的硬件支撑来自FPGA内部实现的USB IP。运行于FPGA之上的Linux内核中包括,对应FPGA内部USB IP的各类驱动程序、暴露给USB资源管理程序的USB IP资源管理程序以及透传远程PC和本地CPU之间交互数据的传输程序。Fig. 9 is a schematic diagram of remote access of a server or a switch according to an embodiment of the present invention. As shown in Fig. 9, the remote access function is divided into three parts as a whole, and the left part corresponds to the server or switch being accessed remotely, from top to bottom, respectively It is the USB customized user program in the user space, the USB device driver, the USB core layer and the USB host controller driver in the kernel space, and the CPU hardware entity of the board-level hardware, wherein the COU includes the USB host controller. From bottom to top, the middle part is the USB IP and network IP implemented inside the FPGA chip, the USB function driver, USB abstraction layer, USB control driver, network card, and USB resources in the user space in the Linux kernel running on the FPGA. hypervisor. On the right is the remote PC accessing the server or switch. The management and scheduling of the remote access function is in charge of the USB resource management program running on the FPGA. The main functions of the USB resource management program are described as follows: First, as a server, receive client requests from remote PCs. These requests include: User security level verification, dynamic adjustment of specified USB resources, file encrypted transmission, etc. Second, forward the interactive data between the local CPU and the remote PC, so as to realize the remote PC's access to the local server or switch. Among them, the local CPU sends URB data packets to it through the USB cable and USB protocol stack, and the USB resource management program is responsible for parsing the URB data packets and repackaging them into network data packets, which are transmitted to the remote client through the network protocol stack and network access end. The hardware support of the remote access function comes from the USB IP implemented inside the FPGA. The Linux kernel running on the FPGA includes various drivers corresponding to the internal USB IP of the FPGA, the USB IP resource management program exposed to the USB resource management program, and the transmission program for transparently transmitting interactive data between the remote PC and the local CPU.

需要说明的是,现有技术中,服务器或交换机的远程访问,以及作为同一实体设备上不同虚拟机之间共享的USB资源池,均属于需要多种USB资源,且需要支持USB资源动态可配的应用场景。在服务器、交换机等网络基础设备中,支持远程监测调试,是一个必需的功能项。远程客户端可以通过网络,抓取服务器现场的串口日志输出、捕获现场设备显示器的实时画面,也可以通过服务器本地的鼠标、键盘去实时操作现场的设备,就像在本地操作一样。实现远程访问依赖的就是服务器或交换机设备内部的多种USB资源,并且这些USB资源最好是支持资源动态可配的,比如服务器只想通过串口交互远程设备时,就只需要加载USB通信设备(Communications Device Class,CDC)资源,再比如服务器没有远程监测设备需要时,可以卸载全部USB资源,以满足设备本身可能存在的USB功能需求。It should be noted that, in the prior art, remote access to servers or switches, as well as USB resource pools shared between different virtual machines on the same physical device, all require multiple USB resources and need to support dynamic configurability of USB resources. application scenarios. In network infrastructure equipment such as servers and switches, it is a necessary function to support remote monitoring and debugging. The remote client can capture the serial port log output of the server site through the network, capture the real-time screen of the on-site device display, or operate the on-site device in real time through the local mouse and keyboard of the server, just like operating locally. The realization of remote access depends on various USB resources inside the server or switch device, and these USB resources should preferably support resource dynamic allocation. For example, when the server only wants to interact with remote devices through the serial port, it only needs to load the USB communication device ( Communications Device Class, CDC) resources, and for example, when the server does not need remote monitoring equipment, all USB resources can be unloaded to meet the possible USB function requirements of the equipment itself.

需要说明的是,现有技术中,为解决硬件设备投入资金大的问题,出现了虚拟机租用业务。可以根据业务需求,租用不同性能配置的虚拟机,虚拟机的背后,是真实的硬件资源在做支撑。不同之处在于,传统的一组硬件资源配置,比如CPU、内存、硬盘、外设等,只分配给一个操作系统进行管理使用,而虚拟机则是多个操作系统共享一组硬件资源配置,比如一台实体硬件包含512G内存,那他就可以支持16台32G内存的虚拟机同时运行。而作为硬件资源的一部分,USB资源做到多样性且动态可配,在这种应用场景下,也成为必需的功能项。需要说明的是,运行于FPGA之上的USB资源管理程序以及内核空间中与之关联的管理程序和传输程序,是服务器或交换机远程访问功能所独有的,如果是虚拟机共享USB资源池的应用场景,这部分功能逻辑可以由运行于CPU之上的软件负责。It should be noted that, in the prior art, in order to solve the problem of large investment in hardware equipment, a virtual machine rental service appears. Virtual machines with different performance configurations can be leased according to business needs. Behind the virtual machines are real hardware resources for support. The difference is that a traditional set of hardware resource configurations, such as CPU, memory, hard disk, peripherals, etc., is only allocated to one operating system for management and use, while a virtual machine is a set of hardware resource configurations shared by multiple operating systems. For example, if a piece of physical hardware contains 512G memory, it can support 16 virtual machines with 32G memory to run simultaneously. As a part of hardware resources, USB resources are diverse and dynamically configurable, and in this application scenario, they also become a necessary function item. It should be noted that the USB resource management program running on the FPGA and the associated management program and transmission program in the kernel space are unique to the remote access function of the server or switch. If the virtual machine shares the USB resource pool In the application scenario, this part of the functional logic can be in charge of the software running on the CPU.

第三方面,本发明提供一种电子设备70,如图10所示,包括如上中任一所述的资源管理芯片701。In a third aspect, the present invention provides an electronic device 70, as shown in FIG. 10 , including the resource management chip 701 described above.

第四方面,本发明提供一种可读存储介质,当所述存储介质中的指令由电子设备的芯片执行时,使得电子设备能够执行如上任一所述的资源管理方法。In a fourth aspect, the present invention provides a readable storage medium. When the instructions in the storage medium are executed by the chip of the electronic device, the electronic device can execute the resource management method described above.

对于方法实施例而言,由于其与芯片实施例基本相似,所以描述得比较简单,相关之处参见芯片实施例的部分说明即可。As for the method embodiment, since it is basically similar to the chip embodiment, the description is relatively simple, and for related parts, refer to the part of the description of the chip embodiment.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其他设备固有相关。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图,或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline the present disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or in its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明的排序设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to realize some or all functions of some or all components in the sorting device according to the present invention. The present invention can also be realized as a device or an apparatus program for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所做的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention. within the scope of protection.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

需要说明的是,本申请实施例中获取各种数据相关过程,都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。It should be noted that the various data-related processes in this embodiment of the application are all carried out under the premise of complying with the corresponding data protection laws and policies of the country where the device is located, and with the authorization granted by the corresponding device owner.

Claims (10)

1. A resource management chip, wherein the chip comprises: a device controller, a hub, a plurality of bus devices, a plurality of first buffers, and an access controller;
the hub comprises a plurality of ports and a plurality of first endpoints;
the device controller is used for receiving a resource acquisition instruction, allocating bus equipment for receiving data according to the resource acquisition instruction, and configuring a corresponding port and a first endpoint for the bus equipment; wherein the bus device accesses the hub through the port;
the bus device comprises a plurality of second endpoints; the bus equipment is used for sending the received data to the corresponding first buffer through the second endpoint;
the first buffer is used for storing the data and sending the data to the hub under the control of the access controller;
the hub is used for receiving the data through the first end point and outputting the data to the outside of the chip under the control of the access controller;
and the access controller is used for receiving a control instruction sent by the device controller, and controlling data transmission between the first buffer and the hub and between the hub and the outside of the chip according to the control instruction.
2. The chip of claim 1, wherein the device controller comprises a first register, a second register, and a third register;
the first register is used for inquiring the current states of each bus device and the hub, and setting the bus device for receiving data, a port corresponding to the bus device and a first endpoint according to the resource acquisition instruction;
the second register is used for sending a first control instruction to the access controller, so that the access controller opens a specified data transmission channel according to the first control instruction;
the third register is used for respectively setting corresponding first buffers for each bus device and inquiring the current state of each first buffer.
3. The chip of claim 2, wherein the bus device comprises a first interface; wherein the first interface comprises a second control endpoint disposed in the first interface;
the second control endpoint is used for controlling the second endpoint to receive data under the control of the first register and sending the data to a corresponding first buffer;
the first register is further configured to set a data transmission type of the first interface according to the resource obtaining instruction, so that the first interface receives data of the data transmission type through the second endpoint; the data transmission type is any one of a video control type, a video transmission type, a serial port transmission type, a network transmission type and a human-computer interaction type.
4. The chip of claim 2, wherein the hub further comprises a first control endpoint and a second buffer;
the first control endpoint is used for controlling the first endpoint to receive the data sent by the first buffer under the control of the first register and sending the data to the second buffer for storage through the first endpoint;
the second buffer is used for receiving and storing data sent by each first endpoint, and sending the data to the outside of the chip according to a second control instruction sent by the access controller.
5. The chip of claim 4, wherein the second buffer comprises a frame linked list and a data linked list;
the data link table is used for caching data sent to the hub by the bus equipment through the first buffer;
and the frame linked list is used for determining the current data to be transmitted by the hub and sending the data to be transmitted to the outside of the chip according to the second control instruction.
6. The chip of claim 1, wherein the access controller comprises a plurality of transmission channels, a channel selection module, and a bus arbiter;
the plurality of transmission channels each have a channel number and a corresponding channel priority;
the channel selection module is used for opening a transmission channel specified by a first control instruction according to the first control instruction sent by the equipment controller; wherein, the first control instruction comprises a channel number of a transmission channel to be opened;
the bus arbiter is used for sorting the transmission channels according to the channel numbers under the condition that the channel priorities of the transmission channels are the same, and controlling the transmission channels to transmit data according to the sorting sequence.
7. The chip of claim 1, wherein the first buffer comprises a routing logic module, a shared transmission buffer, and a dedicated transmission buffer;
the routing logic module is used for analyzing the data packet type of the data sent by the bus equipment and filtering the data packets which do not accord with preset regulations so as to determine that the data sent by the bus equipment is first data which accords with a first time delay requirement or second data which accords with a second time delay requirement;
the shared transmission buffer is used for receiving the first data routed by the routing logic module and sending the first data to the hub under the control of the access controller;
the dedicated transmission buffer is used for receiving the second data routed by the routing logic module and sending the second data to the hub under the control of the access controller.
8. A resource management method, applied to a chip according to any one of claims 1 to 7, the method comprising:
sending a resource acquisition instruction to a device controller, controlling the device controller to allocate bus equipment for receiving data according to the resource acquisition instruction, and configuring a port and a first endpoint of a corresponding hub for the bus equipment;
controlling the bus equipment to receive the data through the equipment controller, and sending the data to a corresponding first buffer through a second endpoint;
controlling the first buffer to receive and store the data sent by the bus equipment through the equipment controller;
and sending a control instruction to an access controller through the device controller, controlling the access controller to control the first buffer to send the data to the hub according to the control instruction, and controlling the hub to receive the data through a first endpoint and output the data to the outside of the chip.
9. An electronic device, characterized in that it comprises a resource management chip according to any one of claims 1 to 7.
10. A readable storage medium, wherein instructions in the storage medium, when executed by a chip of an electronic device, enable the electronic device to perform the resource management method of claim 8.
CN202211385060.0A 2022-11-07 2022-11-07 Resource management chip, method, electronic device and readable storage medium Active CN115658586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211385060.0A CN115658586B (en) 2022-11-07 2022-11-07 Resource management chip, method, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211385060.0A CN115658586B (en) 2022-11-07 2022-11-07 Resource management chip, method, electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN115658586A true CN115658586A (en) 2023-01-31
CN115658586B CN115658586B (en) 2025-06-27

Family

ID=85016632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211385060.0A Active CN115658586B (en) 2022-11-07 2022-11-07 Resource management chip, method, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN115658586B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955241A (en) * 2023-09-21 2023-10-27 杭州智灵瞳人工智能有限公司 Memory chip compatible with multiple types of memory media
CN117290278A (en) * 2023-10-10 2023-12-26 合芯科技有限公司 Chip hardware interconnection structure, chip, server and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5592622A (en) * 1995-05-10 1997-01-07 3Com Corporation Network intermediate system with message passing architecture
CN1551592A (en) * 2003-05-06 2004-12-01 精工爱普生株式会社 Data transmission control device, electronic device and data transmission control method
US8521934B1 (en) * 2010-02-25 2013-08-27 Fresco Logic, Inc. Multi-port context-based host controller
CN107220200A (en) * 2017-06-15 2017-09-29 西安微电子技术研究所 Time triggered Ethernet data management system and method based on dynamic priority
CN109863481A (en) * 2016-10-21 2019-06-07 超威半导体公司 The software pattern register access for adjusting and debugging for platform nargin

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5592622A (en) * 1995-05-10 1997-01-07 3Com Corporation Network intermediate system with message passing architecture
CN1551592A (en) * 2003-05-06 2004-12-01 精工爱普生株式会社 Data transmission control device, electronic device and data transmission control method
US8521934B1 (en) * 2010-02-25 2013-08-27 Fresco Logic, Inc. Multi-port context-based host controller
CN109863481A (en) * 2016-10-21 2019-06-07 超威半导体公司 The software pattern register access for adjusting and debugging for platform nargin
CN107220200A (en) * 2017-06-15 2017-09-29 西安微电子技术研究所 Time triggered Ethernet data management system and method based on dynamic priority

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116955241A (en) * 2023-09-21 2023-10-27 杭州智灵瞳人工智能有限公司 Memory chip compatible with multiple types of memory media
CN116955241B (en) * 2023-09-21 2024-01-05 杭州智灵瞳人工智能有限公司 Memory chip compatible with multiple types of memory media
CN117290278A (en) * 2023-10-10 2023-12-26 合芯科技有限公司 Chip hardware interconnection structure, chip, server and method

Also Published As

Publication number Publication date
CN115658586B (en) 2025-06-27

Similar Documents

Publication Publication Date Title
EP1896965B1 (en) Dma descriptor queue read and cache write pointer arrangement
US10095645B2 (en) Presenting multiple endpoints from an enhanced PCI express endpoint device
CN103888293B (en) Data channel scheduling method of multichannel FC network data simulation system
CN102819447B (en) Direct I/O virtualization method and device used for multi-root sharing system
EP1851626B1 (en) Modification of virtual adapter resources in a logically partitioned data processing system
US6397316B2 (en) System for reducing bus overhead for communication with a network interface
JP3473975B2 (en) Network system and communication method in network
CN115658586A (en) Resource management chip, method, electronic device and readable storage medium
EP3951591B1 (en) Data processing method, apparatus, and device
WO2024207800A1 (en) Direct memory access controller, heterogeneous device, memory access method, and medium
CN113312143A (en) Cloud computing system, command processing method and virtualization simulation device
US11704263B2 (en) Configurable multi-function PCIe endpoint controller in an SoC
JP2006085400A (en) Data processing system
WO2025103479A1 (en) Optical module access method, apparatus and system, electronic device, and nonvolatile readable storage medium
Tu et al. Secure I/O device sharing among virtual machines on multiple hosts
WO2025077279A1 (en) Server management method, device and apparatus, non-volatile readable storage medium, and electronic device
CN112749113A (en) Data interaction method, system, device and medium
CN110971621A (en) Embedded multi-CPU interconnection circuit based on SDIO interface, interconnection method and driving method
Suzuki et al. Multi-root share of single-root I/O virtualization (SR-IOV) compliant PCI express device
CN117215989A (en) Heterogeneous acceleration device, heterogeneous acceleration system, heterogeneous acceleration method, heterogeneous acceleration device and storage medium
CN118709190A (en) A TPM chip interface controller and TPM chip
JP6760579B2 (en) Network line card (LC) integration into host operating system (OS)
US10228968B2 (en) Network interface device that alerts a monitoring processor if configuration of a virtual NID is changed
US20150222513A1 (en) Network interface device that alerts a monitoring processor if configuration of a virtual nid is changed
RU158939U1 (en) PERIPHERAL INTERFACE CONTROLLER (KPI-2)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant