Human-computer interaction device enumeration processing method and device and human-computer interaction device

文档序号:1627672 发布日期:2020-01-14 浏览:7次 中文

阅读说明:本技术 人机交互设备枚举处理方法、装置及人机交互设备 (Human-computer interaction device enumeration processing method and device and human-computer interaction device ) 是由 陈锡剑 于 2019-09-26 设计创作,主要内容包括:本申请实施例提供一种人机交互设备枚举处理方法、装置及人机交互设备,所述方法包括:人机交互设备HID识别主机的操作系统类型;若所述主机的操作系统类型与所述HID生成的初始报告描述符不匹配,则所述HID将所述初始报告描述符中第一子描述符的值修改为无效值,得到修改后的报告描述符,所述第一子描述符为所述主机的操作系统不支持的事件对应的描述符;所述HID向所述主机发送所述修改后的报告描述符。该方法能够极大节省HID被识别的时长,进而极大提升用户的使用体验。(The embodiment of the application provides a man-machine interaction device enumeration processing method, a device and a man-machine interaction device, wherein the method comprises the following steps: the human-computer interaction equipment HID identifies the type of an operating system of a host; if the type of the operating system of the host is not matched with the initial report descriptor generated by the HID, the HID modifies the value of a first sub-descriptor in the initial report descriptor into an invalid value to obtain a modified report descriptor, wherein the first sub-descriptor is a descriptor corresponding to an event which is not supported by the operating system of the host; the HID sends the modified report descriptor to the host. The method can greatly save the time for identifying the HID, and further greatly improve the use experience of a user.)

1. A human-computer interaction device enumeration processing method is characterized by comprising the following steps:

the human-computer interaction equipment HID identifies the type of an operating system of a host;

if the type of the operating system of the host is not matched with the initial report descriptor generated by the HID, the HID modifies the value of a first sub-descriptor in the initial report descriptor into an invalid value to obtain a modified report descriptor, wherein the first sub-descriptor is a descriptor corresponding to an event which is not supported by the operating system of the host;

the HID sends the modified report descriptor to the host.

2. The method of claim 1, wherein before the HID sends the modified report descriptor to the host, further comprising:

the HID receives first request information sent by the host, wherein the first request information is used for requesting to acquire an HID descriptor;

the HID sends first response information to the host according to the first request information, wherein the first response information is used for indicating the length of the initial report descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of a second sub-descriptor, and the second sub-descriptor is a descriptor corresponding to an event supported by an operating system of the host.

3. The method of claim 2, wherein the HID sends the modified report descriptor to the host, comprising:

the HID receives second request information sent by the host, and the second request information is used for requesting to acquire a report descriptor;

and the HID sends second response information to the host according to the second request information, wherein the second response information comprises the modified report descriptor.

4. The method of claim 2, wherein prior to the HID identifying the operating system type of the host, further comprising:

the HID generates the initial report descriptor and the length of the initial report descriptor, the initial report descriptor comprises the first sub-descriptor and the second sub-descriptor, and the value of the first sub-descriptor and the value of the second sub-descriptor are both valid values.

5. The method of claim 1, further comprising:

if the operating system type of the host matches the initial report descriptor generated by the HID, the HID sends the initial report descriptor to the host.

6. The method according to any one of claims 2-4, wherein the first sub-descriptor is a descriptor corresponding to a multi-touch event, and the second sub-descriptor is a descriptor corresponding to a single-touch event.

7. The method of any of claims 1-5, wherein the HID is a multi-touch HID.

8. A human-computer interaction device enumeration processing apparatus, comprising:

the identification module is used for identifying the type of an operating system of the host;

a modification module, configured to modify a value of a first sub-descriptor in an initial report descriptor to an invalid value when an operating system type of the host is not matched with the initial report descriptor generated by a human-computer interaction device HID, so as to obtain a modified report descriptor, where the first sub-descriptor is a descriptor corresponding to an event that is not supported by the operating system of the host;

a sending module, configured to send the modified report descriptor to the host.

9. The apparatus of claim 8, further comprising:

the receiving module is used for receiving first request information sent by the host, wherein the first request information is used for requesting to acquire an HID descriptor;

