A data transmission method, an interaction system, an electronic device and a storage medium
Patent Information
- Application Number
- CN202510471648.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]相关技术中,用户可以通过除手指以外的输入装置间接地在电容触敏表面上执行触摸操作,但是电子设备难以对该类触摸操作进行针对性的响应
[0023]本申请实施中,在获取输入装置的编码信息时,基于输入装置在电容触敏表面形成的N个第一触摸点构建目标坐标系,基于目标坐标系对其他触摸点进行解码得到编码信息,可以快速准确的得到输入装置的编码信息。
Smart Images

Figure CN122963384A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, and more specifically, to a data transmission method, an interactive system, an electronic device, and a storage medium. Background Technology
[0002] When an electronic device integrates a capacitive touch-sensitive surface, it can receive and respond to the user's touch operation, making it easier for the user to control the electronic device.
[0003] In related technologies, users can indirectly perform touch operations on capacitive touch-sensitive surfaces using input devices other than fingers, but electronic devices have difficulty responding specifically to such touch operations. Summary of the Invention
[0004] This application provides a data transmission method, an interactive system, an electronic device, and a storage medium, which enables the electronic device to respond appropriately to touch operations performed via an input device.
[0005] In a first aspect, a data transmission method is provided, applied to an electronic device having a capacitive touch-sensitive surface and a host, and a controller for controlling the capacitive touch-sensitive surface, the method comprising:
[0006] The controller receives a touch operation triggered by the input device on the capacitive touch-sensitive surface and acquires the capacitive sensing data of the capacitive touch-sensitive surface. The input device includes at least one outer surface, and the outer surface is provided with a plurality of conductive elements that can be capacitively coupled with the capacitive touch-sensitive surface.
[0007] When the controller determines, based on the capacitive sensing data, that the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, it sends the capacitive sensing data to the host, where N is a preset integer greater than 2.
[0008] The host computer decodes the input device's encoding information based on the capacitive sensing data and responds to the touch operation according to the encoding information.
[0009] In this embodiment, when the controller receives a touch operation triggered by an input device on the capacitive touch-sensitive surface, it acquires the capacitive sensing data of the capacitive touch-sensitive surface. If, based on the capacitive sensing data, the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, the controller sends the capacitive sensing data to the host. The host decodes the input device's encoding information based on the capacitive sensing data and responds to the touch operation according to the encoding information. This not only enables electronic devices to respond specifically to the input device performing the touch operation but also expands the application scenarios of the capacitive touch-sensitive surface, meeting user needs in specific scenarios. Furthermore, since the number of touch points triggered by an input device is usually not less than N, the controller sending the capacitive sensing data to the host when the number of touch points is greater than or equal to N—that is, sending the capacitive sensing data to the host when it is determined that the touch operation was triggered by an input device—avoids sending the capacitive sensing data to the host when the touch operation was not triggered by an input device. This reduces the data transmission volume between the controller and the host, improving the communication efficiency between them.
[0010] Optionally, the capacitive sensing data is a capacitive image, and sending the capacitive sensing data to the host includes: extracting a region image including the plurality of touch points from the capacitive image; sending the region image to the host so that the host can decode the encoded information based on the region image.
[0011] In this embodiment of the application, during the process of sending a capacitance image to the host, the controller extracts a region image from the capacitance image and sends the region image to the host, which can reduce the amount of data during the transmission process and improve the data transmission efficiency.
[0012] Optionally, sending the region image to the host includes: modifying the pixel value of a first pixel to one of 1 and 0, and modifying the pixel value of a second pixel to the other of 1 and 0, to obtain the region image in binary image form; wherein the first pixel is a pixel of the plurality of touch points included in the region image, and the second pixel is a pixel other than the first pixel; sending the region image in binary image form to the host so that the host decodes the encoded information based on the region image in binary image form.
[0013] In this embodiment of the application, during the process of sending a region image to the host, the controller first converts the region image into a binary image and then sends the binary image to the host, which can reduce the amount of data during the transmission process and improve data transmission efficiency.
[0014] Optionally, the step of cropping the region image including the plurality of touch points from the capacitance image includes: when the capacitance image includes multiple sets of the plurality of touch points, cropping multiple region images from the capacitance image; wherein, the multiple region images correspond one-to-one with the multiple sets of the plurality of touch points.
[0015] In this embodiment of the application, when the capacitive image includes multiple sets of touch points of multiple input devices, the controller captures the area image corresponding to each input device, which enables the host to decode the encoding information of each input device based on the area image corresponding to each input device, and execute the instruction corresponding to each input device based on the encoding information of each input device, so as to realize the response to each input device.
[0016] Optionally, before sending the region image to the host, the method further includes: determining reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface based on the capacitive image; inserting the reference coordinates at a preset position in the region image so that the host extracts and uses the reference coordinates from the preset position in the region image.
[0017] In this embodiment of the application, before sending the area image to the host, the reference coordinates of multiple touch points are inserted at a preset position in the area image, which makes it easier for the host to determine the actual position of the input device on the capacitive touch-sensitive surface through the reference coordinates.
[0018] Optionally, sending the capacitive sensing data to the host includes: determining the coordinates of each touch point on the capacitive touch-sensitive surface based on the capacitive sensing data to obtain multiple touch point coordinates; and sending the multiple touch point coordinates to the host so that the host can decode the encoded information based on the multiple touch point coordinates.
[0019] In this embodiment of the application, when sending capacitive sensing data to the host, the coordinates of multiple touch points are determined based on the capacitive sensing data, and the coordinates of multiple touch points are sent to the host to avoid sending image data to the host, which can reduce the amount of data sent and improve the data sending efficiency.
[0020] Optionally, sending the capacitive sensing data to the host includes: decoding the encoded information based on the capacitive sensing data; and sending the encoded information to the host.
[0021] In this embodiment, the controller identifies the encoding information of the input device based on the capacitance sensing data and directly sends the encoding information to the host, which can reduce the amount of data transmission between the controller and the host and improve data transmission efficiency.
[0022] Optionally, the step of decoding the encoded information based on the capacitive sensing data includes: determining whether the plurality of touch points include N first touch points, wherein the N first touch points form a preset non-rotationally symmetric shape, and the relative distance between any two first touch points matches a preset distance; if the N first touch points are included, then constructing a target coordinate system based on the N first touch points; and decoding the other touch points based on the target coordinate system to obtain the encoded information, wherein the other touch points are touch points other than the N first touch points among the plurality of touch points.
[0023] In this application, when obtaining the encoding information of the input device, a target coordinate system is constructed based on the N first touch points formed by the input device on the capacitive touch-sensitive surface. The encoding information is obtained by decoding other touch points based on the target coordinate system, which can quickly and accurately obtain the encoding information of the input device.
[0024] Optionally, the capacitance sensing data is a capacitance image, and sending the capacitance sensing data to the host includes: sending the capacitance image to the host based on a target communication protocol supported by the controller, wherein the target communication protocol includes a communication protocol for transmitting image data.
[0025] Optionally, the target communication protocol includes a Universal Serial Bus video protocol.
[0026] In this embodiment, by sending a capacitance image to the host via a target communication protocol that supports image data transmission, the capacitance image can be sent to the host quickly and promptly, allowing the host to determine the encoding information of the input device based on the capacitance image and respond to the touch operation accordingly.
[0027] Optionally, sending the capacitive sensing data to the host includes: obtaining target data from the capacitive sensing data, the target data including touch data of multiple touch points; constructing a human-machine interface device report including the target data, and sending the human-machine interface device report to the host, so that the host decodes the encoded information based on the target data in the human-machine interface device report.
[0028] Optionally, constructing the human-machine interface device report that includes the target data includes: constructing the human-machine interface device report based on a custom protocol of the human-machine interface device manufacturer.
[0029] In this embodiment, when the controller sends capacitive sensing data to the host, it constructs an HID report based on the target data obtained from the capacitive sensing data and sends the target data to the host through the HID report, which can achieve fast and accurate transmission of the target data.
[0030] Optionally, responding to the touch operation based on the encoded information includes: generating a key event including the encoded information; and transmitting the key event to an application in the host, so that the application responds to the touch operation based on the encoded information included in the key event.
[0031] Optionally, before generating the key event including the encoded information, the method further includes: the controller sending the encoded information to the host based on the human-machine interface device keyboard protocol, so that the host generates the key event based on the encoded information.
[0032] In this embodiment, when the controller sends encoded information to the host, it sends the encoded information to the host based on the human-machine interface device keyboard protocol, and generates key events based on the encoded information to respond to touch operations. In this way, the existing human-machine interface device keyboard protocol can be used directly to respond to touch operations, thereby avoiding the need to develop corresponding drivers for the encoded information.
[0033] Optionally, the method further includes: determining the reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface based on the capacitive sensing data, and / or determining the rotation angle of the input device on the capacitive touch-sensitive surface; and sending the rotation angle and / or reference coordinates to the host.
[0034] In this embodiment, the controller determines the reference coordinates and / or rotation angle of the input device on the capacitive touch-sensitive surface based on the capacitive sensing data, and sends the rotation angle and reference coordinates to the host, which facilitates the host to execute the corresponding instructions of the input device based on the rotation angle and reference coordinates.
[0035] Optionally, determining the rotation angle of the input device on the capacitive touch-sensitive surface includes: determining a first reference touch point and a second reference touch point from a plurality of touch points, wherein the relative positions of the first reference touch point and the second reference touch point among the plurality of touch points correspond to a preset position; determining the rotation angle based on the angle between the straight line containing the first reference touch point and the second reference touch point and a target coordinate axis, wherein the target coordinate axis is a preset coordinate axis in the original coordinate system of the capacitive touch-sensitive surface.
[0036] In a second aspect, an interactive system is provided, including an electronic device and an input device as described in the first aspect; the electronic device has a capacitive touch-sensitive surface and a host, and a controller for controlling the capacitive touch-sensitive surface; the input device includes at least one outer surface, the outer surface being provided with a plurality of conductive elements capable of capacitively coupling with the capacitive touch-sensitive surface.
[0037] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory is used to store executable program code; and the processor is used to call and run the executable program code from the memory, causing the electronic device to execute the data transmission method in any possible implementation of the first aspect.
[0038] Fourthly, a storage medium is provided that stores executable program code, which, when run on an electronic device, causes the electronic device to execute the data transmission method in any possible implementation of the first aspect.
[0039] Fifthly, an executable program code product is provided, comprising: executable program code that, when executed on an electronic device, causes the electronic device to execute the data transmission method in any possible implementation of the first aspect. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of a capacitor electrode array provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application;
[0042] Figure 3 This is an exemplary partial schematic diagram of a capacitance image provided in an embodiment of this application.
[0043] Figure 4 This is an exemplary schematic diagram of an interactive system provided in an embodiment of this application;
[0044] Figure 5 This is an exemplary cross-sectional view of an input device provided in an embodiment of this application;
[0045] Figure 6 This is an exemplary encoding diagram of an input device provided in an embodiment of this application;
[0046] Figure 7 This is a flowchart illustrating the steps of a data transmission method provided in an embodiment of this application;
[0047] Figure 8 Through Figure 6 A schematic diagram of a local capacitance image when the input device performs a touch operation;
[0048] Figure 9 This is a schematic diagram illustrating the construction of a coordinate system provided in an embodiment of this application;
[0049] Figure 10 This illustration shows a partial schematic diagram of a region image in the form of a binary map, provided in an embodiment of this application.
[0050] Figure 11 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;
[0051] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0052] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0053] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0054] Currently, some electronic devices integrate capacitive touch-sensitive surfaces, allowing users to perform touch operations. These surfaces sense and respond to user touch inputs. The capacitive touch-sensitive surface integrates a capacitive electrode array, which can be either self-capacitive or mutual-capacitive. In the self-capacitive type, each electrode forms a capacitance with ground; in the mutual-capacitive type, capacitance is formed at the intersection of two sets of electrodes.
[0055] See Figure 1 , Figure 1 This is a schematic diagram of a capacitor electrode array provided in an embodiment of this application. Figure 1 The capacitor electrode array 10 shown is a mutual capacitance capacitor electrode array, including an X-axis electrode arranged in the lateral direction along the capacitive touch-sensitive surface. Figure 1 The symbols T1, T2, and T3 represent the Y-axis electrode, which is arranged along the longitudinal direction of the capacitive touch-sensitive surface. Figure 1Represented by symbols R1, R2, and R3, each intersection of the X-axis and Y-axis electrodes (generally called a capacitor node) constitutes a capacitor, and each capacitor corresponds to a coordinate on the capacitive touchscreen surface. For example, when the capacitive touchscreen surface is an 86-inch capacitive screen, the number of X-axis capacitor electrodes is typically 160, the number of Y-axis electrodes is typically 284, and the size (pitch) of each capacitor node is 6.7 mm. Each capacitor corresponds to a coordinate on the capacitive screen.
[0056] When an input device (such as a finger) comes into contact with a capacitive touch-sensitive surface, the capacitance at the touch location changes. Based on the number and coordinates of these capacitors, touch parameters such as the touch position and touch state on the capacitive touch-sensitive surface can be determined. These touch parameters can then be converted into corresponding instructions and executed to respond to touch operations.
[0057] In practical applications, when a capacitive touch-sensitive surface is integrated into an electronic device, a controller is typically included to control it. When the capacitive touch-sensitive surface receives a touch operation, the controller determines touch parameters such as the coordinates and state of the touch operation on the surface. It then sends these touch parameters to the host computer of the electronic device, enabling the host computer to execute corresponding instructions based on these parameters in response to the touch operation.
[0058] See Figure 2 , Figure 2 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. For example... Figure 2 As shown, electronic device 20 includes a capacitive touch-sensitive surface, a controller, a host, and other components not shown. Electronic device 20 can be an interactive flat panel, mobile phone, computer, tablet computer, etc. The capacitive touch-sensitive surface can be a capacitive screen. The controller is usually a microcontroller unit (MCU). The host is usually a system-on-chip (SOC) and a central processing unit (CPU), etc. The controller and the host generally communicate with each other through a human interface device (HID) protocol.
[0059] During the operation of the electronic device, the controller periodically scans the array of capacitive electrodes on the capacitive touch-sensitive surface to obtain the capacitance change of each capacitor in the array, thus acquiring capacitance sensing data. Then, when the controller determines that a touch operation has been received on the capacitive touch-sensitive surface based on the capacitance sensing data, it determines the touch position (i.e., coordinates) and touch state on the capacitive touch-sensitive surface, generates and sends a HID report containing the touch parameters to the host. The host executes corresponding instructions based on the touch parameters in the HID report to respond to the touch operation.
[0060] In related technologies, input devices with multiple conductive elements (equivalent to fingers) are provided, allowing users to indirectly perform touch operations on a capacitively sensitive surface. These conductive elements not only form multiple touch points on the capacitively sensitive surface but also encode the input device. Currently, for this type of input device, after acquiring capacitive sensing data, the controller only sends touch parameters determined based on the touch points in the capacitive sensing data to the host computer. This prevents the host computer from decoding multiple touch points to obtain the input device's encoding, thus hindering a targeted response to this type of touch operation.
[0061] To address this technical problem, this application provides a data transmission method. In this method, when a controller receives a touch operation triggered by an input device on a capacitive touch-sensitive surface, it acquires capacitive sensing data of the capacitive touch-sensitive surface. If, based on the capacitive sensing data, the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, the controller sends the capacitive sensing data to the host computer. The host computer decodes the capacitive sensing data to obtain the encoded information of the input device and responds to the touch operation according to the encoded information. This allows the host computer to provide targeted responses to the input device, thereby expanding the application scenarios of electronic devices and meeting user needs in specific scenarios.
[0062] The capacitive sensing data can be a capacitance image of the capacitive touch-sensitive surface. A capacitance image is an image constructed based on the capacitance change of each capacitor in the capacitor electrode array. A capacitance image is generally a grayscale image, where each pixel corresponds to a capacitor, and the pixel value (grayscale value) of each pixel corresponds to the magnitude of the capacitance change. Furthermore, since each capacitor has a unique coordinate on the capacitive touch-sensitive surface, the position of each pixel in the capacitance image is the same as the position of the corresponding capacitor on the capacitive touch-sensitive surface. In other words, the pixels in the capacitance image correspond one-to-one with the capacitors on the capacitive touch-sensitive surface, and each pixel in the capacitance image corresponds to a coordinate on the capacitive touch-sensitive surface.
[0063] See Figure 3 , Figure 3This is an exemplary partial schematic diagram of a capacitance image provided in an embodiment of this application. For example... Figure 3 As shown, each number (i.e., pixel) in the capacitance image 30 corresponds to a capacitor in the capacitive touch surface. The size of the pixel represents the magnitude of the capacitance change. The position of the pixel in the capacitance image is consistent with the position of the corresponding capacitor in the capacitive touch surface.
[0064] To facilitate understanding of this application, the following is a brief introduction to the application scenarios and input devices involved in this application, in conjunction with the accompanying drawings.
[0065] This application provides an interactive system including an electronic device and an input device as described above. The electronic device has a capacitive touch-sensitive surface and a host, as well as a controller for controlling the capacitive touch-sensitive surface. The input device includes at least one outer surface, on which a plurality of conductive elements capable of capacitively coupling with the capacitive touch-sensitive surface are disposed.
[0066] See Figure 4 , Figure 4 This is an exemplary schematic diagram of an interactive system provided in an embodiment of this application. The system includes an electronic device 41 and an input device 42. The electronic device 41 integrates a capacitive touch-sensitive surface, capable of receiving and responding to touch operations. At least one outer surface of the input device 42 may be provided with multiple conductive elements 421. These conductive elements 421 not only encode the input device 42 but also enable the input device 42 to perform touch operations, forming multiple touch points 411 on the capacitive touch-sensitive surface. The electronic device 41 can decode the multiple touch points 411 to obtain encoded information corresponding to the input device 42, and respond to touch operations based on the encoded information to achieve a targeted response to the input device 42.
[0067] See Figure 5 , Figure 5 This is an exemplary cross-sectional view of an input device provided in an embodiment of this application. The outer contour of the input device 50 can be a cube, a cuboid, or other shapes; this embodiment does not limit this. The input device 50 has an outer surface 51 and a gripping end 52. Multiple conductive elements 53 are disposed on the input device 50, each conductive element 53 having a portion protruding from the outer surface 51. When the outer surface 51 abuts against the capacitive touch-sensitive surface, each conductive element 53 can contact the capacitive touch-sensitive surface. A connecting portion 54 is also disposed inside the input device 50. One end of the connecting portion 54 is connected to each conductive element 53, and the other end is exposed from the gripping end 52, allowing the user's hand to contact the connecting portion 54 when gripping the input device 50, thus grounding the conductive elements 53 through the human body.
[0068] Both the conductive element 53 and the connecting part 54 are made of conductive materials. When the user indirectly performs a touch operation through the input device 50, the hand remains in contact with the connecting part 54 while holding the input device. The connecting part 54 short-circuits the hand to each conductive element 53, and the conductive element 53 is grounded through the human body. At this time, each conductive element 53 is equivalent to a finger of the user. When the outer surface 51 abuts against the capacitive touch-sensitive surface, each conductive element 53 can capacitively couple with the capacitor at the corresponding position on the capacitive touch-sensitive surface, causing the capacitance value to change and forming a touch point on the capacitive touch-sensitive surface.
[0069] For example, when encoding an input device using multiple conductive elements, multiple first conductive elements can be provided on the input device. Based on these first conductive elements, multiple encoding regions are divided on the input device, and each encoding region corresponds one-to-one with multiple code elements in the encoding of the input device. For each code element, the specific value of the code element is characterized by the capacitance change caused by a second conductive element provided in the corresponding encoding region.
[0070] See Figure 6 , Figure 6 This is an exemplary encoding diagram of an input device provided in an embodiment of this application. (In conjunction with...) Figure 5 As shown, a conductive element arrangement area 511 is provided on the outer surface of the outer surface 51. N first conductive elements 531 (N is an integer greater than 2, for example, 3) and M second conductive elements 532 (M is an integer greater than or equal to 0) are arranged on the conductive element arrangement area 511. Multiple first conductive elements 531 form a preset pattern (the preset pattern can be a non-rotationally symmetric pattern) that can identify the input device as a recognizable input device. The M second conductive elements 532 are used to encode the input device. Three first conductive elements 531 can form a non-rotationally symmetric preset pattern "L". A coordinate system is constructed based on the three first conductive elements, and multiple coding regions are divided within the coordinate system. Second conductive elements 532 are arranged within the coding regions.
[0071] like Figure 6 As shown, a rectangular coordinate system is constructed with the center point of one of the first conductive components as the origin of the coordinate system, and the two directions from the center point of the first conductive component to the center points of the other two first conductive components as the directions of the two axes of the rectangular coordinate system. Multiple adjacent coding regions are divided in the coordinate system.
[0072] Optionally, the dimensions of each conductive element (including the first and second conductive elements) can be designed such that the size of the touch point formed by each conductive element on the capacitive touch-sensitive surface is less than or equal to K (K is, for example, a length of 3 pixels). Based on the size of the touch point, the conductive element arrangement area 511 is divided into 16 square areas of the same size, each square area having a side length of H, where H is greater than or equal to K. The relative distance between the center points of two adjacent areas is H, and the number of the upper left corner of each area is the area number. Areas 1, 4, and 13 are reference areas, which are used to set the first conductive elements so that the three first conductive elements form a preset shape "L".
[0073] When placing conductive components within each region, the center point of the conductive component coincides with the center point of the region. The center point of the first conductive component in region 1 can be set as the origin of the coordinate system. The direction from the center point of region 1 to the center point of the first conductive component in region 4 is the positive direction of the X-axis in the coordinate system, and the direction from the center point of region 1 to the center point of the first conductive component in region 13 is the negative direction of the Y-axis in the coordinate system. Figure 6 In the constructed rectangular coordinate system, the symbol X2 represents the X-axis and the symbol Y2 represents the Y-axis.
[0074] Among them, regions 2 and 3, regions 5-12, and regions 14 and 15 are coding regions. Each coding region corresponds to a symbol in the encoding of the input device. The number in the lower right corner of each coding region is the region number of the coding region, which also represents the bit index of the coding region. The bit index is the position of the symbol corresponding to the coding region in the encoding.
[0075] When the conductive component arrangement area 511 abuts against the capacitive touch-sensitive surface, both the first conductive component 531 and the second conductive component 532 can capacitively couple with the capacitor in the capacitive touch-sensitive surface, forming a touch point on the capacitive touch-sensitive surface. Here, capacitive coupling between the conductive component and the capacitor in the capacitive touch-sensitive surface means that the conductive component can cause a change in the capacitance of the capacitor in the capacitive touch-sensitive surface.
[0076] To avoid confusion, the touch point formed by the first conductive element 531 will be referred to as the first touch point, and the touch point formed by the second conductive element 532 will be referred to as the second touch point.
[0077] like Figure 6As shown, when a touch operation is performed via an input device, each region in the conductive element arrangement area 511 is opposite to a region in the capacitive touch-sensitive surface. The region in the capacitive touch-sensitive surface corresponding to the reference region (hereinafter referred to as the positioning region) has a first touch point formed by the first conductive element, and the center point of the first touch point is located at the center point of the positioning region. When a second conductive element is provided in the encoding region, the region in the capacitive touch-sensitive surface corresponding to the encoding region (hereinafter referred to as the decoding region) has a second touch point formed by the second conductive element, and the center point of the second touch point is located at the center of the decoding region. When no second conductive element is provided in the encoding region, there is no second touch point formed by the second conductive element in the decoding region corresponding to the encoding region.
[0078] Based on the above examples, the coordinates of the encoded region in this coordinate system can be represented by the coordinates of the center point of the encoded region in the coordinate system. The coordinates of the encoded region in this coordinate system can be called the preset coordinates. Since the relative positional relationship between the encoded region and the reference region is fixed and known, the relative positional relationship between the decoded region and the positioning region is also fixed and known.
[0079] For example, the encoding of the input device can be a binary number. When the encoding area has a second conductive element, the corresponding code element of the encoding area is 1; when the encoding area does not have a second conductive element, the corresponding code element of the encoding area is 0. The decoding area corresponds one-to-one with the encoding area. Therefore, for each encoding area, when a second touch point formed by the second conductive element exists within the decoding area, the corresponding code element of the decoding area is 1; when no second touch point formed by the second conductive element exists within the decoding area, the corresponding code element of the decoding area is 0. Furthermore, since the relative positional relationship between the decoding area and the first touch point is the same as the relative positional relationship between the corresponding encoding area and the first conductive element, the decoding area and the corresponding encoding area correspond to the same bit index.
[0080] like Figure 6 As shown, the conductive component arrangement area 511 has a total of 12 coding areas. Therefore, the code of the input device is a 12-bit binary number. There is no second conductive component in coding area 1, so the first bit of the binary number is 0. There is a second conductive component in coding area 2, so the second bit of the binary number is 1, and so on. Figure 6 The input device shown is coded as “010111101010”. It can be understood that when no second conductive element is provided in any of the coded areas, the input device is coded as “000000000000”, while when a second conductive element is provided in all coded areas, the input device is coded as “111111111111”.
[0081] When encoding different input devices, a unique 12-bit binary number (i.e., code) can be assigned to each input device. Then, for each code element in the binary number, the corresponding encoding region is determined from 12 encoding regions based on the bit index of the code element in the binary number. When the code element is 1, a second conductive element is set in the corresponding encoding region; when the code element is 0, no second conductive element is set in the corresponding encoding region, thereby realizing the encoding of the input device.
[0082] like Figure 6 As shown, the preset pattern formed by multiple first conductive elements 531 is "L"-shaped, and the relative distance between any two first conductive elements 531 is a preset distance (hereinafter referred to as the preset distance). Based on this, when a touch operation is performed through the input device and multiple touch points are formed on the capacitive touch-sensitive surface, each first touch point is located within the positioning area corresponding to the reference area. The electronic device can identify each first touch point from the multiple touch points based on the relative positional relationship between the touch points. The relative distance between two conductive elements refers to the distance between the center points of the two conductive elements, and the relative distance between two touch points refers to the distance between the center points of the two touch points.
[0083] Simultaneously, each second touch point is located within the decoding area corresponding to the encoding area. The electronic device can determine the bit index corresponding to the decoding area based on the relative positional relationship between the decoding area and multiple first touch points (i.e., positioning areas), and determine whether there is a second touch point within the decoding area. When there is a second touch point, the corresponding code element can be determined to be 1. When there is no second touch point (i.e., no second conductive element is provided), the corresponding code element can be determined to be 0. In this way, each code element in the encoding can be determined. The encoding of the input device can be obtained by combining all code elements and the bit index corresponding to each decoding area.
[0084] In practical applications, by properly setting the size of each conductive component, the size of the touch point formed when the conductive component abuts against the capacitive touch-sensitive surface can be controlled. This also ensures that the conductive components do not interfere with each other, and that the touch points formed by the conductive components on the capacitive touch-sensitive surface do not interfere with each other. Each touch point can be clearly identified and distinguished by electronic devices.
[0085] It should be noted that the encoding method of the input device can be as follows: Figure 6 As shown, other methods can also be used, as long as they can uniquely identify the input device. The encoding method of the input device can include, but is not limited to, the examples above.
[0086] The data transmission method provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0087] See Figure 7 , Figure 7 This is a flowchart illustrating the steps of a data transmission method provided in an embodiment of this application. This method can be executed by the controller and host as illustrated in the above example, such as... Figure 7 As shown, the method includes the following steps:
[0088] Step 701: The controller receives a touch operation triggered by the input device on the capacitive touch-sensitive surface and acquires the capacitance sensing data of the capacitive touch-sensitive surface.
[0089] In this embodiment, during the operation of the electronic device, the controller can detect whether the capacitive touch-sensitive surface receives a touch operation. When a touch operation is detected, the controller acquires the capacitance sensing data of the capacitive touch-sensitive surface. For example, the controller can periodically scan the capacitor electrode array in the capacitive touch-sensitive surface. During each scan, the controller can acquire the capacitance change of each capacitor in the capacitor electrode array. If it is determined that the capacitance change of a certain capacitor in the capacitor electrode array is greater than a preset threshold, then it is determined that the capacitive touch-sensitive surface has received a touch operation. At this time, the controller can draw a capacitance image based on the capacitance change of each capacitor.
[0090] After detecting a touch operation on the capacitive touch-sensitive surface, the controller can continuously acquire multiple frames of capacitive images and continuously send the acquired multiple frames of capacitive images to the host via the Universal Serial Bus Video Class (UVC) protocol.
[0091] Step 702: When the controller determines, based on the capacitive sensing data, that the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, it sends the capacitive sensing data to the host.
[0092] In this embodiment, after acquiring the capacitive sensing data, the controller can determine the number of touch points formed by the touch operation on the capacitive touch-sensitive surface based on the capacitive sensing data. For example, the controller can find each pixel in the capacitive image whose pixel value is greater than a preset threshold. For each pixel whose pixel value is greater than the preset threshold, the controller determines the pixel values of other pixels within a square area centered on that pixel, with a side length of 3 pixels (the size of the first touch point and the second touch point is 3 pixels (i.e., K)). If the pixel values of all other pixels are greater than the preset threshold and less than the pixel value of that pixel, then the square area is determined as a touch point. This allows the determination of all touch points on the capacitive touch-sensitive surface.
[0093] like Figure 6As shown, after identifying all touch points on the capacitive touch-sensitive surface, if the number of touch points is greater than or equal to N, it is determined that the touch operation may have been triggered by an input device. In this case, the controller can send a capacitance image to the host computer. It should be understood that when the number of touch points is less than N, it can be determined that the touch operation was not triggered by an input device, and the controller does not send a capacitance image to the host computer.
[0094] Optionally, when the capacitance sensing data is a capacitance image, the controller can send the capacitance image to the host based on a target communication protocol supported by the controller. The target communication protocol includes a communication protocol for transmitting image data. Optionally, the target communication protocol includes the UVC protocol.
[0095] For example, a USB interface can be configured for the controller, which connects to the host via the USB interface. When sending capacitance images to the host, the controller and host can communicate via the UVC protocol, with the controller sending the capacitance images to the host through the UVC protocol. It should be understood that communication protocols used for outputting image data include, but are not limited to, the UVC protocol, and the controller can also send capacitance images to the host through other communication protocols that support image data transmission.
[0096] In this embodiment, by sending a capacitance image to the host via a target communication protocol that supports image data transmission, the capacitance image can be sent to the host quickly and promptly, allowing the host to determine the encoding information of the input device based on the capacitance image and respond to the touch operation accordingly.
[0097] Step 702: The host decodes the input device's encoding information based on the capacitive sensing data and responds to touch operations according to the encoding information.
[0098] For example, the host receives a complete capacitance image sent by the controller. After receiving the complete capacitance image, the host can determine whether there are multiple touch points in the capacitance image. If there are multiple touch points in the capacitance image, the host can decode the multiple touch points. Since the multiple conductive elements on the input device correspond one-to-one with the multiple touch points in the capacitance image, decoding the multiple touch points is equivalent to decoding the multiple conductive elements.
[0099] See Figure 8 , Figure 8 Through Figure 6 This diagram illustrates a partial capacitance image of an input device during a touch operation. In this capacitance image 80, the pixel value of each pixel represents the change in capacitance across the corresponding capacitor. A larger pixel value indicates a greater change in capacitance, and consequently, a higher pixel brightness. (Combined with...) Figure 6 As shown, when passing through Figure 6When the input device shown performs a touch operation, each conductive element in the conductive element arrangement area 511 is in contact with the capacitive touch-sensitive surface. Each conductive element can cause a change in the capacitance at the contact position. Each first conductive element 531 can form a first touch point 81 in the capacitance image 80, and each second conductive element 532 can form a second touch point 82 in the capacitance image 80.
[0100] When the capacitance image includes Figure 8 When multiple touch points are shown, due to Figure 8 The multiple touch points shown are Figure 6 The multiple conductive components shown correspond one-to-one with each other. Figure 8 Decoding multiple touch points in the process is equivalent to... Figure 6 The multiple conductive components shown are decoded, and the resulting code is... Figure 6 The input device's encoding information is shown.
[0101] In capacitive image, the touch point is the touch point on the capacitive touch-sensitive surface, also called the touch area. The touch area is usually composed of one or more pixels with a pixel value greater than a preset threshold. A pixel value greater than the preset threshold indicates that the capacitance at the corresponding pixel has changed significantly due to the presence of the input device. Typically, the pixel located at the center of the touch area (hereinafter referred to as the center pixel) has the largest pixel value, and the coordinates of the center pixel are usually the coordinates of the touch point on the capacitive touch-sensitive surface.
[0102] In one implementation, the host computer can identify the capacitance image using a decoding model to determine the encoded information of the input device. A neural network model can be pre-trained so that the trained model (i.e., the decoding model) can identify the encoded information from the capacitance image.
[0103] When training a neural network model, multiple training samples can be pre-acquired, each corresponding one-to-one with a different input device. Each training sample includes a sample image and a sample label for the corresponding input device. The sample image is a capacitance image of the input device when performing a touch operation, and the sample label contains the encoded information of the input device. Figure 6 Taking the input device shown as an example, it is possible to obtain the information in advance. Figure 6 The capacitance image shown is generated when the input device performs a touch operation. This capacitance image is used as a sample image, and the corresponding encoded information "010111101010" is used as the sample label. By combining the sample image and the sample label, a training sample can be obtained. Similarly, a training sample can be obtained for each input device. When there are a large number of input devices, a large number of training samples can be acquired.
[0104] Simultaneously, an initial model can be constructed, which refers to an untrained neural network model for image recognition. Then, the initial model can be trained using the acquired training samples. During training, for each training sample, the sample image from the training sample can be input into the initial model to obtain the decoding result output by the initial model. Based on the deviation between the decoding result and the sample labels in the training samples, the model parameters of the initial model are adjusted. This process is repeated, training the initial model with a large number of training samples. When the accuracy of the decoding result output by the initial model reaches a preset accuracy, training stops, and the initial model is used as the final decoding model.
[0105] For example, a decoding model can be deployed in an electronic device, which can input the capacitance image into the decoding model each time it acquires it. When the capacitance image includes multiple touch points formed by multiple conductive elements on the input device, the decoding result output by the decoding model can be obtained, which is the encoded information of the input device.
[0106] For example, the decoding model can be deployed on a server. After each acquisition of a capacitance image, the electronic device can upload the capacitance image to the server. Upon receiving the capacitance image, the server can input the capacitance image into the decoding model. When the capacitance image includes multiple touch points formed by multiple conductive parts on the input device, the server can obtain the encoded information output by the decoding model. The server can then send the encoded information to the electronic device, thereby achieving decoding and obtaining the target decoder for the input device.
[0107] It is understandable that during the process of obtaining encoded information through the decoding model, when the capacitance image does not include multiple touch points formed by multiple conductive parts on the input device, the decoding result output by the decoding model will not contain encoded information. In this case, it can be determined that no input device is performing a touch operation, or that the input device is a normal input device (such as a finger), and there is no need to decode to determine the encoded information of the input device.
[0108] In another implementation, the input device can be decoded using template matching to determine its encoding information from the capacitance image. For example, for each input device, a capacitance image and its encoding can be pre-obtained, using the capacitance image as an image template and the input device's encoding as a preset encoding corresponding to the image template. Thus, for multiple input devices, multiple image templates and preset encodings corresponding to each image template can be obtained.
[0109] After acquiring a capacitance image, the electronic device can sequentially calculate the similarity between the capacitance image and each image template. When the similarity between a certain image template and the capacitance image is greater than a preset similarity, the image template can be identified as the target image template, and the preset code corresponding to the target image template is used as the encoding information of the input device. The preset similarity can be a large value, such as 95%, 98%, 99%, or 100%.
[0110] In the process of determining the encoded information through template matching, when the capacitive image does not include multiple touch points formed by multiple conductive parts on the input device, the target image template will not exist among the multiple image templates. In this case, it can be determined that no input device is performing a touch operation, or that the input device is a normal input device (such as a finger), and it is not necessary to decode and determine the encoded information of the input device.
[0111] In one embodiment, a corresponding response method can be pre-set for each encoded information of the input device. After determining the encoded information of the input device, the corresponding response method can be determined based on the encoded information, and the touch operation can be responded to according to the corresponding response method. For example, if it is necessary to trigger the electronic device to open a certain software interface through the input device for one of the encoded information of the input device, the response method corresponding to the encoded information of the input device can be set to open the software interface. After decoding the encoded information of the input device, it can be determined that the response method corresponding to the encoded information is to open the software interface. At this time, the capacitive screen is controlled to display the software interface to realize the response to the touch operation performed by the input device.
[0112] For example, if an electronic device needs to play an audio signal to trigger the input device, the response mode corresponding to the encoding information of the input device can be set to play an audio signal. After decoding the encoding information of the input device, the response mode corresponding to the encoding information can be determined to be playing an audio signal, and the audio signal can be played through the speaker to realize the response to the touch operation performed by the input device.
[0113] For example, if it is necessary to trigger an electronic device to output an indicator light signal through one of the input devices, the response mode corresponding to the encoded information of the input device can be set to output an indicator light signal. After decoding the encoded information of the input device, it can be determined that the response mode corresponding to the encoded information is to output an indicator light signal, and the indicator light can be turned on to output the indicator light signal, thereby realizing the response to the touch operation performed by the input device.
[0114] For example, if it is necessary to trigger the electronic device to output a vibration signal (response mode is vibration) through one of the input devices, the response mode corresponding to the encoded information of the input device can be set to vibration. After decoding the encoded information of the input device, it can be determined that the response mode corresponding to the encoded information is vibration, and then the linear motor can be controlled to start running to output a vibration signal, thereby realizing the response to touch operation.
[0115] It should be understood that the above are merely illustrative examples, and the response methods for touch operations may include, but are not limited to, the examples above.
[0116] Optionally, the encoded information is obtained by decoding the capacitive sensing data, including:
[0117] Determine whether the multiple touch points include N first touch points, the N first touch points form a preset non-rotationally symmetric shape, and the relative distance between any two first touch points matches the preset distance;
[0118] If there are N first touch points, then construct a target coordinate system based on the N first touch points;
[0119] Based on the target coordinate system, the other touch points are decoded to obtain the encoded information. The other touch points are the touch points other than the N first touch points among multiple touch points.
[0120] like Figure 6 As shown, in the conductive component arrangement area 511, the side length of each square area is H. The size of the square area can be greater than or equal to the size of the first touch point and the second touch point. The distance between the center point of area 1 and the center point of area 4 is 3H, the distance between the center point of area 1 and the center point of area 13 is 3H, and the distance between the center point of area 4 and the center point of area 13 is...
[0121] After acquiring the capacitance image, the host computer can locate each pixel in the capacitance image whose pixel value is greater than a preset threshold. For each pixel whose pixel value is greater than the preset threshold, a square area with a side length of 3 pixels (both the first and second touch points have a side length of 3 pixels, i.e., K) is defined centered on that pixel. If the pixel values of other pixels are all greater than the preset threshold and less than the pixel value of the first touch point, then the square area is determined to be either the first or second touch point. Next, for each pixel within the square area, the product between the pixel value and its coordinates is calculated, resulting in a product for each pixel. All product results are summed to obtain a first summation result, and the pixel values of all pixels within the square area are summed to obtain a second summation result. Dividing the first summation result by the second summation result yields the center coordinates of the square area, which are the center coordinates of the touch point. In this way, all touch points in the capacitance image and the center coordinates of each touch point can be determined.
[0122] For example, such as Figure 6 As shown, when constructing a coordinate system based on three first conductive elements, the center point of the first conductive element in region 1 is the origin. The direction from the center point of the first conductive element in region 1 to the center point of the first conductive element in region 4 is the positive direction of the X-axis in the coordinate system, and the direction from the center point of the first conductive element in region 1 to the center point of the first conductive element in region 13 is the negative direction of the Y-axis in the coordinate system. Multiple preset coordinates represent the coordinates of the center points of multiple encoding regions in the coordinate system. These preset coordinates correspond one-to-one with the multiple encoding regions, and the multiple encoding regions correspond one-to-one with the multiple decoding regions. Therefore, the multiple preset coordinates also correspond one-to-one with the multiple decoding regions.
[0123] Based on the relative distances between the regions, it can be determined that the relative distance between the first touch point corresponding to region 1 and the first touch point corresponding to region 4 is approximately or equal to 3H, the relative distance between the first touch point corresponding to region 1 and the first touch point corresponding to region 13 is approximately or equal to 3H, and the relative distance between the first touch point corresponding to region 4 and the first touch point corresponding to region 13 is approximately or equal to 3H.
[0124] After determining that there are multiple touch points in the capacitance image using the above method, if the relative distance between two touch points is... These two touch points are then identified as the two first touch points corresponding to regions 4 and 13, respectively. If the relative distance between any touch point and both of these first touch points is 3H, then that touch point can be identified as the first touch point corresponding to region 1.
[0125] Optionally, after determining N first touch points, a first target touch point, a second target touch point, and a third target touch point can be determined from the N first touch points; the relative distance between each pair of the first target touch point, the second target touch point, and the third target touch point is a preset distance; a target coordinate system is constructed with the first target touch point as the origin of the rectangular coordinate system, the direction from the first target touch point to the second target touch point as the X-axis direction of the rectangular coordinate system, and the direction from the first target touch point to the third target touch point as the Y-axis direction of the rectangular coordinate system.
[0126] For example, after determining that there are multiple touch points in the capacitive image using the above method, the relative distance between every two touch points is calculated. If the relative distance between two touch points is... These two touch points are then identified as the two first touch points corresponding to regions 4 and 13, respectively. If the relative distance between one of the touch points and both of these first touch points is a preset distance of 3H, then the touch point can be identified as the first touch point corresponding to region 1, and this first touch point is the first target touch point.
[0127] See Figure 9 , Figure 9 This illustration shows a schematic diagram of the construction of a coordinate system provided in an embodiment of this application. Figure 9 In the capacitance image 900 shown, each dashed box represents a decoding region. The number in the lower right corner of the decoding region is the region number, which is consistent with the bit index of the corresponding decoding region. Touch point 91 is the first touch point corresponding to the first conductive element in region 1, touch point 92 is the first touch point corresponding to the first conductive element in region 4, and touch point 93 is the first touch point corresponding to the first conductive element in region 13.
[0128] After determining that touch point 91 is the first touch point (i.e., the first target touch point) corresponding to region 1 using the above method, the center point of touch point 91 can be used as the origin of the target coordinate system. For touch points 92 and 93, a first vector 94 pointing from the center of touch point 91 to the center of touch point 92, and a second vector 95 pointing from the center of touch point 91 to the center of touch point 93 are determined. If the cross product between the first vector 94 and the second vector 95 is negative, then the first vector 94 is located on the X2 axis of the target coordinate system, and the second vector 95 is located on the Y2 axis of the coordinate system. Therefore, touch point 92 can be determined as the first touch point (i.e., the second target touch point) corresponding to region 4, and touch point 93 as the first touch point (i.e., the third target touch point) corresponding to region 13.
[0129] The cross product (also called the vector product or outer product) between the first vector 94 and the second vector 95 is an operation on the first vector 94 and the second vector 95. The result is a vector perpendicular to both vectors 94 and 95, and its magnitude is equal to the magnitudes of the first vector 94 and the second vector 95 multiplied by the sine of the angle between them. For example, when the first vector 94 is 'a' and the second vector 95 is 'b', the cross product between the first vector 94 and the second vector 95 is a × b.
[0130] Next, the direction from the center point of touch point 91 to the center point of touch point 92 can be determined as the X2 axis direction in the coordinate system, and the direction from the center point of touch point 91 to the center point of touch point 93 can be determined as the Y2 axis direction in the coordinate system. This allows the construction of a Cartesian coordinate system composed of the X2 and Y2 axes. Simultaneously, the angle α between the X1 and X2 axes in the original coordinate system of the capacitive image can be calculated and determined.
[0131] The original coordinate system of the capacitance image is the same as the original coordinate system of the capacitive touch-sensitive surface. For example... Figure 9 As shown, when the capacitive touch-sensitive surface is a capacitive screen, the horizontal direction of the capacitive screen is the X1 axis of the original coordinate system, and the vertical direction is the Y1 axis of the original coordinate system. The position of the touch point in the original coordinate system is the position of the touch point on the capacitive screen.
[0132] It can be understood that after determining the first vector 94 and the second vector 95, if the cross product between the first vector 94 and the second vector 95 is determined to be positive, then the first vector 94 can be determined to be located on the Y2 axis of the coordinate system, and the second vector 95 can be determined to be located on the X2 axis of the coordinate system. Therefore, touch point 92 can be determined to be the first touch point (i.e., the third target touch point) corresponding to region 13, and touch point 93 can be determined to be the first touch point (i.e., the second target touch point) corresponding to region 4. Subsequently, the direction from the center point of touch point 91 to the center point of touch point 93 can be determined as the X2 axis direction of the coordinate system, and the direction from the center point of touch point 91 to the center point of touch point 92 can be determined as the Y2 axis direction of the coordinate system.
[0133] Combination Figure 6 As shown, each encoded region corresponds to a decoded region, and the preset coordinates of the encoded region are the same as the preset coordinates of the corresponding decoded region. In determining the decoded region based on the target coordinate system, after the target coordinate system is constructed, the preset coordinates of each encoded region can be obtained from the pre-stored coordinates. Based on these preset coordinates, the position of the center point of the corresponding decoded region is determined from the coordinate system. Then, a square region with a side length H centered on the center point is determined as the decoded region. The angle between two opposite sides of this square region and the X1 axis is angle α, and the other two sides are perpendicular to the line segment between touch points 91 and 92. Similarly, each other decoded region can be determined.
[0134] Taking decoding regions 1 and 2 as examples, decoding region 1 has no second touch point, so the code element corresponding to decoding region 1 can be determined to be 0, and the bit index corresponding to this code element can be determined to be 1. Decoding region 2 has a second touch point 96, so the code element corresponding to decoding region 2 can be determined to be 1, and the bit index corresponding to this code element can be determined to be 2. Thus, the first and second bits in the encoded information are determined to be 0 and 1 respectively. Similarly, each code element and its corresponding index can be determined. Based on the code elements and bit indices corresponding to all decoding regions, the target code element of the input device can be obtained by combining the code elements corresponding to all decoding regions.
[0135] Optionally, the step of decoding other touch points to obtain encoded information based on the target coordinate system may include: for each other touch point, if the coordinates of the other touch point in the target coordinate system correspond to one of the preset coordinates, then determining a code element in the target code corresponding to the other touch point based on the pixel value of the other touch point; wherein the pixel value of the other touch point is the pixel value of the other touch point in the capacitance image of the capacitive touch-sensitive surface; and determining the bit index of the code element corresponding to the other touch point in the target code based on the preset coordinate corresponding to the other touch point; and determining the target code based on all determined code elements and the corresponding bit indexes.
[0136] The coordinates of other touch points in the target coordinate system correspond to one of the preset coordinates. This means that the coordinates of other touch points overlap with the preset coordinates, or the distance between the coordinates of other touch points and a certain preset coordinate is less than or equal to a preset distance threshold, and they almost overlap with the preset coordinates.
[0137] For example, after constructing the target coordinate system, if it is determined that the capacitive image also includes other touch points, the coordinates of these other touch points in the target coordinate system can be directly determined. If the coordinates of these other touch points in the target coordinate system overlap with a preset coordinate, then these other touch points can be determined as the second touch point corresponding to the preset coordinate. Alternatively, if the distance between these other touch points and a certain touch point is less than a preset distance threshold (e.g., 3 pixels), then these other touch points can be determined as almost overlapping with the second touch point corresponding to the preset coordinate, and these other touch points are the second touch point.
[0138] At this point, a symbol in the target encoding corresponding to other touch points can be determined based on the pixel values of those other touch points. For example, when the input device's encoding is binary data, the symbol corresponding to the other touch point (i.e., the second touch point) can be directly determined to be 1. When the input device's encoding is decimal data, the target pixel value range where the pixel value of the other touch point (i.e., the second touch point) is located can be determined, and the symbol corresponding to the target pixel value range can be used as the symbol corresponding to the other touch point. Simultaneously, the bit index corresponding to the preset coordinates of the other touch points can be determined as the bit index of the symbol corresponding to the other touch point in the target encoding.
[0139] In this embodiment, after constructing the target coordinate system, other touch points besides the first touch point are determined, and the code elements in the target code are determined according to the relationship between the other touch points and the preset coordinates. This allows processing only a small number of touch points, reducing the amount of data processing and improving the efficiency of determining the target code.
[0140] It should be understood that the above are merely illustrative examples, and specific methods for obtaining encoded information based on capacitance image decoding may include, but are not limited to, the examples above.
[0141] In this embodiment, when the controller receives a touch operation triggered by an input device on the capacitive touch-sensitive surface, it acquires the capacitive sensing data of the capacitive touch-sensitive surface. If, based on the capacitive sensing data, the number of touch points formed on the capacitive touch-sensitive surface by the touch operation is greater than or equal to N, the controller sends the capacitive sensing data to the host. The host decodes the input device's encoding information based on the capacitive sensing data and responds to the touch operation according to the encoding information. This not only enables electronic devices to respond specifically to the input device performing the touch operation but also expands the application scenarios of capacitive touch-sensitive surfaces, meeting user needs in specific scenarios.
[0142] Furthermore, since the number of touch points triggered by the input device is usually not less than N, the controller sends capacitive sensing data to the host when the number of touch points is greater than or equal to N. That is, it sends capacitive sensing data to the host when it is determined that the touch operation is triggered by the input device. This avoids sending capacitive sensing data to the host when the touch operation is not triggered by the input device, which can reduce the amount of data transmission between the controller and the host and improve the communication efficiency between the controller and the host.
[0143] Optionally, when the capacitive sensing data is a capacitive image, the step of sending the capacitive sensing data to the host may include: extracting a region image including multiple touch points from the capacitive image; sending the region image to the host so that the host can decode the encoded information based on the region image.
[0144] In one implementation, when sending a capacitance image to the host, the controller can only send images of the areas within the capacitance image that include multiple touch points, thereby reducing the amount of data transmitted. For example... Figure 9 As shown, when passing through Figure 6 When the input device shown performs a touch operation, multiple touch points can be formed in the capacitive image 900. The multiple touch points include a first touch point and a second touch point, and there may also be other touch points.
[0145] When extracting a region image 90 containing multiple touch points from the capacitive image 900, the upper-left corner coordinate A and lower-right corner coordinate B of the region image 90 can first be determined from the multiple touch points. The x-coordinate of the upper-left corner coordinate A is the minimum x-coordinate among all the x-coordinates of the multiple touch points plus a first preset offset (the first preset offset is a negative value), and the y-coordinate is the maximum y-coordinate among all the y-coordinates of the multiple touch points plus a second preset offset (the second preset offset is a positive value); the x-coordinate of the lower-right corner coordinate B is the maximum x-coordinate among all the x-coordinates of the multiple touch points plus a third preset offset (the third preset offset is a positive value), and the y-coordinate is the minimum y-coordinate among all the y-coordinates of the multiple touch points plus a fourth preset offset (the fourth preset offset is a negative value).
[0146] After determining the top-left corner coordinates A and bottom-right corner coordinates B of region image 90, the controller can extract a rectangular region located between the top-left corner coordinates A and the bottom-right corner coordinates B from the capacitance image 900 to obtain region image 90. After obtaining region image 90, the controller can send region image 90 to the host.
[0147] Correspondingly, the host can decode the input device's encoding information based on the multiple touch points included in the region image 90. In the process of obtaining encoding information based on the region image 90, the host can also use the decoding method described in the aforementioned embodiment to decode the multiple touch points in the region image 90 to obtain the encoding information.
[0148] In practical applications, the first preset offset, the second preset offset, the third preset offset, and the fourth preset offset can be reasonably set so that the controller can capture an area image including all the first touch points and the second touch points from the capacitive image regardless of how the input device rotates on the capacitive touch-sensitive surface.
[0149] In this embodiment of the application, during the process of sending a capacitance image to the host, the controller extracts a region image from the capacitance image and sends the region image to the host, which can reduce the amount of data during the transmission process and improve the data transmission efficiency.
[0150] Optionally, the step of sending a region image to the host may include:
[0151] The pixel value of the first pixel is modified to one of 1 and 0, and the pixel value of the second pixel is modified to the other of 1 and 0, so as to obtain a region image in the form of a binary map;
[0152] Send a region image in binary form to the host so that the host can decode the encoded information based on the region image in binary form.
[0153] Here, the first pixel refers to the pixel among the multiple touch points included in the region image, and the second pixel refers to all other pixels except the first pixel. For example... Figure 8 As shown, when the pixel value of a pixel in a touch point is greater than or equal to a preset threshold, the first pixel is the pixel in the area image whose pixel value is greater than or equal to the preset threshold, and the second pixel is the pixel in the area image whose pixel value is less than the preset threshold.
[0154] For example, before sending the region image to the host, the controller can iterate through each pixel in the region image. If the pixel value (i.e., grayscale value) is greater than or equal to a preset threshold, the pixel is determined to be a pixel within the touch point, and its pixel value can be modified to 1. If the pixel value is less than the preset threshold, the pixel is determined to be a pixel outside the touch point, and its pixel value can be modified to 0. At this point, the grayscale region image can be modified into a binary region image. The controller can then send the binary region image to the host.
[0155] See Figure 10 , Figure 10 This illustration shows a partial schematic diagram of a region image in binary map form provided in an embodiment of this application. For example... Figure 10 As shown, in the binary image 100, each pixel has a pixel value of 1 or 0. A pixel with a pixel value of 1 is the first pixel in the region image whose pixel value is greater than or equal to a preset threshold, and a pixel with a pixel value of 0 is the second pixel in the region image whose pixel value is less than the preset threshold.
[0156] Correspondingly, when decoding a region image based on a binary image, the host can use template matching to decode and obtain the encoded information, or it can use a decoding model to identify the encoded information from the region image, or it can decode and obtain the encoded information by constructing a coordinate system. Specifically, when decoding by constructing a coordinate system, the host can identify pixels with a value of 1 in the binary region image as touch points, and pixels with a value of 0 as non-touch points. Touch points in the region image are determined based on pixels with a value of 1, and then the region image is decoded to obtain the encoded information.
[0157] In this embodiment of the application, during the process of sending a region image to the host, the controller first converts the region image into a binary image and then sends the binary image to the host, which can reduce the amount of data during the transmission process and improve data transmission efficiency.
[0158] Optionally, when sending a complete capacitance image to the host, the controller can also convert the capacitance image into a binary image and send the binary image to the host. Correspondingly, the host can decode the input device based on the binary capacitance image to obtain the input device's encoded information.
[0159] Optionally, before sending the region image to the host, the method may further include:
[0160] Based on the capacitance image, determine the reference coordinates of the reference point of the input device in the capacitive touch-sensitive surface;
[0161] A reference coordinate is inserted at a preset position in the regional image so that the host can extract and use the reference coordinate from the preset position in the regional image.
[0162] For example, when through Figure 6 When encoding the input device using the encoding method shown, the reference point on the input device can be the center point of the conductive element arrangement area 511, and the reference coordinates are the coordinates of the center point of the conductive element arrangement area 511 on the capacitive touch-sensitive surface (i.e., the capacitance image). Of course, the reference point can also be located at other positions on the input device.
[0163] For example, after acquiring the capacitance image, the controller can determine N first touch points from the capacitance image using the aforementioned method, and construct a target coordinate system based on the N first touch points. After constructing the target coordinate system, a center point C can be determined from the target coordinate system. The coordinates of the center point C in the target coordinate system are preset (1.5H, -1.5H), and the coordinates (1.5H, -1.5H) are the coordinates of the center point of the conductive component arrangement area 511 in the rectangular coordinate system formed by the X2 axis and the Y2 axis. Then, the controller can determine the coordinates of the center point C in the original coordinate system of the capacitance image, which are the reference coordinates.
[0164] Before sending a region image to the host, the controller can insert reference coordinates at the end (i.e., a preset position) of all data included in the region image. Alternatively, before sending a binary region image to the host, reference coordinates can be inserted at the beginning (i.e., a preset position) of all data included in the binary region image. Correspondingly, after receiving the region image, the host can extract the reference coordinates from the preset positions (beginning or end) of all data included in the region image.
[0165] The host computer can determine the position of a reference point on the input device within the capacitive touch-sensitive surface based on reference coordinates, and respond to touch operations accordingly. For example, when the capacitive touch-sensitive surface is a capacitive screen, the corresponding object to be displayed on the capacitive screen can be displayed at the corresponding position on the screen. The object to be displayed can be data such as images and text.
[0166] like Figure 9 As shown, when the capacitive touch-sensitive surface is a capacitive screen, when the response mode corresponding to the encoded information is to display the object 97 to be displayed corresponding to the input device, the object 97 to be displayed can be displayed at the corresponding position of the capacitive screen according to the reference coordinates, or the object 97 to be displayed can be displayed near the reference coordinates. The object 97 to be displayed can be an analog image of the input device, or it can be data such as images and text corresponding to the input device.
[0167] The rotation angle of the object to be displayed 97 on the capacitive screen is the same as the rotation angle α of the input device on the capacitive screen.
[0168] It should be understood that the preset position may include, but is not limited to, the beginning or the end, and the method of using the reference coordinates may include, but is not limited to, the examples above.
[0169] In practical applications, when the controller sends a complete capacitance image to the host, it can also insert reference coordinates at preset positions in the capacitance image.
[0170] In this embodiment, before sending the area image to the host, reference coordinates of multiple touch points are inserted at a preset position in the area image. This allows the host to determine the actual position of the input device on the capacitive touch-sensitive surface using the reference coordinates and respond to touch operations based on that position.
[0171] Optionally, the step of cropping an image of a region including multiple touch points from a capacitance image may include:
[0172] When a capacitive image includes multiple sets of multiple touch points, multiple region images are extracted from the capacitive image; wherein, each of the multiple region images corresponds one-to-one with each of the multiple sets of multiple touch points.
[0173] In one embodiment, during the process of cropping a region image from a capacitance image, the controller can determine the number of input devices present on the capacitive touch-sensitive surface based on the capacitance image. When it is determined that there are multiple input devices on the capacitive touch-sensitive surface, a region image corresponding to each input device can be cropped from the capacitance image. Each region image includes a set of touch points formed by the corresponding input device. The set of touch points includes multiple touch points formed by multiple conductive elements on the input device.
[0174] For example, in adopting Figure 6When encoding the input device using the encoding method shown, after acquiring the capacitance image, the controller first uses the method described above to detect and determine each group of first touch points included in the capacitance image, with each group of first touch points corresponding to one input device. For each group of first touch points, a region image corresponding to each group of first input devices can be extracted to obtain a corresponding region image.
[0175] like Figure 9 As shown, for each group of first touch points, a coordinate system is constructed based on the first touch point, and the reference coordinates of the input device (i.e., center point C) are determined from the coordinate system. Then, a square region is determined from the capacitance image based on the center point C. The center point of the square region coincides with the center point C. The bottom and top edges of the square region are parallel to the X1 axis in the original coordinate system of the capacitance image, and the two sides of the square region are parallel to the Y1 axis in the original coordinate system of the capacitance image. The side length of the square region is greater than or equal to the length of the diagonal of the conductive component arrangement area 511. In this way, an area image including multiple touch points corresponding to the input device can be captured.
[0176] Similarly, when the controller sends the area image corresponding to each input device to the host, it can insert the reference coordinates of the reference point of the input device at a preset position in the area image.
[0177] The above are merely illustrative examples. Methods for extracting the region image corresponding to each input device from the capacitance image may include, but are not limited to, the examples above. This embodiment does not limit these methods.
[0178] In this embodiment of the application, when the capacitive image includes multiple sets of touch points of multiple input devices, the controller captures the area image corresponding to each input device, which enables the host to decode the encoding information of each input device based on the area image corresponding to each input device, and execute the instruction corresponding to each input device based on the encoding information of each input device, so as to realize the response to each input device.
[0179] Optionally, the step of sending capacitive sensing data to the host may include: determining the coordinates of each touch point in the capacitive touch-sensitive surface based on the capacitive sensing data to obtain multiple touch point coordinates; and sending the multiple touch point coordinates to the host so that the host can decode the encoded information based on the multiple touch point coordinates.
[0180] For example, after acquiring the capacitive image, the controller can determine each first touch point and each second touch point included in the capacitive image using the aforementioned method, and determine the coordinates of each first touch point in the capacitive image (i.e., touch point coordinates), and the coordinates of each second touch point in the capacitive image (i.e., touch point coordinates). Then, an array can be created that includes the touch point coordinates of each first touch point and the touch point coordinates of each second touch point, and then the array can be sent to the host.
[0181] Correspondingly, after receiving the array, the host can construct a coordinate system based on the touch point coordinates of each first touch point included in the array, and determine each decoding region from the coordinate system based on the preset coordinates corresponding to each decoding region. Then, for each decoding region, if the touch point coordinates of a second touch point are located within that decoding region, the corresponding code element for that decoding region is determined to be 1; otherwise, if no touch point coordinates are located within that decoding region, the corresponding code element is determined to be 0. In this way, each code element included in the encoding information of the input device can be determined, thus achieving decoding of the input device.
[0182] In this embodiment of the application, when sending capacitive sensing data to the host, the coordinates of multiple touch points are determined based on the capacitive sensing data, and the coordinates of multiple touch points are sent to the host to avoid sending image data to the host, which can reduce the amount of data sent and improve the data sending efficiency.
[0183] Optionally, during the process of sending region images to the host, the controller can also configure a unique identification document (ID) for each region image. For example, after acquiring a capacitance image, the controller can assign a unique ID to each region image of an input device extracted from the capacitance image and insert the ID at a preset position in the region image. Correspondingly, after receiving a region image, the host can extract the ID from the preset position in the region image and distinguish between multiple received region images based on the ID.
[0184] Optionally, the method may further include: the controller determining the reference coordinates of the reference point of the input device in the capacitive touch-sensitive surface based on the capacitive sensing data, and / or determining the rotation angle of the input device in the capacitive touch-sensitive surface; and sending the rotation angle and / or reference coordinates to the host.
[0185] The rotation angle of the input device on the capacitive touch-sensitive surface can be the deflection angle between the reference line of the input device and the X-axis in the original coordinate system of the capacitive image. For example... Figure 9 As shown, when using Figure 6When encoding the input device using the encoding method shown, the reference line of the input device can be the X2 axis of the constructed coordinate system, and the rotation angle is the deflection angle α between the X2 axis and X1.
[0186] like Figure 9 As shown, after acquiring the capacitive image, the controller can determine the touch point coordinates of each touch point from the capacitive image. Simultaneously, it can determine N first touch points from multiple touch points, construct a coordinate system based on these N first touch points in the capacitive image, and then determine the angle α between the X2 axis of the constructed coordinate system and the X1 axis of the original coordinate system of the capacitive image. This angle α is then defined as the rotation angle of the input device on the capacitive touch-sensitive surface.
[0187] For example, when sending an array of touch point coordinates of multiple touch points to the host, a rotation angle can be inserted at the first specified position of the array to send the rotation angle to the host. Of course, the controller can also send the rotation angle to the host individually.
[0188] Furthermore, when sending an array of touch point coordinates from multiple touch points to the host, the controller can also insert reference coordinates at a second specified position in the array to send reference coordinates to the host. Of course, the controller can also send reference coordinates to the host independently.
[0189] The host computer can execute commands corresponding to the input device based on reference coordinates and / or rotation angles. For example... Figure 9 As shown, when it is necessary to display the object 97 corresponding to the input device, the host can first determine the reference coordinates from the capacitive touch-sensitive surface and display the object 97 at the reference coordinates. Furthermore, during the display of the object 97, the rotation angle of the object 97 can be controlled based on the rotation angle, ensuring that the rotation angle of the object 97 on the capacitive screen is consistent with the rotation angle of the input device on the capacitive screen. Specific methods of using the reference coordinates and rotation angle may include, but are not limited to, the examples described above.
[0190] In this embodiment, the controller determines the reference coordinates and / or rotation angle of the input device on the capacitive touch-sensitive surface based on the capacitive sensing data, and sends the rotation angle and reference coordinates to the host, which facilitates the host to execute the corresponding instructions of the input device based on the rotation angle and reference coordinates.
[0191] After receiving a capacitance image or a region image, the host can also determine the rotation angle and reference coordinates based on the capacitance image or region image, and respond to touch operations based on the rotation angle and / or capacitance image.
[0192] Optionally, determining the rotation angle of the input device in the capacitive touch-sensitive surface includes:
[0193] A first reference touch point and a second reference touch point are determined from multiple touch points, and the relative positions of the first reference touch point and the second reference touch point among the multiple touch points correspond to preset positions;
[0194] The rotation angle is determined based on the angle between the straight line containing the first and second reference touch points and the target coordinate axis. The target coordinate axis is a preset coordinate axis in the original coordinate system of the capacitive touch-sensitive surface.
[0195] like Figure 9 As shown, the first reference touch point can be touch point 91, and the second reference touch point can be touch point 92. The straight line containing the first and second reference touch points is the straight line containing the X2 axis, and the target coordinate axis is the X1 axis in the original coordinate system. In determining the rotation angle, the straight line containing the X2 axis can be determined first, and then the angle α between the straight line containing the X2 axis and the X1 axis can be determined as the rotation angle. The method for determining the straight line containing the X2 axis can refer to the aforementioned method for constructing the target coordinate system, and will not be elaborated upon in this embodiment.
[0196] Optionally, the step of sending capacitive sensing data to the host may include: decoding the capacitive sensing data to obtain encoded information; and sending the encoded information to the host.
[0197] In one implementation, after acquiring the capacitive sensing data, the controller can directly decode the input device's encoding information based on the capacitive sensing data and then send the encoding information directly to the host. Correspondingly, after receiving the encoding information, the host can respond to the touch operation corresponding to the encoding information. The process by which the controller determines the encoding information based on the capacitive sensing data can be referred to the process by which the host determines the encoding information based on the capacitive sensing data, and will not be described in detail here.
[0198] After acquiring the capacitive sensing data, the controller can also determine the reference coordinates of the reference point of the input device on the capacitive touch surface and / or determine the rotation angle of the input device on the capacitive touch surface based on the capacitive sensing data. During the process of sending the encoded information to the host, the controller can simultaneously send the encoded information, reference coordinates and rotation angle to the host.
[0199] In this embodiment, the controller identifies the encoding information of the input device based on the capacitance sensing data and directly sends the encoding information to the host, which can reduce the amount of data transmission between the controller and the host and improve data transmission efficiency.
[0200] In this configuration, upon receiving a region image, the host can determine the rotation angle based on the region image when needed. Alternatively, the controller can determine the rotation angle based on the capacitance image, insert the rotation angle at a preset position in the region image, and the host can extract the rotation angle from the preset position in the region image after receiving it.
[0201] Optionally, capacitive sensing data is sent to the host, including:
[0202] Target data is obtained from capacitive sensing data, which includes touch data from multiple touch points;
[0203] A human-machine interface device report including target data is constructed and sent to the host so that the host can decode the encoded information based on the target data in the human-machine interface device report.
[0204] For example, a new HID Vendor protocol can be obtained by extending the existing Human Interface Device Vendor (HID Vendor) protocol, and the controller and the host communicate through the new HID Vendor protocol.
[0205] Touch data can include encoded information and reference coordinates. After acquiring the encoded information and reference coordinates based on the capacitive image, the controller can assign a unique ID to the encoded information. Then, an HID report can be built based on the new HID Vendor protocol. The HID report includes the ID of the encoded information, the encoded information, and the reference coordinates, and can then be sent to the host.
[0206] Correspondingly, after receiving the HID report, the host can parse the encoding information and reference coordinates from the HID report, and then respond to the touch operation based on the encoding information and reference coordinates.
[0207] The touch data can also include the reference coordinates and a region image in binary form, as illustrated in the example above. When sending the reference coordinates and the region image in binary form to the host, the controller can assign a unique ID to each. Then, an HID report can be constructed based on the new HID Vendor protocol. This HID report includes the coded ID, reference coordinates, and the region image in binary form, and is then sent to the host.
[0208] Correspondingly, after receiving the HID report, the host can parse the reference coordinates and the region image in binary form from the HID report, then decode the region image to obtain the encoded information, and respond to the touch operation based on the encoded information and the reference coordinates.
[0209] The touch data can also include the reference coordinates and area image as shown in the example above. When sending the reference coordinates and area image to the host, the controller can assign a unique ID to the reference coordinates and area image. Then, an HID report can be built based on the new HID Vendor protocol. The HID report includes the ID, reference coordinates, and area image of the encoded information, and the HID report can be sent to the host.
[0210] Correspondingly, after receiving the HID report, the host can parse the reference coordinates and area image from the HID report, then decode the area image to obtain the encoding information, and respond to the touch operation based on the encoding information and reference coordinates.
[0211] The touch data can also include the reference coordinates and multiple touch point coordinates as shown in the example above. When sending the reference coordinates and multiple touch point coordinates to the host, the controller can assign unique IDs to the reference coordinates and multiple touch point coordinates. Then, an HID report can be built based on the new HID Vendor protocol. The HID report includes the IDs of the encoded information, the reference coordinates, and the multiple touch point coordinates, and the HID report can be sent to the host.
[0212] Correspondingly, after receiving the HID report, the host can parse the reference coordinates and multiple touch point coordinates from the HID report, then decode the encoded information based on the multiple touch point coordinates, and respond to the touch operation based on the encoded information and the reference coordinates.
[0213] In this embodiment, when the controller sends capacitive sensing data to the host, it constructs an HID report based on the target data obtained from the capacitive sensing data and sends the target data to the host through the HID report, which can achieve fast and accurate transmission of the target data.
[0214] Optionally, the controller sends encoded information to the host based on the keyboard protocol of the human-machine interface device, so that the host can generate key events based on the encoded information.
[0215] Correspondingly, when the host responds to a touch operation based on the encoded information, it can generate a key event that includes the encoded information; and pass the key event to the application in the host so that the application can respond to the touch operation based on the encoded information included in the key event.
[0216] For example, the controller and the host can communicate via the Human Interface Device Keyboard (HID Keyboard) protocol. When sending encoded information to the host, the controller can send encoded information to the host's HID Keyboard interface based on the HID Keyboard protocol.
[0217] The host computer has an operating system installed, and the operating system contains at least one application. After receiving encoded information through the HIDKeyboard interface, the host computer can generate key events based on the encoded information. These key events include the encoded information. The host computer can then transmit these key events to various applications. Within each application, the target application that responds to the key event responds based on the encoded information within the key event, thus enabling responsiveness to touch operations.
[0218] When the controller sends encoded information to the host via the HID Keyboard protocol, it can simultaneously send the rotation angle and / or reference coordinates. Correspondingly, the host can generate key events that include the encoded information, rotation angle, and / or reference coordinates. The target application can respond to the key events based on the encoded information, rotation angle, and / or reference coordinates in the key events, thereby enabling response to touch operations.
[0219] In this embodiment, when the controller sends encoded information to the host, it sends the encoded information to the host based on the human-machine interface device keyboard protocol, and generates key events based on the encoded information to respond to touch operations. In this way, the existing human-machine interface device keyboard protocol can be used directly to respond to touch operations, thereby avoiding the need to develop corresponding drivers for the encoded information.
[0220] The above text combined Figures 1 to 10 The data transmission method provided in the embodiments of this application is described in detail below; the following will be combined with Figure 11 and Figure 12 The apparatus embodiments of this application are described in detail below. It should be understood that the apparatus in the embodiments of this application can perform the various methods described in the foregoing embodiments of this application, that is, the specific working processes of the various products described below can be referred to the corresponding processes in the foregoing method embodiments.
[0221] Figure 11 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. For example, as shown... Figure 11 As shown, the data transmission device 110 is installed in the control chip of the electronic device, and the data transmission device includes:
[0222] The acquisition module 111 is a controller located in an electronic device, used to receive a touch operation triggered by an input device on the capacitive touch-sensitive surface of the electronic device, and acquire the capacitive sensing data of the capacitive touch-sensitive surface. The input device includes at least one outer surface, and the outer surface is provided with a plurality of conductive elements that can be capacitively coupled with the capacitive touch-sensitive surface.
[0223] The sending module 112, located in the controller, is used to send the capacitive sensing data to the host of the electronic device when it is determined based on the capacitive sensing data that the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, where N is a preset integer greater than 2.
[0224] The response module 113, located in the host, is used to decode the input device's encoding information based on the capacitive sensing data and respond to the touch operation according to the encoding information.
[0225] Optionally, the capacitive sensing data is a capacitive image, and the sending module 112 is specifically used to extract an area image including the plurality of touch points from the capacitive sensing data; and send the area image to the host so that the host can decode the encoded information based on the area image.
[0226] Optionally, the sending module 112 is specifically configured to modify the pixel value of the first pixel to one of 1 and 0, and modify the pixel value of the second pixel to the other of 1 and 0, to obtain the region image in the form of a binary image; wherein, the first pixel is the pixel of the plurality of touch points included in the region image, and the second pixel is other pixels besides the first pixel; and send the region image in the form of a binary image to the host so that the host can decode the encoded information based on the region image in the form of a binary image.
[0227] Optionally, the sending module 112 is specifically used to extract multiple region images from the capacitance image when the capacitance image includes multiple sets of multiple touch points; wherein, the multiple region images correspond one-to-one with the multiple sets of multiple touch points.
[0228] Optionally, the sending module 112 is further configured to, before sending the region image to the host, determine the reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface based on the capacitive image; and insert the reference coordinates at a preset position in the region image so that the host can extract and use the reference coordinates from the preset position in the region image.
[0229] Optionally, the sending module 112 is specifically used to determine the coordinates of each touch point on the capacitive touch-sensitive surface based on the capacitive sensing data to obtain multiple touch point coordinates; and to send the multiple touch point coordinates to the host so that the host can decode the encoded information based on the multiple touch point coordinates.
[0230] Optionally, the sending module 112 is further configured to determine, based on the capacitive sensing data, the reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface, and / or determine the rotation angle of the input device on the capacitive touch-sensitive surface; and send the rotation angle and / or reference coordinates to the host.
[0231] Optionally, the sending module 112 is specifically used to decode the encoded information based on the capacitive sensing data and send the encoded information to the host.
[0232] Optionally, the sending module 112 is specifically used to determine whether the plurality of touch points include N first touch points, the N first touch points forming a preset non-rotationally symmetric shape, and the relative distance between any two first touch points matching the preset distance; if the N first touch points are included, a target coordinate system is constructed based on the N first touch points; based on the target coordinate system, the other touch points are decoded to obtain the encoded information, the other touch points being touch points other than the N first touch points among the plurality of touch points.
[0233] Optionally, the capacitance sensing data is a capacitance image, and the sending module 112 is specifically used to send the capacitance image to the host based on a target communication protocol supported by the controller. The target communication protocol includes a communication protocol for transmitting image data.
[0234] Optionally, the target communication protocol includes a Universal Serial Bus video protocol.
[0235] Optionally, the sending module 112 is specifically used to obtain target data from the capacitive sensing data, the target data including touch data of multiple touch points; construct a human-machine interface device report including the target data, and send the human-machine interface device report to the host, so that the host can decode the encoded information based on the target data in the human-machine interface device report.
[0236] Optionally, the sending module 112 is specifically used to construct the human-machine interface device report based on the human-machine interface device manufacturer's custom protocol.
[0237] Optionally, the response module 113 is specifically configured to generate a key event including the encoded information; and transmit the key event to an application in the host, so that the application responds to the touch operation according to the encoded information included in the key event.
[0238] Optionally, the sending module 112 is specifically used to send the encoded information to the host based on the human-machine interface device keyboard protocol, so that the host generates the key event based on the encoded information.
[0239] It should be noted that the aforementioned data transmission device 110 is embodied in the form of a functional unit. The term "module" here can be implemented in software and / or hardware, without specific limitations.
[0240] For example, a "module" can be a software program, hardware circuit, or a combination of both that implements the above functions. Hardware circuits may include application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functions.
[0241] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of electronic device software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0242] This embodiment can divide the device into functional modules based on the above method example. For example, each module can correspond to a separate function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0243] It should be understood that the apparatus provided in this embodiment is used to execute the above-described data transmission method, and therefore can achieve the same effect as the above-described implementation method.
[0244] When using integrated units, the device may include a processing module and a storage module. The processing module may be a processor or a control chip that can implement or execute various exemplary logic blocks, modules, and circuits shown in conjunction with the disclosure of this application. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module may be a memory.
[0245] In addition, the device provided in this application embodiment may specifically be a chip, component or module. The chip may include a connected processor and a memory. The memory is used to store a first control signal. When the processor calls and executes the first control signal, the chip can execute a data transmission method provided in the above embodiment.
[0246] This application also provides a storage medium storing executable program code. When the executable program code is run on an electronic device, the electronic device executes the above-described related method steps to implement a data transmission method provided in the above embodiments. The electronic device readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROMs), microdrives, and magneto-optical disks, read-only memory (ROMs), random access memory (RAMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), dynamic random access memory (DRAMs), video random access memory (VRAMs), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing first control signals and / or data.
[0247] This application also provides an executable program code product. When the executable program code product is run on an electronic device, the electronic device performs the above-mentioned related steps to realize the data transmission method provided in the above embodiments.
[0248] In this application, the storage medium, executable program code product, or chip provided are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0249] See Figure 12 , Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device is, for example, the computer mentioned above.
[0250] For example, such as Figure 12 As shown, the electronic device 12 includes a memory 121 and a processor 122, wherein the memory 121 stores executable program code 123, and the processor 122 is used to call and execute the executable program code 123 to perform a data transmission method.
[0251] For example, memory 121 can be used to store related programs of the data transmission method provided in the embodiments of this application; processor 122 can call the related programs of the data transmission method stored in memory 121 to execute the data transmission method of the embodiments of this application.
[0252] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0253] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0254] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data transmission method, characterized in that, Applied to an electronic device having a capacitive touch-sensitive surface and a host, and a controller for controlling the capacitive touch-sensitive surface, the method includes: The controller receives a touch operation triggered by the input device on the capacitive touch-sensitive surface and acquires the capacitive sensing data of the capacitive touch-sensitive surface. The input device includes at least one outer surface, and the outer surface is provided with a plurality of conductive elements that can be capacitively coupled with the capacitive touch-sensitive surface. When the controller determines, based on the capacitive sensing data, that the number of touch points formed by the touch operation on the capacitive touch-sensitive surface is greater than or equal to N, it sends the capacitive sensing data to the host, where N is a preset integer greater than 2. The host computer decodes the input device's encoding information based on the capacitive sensing data and responds to the touch operation according to the encoding information.
2. The method as described in claim 1, characterized in that, The capacitance sensing data is a capacitance image, and sending the capacitance sensing data to the host includes: A region image is cropped from the capacitance image, and multiple touch points are located within the region image; The region image is sent to the host so that the host can decode the encoded information based on the region image.
3. The method as described in claim 2, characterized in that, Sending the region image to the host includes: The pixel value of the first pixel is modified to one of 1 and 0, and the pixel value of the second pixel is modified to the other of 1 and 0 to obtain the region image in the form of a binary image; wherein, the first pixel is a pixel of the plurality of touch points included in the region image, and the second pixel is a pixel other than the first pixel; The region image in binary form is sent to the host so that the host can decode the encoded information based on the region image in binary form.
4. The method as described in claim 3, characterized in that, The step of cropping a region image from the capacitance image includes: When the capacitance image includes multiple sets of touch points, multiple region images are extracted from the capacitance image, and the multiple region images correspond one-to-one with the multiple sets of touch points, with each set of touch points located within a corresponding region image.
5. The method as described in claim 2, characterized in that, Before sending the region image to the host, the method further includes: Based on the capacitance image, determine the reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface; The reference coordinates are inserted at a preset position in the region image so that the host can extract and use the reference coordinates from the preset position in the region image.
6. The method as described in claim 1, characterized in that, Sending the capacitance sensing data to the host includes: Based on the capacitive sensing data, the coordinates of each touch point in the capacitive touch-sensitive surface are determined to obtain multiple touch point coordinates; The multiple touch point coordinates are sent to the host so that the host can decode the encoded information based on the multiple touch point coordinates.
7. The method as described in claim 1, characterized in that, Sending the capacitance sensing data to the host includes: The encoded information is obtained by decoding the capacitive sensing data. The encoded information is sent to the host.
8. The method as described in claim 7, characterized in that, The process of decoding the encoded information based on the capacitive sensing data includes: Determine whether the plurality of touch points include N first touch points, wherein the N first touch points form a preset non-rotationally symmetric shape, and the relative distance between any two first touch points matches the preset distance; If the N first touch points are included, then a target coordinate system is constructed based on the N first touch points; Based on the target coordinate system, the other touch points are decoded to obtain the encoded information, wherein the other touch points are touch points other than the N first touch points among the multiple touch points.
9. The method as described in claim 1, characterized in that, The capacitance sensing data is a capacitance image, and sending the capacitance sensing data to the host includes: The controller sends the capacitance image to the host based on a target communication protocol supported by the controller, the target communication protocol including a communication protocol for transmitting image data.
10. The method as described in claim 9, characterized in that, The target communication protocol includes Universal Serial Bus video protocols.
11. The method according to any one of claims 2-8, characterized in that, Sending the capacitance sensing data to the host includes: Target data is obtained from the capacitive sensing data, the target data including touch data of multiple touch points; A human-machine interface device report including the target data is constructed, and the human-machine interface device report is sent to the host so that the host can decode the encoded information based on the target data in the human-machine interface device report.
12. The method as described in claim 11, characterized in that, The construction of the human-machine interface device report including the target data includes: The human-machine interface device report is constructed based on a custom protocol defined by the human-machine interface device manufacturer.
13. The method as described in claim 1, characterized in that, The step of responding to the touch operation according to the encoded information includes: Generate key events that include the encoded information; The key event is transmitted to an application in the host computer so that the application responds to the touch operation based on the encoded information included in the key event.
14. The method as described in claim 13, characterized in that, Before generating the key event including the encoded information, the method further includes: The controller sends the encoded information to the host based on the human-machine interface device keyboard protocol, so that the host generates the key event based on the encoded information.
15. The method as described in claim 6 or 7, characterized in that, The method further includes: Based on the capacitive sensing data, the controller determines the reference coordinates of the reference point of the input device on the capacitive touch-sensitive surface, and / or determines the rotation angle of the input device on the capacitive touch-sensitive surface. The controller sends the rotation angle and / or the reference coordinates to the host computer.
16. The method as described in claim 12, characterized in that, Determining the rotation angle of the input device on the capacitive touch-sensitive surface includes: A first reference touch point and a second reference touch point are determined from a plurality of touch points, wherein the relative positions of the first reference touch point and the second reference touch point among the plurality of touch points correspond to a preset position; The rotation angle is determined based on the angle between the straight line containing the first reference touch point and the second reference touch point and the target coordinate axis, where the target coordinate axis is a preset coordinate axis in the original coordinate system of the capacitive touch-sensitive surface.
17. An interactive system, characterized in that, The interactive system includes the electronic device and input device as described in any one of claims 1-16; The electronic device has a capacitive touch-sensitive surface and a host, as well as a controller for controlling the capacitive touch-sensitive surface; The input device includes at least one outer surface, and the outer surface is provided with a plurality of conductive elements capable of capacitively coupling with the capacitive touch-sensitive surface.
18. An electronic device, characterized in that, include: A memory and a processor, wherein the memory is used to store executable program code; The processor is configured to call and run the executable program code from the memory, causing the electronic device to perform the data transmission method as described in any one of claims 1-16.
19. A storage medium, characterized in that, The storage medium stores executable program code, which, when run on an electronic device, causes the electronic device to perform the data transmission method as described in any one of claims 1-16.