the sending module is further configured to: according to the first request message, sending a first response message to the host, wherein the first response message is used for indicating the length of the initial report descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of a second sub-descriptor, and the second sub-descriptor is a descriptor corresponding to an event supported by an operating system of the host.

10. The apparatus of claim 9, wherein the receiving module is further configured to:

receiving second request information sent by the host, wherein the second request information is used for requesting to acquire a report descriptor;

the sending module is specifically configured to: and sending second response information to the host according to the second request information, wherein the second response information comprises the modified report descriptor.

11. The apparatus of claim 9, further comprising:

a generating module, configured to generate the initial report descriptor and a length of the initial report descriptor, where the initial report descriptor includes the first sub-descriptor and the second sub-descriptor, and a value of the first sub-descriptor and a value of the second sub-descriptor are both valid values.

12. The apparatus of claim 8, wherein the sending module is further configured to:

sending the initial report descriptor to the host when the operating system type of the host matches an HID generated initial report descriptor.

13. The apparatus according to any of claims 9-11, wherein the first sub-descriptor is a descriptor corresponding to a multi-touch event, and the second sub-descriptor is a descriptor corresponding to a single-touch event.

14. The device of any of claims 8-12, wherein the HID is a multi-touch HID.

15. A human-computer interaction device, comprising:

a memory for storing program instructions;

a processor for invoking and executing program instructions in said memory for performing the method steps of any of claims 1-7.

16. A readable storage medium, characterized in that a computer program is stored in the readable storage medium for performing the method of any of claims 1-7.

Technical Field

The embodiment of the application relates to computer technologies, and in particular, to a human-computer interaction device enumeration processing method and apparatus, and a human-computer interaction device.

Background

Human Interface Device (HID for short) refers to a Device that directly interacts with Human, and is a Universal Serial Bus (USB) Device. The HID may be connected to a desktop computer, laptop computer, etc. to help the user use the devices more conveniently and quickly. In the USB system, a device connected to a USB device is referred to as a USB host. HIDs may include, for example: keyboard, mouse, joystick, etc. The multi-touch HID is an important USB-HID device, and can be a touch pen, a touch frame and the like. The multi-touch HID may be connected to a host running different operating systems, and the different operating systems may support the multi-touch HID to different extents. Illustratively, both the Windows and android operating systems are capable of supporting single touch (mouse) and multi-touch (touch), while the Mac operating system running on the apple Macintosh family of computers supports only single touch (mouse). Therefore, for the same multi-touch HID, adaptation processing is required to ensure that the HID can be used normally on hosts running different operating systems.

Disclosure of Invention

The embodiment of the application provides a man-machine interaction device enumeration processing method and device and a man-machine interaction device.

A first aspect of an embodiment of the present application provides a method for enumeration processing of a human-computer interaction device, where the method includes:

the human-computer interaction equipment HID identifies the type of an operating system of a host;

if the type of the operating system of the host is not matched with the initial report descriptor generated by the HID, the HID modifies the value of a first sub-descriptor in the initial report descriptor into an invalid value to obtain a modified report descriptor, wherein the first sub-descriptor is a descriptor corresponding to an event which is not supported by the operating system of the host;

the HID sends the modified report descriptor to the host.

Further, before the HID sends the modified report descriptor to the host, the HID further includes:

the HID receives first request information sent by the host, wherein the first request information is used for requesting to acquire an HID descriptor;

the HID sends first response information to the host according to the first request information, wherein the first response information is used for indicating the length of the initial report descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of a second sub-descriptor, and the second sub-descriptor is a descriptor corresponding to an event supported by an operating system of the host.

Further, the HID sending the modified report descriptor to the host, including:

the HID receives second request information sent by the host, and the second request information is used for requesting to acquire a report descriptor;

and the HID sends second response information to the host according to the second request information, wherein the second response information comprises the modified report descriptor.

Further, before the HID identifies the operating system type of the host, the HID further includes:

the HID generates the initial report descriptor and the length of the initial report descriptor, the initial report descriptor comprises the first sub-descriptor and the second sub-descriptor, and the value of the first sub-descriptor and the value of the second sub-descriptor are both valid values.

Further, the method also comprises the following steps:

if the operating system type of the host matches the initial report descriptor generated by the HID, the HID sends the initial report descriptor to the host.

Further, the first sub-descriptor is a descriptor corresponding to a multi-touch event, and the second sub-descriptor is a descriptor corresponding to a single-touch event.

Further, the HID is a multi-touch HID.

A second aspect of an embodiment of the present application provides a device for enumeration processing of human-computer interaction devices, where the device includes:

the identification module is used for identifying the type of an operating system of the host;

a modification module, configured to modify a value of a first sub-descriptor in an initial report descriptor to an invalid value when an operating system type of the host is not matched with the initial report descriptor generated by a human-computer interaction device HID, so as to obtain a modified report descriptor, where the first sub-descriptor is a descriptor corresponding to an event that is not supported by the operating system of the host;

a sending module, configured to send the modified report descriptor to the host.

Further, the apparatus further comprises:

the receiving module is used for receiving first request information sent by the host, wherein the first request information is used for requesting to acquire an HID descriptor;

the sending module is further configured to: according to the first request message, sending a first response message to the host, wherein the first response message is used for indicating the length of the initial report descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of a second sub-descriptor, and the second sub-descriptor is a descriptor corresponding to an event supported by an operating system of the host.

Further, the receiving module is further configured to:

receiving second request information sent by the host, wherein the second request information is used for requesting to acquire a report descriptor;

the sending module is specifically configured to: and sending second response information to the host according to the second request information, wherein the second response information comprises the modified report descriptor.

Further, the apparatus further comprises:

a generating module, configured to generate the initial report descriptor and a length of the initial report descriptor, where the initial report descriptor includes the first sub-descriptor and the second sub-descriptor, and a value of the first sub-descriptor and a value of the second sub-descriptor are both valid values.

Further, the sending module is further configured to:

sending the initial report descriptor to the host when the operating system type of the host matches an HID generated initial report descriptor.

Further, the first sub-descriptor is a descriptor corresponding to a multi-touch event, and the second sub-descriptor is a descriptor corresponding to a single-touch event.

Further, the HID is a multi-touch HID.

A third aspect of the embodiments of the present application provides a human-computer interaction device, including:

a memory for storing program instructions;

a processor for calling and executing the program instructions in the memory to perform the method steps of the first aspect.

A fourth aspect of embodiments of the present application provides a readable storage medium, in which a computer program is stored, where the computer program is configured to execute the method according to the first aspect.

According to the human-computer interaction device enumeration processing method and device and the human-computer interaction device, when the HID identifies that the type of the operating system of the host is not matched with the report descriptor, the HID only modifies the value of the descriptor corresponding to the event which is not supported by the operating system in the initial report descriptor into an invalid value, and sends the modified report descriptor to the host without executing the processes of disconnection, reconnection and the like, so that the interaction steps of the HID and the host are not increased, the time for identifying the HID can be greatly saved, and the use experience of a user is greatly improved.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the following briefly introduces the drawings needed to be used in the description of the embodiments or the prior art, and obviously, the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings according to the drawings without inventive labor.

Fig. 1 is an exemplary system architecture diagram of an enumeration processing method for a human-computer interaction device according to an embodiment of the present disclosure;

FIG. 2 is a schematic diagram of an HID enumeration process in the prior art;

fig. 3 is a schematic flow chart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application;

FIG. 4 is a schematic diagram of the relationship between various descriptors of the HID;

fig. 5 is a schematic flow chart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application;

fig. 6 is a schematic flow chart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application;

fig. 7 is an interaction flowchart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application;

fig. 8 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present disclosure;

fig. 9 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present disclosure;

fig. 10 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present disclosure;

fig. 11 is a schematic structural diagram of a human-computer interaction device 1100 according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is an exemplary system architecture diagram of an enumeration processing method for a human-computer interaction device according to an embodiment of the present disclosure, and as shown in fig. 1, the method may be applied to a USB system, where the USB system adopts a stepped star topology. A USB system includes a host having a root hub disposed therein, the root hub providing an initial attachment point on the host. The root hub can be connected with a USB device (such as the joystick shown in FIG. 1) and can also be connected with the hub to expand more USB interfaces for connecting more USB devices with the host. The number of layers of the hub may be up to 5 layers in the USB1.1 protocol and up to 7 layers in the USB2.0 protocol. Figure 1 shows three layers. As shown in fig. 1, the USB device that the host can connect to can be a joystick, a scanner, a mouse, a touch pen, etc. The embodiment of the application is mainly applied to the HID connected with the USB host, and as mentioned above, the HID is a USB device directly interacting with people. The HIDs may include single-touch HIDs, which may include a mouse or the like, and multi-touch HIDs, which may include a stylus, a touch frame, or the like, which support multi-touch. The technical scheme of the embodiment of the application can be applied to the two HID. When the multi-touch HID is connected to a host with an operating system Mac, only a single touch is supported.

For convenience of description, the USB host is referred to as a host in the embodiments of the present application.

After the HID is inserted into the host, executing an enumeration process of the HID, wherein the enumeration process refers to information interaction between the HID and the host, so that the host can know which type of device the HID belongs to and how to communicate with the HID, and further the host loads a driver suitable for the HID according to the information to communicate between the HID and the host. The technical scheme of the embodiment of the application is applied to the enumeration process.

Fig. 2 is a schematic diagram of an HID enumeration process in the prior art, and as shown in fig. 2, an enumeration process in the prior art includes:

s201, the HID and the host machine carry out interaction of other enumeration information.

After the HID connects with the host, the HID interacts with the host for other enumeration information. The specific interaction process is illustrated in the following examples.

S202, the HID identifies the type of the operating system of the host.

The HID may identify the operating system type of the host from the other enumeration information described above.

S203, the HID identifies that the type of the operating system of the host does not match the report descriptor generated by the HID, and the HID disconnects the host by itself.

And S204, the HID selects the matched report descriptor according to the type of the operating system of the host.

S205, the HID sets the length of the report descriptor.

In the above steps S204 and S205, if the operating system of the host supports multi-touch (for example, Windows operating system and android operating system, which are abbreviated as Windows/android os in fig. 1), the HID selects the single-point descriptor and the multi-point descriptor, and the single-point descriptor and the multi-point descriptor are stored in a continuous address area by default. The single-point descriptor is a descriptor corresponding to a single-point touch event, and the multi-point descriptor is a descriptor corresponding to a multi-point touch event. The single-point descriptor may be, for example, a mouse descriptor, and the multi-point descriptor may be, for example, a touch descriptor. Accordingly, the length of the report descriptor set by the HID is the sum of the length of the one-point descriptor and the length of the multi-point descriptor. If the operating system of the host does not support multi-touch (e.g., MAC operating system, abbreviated MAC os in FIG. 1), the HID selects a single-point descriptor. Accordingly, the length of the report descriptor set by the HID is the length of the single-point descriptor.

S206, the HID is reconnected with the host computer, and other enumeration information interaction is carried out with the host computer.

S207, the host requests the HID descriptor from the HID.

S208, the HID transmits the length of the report descriptor set in step S205 to the host.

S209, the host requests the HID to report the descriptor.

S210, the HID sends the report descriptor selected in step S204 to the host.

In the above process, when the HID identifies that the operating system type of the host does not match the report descriptor selected by default, the HID disconnects itself, selects the matched report descriptor, and re-executes the enumeration process to send the report descriptor to the host. Since the enumeration process needs to be disconnected and resumed in the above enumeration process, the HID is identified for a long time, which affects the user experience.

The technical scheme of the embodiment of the application aims to solve the problems.

Fig. 3 is a schematic flow diagram of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application, where an execution subject of the method is the HID described above, and as shown in fig. 3, the method includes:

s301, the HID identifies the operating system type of the host.

During enumeration, the HID sends a variety of descriptors to the host, so that the host knows the device type, communication mode, etc. of the HID according to the descriptors. Fig. 4 is a schematic diagram of a relationship between various descriptors of HIDs, and as shown in fig. 4, the descriptors of HIDs include a device descriptor, a configuration descriptor, an interface descriptor, an endpoint descriptor, a string descriptor, and a HID descriptor, and the HID descriptor includes a report descriptor and a physical descriptor. The configuration number of the HID is defined in the device descriptor, the configuration descriptor of each configuration defines the interface number of the configuration, the interface descriptor of each interface defines the endpoint number of the interface, and each endpoint has a respective endpoint descriptor.

Alternatively, the HID may identify the operating system type of the host through other enumeration processes after connecting to the host. This other enumeration process may refer to an enumeration process involving a descriptor other than the report description among the descriptors shown in fig. 4 described above. Illustratively, the HID may identify the operating system type of the host through an enumeration process involving device descriptors, configuration descriptors, and interface descriptors.

S302, if the type of the operating system of the host is not matched with the initial report descriptor generated by the HID, the HID modifies the value of the first sub-descriptor in the initial report descriptor into an invalid value to obtain a modified report descriptor. The first subdescriptor is a descriptor corresponding to an event which is not supported by an operating system of the host.

Optionally, the HID may generate the initial report descriptor and the length of the initial report descriptor before performing the enumeration.

Optionally, the HID generated initial report descriptor may include a single point descriptor and/or a multi-point descriptor. As described above, the single-point descriptor is a descriptor corresponding to a single-point touch event, and the multi-point descriptor is a descriptor corresponding to a multi-point touch event. The single point description may be, for example, a mouse descriptor, and the multi-point descriptor may be, for example, a touch descriptor.

In an alternative, the HID generates the initial report descriptor only including the first sub-descriptor, and the first sub-descriptor may be the single-point descriptor or the multi-point descriptor. Accordingly, the length of the initial report descriptor generated by the HID is the length of the first subdescriptor. Specifically, if the first sub-descriptor is the single-point descriptor, the length of the initial report descriptor is the length of the single-point descriptor. If the first subdescriptor is the above-mentioned multi-point descriptor, the length of the initial report descriptor is the length of the multi-point descriptor.

Alternatively, the HID generates an initial report descriptor including a first subdescriptor and a second subdescriptor. The first sub-descriptor is a descriptor corresponding to an event which is not supported by an operating system of the host, and the second sub-descriptor is a descriptor corresponding to an event which is supported by the operating system of the host. The first subdescriptor may be a multipoint descriptor and the second subdescriptor may be a single point descriptor. Alternatively, the first subdescriptor may be a single-point descriptor, and the first subdescriptor may be a multi-point descriptor.

Whichever of the above approaches is used, the value of the initial report descriptor generated by the HID is a valid value. The valid value refers to a value that follows the USB protocol and from which the host can recognize some touch event. In contrast, an invalid value is a value from which the host cannot recognize a certain touch event.

Optionally, the fact that the operating system type of the host does not match the initial report descriptor generated by the HID means that the operating system of the host does not support an event corresponding to a certain sub-descriptor in the initial report descriptor. Illustratively, the operating system type of the host is a Mac operating system, and the HID generates an initial report descriptor including a single-point descriptor and a multi-point descriptor, and the operating system type of the host does not match the initial report descriptor because the Mac operating system does not support multi-touch events.

When the operating system type of the host does not match the initial report descriptor, the HID modifies the value of the descriptor corresponding to the event that is not supported by the operating system in the initial report descriptor to an invalid value. Illustratively, the operating system of the host does not support multi-touch events, and the host generates an initial report descriptor including a multi-point descriptor, so the HID may modify the value of the multi-point descriptor in the initial report descriptor to an invalid value.

It should be noted that the invalid value may be set according to a definition for the descriptor in the USB protocol, and the embodiment of the present application is not limited to a specific setting manner of the invalid value, as long as it is ensured that the host can recognize the invalid value as the invalid value. In one example, the invalid value may be a value of all 0 s.

S303, the HID sends the modified report descriptor to the host.

After the HID sends the modified report descriptor to the host, the host may identify the device type, communication mode, etc. of the HID in combination with the modified report descriptor and the aforementioned other descriptors, so that the host may select a suitable driver, and the HID may communicate with the host normally.

In the above process, the HID does not reselect the report descriptor and re-establish the connection and perform enumeration after disconnecting the connection with the host as in the prior art, but only modifies the value of the descriptor corresponding to the event that is not supported by the operating system in the initial report descriptor to an invalid value when recognizing that the operating system type of the host does not match the report descriptor, and at the same time, does not modify the length of the report descriptor, and sends the modified report descriptor to the host for the enumeration process. The process does not need to add the step of interaction between the HID and the host, so that compared with the method in the prior art, the method can greatly save the time for identifying the HID, and further greatly improves the use experience of a user.

In this embodiment, when the HID identifies that the type of the operating system of the host is not matched with the report descriptor, the HID modifies only the value of the descriptor corresponding to the event that the operating system does not support in the initial report descriptor to an invalid value, and sends the modified report descriptor to the host without performing the processes of disconnection, reconnection, and the like.

Fig. 5 is a schematic flow chart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application, and as shown in fig. 5, before step S303, the method further includes:

s501, the HID receives first request information sent by the host, and the first request information is used for requesting to acquire the HID descriptor.

S502, the HID sends a first response message to the host according to the first request message, where the first response message is used to indicate the length of the initial report descriptor.

In an alternative, if the HID generates the initial report descriptor including the first sub-descriptor and the second sub-descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of the second sub-descriptor.

Alternatively, if the initial report descriptor generated by the HID includes only the first subdescriptor, the length of the initial report descriptor is the length of the first subdescriptor.

According to the specification of the USB protocol, when the HID sends the length of the report descriptor, the HID sends the report descriptor through a specific HID descriptor wDescriptorLength, and when the HID generates the initial report descriptor and the length of the initial report descriptor, the HID endows the wDescriptorLength descriptor with the length of the initial report descriptor. Furthermore, when the HID modifies the initial report descriptor, only the value of the descriptor is modified, and the length of the descriptor is not changed, so the value of the wdescriptorrength descriptor does not need to be modified. In this step, the HID directly sends the wdescriptorrength descriptor to the host after receiving the first request message. In this process, the HID need only assign a value to the wdescriptorrength descriptor when generating the initial report descriptor and directly transmit the wdescriptorrength descriptor to the host without resetting the length value of the report descriptor as in the prior art, thus further saving the time for the host to recognize the HID.

Fig. 6 is a schematic flowchart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application, and as shown in fig. 6, on the basis of the flowchart shown in fig. 5, an optional manner of step S303 includes:

s601, the HID receives second request information sent by the host, and the second request information is used for requesting to acquire a report descriptor.

After receiving the length of the report descriptor sent by the HID, the host may send second request information to the HID to request to acquire the report descriptor. Accordingly, the HID receives the second request message.

S602, the HID sends second response information to the host according to the second request information, and the second response information comprises the modified report descriptor.

After the HID sends the modified report descriptor to the host, the host can read the complete report descriptor according to the length of the obtained report descriptor. Furthermore, the host analyzes the report descriptor, analyzes an effective value and an invalid value in the report descriptor, determines which touch events of the HID need to be responded according to the effective value and the invalid value, and further selects a driver, communicates with the HID and the like.

In another alternative embodiment, in step S302, if the HID determines that the operating system type of the host matches the initial report descriptor generated by the HID, the HID sends the initial report descriptor to the host.

Specifically, after receiving the second request message sent by the host, the HID sends the generated initial report descriptor to the host by carrying the initial report descriptor in the second response message.

The following describes the interaction flow between the HID and the host.

Fig. 7 is an interaction flowchart of an enumeration processing method for a human-computer interaction device according to an embodiment of the present application, where as shown in fig. 7, an interaction process between an HID and a host includes:

s701, the HID generates an initial report descriptor and the length of the initial report descriptor, and the length of the initial report descriptor is given to the wDescriptorLength descriptor.

S702, the HID identifies the operating system type of the host through other enumeration information.

S703, the host sends first request information for acquiring the HID descriptor to the HID.

S704, the HID sends the wDescriptorLength descriptor to the host through the first response message.

S705, the host sends second request information requesting report descriptors to the HID.

S706, the HID modifies the value of the first subdescriptor in the report descriptor into an invalid value.

It should be noted that step S706 may be executed before step S703.

And S707, the HID sends the report descriptor to the host through the second response message.

The specific execution process of the above steps may be implemented in the foregoing embodiments, and will not be described herein again.

Fig. 8 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present application, where as shown in fig. 8, the apparatus includes:

an identifying module 801 is used for identifying the operating system type of the host.

A modifying module 802, configured to modify, when the type of the operating system of the host is not matched with the initial report descriptor generated by the HID, a value of a first sub-descriptor in the initial report descriptor to an invalid value, so as to obtain a modified report descriptor, where the first sub-descriptor is a descriptor corresponding to an event that is not supported by the operating system of the host.

A sending module 803, configured to send the modified report descriptor to the host.

Fig. 9 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present application, where as shown in fig. 9, the apparatus further includes:

a receiving module 804, configured to receive first request information sent by the host, where the first request information is used to request to obtain an HID descriptor.

The sending module 803 is further configured to:

according to the first request message, sending a first response message to the host, wherein the first response message is used for indicating the length of the initial report descriptor, the length of the initial report descriptor is the sum of the length of the first sub-descriptor and the length of a second sub-descriptor, and the second sub-descriptor is a descriptor corresponding to an event supported by an operating system of the host.

In another embodiment, the receiving module 804 is further configured to:

and receiving second request information sent by the host, wherein the second request information is used for requesting to acquire a report descriptor.

The sending module 803 is specifically configured to:

and sending second response information to the host according to the second request information, wherein the second response information comprises the modified report descriptor.

Fig. 10 is a block diagram of a human-computer interaction device enumeration processing apparatus according to an embodiment of the present application, where as shown in fig. 10, the apparatus further includes:

a generating module 805, configured to generate the initial report descriptor and the length of the initial report descriptor, where the initial report descriptor includes the first sub-descriptor and the second sub-descriptor, and a value of the first sub-descriptor and a value of the second sub-descriptor are both valid values.

In another embodiment, the sending module 803 is further configured to:

sending the initial report descriptor to the host when the operating system type of the host matches an HID generated initial report descriptor.

In another embodiment, the first sub-descriptor is a descriptor corresponding to a multi-touch event, and the second sub-descriptor is a descriptor corresponding to a single-touch event.

In another embodiment, the HID is a multi-touch HID

The enumeration processing device for human-computer interaction equipment provided in the embodiment of the present application may execute the method steps in the above method embodiments, and its implementation principle and technical effect are similar, and are not described herein again.

It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the determining module may be a processing element separately set up, or may be implemented by being integrated in a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and the function of the determining module is called and executed by a processing element of the apparatus. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.

For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when some of the above modules are implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor that can call program code. As another example, these modules may be integrated together, implemented in the form of a system-on-a-chip (SOC).

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

Fig. 11 is a schematic structural diagram of a human-computer interaction device 1100 according to an embodiment of the present invention. As shown in fig. 11, the human-computer interaction device may include: the system comprises a processor 111, a memory 112, a communication interface 113 and a system bus 114, wherein the memory 112 and the communication interface 113 are connected with the processor 111 through the system bus 114 and complete mutual communication, the memory 112 is used for storing computer execution instructions, the communication interface 113 is used for communicating with other devices, and the processor 111 implements the scheme of the embodiment shown in fig. 3 to 7 when executing the computer program.

The system bus mentioned in fig. 11 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The communication interface is used for realizing communication between the database access device and other equipment (such as a client, a read-write library and a read-only library). The memory may comprise Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.

The processor may be a general-purpose processor, including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.

Optionally, an embodiment of the present invention further provides a storage medium, where instructions are stored in the storage medium, and when the storage medium is run on a computer, the storage medium causes the computer to execute the method according to the embodiment shown in fig. 3 to 7.

Optionally, an embodiment of the present invention further provides a chip for executing the instruction, where the chip is configured to execute the method in the embodiment shown in fig. 3 to 7.

Embodiments of the present invention further provide a program product, where the program product includes a computer program, where the computer program is stored in a storage medium, and at least one processor may read the computer program from the storage medium, and when the at least one processor executes the computer program, the at least one processor may implement the method in the embodiments shown in fig. 3 to 7.

In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship; in the formula, the character "/" indicates that the preceding and following related objects are in a relationship of "division". "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.

It is to be understood that the various numerical references referred to in the embodiments of the present invention are merely for convenience of description and distinction and are not intended to limit the scope of the embodiments of the present invention.

It should be understood that, in the embodiment of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:按键配置方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类