Data processing method, external device and electronic device
By detecting and reporting missed lift event data in external devices, the problem of cursor lag caused by missed lift events in external devices is solved and smoother cursor operations are achieved.
Patent Information
- Application Number
- CN202310766621.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-06-26
AI Technical Summary
When using an external device, lift events may be missed, causing the main device to be unable to receive complete press event and lift event data, resulting in cursor freezing.
The external device detects the event data of the previous frame and the event data of the current frame, identifies and reports the missed lift event data, so that the electronic device receives complete event data and avoids cursor lag. The specific method includes traversing the press and lift events of the target object in the event data, generating supplementary lift event data, and sending it to the main device at a preset frequency.
This ensures that the electronic device receives complete press and lift event data, optimizes the smoothness of cursor operations, and avoids cursor stuck problems caused by missing lift event data.
Smart Images

Figure CN117724632B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a data processing method, an external device, and an electronic device. Background Art
[0002] When a user performs a pressing operation or a lifting operation on the keyboard or touch pad of an external device, a pressing event or a lifting event is triggered, and the external device can send data corresponding to the pressing event or the lifting event to its corresponding main device, and the main device controls the cursor to perform a corresponding moving operation according to the data. Specifically, the pressing event or the lifting event detected by the touch pad of the external device corresponds to a down event or an up event based on the touch pad.
[0003] In the actual use of external devices, the external device may fail to report the lift event, which makes the main device unable to receive the complete data of the press event and lift event, unable to respond to the cursor movement operation, resulting in the main device cursor freezing problem. Summary of the invention
[0004] The embodiment of the present application provides a data processing method, an external device and an electronic device. When the external device sends multiple lift events and press events to the electronic device, when it is determined that there is missed lift event data, the lift event data can be reported in time, so that the electronic device receives a complete multiple press event data and lift event data, avoiding the problem of cursor stuck due to the lack of a certain lift event data, making the cursor operation smoother. The embodiment of the present application adopts the following technical solutions:
[0005] In a first aspect, a data processing method is provided, which is applied to an external device, wherein the external device includes at least one of a keyboard and a touchpad, and the method includes:
[0006] The external device obtains first event data, which is event data to be sent by the external device to the electronic device. The event data is used to characterize the objects of the pressing and lifting operations on the keyboard or touchpad of the external device and the event types, including pressing events and lifting events.
[0007] The external device acquires second event data, where the second event data is a frame of event data that the external device has sent to the electronic device before sending the first event data.
[0008] If the second event data contains a target object whose event type is a press event, and the first event data does not contain press event data and lift event data corresponding to the target object, the external device creates lift event data corresponding to the lift event of the target object based on the target object. The external device generates third event data based on the lift event data of the target object; and the external device sends the third event data to the electronic device.
[0009] In the present application, the external device obtains the first event data and the second event data. When it is determined that the event type of at least one target object included in the second event data is a press event, and the first event data does not include the lift event data and the press event data corresponding to the target object, the external device creates the lift event data corresponding to the lift event of the target object. The external device can detect the missed lift event data of the event data (first event data) of the current frame based on the event data (second event data) of the previous frame. There is a press event of the target object in the second event data, but there is no corresponding lift event data in the first event data. At this time, it can be determined that there is missed lift event data of the target object. The external device creates the lift event data of the target object for supplementary reporting. The event data received by the electronic device always includes the complete event data in the press-lift operation, avoiding the problem of cursor stuck point caused by the lack of lift event data of the electronic device, and optimizing the user experience.
[0010] In another possible implementation manner of the first aspect, if there are N target objects whose event type is a press event in the second event data, where N is a positive integer, the method further includes:
[0011] The external device traverses and searches for the press event data corresponding to the j-th target object of the second event data from the objects included in the first event data, where j is a value from 1 to N; if the event data corresponding to the object in the first event data is not the press event data corresponding to the j-th target object of the second event data, it is determined that the press event data corresponding to the j-th target object of the first event data does not exist in the third event data;
[0012] If there is an object in the first event data corresponding to event data which is press event data corresponding to the j-th target object of the second event data, it is determined that there is press event data in the first event data corresponding to the j-th target object of the second event data.
[0013] In another possible implementation manner of the first aspect, after determining that there is no press event data corresponding to the j-th target object in the second event data in the first event data, the method further includes:
[0014] The external device traverses and searches for the lifting event data corresponding to the j-th target object of the second event data from all objects included in the first event data;
[0015] If the event data corresponding to the object in the first event data is not the lifting event data corresponding to the j-th target object in the second event data, determining that the lifting event data corresponding to the j-th target object in the second event data does not exist in the first event data;
[0016] If there is event data corresponding to an object in the first event data that is lift event data corresponding to the j-th target object of the second event data, it is determined that there is lift event data corresponding to the j-th target object of the second event data in the first event data.
[0017] In the present application, the external device can perform a traversal query on each target object in the second event data and all objects in the first event data to determine whether there is press event data or lift event data corresponding to the target object in the first event data, so that the lift event data of the target object that needs to be supplemented is more complete and accurate. If there is press event data corresponding to the target object in the first event data, it means that the target object is in a continuous press state and there is no loss of lift event data. In this case, the external device can directly obtain the press event data of the target object. If there is no press event data corresponding to the target object in the first event data, and there is no lift event data corresponding to the j-th target object, it means that the lift event data of the target object is indeed. In this case, the external device needs to create lift event data corresponding to the lift event of the j-th target object for subsequent supplementary reporting operations.
[0018] In another possible implementation manner of the first aspect, the first event data further includes a first number of press events of event type; and the method further includes:
[0019] The external device determines that a second number of pressing event data and lifting event data corresponding to the target object of the second event data does not exist in the first event data;
[0020] determining a sum of the second quantity and the first quantity as a target quantity;
[0021] The external device acquires event data of objects other than the target object in the second event data;
[0022] The third event data is generated based on the number of targets, the lift event data or the press event data of the second number of target objects, and the event data of the objects other than the target objects in the second event data.
[0023] In this application, the first quantity refers to the number of objects of the pressing event in the first event data, for example, when a finger presses a touchpad, the first quantity is the number of pressing fingers. According to the preset reporting data format, after the external device obtains the target quantity, it generates the third event data based on the target quantity, the lifting event data or pressing event data of the target object, and the event data of other objects, and reports the third event data, so that the electronic device can release the coordinate information of the target object in time according to the third event data to achieve normal control of the cursor, gesture or other functions.
[0024] In another possible implementation manner of the first aspect, the method further includes:
[0025] The external device sends first event data to the electronic device.
[0026] In the present application, the third event data is the supplementary event data, and the first event data is the event data currently to be sent. Since the external device determines that there is an underreporting of the target object's lifting event data after the second event data, timely supplementary reporting of the third event data can enable the electronic device to release the coordinates of the target object in time according to the third event data, so as to achieve normal control of the cursor, gesture or other functions; thereafter, the first event data is sent at a preset frequency, and the electronic device can respond normally to the operations of all objects.
[0027] In another possible implementation of the first aspect, the external device obtains the second event data, including:
[0028] When the external device determines that the first event data does not belong to the preset abnormal event data, the external device obtains the second event data; the preset abnormal event data includes the no-touch event data and the data of the abnormal identification object touch.
[0029] In the present application, when the external device determines that the first event data does not belong to the preset abnormal event data, the second event data is obtained. In this way, invalid first event data can be filtered out, the first event data is not sent to the electronic device, and the computing resources of the external device are saved.
[0030] In another possible implementation manner of the first aspect, the method further includes:
[0031] When the external device receives the screen-off instruction sent by the electronic device, the external device obtains fourth event data, where the fourth event data is a frame of event data sent to the electronic device before the external device receives the screen-off instruction;
[0032] If there is a target object whose event type is a press event in the fourth event data, the external device obtains a third number of target objects whose event type is a press event in the fourth event;
[0033] The external device obtains event data of objects other than the target object in the fourth event data;
[0034] The external device generates fifth event data according to the lift event data of the target object, the third number, and event data of objects other than the target object in the fourth event data.
[0035] In the present application, the external device may not be able to detect or report the lift event generated after the electronic device enters the screen-off state in a timely manner. Therefore, each time the external device receives the screen-off command issued by the electronic device, it can obtain the fourth event data to detect whether the lift event data is missed, which can further ensure the integrity of the event data sent to the electronic device. The external device obtains the third quantity of the target object according to the preset reporting data format, and generates the fifth event data based on the lift event data of the target object and the third quantity. The fifth event data includes the lift event data missed in the screen-off state.
[0036] In another possible implementation manner of the first aspect, the method further includes:
[0037] When the external device receives the screen-on instruction sent by the electronic device, the external device sends fifth event data to the electronic device.
[0038] In the present application, after receiving the screen-on command issued by the electronic device, the external device promptly reports the fifth event data to the electronic device, so that the electronic device can release the coordinates of the target object in time, thereby achieving normal event response and avoiding the problem of the electronic device cursor being stuck.
[0039] In a second aspect, a data processing method is provided, which is applied to an electronic device, wherein the electronic device is communicatively connected to an external device, and the external device includes at least one of a keyboard and a touchpad; the method includes:
[0040] The electronic device receives first event data sent by an external device; the first event data is event data to be responded to by the electronic device, and the event data is used to characterize the objects of the pressing and lifting operations on the keyboard or touchpad of the external device and the event type, and the event types include pressing events and lifting events.
[0041] The electronic device obtains second event data; the second event data is event data that has been responded to before the first event data.
[0042] If there is a target object whose event type is a press event in the second event data, and there is no lift event data and press event data corresponding to the target object in the first event data, the electronic device creates lift event data corresponding to the lift event of the target object based on the target object.
[0043] The electronic device generates third event data according to the lift event data of the target object, and performs corresponding control operations based on the third event data; the control operations include controlling cursor movement, controlling gesture movement, or function control operations corresponding to the target object.
[0044] In the present application, when the electronic device is continuously acquiring event data, if the target object whose event type is a lift event does not exist in the first event data currently to be responded to, the electronic device acquires the second event data that has been responded to, and determines whether the lift event data is missing in the second event data that has been responded to. If the second event data includes the press event data of the target object, but the lift event data or press event data corresponding to the target object does not exist in the first event data, it is determined that the lift event data of the target object is missing in the second event data. At this time, the electronic device can perform supplementary processing on the lift event data of the target object to obtain the third event data, respond to the third event data, and release the coordinate information of the target object in time, so that the subsequent response operation of the target object can be carried out normally, avoiding the problem of cursor stuck or function failure.
[0045] In a possible implementation manner of the second aspect, the method further includes:
[0046] After the screen is turned on, the electronic device obtains fourth event data; the fourth event data is the last frame of event data received and responded to by the electronic device before the screen is turned off.
[0047] If there is a target object whose event type is a press event in the fourth event data, the electronic device creates lift event data of the target object based on the target object; the electronic device generates fifth event data based on the lift event data of the target object; and the electronic device performs corresponding control operations based on the fifth event data.
[0048] In the present application, the electronic device can actively detect whether the last frame of event data received and responded to contains missing lift event data after the screen is turned off and then on again. When it is determined that the responded event data includes the pressing event data of the target object, it is determined that the lift event data of the target object is not received. At this time, the electronic device can perform supplementary processing on the lift event data of the target object to obtain the fifth event data, respond to the fifth event data, and promptly release the coordinate information of the target object so that subsequent response operations of the target object can be performed normally.
[0049] In a third aspect, an external device is provided, which includes a memory and one or more processors; the memory is coupled to the processor; computer program code is stored in the memory, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes a method as described in any one of the above-mentioned first aspects.
[0050] In a possible implementation of the third aspect, the external device also includes a touchpad; the touchpad is used to detect press events and lift events of an object acting on the touchpad; the event data of the press events and lift events of the object are sent to a processor; and the processor executes a method as described in any one of the first aspects.
[0051] In a possible implementation of the third aspect, the processor is further configured to send a control instruction to the touch panel to control the touch panel to enter a sleep mode or a power-off mode when receiving a screen-off instruction issued by the host device.
[0052] In another possible implementation of the third aspect, the external device also includes a button; the button is used to detect a press event and a lift event of an object acting on the button; the event data of the press event and the lift event of the object are sent to a processor; and the processor executes a method as described in any one of the first aspects.
[0053] In a fourth aspect, an electronic device is provided, comprising a memory, a display screen and one or more processors; the memory and the display screen are coupled to the processor; a computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method as described in any one of the above-mentioned second aspects.
[0054] In a fifth aspect, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on an electronic device, the electronic device can execute any one of the methods in the first aspect or the second aspect.
[0055] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on an electronic device, enables the electronic device to execute any one of the methods described in the first aspect.
[0056] In a seventh aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute a method as described in any one of the first aspect or the second aspect.
[0057] It can be understood that the beneficial effects that can be achieved by the external device described in the second aspect, the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, the computer program product described in the fifth aspect, and the chip described in the sixth aspect provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1An interactive schematic diagram of a tablet computer, MCU, and touch panel for processing a press-and-lift event provided in an embodiment of the present application;
[0059] Figure 2 A schematic diagram of the change of event data and the shift of finger IDs during a multi-finger press-and-lift process provided by an embodiment of the present application;
[0060] Figure 3 A schematic diagram of various situations of finger ID displacement during a multi-finger press-and-lift process provided in an embodiment of the present application;
[0061] Figure 4 An interactive schematic diagram of a touch panel missing up event data provided by an embodiment of the present application;
[0062] Figure 5 A schematic diagram of a comparison between normal reported event data and missed reported up event data provided in an embodiment of the present application;
[0063] Figure 6 An interactive schematic diagram of a touch panel that is unable to report up event data when it is powered off provided by an embodiment of the present application;
[0064] Figure 7 A schematic diagram of the structure of an external device provided in an embodiment of the present application;
[0065] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0066] Fig. 9 An interactive schematic diagram of a MCU performing supplementary reporting processing provided in an embodiment of the present application;
[0067] Fig.10 An interactive schematic diagram of supplementing the missed up event data of the touch panel provided in an embodiment of the present application;
[0068] Fig.11 A flowchart of a data processing method provided in an embodiment of the present application;
[0069] Fig.12 An interactive schematic diagram of supplementing the up event data that cannot be reported by the touch panel provided in an embodiment of the present application;
[0070] Fig.13 A flowchart of another data processing method provided in an embodiment of the present application;
[0071] Fig.14 A schematic diagram of interaction between an electronic device and an external device provided in an embodiment of the present application;
[0072] Fig.15A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0074] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0075] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0076] When the user performs a pressing operation or a lifting operation on the keyboard or touchpad of an external device, a pressing event or a lifting event will be triggered. The external device can report the pressing event or the lifting event to its corresponding main device, and the main device controls the cursor to perform corresponding movement operations according to the pressing and lifting events. Specifically, the pressing event detected by the keyboard of the external device corresponds to a keydown event based on a keyboard key, and the lifting event detected by the keyboard of the external device corresponds to a keyup event based on a keyboard key; the pressing event detected by the touchpad of the external device corresponds to a down event based on the touchpad, and the lifting event and the up event detected by the touchpad of the external device.
[0077] Exemplarily, in a scenario where the external device is a keyboard without a touchpad and the main device is a tablet computer: the press event and lift event triggered by the user pressing a keyboard key correspond to the keydown event and keyup event. When the keyboard detects the keydown event or keyup event of a certain key, it processes the keydown event data or keyup event data of the certain key (for example, data filtering, data exception processing, data format conversion, etc.), and then reports the processed keydown event data or keyup event data to the tablet computer; after the tablet computer receives the data, if it is keydown event data, it records the pressed key and executes the function corresponding to the key; if it is keyup event data, it releases the pressed key. The tablet can directly perform corresponding function implementation or function release on the key involved in the keydown event data or keyup event data according to the identity document (ID) of the key.
[0078] Exemplarily, the external device is a keyboard with a touchpad, and the main device is a tablet computer: the touchpad of the keyboard detects the touch state of the finger, obtains the generated down event or up event, reports the down event data or up event data to the tablet computer, and the tablet computer controls the cursor movement / performs the corresponding gesture operation according to the reported data. Optionally, the keyboard may include a touchpad and a processor, wherein, exemplarily, the processor may be a microcontroller unit (MCU). The touchpad includes a microelectronic device (integrated circuit chip, IC chip) for detecting touch events (down events / up events) and reporting touch event data.
[0079] The touch panel (same as the IC chip) can detect the touch state of the finger through the capacitance of the built-in sensor and report the down event data or up event data to the MCU; the MCU is used to process the down event data or up event data (for example, data filtering, data exception processing, data format conversion, etc.), and then report the processed down event data or up event data to the tablet computer. For example, refer to Figure 1 The work flow diagram between the tablet computer, MCU and touchpad is shown. When a finger is pressed / lifted on the touchpad, the touchpad detects a change in capacitance through a built-in sensor, generates an interrupt and reports down event data / up event data to the MCU through an inter-integrated circuit (I2C). The MCU processes the down event data / up event data and sends the processed down / up event data to the tablet computer through a universal asynchronous receiver transmitter (UART) link or a Bluetooth link. After receiving the down event data / up event data, the tablet computer determines the data type; if it is down event data, the identity document (ID) and finger status of each finger are recorded and the coordinate information of each finger is updated, thereby controlling the cursor movement / page turning and other behaviors of the tablet computer; if it is up event data, the corresponding finger ID is released and the coordinate information is cleared.
[0080] When a finger on the touchpad changes from pressing to lifting, the touchpad detects the press-lift event and reports the up event data corresponding to the finger ID to the MCU, which then sends the converted up event data to the tablet. After receiving the up event data, the tablet releases the corresponding finger ID and clears the coordinate information. When the finger ID sends a down event again, the tablet will record the finger ID and refresh the corresponding coordinates in real time, thereby controlling the movement of the cursor / page turning.
[0081] With the development of touch technology, touch operation has evolved from single-finger operation to multi-finger operation and other gesture operations. For example, three-finger swipe to return to the main interface of the device, two-finger swipe left, two-finger swipe right, three-finger swipe to take a screenshot, knuckle tapping to take a screenshot, etc. The number of fingers, gestures and their corresponding functions can be customized based on the functions provided by the device, and this embodiment does not limit this.
[0082] When the touchpad detects a multi-finger touch operation, it involves the identification of the finger ID and the processing of the data corresponding to each finger ID. For the data processing of multiple finger IDs, this embodiment stipulates the data format in the multi-finger touch operation. For example, the down event data or up event data reported by the touchpad may include each finger ID, the event type generated by each finger ID, coordinate information, the number of fingers, and other information. Please refer to the following:
[0083] Table 1
[0084]
[0085] For the down event data or up event data reported by the touch panel corresponding to multi-finger operation, the three-finger data corresponding to three-finger operation is used as an example to introduce the reporting data format:
[0086] During a three-finger touch operation, each down event or up event generated corresponds to a frame of data. Each frame of data includes the IDs of three fingers, and each finger ID occupies one byte (8 bits). Among them, bit[0] (Confidence) is used to distinguish between large palm / no touch status; bit[1] (Tip) is used to distinguish between the pressed / lifted status of the finger. Bit[4]-bit[7] are used to distinguish different fingers. Finger 1 is represented by bit[4] being 1 and bits[5]-bit[7] being 0; finger 2 is represented by bit[5] being 1 and the remaining bits being 0; finger 3 is represented by bit[6] being 1 and the remaining bits being 0.
[0087] The byte [0] where the finger ID 1 is located is represented as:
[0088] Table 2
[0089]
[0090] Specifically, when byte[0] is 0x00 (bit[4]=0, bit[0]=0, bit[1]=0), it indicates a no-touch state, which can be expressed as:
[0091] Table 3
[0092]
[0093] When byte[0] is 0x17 (bit[4]=1, bit[0]=1, bit[1]=0), it indicates that finger 1 is lifted (from down->up), which can be expressed as:
[0094] Table 4
[0095]
[0096] When byte[0]0x19 (bit[4]=1, bit[0]=1, bit[1]=1), it means that finger 1 is in the pressed (down) state, which can be expressed as:
[0097] Table 5
[0098]
[0099] When byte[0]0x18 (bit[4]=1, bit[0]=0, bit[1]=1), it means that finger 1 is in the large palm state, which can be expressed as:
[0100] Table 6
[0101]
[0102] Among them, when the touchpad normally recognizes the finger pressing state, the recognized finger pressing area is a point area; if the touchpad recognizes the finger pressing area as a surface area larger than the area threshold, it is considered that the touchpad recognizes the finger pressing area abnormally, and this state of abnormal finger pressing area recognition is the large palm state.
[0103] The byte where the finger ID1 is located is represented as byte[0] and the data format of the four bytes byte[1]-byte[4] used to represent the coordinates of the finger ID1 can be expressed as:
[0104] Table 7
[0105]
[0106] Among them, the X1 coordinate of finger 1 represents the least significant bit (LSB) of the X coordinate of finger 1; the X2 coordinate of finger 1 represents the most significant bit (MSB) of the X coordinate of finger 1; the Y1 coordinate of finger 1 represents the least significant bit (LSB) of the Y coordinate of finger 1; and the Y2 coordinate of finger 1 represents the most significant bit (MSB) of the Y coordinate of finger 1.
[0107] For example, the byte [5] where the finger ID2 is located is represented as:
[0108] Table 8
[0109]
[0110] For example, the byte
[10] where the finger ID3 is located is represented as:
[0111] Table 9
[0112]
[0113] The data format including at least finger ID1 and finger ID2 can be expressed as:
[0114] Table 10
[0115]
[0116]
[0117] In combination with the above-mentioned reporting data format, for example, when the touchpad is operated by three fingers, each frame of data corresponding to the down / up / all 0 / large palm state corresponding to each finger can be expressed as:
[0118] When finger ID1, finger ID2 and finger ID3 are all in down state, this frame of data can be expressed as:
[0119] Table 11
[0120] Finger ID1 Finger ID2 Finger ID3 Number of fingers (num) 0x19 0x35 0x67 3
[0121] When finger ID1, finger ID2 and finger ID3 are all in the up state, this frame of data can be expressed as:
[0122] Table 12
[0123] Finger ID1 Finger ID2 Finger ID3 Number of fingers (num) 0x17 0x33 0x65 3
[0124] When finger ID1, finger ID2 and finger ID3 are all in the no-touch state, this frame of data can be expressed as:
[0125] Table 13
[0126] Finger ID1 Finger ID2 Finger ID3 Number of fingers (num) 0x00 0x00 0x00 0
[0127] When finger ID1, finger ID2 and finger ID3 are all in the large palm state, this frame of data can be expressed as:
[0128] Table 14
[0129] Finger ID1 Finger ID2 Finger ID3 Number of fingers (num) 0x18 0x34 0x66 3
[0130] Among them, the data of the no-touch state and the large palm state can be regarded as invalid data, and the touch panel will not report these two types of data to the MCU.
[0131] It should be noted that ID1 does not necessarily correspond to 0x19, ID2 does not necessarily correspond to 0x35, and ID3 does not necessarily correspond to 0x67. When a finger moves on the touchpad, the finger ID will shift during the process of repeatedly pressing and lifting.
[0132] For example, when three fingers are pressed on the touchpad, if one of the fingers is lifted, the finger ID in the touchpad report data will change. The finger ID will shift between the three positions ID1 / ID2 / ID3 according to the scene. Figure 2 As shown. When three fingers are pressed on the touchpad, the corresponding data is ID1 is 0x19, ID2 is 0x35, and ID3 is 0x67; the number of fingers (num) is 3. Exemplarily, ID1, ID2, and ID3 correspond to the three pressed fingers according to the finger pressing sequence; for example, ID1 corresponds to the finger pressed first in the sequence (the first finger), ID2 corresponds to the finger pressed after ID1 in the sequence (the second finger), and ID3 corresponds to the finger pressed after ID2 in the sequence (the third finger).
[0133] When any one of the three fingers is lifted, for example, the second finger is lifted, the corresponding data on the touchpad is ID1 is 0x19, ID2 is 0x33, and ID3 is 0x67; the number of fingers is 3.
[0134] The touch panel obtains a subsequent frame of data based on the lifting operation of the second finger. The subsequent frame of data of the lifting operation of the second finger is that ID1 is 0x19, ID2 is 0x00, and ID3 is 0x67; the number of fingers (num) is 2.
[0135] After the second finger is lifted, the touchpad performs a shift process on the finger ID. The data after the shift is 0x19 for ID1, 0x67 for ID2, and 0x00 for ID3; the number of fingers (num) is 2.
[0136] At this time, the data of the third finger originally at the ID3 position is shifted to the ID2 position after the second finger is lifted.
[0137] When the first finger and the third finger are still in the pressing state on the touchpad and the second finger presses the touchpad again, the second finger at this time is actually called the finger after the first finger and the third finger in the pressing sequence. The data of the second finger corresponds to the position of ID3, and the corresponding data is ID1 is 0x19, ID2 is 0x67, and ID3 is 0x35; the number of fingers (num) is 3.
[0138] At this time, the data of the third finger (the second finger) pressing in the timing sequence is at the position of ID3. For example, Figure 3 A schematic diagram of the shifted data pattern that may be generated in the three-finger operation is given.
[0139] To better explain, Figure 3 The changes of all the event data shown are for the entire process of three-finger alternate pressing and lifting, wherein it is assumed that the fingers represented by the first finger, the second finger, and the third finger do not change.
[0140] in, Figure 3 The event data corresponding to ① in the figure is the event data when all three fingers are in the pressing state. The first finger corresponds to ID1, the second finger corresponds to ID2, and the third finger corresponds to ID3. ID1 is 0x19, ID2 is 0x35, and ID3 is 0x67. The number of fingers (num) is 3.
[0141] based on Figure 3 In the event data corresponding to ①, after the first finger is lifted, the data of ID1 is cleared, and the second finger corresponding to ID2 is shifted to ID1, and ID1 is 0x35. The second finger is pressed continuously, and during this period, the third finger is lifted, and the data of ID3 is cleared. The first finger is pressed, and the first finger corresponding to ID1 is shifted to ID2, and ID2 is 0x19. The third finger is pressed, and the third finger corresponds to ID3, and ID3 is 0x67. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ② in .
[0142] based on Figure 3 In the event data corresponding to ②, the second finger is still pressed. After the first finger is lifted, the data of ID2 is cleared, and the third finger corresponding to ID3 is shifted to ID2, and ID2 is 0x67. The first finger is pressed, and the first finger corresponds to ID3, and ID3 is 0x19. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ③ in .
[0143] based on Figure 3 In the event data corresponding to ①, lift the second finger, the data of ID2 is cleared, and the third finger corresponding to ID3 is shifted to ID2, and ID2 is 0x67. Press the second finger, the second finger corresponds to ID3, and ID3 is 0x35. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ④ in .
[0144] Or, based on Figure 3 In the event data corresponding to ③, when the second finger is lifted, the data of ID1 is cleared; when the third finger is lifted, the data of ID2 is cleared, and the first finger corresponding to ID3 is shifted to ID1, and ID1 is 0x19. When the third finger is pressed, the third finger corresponds to ID2, and ID2 is 0x67. When the second finger is pressed, the second finger corresponds to ID3, and ID3 is 0x35. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ④ in .
[0145] based on Figure 3The event data corresponding to ④ in the figure is: lift the first finger, the data of ID1 is cleared, and the third finger that originally corresponds to ID2 is shifted to ID1, and ID1 is 0x67. Lift the second finger, and the data of ID3 is cleared. Press the first finger, and the first finger corresponds to ID2, and ID2 is 0x19. Press the second finger, and the second finger corresponds to ID3, and ID3 is 0x35. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ⑤ in .
[0146] based on Figure 3 The event data corresponding to ⑤ in the figure is that the third finger corresponds to ID1, and the third finger is pressed continuously. The first finger is lifted, the data of ID2 is cleared, and the third finger corresponding to ID3 is shifted to ID2, and ID2 is 0x67. The first finger is pressed, and the first finger corresponds to ID3, and ID3 is 0x19. The number of fingers (num) is 3. Reference Figure 3 The event data corresponding to ⑥ in .
[0147] During the data interaction between the tablet computer and the keyboard with MCU and touchpad, that is, during the processing of down event data / up event data of the tablet computer-MCU-touchpad, the tablet computer will calculate the coordinate information corresponding to each finger ID according to the down event data corresponding to each finger ID reported by the MCU, and clear the coordinate information corresponding to each finger ID according to the up event data corresponding to each finger ID, thereby realizing the movement of the cursor or the control of the gesture or the realization of the corresponding function corresponding to each finger ID.
[0148] If the tablet computer does not receive the up event data corresponding to a certain finger ID after receiving the down event data of the finger ID, it means that the coordinate information of the current down-up event of the finger ID cannot be cleared. When the finger ID is pressed again, the tablet computer receives new down event data, and there are two coordinate information about the finger ID in the tablet computer. The tablet computer cannot process the two coordinate information of the finger ID, and the cursor will be stuck at the first coordinate position for a period of time before moving to the second coordinate position. In other words, the tablet computer will have a problem of the cursor being stuck for a period of time. Usually, this stuck time is 20 to 30 seconds, and human intervention is required to restart the tablet computer or the keyboard needs to be powered off and then powered on again to recover.
[0149] There are many reasons why the tablet computer fails to receive the up event of a certain finger ID. For example, due to an abnormality in the touchpad, the up event is not detected or the up event data is not reported to the MCU, resulting in the MCU failing to report the up event data to the tablet computer; or, in a usage scenario involving multi-finger switching to few-finger switching, the touchpad fails to detect the lifting operation of one or more fingers in the process in time, and the touchpad misses reporting the up event data of the lifted fingers to the MCU, resulting in the MCU failing to report the up event data to the tablet computer; or, the finger is pressed when the touchpad is in the powered-on state, and the lift operation is not performed until the touchpad is powered off. After the touchpad is powered off, the lift operation cannot be detected and the corresponding up event data cannot be reported, resulting in the tablet computer failing to receive the up event data, etc.
[0150] For example, take the touch panel missing up event data as an example to illustrate, refer to Figure 4 The data processing flow diagram shown in FIG. 1 is a schematic diagram of the data processing flow. When the finger changes from a pressing operation to a lifting operation, the touchpad does not report the up event data corresponding to the lifting operation of the finger, resulting in that the tablet computer does not receive the up event data even though the finger has been lifted. The tablet computer still believes that the finger is in the down state and refreshes the corresponding coordinate information when it is in the down state. In fact, at this time, the finger has been lifted, and the touchpad no longer reports the data of the finger, resulting in the inability to clear the coordinate information of the finger in the tablet computer in time. When the finger is pressed again, when the touchpad reports the down event data of the finger to the tablet computer via the MCU, there are two coordinate information about the finger in the tablet computer, and the two coordinate information do not match, resulting in the problem of cursor stuck. When the cursor stuck problem occurs, the cursor will disappear after a period of freezing and cannot recover by itself. It requires human intervention to power off and then power on the keyboard to recover, which greatly affects the user experience.
[0151] For example, take the case where the touchpad fails to report up event data during the three-finger switching to two-finger operation. Figure 5A schematic diagram comparing the normal reported data frame and the missed data frame of a touchpad is given. Specifically, the touchpad detects a touch event of a three-finger pressing operation. At this time, the data of the three-finger pressing is ID1 is 0x19, ID2 is 0x35, ID3 is 0x67, and the number of fingers (num) is 3. In the process of alternately pressing and lifting the three fingers, the second finger (finger ID2) is lifted, and the normally reported data should be ID1 is 0x19, ID2 is 0x33, ID3 is 0x67, and the number of fingers (num) is 3. However, due to an abnormality or failure to detect the lifting operation of the second finger in time, the touchpad misses the up event data of finger ID2. At this time, after the tablet computer receives the down event data corresponding to the second finger (finger ID2), it does not receive the up event data corresponding to the second finger. The tablet computer will not clear the coordinate information of the second finger when it is in the down state, which will cause the cursor to get stuck.
[0152] After the touchpad fails to report the up event data of finger ID2, it detects that there are two fingers pressing on the touchpad. At this time, the finger ID is shifted and the data of the third value at the position of ID3 is shifted to the position of ID2. After the second finger is lifted, the processing after the shifting is that ID1 is 0x19, ID2 is 0x67, ID3 is 0x00, and the number of fingers (num) is 2.
[0153] During the two-finger operation, the third finger is lifted (at this time, the ID of the third finger is ID2). The data reported normally should be ID1 is 0x19, ID2 is 0x65, ID3 is 0x00, and the number of fingers (num) is 2. However, due to an abnormality or failure to detect the lifting of the second finger in time, the touchpad misses the up event data of finger ID2. At this time, after the tablet receives the down event data corresponding to the third finger (finger ID2), it does not receive the up event data corresponding to the third finger. The tablet will not clear the coordinate information when the third finger is in the down state, which will cause the cursor to get stuck.
[0154] After the third finger is lifted, only one finger is in the pressing state on the touchpad. At this time, the normally reported data should be ID1 is 0x19, ID2 is 0x00, ID3 is 0x00, and the number of fingers (num) is 1.
[0155] For example, the touch panel is powered off and cannot report up event data. Figure 6Schematic diagram of data processing flow shown. When finger 1 is pressed on the touchpad without moving, the touchpad will send down event data to the MCU at a certain frequency. Exemplarily, the touchpad can send down event data to the MCU at a frequency of 120-140Hz, and the MCU sends down event data to the tablet computer. At this time, the tablet computer turns off the screen or closes the cover. After the MCU receives the screen off / cover closing instruction from the tablet computer, it sends an instruction to the touchpad to enter the sleep / power-off mode. After the touchpad enters the sleep / power-off mode, finger 1 changes from a pressed state to a lifted state. At this time, the touchpad can no longer detect and report up event data. When the tablet computer turns on the screen / opens the cover again, the touchpad enters the normal working mode. Finger 1 presses the touchpad again. Since the finger 1 recorded by the tablet computer before the screen is turned off is still the down event data, the coordinate information of the finger 1 is not released. At this time, when the down event data of finger 1 is reported to the tablet computer, the coordinate information generated for the second time cannot be connected with the previously uncleared coordinate information. The tablet computer cannot process the two coordinate information, and problems such as cursor freeze / page turning failure will occur. It is not until human intervention causes the keyboard to be powered off and then powered on again that the tablet computer can resume normal processing of the down event data and up event data reported by the keyboard touchpad.
[0156] Whether it is because the touchpad fails to report up event data due to an abnormality, or the touchpad misses reporting up event data, or the touchpad fails to report up event data after powering off, the tablet computer fails to receive normal up event data corresponding to the down event, resulting in cursor stuck or gesture failure.
[0157] In the process of processing the keydown event data / keyup event data of the tablet computer-keyboard keys, similarly, the tablet computer will record the status of each key and perform corresponding operations according to the keydown event data corresponding to each key reported by the keyboard; and update the status of each key according to the keyup event data corresponding to each key, thereby realizing the corresponding function of each key.
[0158] If the tablet does not receive the keyup event data corresponding to a key after receiving the keydown event data of the key, it means that the current keydown-keyup event status of the key cannot be updated, causing the tablet to be stuck in the process of processing the keydown event data of the key, and in severe cases, the tablet may crash.
[0159] The embodiment of the present application provides a data processing method, which can be applied to all scenarios where the main device and the external device process the data of the press-lift event. The external device obtains the first event data, and the first event data is the last frame of event data reported in the time sequence. If it is determined that the event type of at least one target object included in the first event data is a press event, the external device obtains the data of the lift event corresponding to the target object, and obtains the second event data based on the data of the lift event corresponding to the target object, and reports the second event data to the main device. Among them, the second event data includes the missed event data of the lift event data of the target object. In this embodiment, the external device can detect the missed report of the lift event data based on the event data of the previous frame (the first event data), and perform supplementary reporting based on the data of the lift event of the target object, so that the event data received by the main device always includes the complete event data in the press-lift operation, avoiding the problem of the cursor stuck due to the lack of lift event data of the main device, and optimizing the user experience.
[0160] The external device in the embodiment of the present application can be a keyboard, a drawing board, a smart handle, a wearable device, etc. Among them, for example, the keyboard includes a keyboard with a touchpad, a keyboard with buttons, etc.
[0161] For example, Figure 7 A schematic diagram of the structure of an external device 100 is provided. The external device 100 includes a processor 101 , a sensor module 102 and a communication module 103 .
[0162] The processor 101 may be one or more processing units. For example, the processor 101 may include an MCU, a memory, etc. Different processing units may be independent devices or integrated into one or more processors.
[0163] The sensor module 102 may be used to detect an interrupt event occurring in an external device, such as a key interrupt event, a touch interrupt event, and the like.
[0164] The communication module 103 can provide a communication processing module for wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), near field communication technology (NFC), etc., which are applied to the external device 100.
[0165] Optionally, the external device may further include a touch panel 104, which has a built-in processing unit, for example, the built-in processing unit may be an IC chip of the touch panel, and the IC chip is used to detect whether an interrupt event is generated through the sensor module 102, and generate data corresponding to the interrupt event. Exemplarily, the sensor in the external device having a touch panel may be a touch sensor, a pressure sensor, and the like.
[0166] Optionally, the external device may further include a key module 105, which has a built-in processing unit for detecting whether a key interruption event occurs through the sensor module 102 and generating data corresponding to the key interruption event. Exemplarily, the sensor in the external device with a key may include a pressure sensor or the like.
[0167] Exemplarily, the sensor module 102 of the external device may include a pressure sensor, which is used to sense pressure signals and convert pressure signals into electrical signals. In some embodiments, the pressure sensor may be arranged in a button or touch pad of the external device. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor may be a device including at least two parallel plates having a conductive material. When a force acts on the pressure sensor, the capacitance between the electrodes changes. The button or touch pad of the external device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the touch pad of the external device, the touch pad (IC chip) detects the intensity of the touch operation based on the pressure sensor. The touch pad can also calculate the position of the touch based on the detection signal of the pressure sensor.
[0168] In some embodiments, multiple fingers act on different touch positions of the touchpad, and the touchpad generates finger IDs corresponding to each finger, the status of each finger ID, and coordinate information of each finger ID, etc. For example: when at least one finger performs a touch operation on an external device, the event type of the finger's press or lift operation is determined based on the change in the capacitance of the pressure sensor, and down event data or up event data corresponding to the current finger is generated based on a preset data format. The touchpad can report the down event data or up event data to the processor of the external device, and the processor reports the down event data or up event data to the main device after data processing.
[0169] Exemplarily, the sensor module 102 of the external device may also include a touch sensor. The touch sensor may be provided in a touch panel of the external device to detect a touch operation on or near the touch panel, and the detected touch operation may be transmitted to a processor of the external device to determine the type of the touch event.
[0170] In some embodiments, the processor 101 of the external device may include an interface. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a UART interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a USB interface.
[0171] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDL) and a serial clock line (SCL). In some embodiments, the processor 101 may include multiple groups of I2C buses. The processor 101 may be coupled to the sensor module 102 through different I2C bus interfaces. For example, the processor 101 may be coupled to the sensor 102 through the I2C interface, so that the processor 101 communicates with the touch sensor module 102 through the I2C bus interface to realize the touch function of the external device 100.
[0172] The UART interface is a universal serial data bus for asynchronous communication. The bus is a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 101 and the communication module 103. For example, the processor 101 realizes a UART link communication connection or a Bluetooth link communication connection with the host device through the communication module 103.
[0173] In some embodiments, when a finger is pressed / lifted on the touch pad, the touch pad detects a change in capacitance through the sensor module 102, generates an interrupt, and reports down event data / up event data to the processor 101 through I2C. The processor 101 processes the down event data / up event data, and sends the processed down event data / up event data to the host device through a UART link or a Bluetooth link.
[0174] In the embodiment of the present application, the main device that is communicatively connected to the external device may be an electronic device. For example, the electronic device may be a portable computer (such as a mobile phone), a tablet computer, a laptop computer, a personal computer (PC), an augmented reality (AR) device, a virtual reality (VR) device, etc. The following embodiments do not impose any special restrictions on the specific forms of the electronic device and the external device.
[0175] The communication mode between the main device and the external device includes a wired communication mode and a wireless communication mode. The wired communication mode may include connection through a pogo pin, etc. The wireless communication mode may include UART connection, WLAN connection, Bluetooth connection, etc.
[0176] Please refer to Figure 8 , which shows a structural block diagram of an electronic device (such as an electronic device 300) provided in an embodiment of the present application. Among them, the electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a radio frequency module 350, a communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394, etc.
[0177] The structure shown in the embodiment of the present invention does not constitute a limitation on the electronic device 300. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0178] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0179] The controller can be a decision maker that directs the various components of the electronic device 300 to work in coordination according to the instructions. It is the nerve center and command center of the electronic device 300. The controller generates an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0180] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a high-speed cache memory, which can store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0181] In some embodiments, the processor 310 may receive down event data / up event data, keydown event data / keyup event data, etc. reported by an external device through the communication module 360. The processor 310 may determine the state and coordinate information of the finger ID corresponding to the down event data / up event data based on the received down event data / up event data, and control the cursor movement or perform a corresponding gesture operation based on the down event data / up event data. The processor 310 may determine the key corresponding to the keydown event data / keyup event data based on the received keydown event data / keyup event data, and implement the function corresponding to the key.
[0182] In some embodiments, the processor 310 may include an interface. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a UART interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0183] The interface connection relationship between the modules shown in the embodiment of the present invention is only for illustrative purposes and does not constitute a structural limitation on the electronic device 300. The electronic device 300 may adopt different interface connection methods in the embodiment of the present invention, or a combination of multiple interface connection methods.
[0184] The charging management module 340 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 340 may receive charging input from a wired charger through the USB interface 330. In some wireless charging embodiments, the charging management module 340 may receive wireless charging input through a wireless charging coil of the electronic device 300. While the charging management module 340 is charging the battery 342, it may also power the electronic device 300 through the power management module 341.
[0185] The power management module 341 is used to connect the battery 342, the charging management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, and supplies power to the processor 310, the internal memory 321, the external memory interface 320, the display screen 394, the camera 393, and the communication module 360. The power management module 341 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some embodiments, the power management module 341 can also be set in the processor 310. In some embodiments, the power management module 341 and the charging management module 340 can also be set in the same device.
[0186] The wireless communication function of the electronic device 300 can be implemented through antenna 1, antenna 2, radio frequency module 350, communication module 360, modem and baseband processor.
[0187] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, a cellular network antenna can be reused as a wireless local area network diversity antenna. In some embodiments, the antenna can be used in combination with a tuning switch.
[0188] The RF module 350 can provide a communication processing module for wireless communication solutions including 2G / 3G / 4G / 5G, etc., applied to the electronic device 300. The RF module 350 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The RF module 350 receives electromagnetic waves from the antenna 1, and performs filtering, amplification, and other processing on the received electromagnetic waves, and transmits them to the modem for demodulation. The RF module 350 can also amplify the signal modulated by the modem, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the RF module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the RF module 350 can be set in the same device as at least some of the modules of the processor 310.
[0189] The modem may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 370A, a receiver 370B, etc.), or displays an image or video through a display screen 394. In some embodiments, the modem may be an independent device. In some embodiments, the modem may be independent of the processor 310 and be arranged in the same device as the RF module 350 or other functional modules.
[0190] The communication module 360 can provide a communication processing module for wireless communication solutions including WLAN, Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 300. The communication module 360 can be one or more devices integrating at least one communication processing module. The communication module 360 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 310. The communication module 360 can also receive the signal to be sent from the processor 310, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0191] In some embodiments, the antenna 1 of the electronic device 300 is coupled to the radio frequency module 350, and the antenna 2 is coupled to the communication module 360, so that the electronic device 300 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global satellite positioning system (satellite based augmentation systems, SBAS), a global navigation satellite system (global navigation satellite system, GLONASS), a BeiDou navigation satellite system (BeiDounavigation satellite system, BDS), a Quasi-Zenith satellite system (Quasi-Zenith satellite system, QZSS) and / or a satellite based augmentation system (SBAS).
[0192] The electronic device 300 implements the display function through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.
[0193] The display screen 394 is used to display images, videos, etc. In this embodiment, for example, the display screen 394 can control the cursor movement or perform a corresponding gesture operation according to the down event data / up event data reported by the external device. The display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include 1 or N display screens 394, where N is a positive integer greater than 1.
[0194] The electronic device 300 can realize the shooting function through ISP, camera 393, video codec, GPU, display screen and application processor.
[0195] The ISP is used to process the data fed back by the camera 393. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. In some embodiments, the ISP can be set in the camera 393.
[0196] The camera 393 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 300 may include 1 or N cameras 393, where N is a positive integer greater than 1.
[0197] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 300 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0198] Video codecs are used to compress or decompress digital videos. The electronic device 300 may support one or more video codecs. Thus, the electronic device 300 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0199] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 300 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0200] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 300. The external memory card communicates with the processor 310 through the external memory interface 320 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0201] The internal memory 321 can be used to store computer executable program codes, which include instructions. The processor 310 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the internal memory 321. The memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.), etc. In addition, the memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
[0202] The electronic device 300 can implement audio functions such as music playing and recording through the audio module 370, the speaker 370A, the receiver 370B, the microphone 370C, the headphone jack 370D, and the application processor.
[0203] The audio module 370 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 370 can also be used to encode and decode audio signals. In some embodiments, the audio module 370 can be arranged in the processor 310, or some functional modules of the audio module 370 can be arranged in the processor 310.
[0204] The speaker 370A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 300 can listen to music or listen to a hands-free call through the speaker 370A.
[0205] The receiver 370B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 300 receives a call or voice message, the voice can be received by placing the receiver 370B close to the human ear.
[0206] Microphone 370C, also called "microphone" or "microphone", is used to convert sound signals into audio electrical signals. When making a call or sending a voice message, the user can speak by approaching the microphone 370C with his mouth to input the sound signal into the microphone 370C. The electronic device 300 can be provided with at least one microphone 370C.
[0207] The earphone interface 370D is used to connect a wired earphone and can be a USB interface 330, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0208] The key 390 includes a power key, a volume key, etc. The key 390 may be a mechanical key or a touch key. The electronic device 300 receives the key 390 input and generates a key signal input related to the user settings and function control of the electronic device 300.
[0209] Motor 391 can generate vibration prompts. Motor 391 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Touch operations acting on different areas of the display screen 394 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0210] Indicator 392 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0211] The data processing method provided by the embodiment of the present application is described in conjunction with a specific embodiment. Fig. 9 In a data processing method provided in an embodiment of the present application, an external device obtains second event data, and the second event data is the last frame of event data reported in time sequence. If it is determined that the event type of at least one target object included in the second event data is a press event, the external device obtains the data of the lift event corresponding to the target object, and obtains third event data based on the data of the lift event corresponding to the target object, and reports the third event data to the main device. Among them, the third event data includes the missed lift event data of the lift event data of the target object. In this embodiment, the external device can detect the missed lift event data based on the event data of the previous frame (second event data), and perform supplementary reporting based on the lift event data of the target object, so that the event data received by the main device always includes the complete event data in the press-lift operation, avoiding the problem of cursor stuck due to the lack of lift event data of the main device, and optimizing the user experience.
[0212] In an achievable embodiment, exemplarily, the main device is a tablet computer, and the external device is a keyboard with a touchpad, wherein the keyboard includes a touchpad and a processor (taking MCU as an example), and the MCU is taken as an example to illustrate the execution subject of the data processing method provided in the embodiment of the present application.
[0213] For the scenario where the touchpad fails to report up event data abnormally or fails to report up event data during the multi-finger to less-finger switching process, the preset conditions include that the external device receives the first event data as valid data, wherein the first event data is the event data to be reported by the MCU; the second event data is the last frame of event data reported by the MCU; and the third event data is the event data supplemented by the MCU. The object includes multiple finger IDs.
[0214] refer to Fig.10 In the data processing method provided in this embodiment, when the user performs a pressing / lifting operation based on the touchpad, the touchpad detects the touch state of the finger through the capacitance of the built-in sensor and reports down event data or up event data to the MCU. When the MCU receives the event data of the current frame (first event data), it obtains the event data of the previous frame (second event data). Based on the event type in the second event data, the MCU determines whether there is a finger ID with an event type of down event. If the second event data includes down event data of at least one target finger ID, it is determined whether there is up event data corresponding to each target finger ID in the first event data; if there is no up event data corresponding to at least one target finger ID in the first event data, it indicates that the touchpad has an abnormality of missing up event data. In this case, the MCU performs supplementary processing on the corresponding up event data according to each target finger ID to obtain the third event data. The third event data includes the supplemented up event data of each target finger ID. The third event data is the data reported before the first event data. The MCU reports the third event data to the tablet computer, so that the tablet computer can release the coordinates corresponding to the target finger ID in time, realize the normal response of the target finger's press-and-lift event, that is, realize normal cursor movement or gesture control. The MCU determines the missed target finger ID when determining the missed up event data by identifying and judging the events in the previous frame event data and the current frame event data of the missed event data, and promptly reports the up event data of the target finger ID, thereby avoiding the problem of the tablet computer's cursor being stuck due to the coordinates not being connected due to the up event data of the target finger ID.
[0215] Specifically, the mechanism by which the MCU detects whether the up event data is missed based on the up and down frame event data and reports the up event data of the corresponding finger ID is as follows: Fig.11 As shown, including:
[0216] S201. MCU receives first event data reported by a touch panel.
[0217] In this embodiment, the first event data may be the event data of the current frame. For example, the event data of the current frame includes finger ID1 (0x19), finger ID2 (0x00), the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID2; and the number of fingers is 2.
[0218] Among them, when finger ID1 is 0x19, it means that the finger corresponding to finger ID1 is in a pressing state and a down event is generated; when finger ID2 is 0x00, it means that the finger corresponding to finger ID2 is in a no-touch state or a lifted state.
[0219] S202: If the first event data is non-abnormal event data, the MCU obtains second event data.
[0220] The abnormal event data includes the event data corresponding to all fingers in the no-touch state and the event data corresponding to the large palm state. For example, the event data corresponding to the no-touch state includes all finger IDs are 0x00; the event data corresponding to the large palm state are finger ID1 (0x18), finger ID2 (0x34), and finger ID3 (0x36).
[0221] In some embodiments, if the first event data is all 0 data (all fingers are in a no-touch state), or the first event data is event data corresponding to a large palm state, the event data is considered invalid data, and the MCU can filter it out and not report it to the tablet computer.
[0222] If the first event data is non-abnormal event data, the MCU obtains the second event data, wherein the second event data is the last event data reported in the time sequence among the reported event data. The second event data also includes information such as each finger ID, the event type corresponding to each finger ID, the coordinates corresponding to each finger ID, and the number of fingers.
[0223] S203: The MCU determines whether there is at least one finger ID in the second event data whose event type is a down event.
[0224] In this embodiment, according to the 8-bit finger ID in the reporting data format introduced above, it can be seen that when the finger ID1 is 0x16, it indicates no touch; when the finger ID1 is 0x17, it indicates that the finger 1 is in the state from down→up, and its corresponding event type is an up event; when the finger ID1 is 0x19, it indicates that the finger 1 is in the down state, and its corresponding event type is a down event; when the finger ID1 is 0x18, it indicates that the finger 1 is in the large palm state, which is an abnormal event. Referring to the above description, the MCU can determine the event type corresponding to each finger ID according to the event data.
[0225] If the event type of one or more finger IDs in the second event data is a down event, it means that a press operation has occurred in the touchpad in the past period of time. In this case, the MCU can be triggered to perform the up event compensation mechanism, that is, to perform the up event data missed reporting judgment and up event data compensation operation.
[0226] Specifically, S204 , the MCU queries, based on the target finger ID in the second event data, whether there is a down event corresponding to the target finger ID in the first event data.
[0227] The target finger ID includes the finger ID of the event type down. The target finger ID may include one or more. The MCU needs to determine whether the up event data of each target finger ID is missed, and perform the corresponding up event data supplement operation after determining that the up event data is missed.
[0228] Exemplarily, the MCU performs a traversal query on all finger IDs [i] in the first event data based on the target finger ID [j] in the second event data, and determines whether there is a down event of the finger ID [i] that is the same as the target finger ID [j] in the first event data. The initial value of j is 1, and j is a natural number greater than 0; the initial value of i is also 1, and i is a natural number greater than 0.
[0229] If there is a down event of the finger ID[i] that is the same as the target finger ID[j] in the first event data, it means that the target finger ID[j] is in a continuous pressing state. At this time, the MCU can continue to query the next target finger ID[j++] in the second event data and execute S205; if there is no down event of the finger ID[i] that is the same as the target finger ID[j] in the first event data, it means that the target finger ID[j] is no longer in the down state in the current frame and has changed, which requires further judgment and executes S206.
[0230] S205 , the MCU sets j=j+1, and when it is determined that j is less than the number of fingers (fingernum), it returns to execute S203 and continues to detect the next target finger ID in the second event data.
[0231] S206. Based on the target finger ID in the second event data, the MCU queries whether there is an up event corresponding to the target finger ID in all finger IDs [i] of the first event data.
[0232] Exemplarily, the MCU performs a traversal query on all finger IDs [i] in the first event data based on the target finger ID [j] in the second event data, and determines whether there is an up event of the finger ID [i] that is the same as the target finger ID [j] in the first event data. If there is an up event of the finger ID [i] that is the same as the target finger ID [j] in the first three event data, it means that the up event reporting of the target finger ID [j] is normal, and S207 is executed; if there is no up event of the finger ID [i] that is the same as the target finger ID [j] in the first event data, it means that the up event reporting of the target finger ID [j] is abnormal, and the up event of the target finger ID [j] has been missed. In this case, S208 is executed.
[0233] S207. The up event of the target finger ID [j] is reported normally, and the MCU sets j=j+1. When it is determined that j is less than the number of fingers, it returns to execute S203 and continues to detect the next target finger ID in the second event data.
[0234] S208, the up event report of the target finger ID [j] is abnormal, the MCU obtains the up event data of the target finger ID [j], and increases the finger number (fingernum) by 1. In this way, the MCU traverses all the target finger IDs in the second event data, and obtains the corresponding up event data for the target finger ID that reports the up event abnormally.
[0235] Optionally, the number of fingers (fingernum) cannot be greater than the maximum number of fingers (numMax) supported by the tablet computer to prevent data anomalies.
[0236] S209. The MCU generates third event data based on the down event data and the up event data corresponding to all the finger IDs, and reports the third event data to the tablet computer.
[0237] The third event data includes the target finger ID with abnormal up event reporting that has been supplemented by the MCU to obtain its corresponding up event data, and the event data of other finger IDs that are normal.
[0238] In this embodiment, when the tablet computer receives the third event data supplemented with the up event data of the target finger ID, it can release the coordinate information of the target finger ID in time according to the up event data of the target finger ID in the third event data, so as to control the cursor movement or gesture operation normally.
[0239] S210. The MCU reports the first event data to the tablet computer based on a reporting cycle.
[0240] In this embodiment, after responding to the third event data, the tablet computer receives the first event data and can normally respond to the cursor control or gesture control corresponding to the finger in the pressing state or the finger in the non-touch state in the first event data.
[0241] In this embodiment, the external device obtains the second event data, which is the last frame of event data reported in the time sequence. If it is determined that the event type of at least one target object included in the second event data is a press event, and the first event data does not include the press event data and the lift event data corresponding to the target object, the external device obtains the lift event data corresponding to the target object, and obtains the third event data based on the lift event data corresponding to the target object, and reports the third event data to the main device. The third event data includes the lift event data of the target object that was missed.
[0242] In this embodiment, the external device can detect the data of the missed report of the lift event of the current frame event data (first event data) based on the event data of the previous frame (second event data). When it is determined that there is data of missed report of the lift event of the target object, supplementary reporting is performed based on the data of the lift event of the target object. That is, supplementary reporting is performed based on the previous frame event data (second event data) and the next frame event data (first event data) of the missed event data. The external device will first report the third event data obtained based on the data of the lift event of the target object to the main device, and then report the first event data to the main device. The event data received by the main device always includes the complete event data in the press-lift operation, avoiding the problem of the cursor stuck due to the lack of lift event data on the main device, and optimizing the user experience.
[0243] based on Fig.11 S201-S210 in the provided embodiment introduces the data processing method of this embodiment in combination with the operation scenario of switching from multiple fingers to fewer fingers. Exemplarily, switching from multiple fingers to fewer fingers may include switching from three fingers to two fingers, switching from two fingers to one finger, switching from three fingers to one finger, switching from four fingers to three fingers, and so on. Taking switching from three fingers to two fingers and switching from two fingers to one finger as an example, it can be combined with Figure 5 In the embodiment of the missed up event data, the data processing method of this embodiment includes:
[0244] S301 : MCU receives first event data reported by a touch panel.
[0245] In this embodiment, the first event data may be event data of the current frame. The first event data includes data of a frame after the second finger is lifted during the three-finger press and lift process. Figure 5 The first event data includes finger ID1 (0x19), finger ID2 (0x67), finger ID3 (0x00), the number of fingers is 2, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID3.
[0246] After the touchpad shifts the third finger, the third finger corresponds to finger ID2, and the second finger that is lifted corresponds to finger ID3. When finger ID1 is 0x19, it indicates that the first finger corresponding to finger ID1 is in a pressed state, corresponding to a down event; when finger ID2 is 0x67, it indicates that the third finger corresponding to finger ID2 is in a pressed state, corresponding to a down event; when finger ID3 is 0x00, it indicates that the second finger corresponding to finger ID3 is in a no-touch state or lifted state.
[0247] Exemplarily, the first event data is finger ID1 (0x19), finger ID2 (0x67), finger ID3 (0x00), and when the number of fingers is 2, the corresponding scenario may be lifting the second finger pressed in sequence during the three-finger sliding process. For example, the user presses the first finger, the second finger, and the third finger on the touchpad, and after the three fingers slide on the touchpad and return to the main display interface of the tablet computer, the user lifts the second finger. The event data reported by the touchpad to the MCU is the data after the finger ID is shifted, including finger ID1 (0x19), finger ID2 (0x67), finger ID3 (0x00), and the number of fingers is 2. Among them, the first finger is the finger that is pressed on the touchpad first in sequence, the second finger is the finger that is pressed on the touchpad after the first finger, and the third finger is the finger that is pressed on the touchpad after the second finger.
[0248] S302: The first event data is non-abnormal event data, and the MCU obtains second event data.
[0249] For example, reference Figure 5The second event data is the last event data reported in the time sequence among the reported event data. The second event data is the data when three fingers are pressed, including the first finger (0x19) corresponding to finger ID1, the second finger (0x35) corresponding to finger ID2, the third finger (0x67) corresponding to finger ID3, the number of fingers is 3, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID2; and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID3.
[0250] Among them, finger ID1, finger ID2, and finger ID3 are all in a pressing state, and their event types are all down events.
[0251] Exemplarily, the second event data is the event data before the first event data in terms of timing. The second event data is ID1 (0x19), finger ID2 (0x35), finger ID3 (0x67), and the number of fingers is 3. The corresponding scenario can be the process of three fingers pressing and sliding on the touchpad. For example, the user presses the first finger, the second finger, and the third finger on the touchpad, and slides the three fingers on the touchpad to return to the main display interface of the tablet computer. During the three-finger pressing and sliding process, the event data reported by the touchpad to the MCU is finger ID1 (0x19), finger ID2 (0x35), finger ID3 (0x67), and the number of fingers is 3.
[0252] S303: The MCU determines that the event type of the three finger IDs in the second event data is a down event, and triggers the MCU to perform an up event mechanism.
[0253] S304: The MCU queries, based on the target finger ID in the second event data, whether there is a down event corresponding to the target finger ID in the first event data.
[0254] The target finger IDs include finger ID 1, finger ID 2 and finger ID 3. The MCU needs to determine whether up event data of each target finger ID is missed, and perform corresponding up event data supplementation operations after determining that up event data is missed.
[0255] For example, based on the target finger ID1 in the second event data, the MCU performs a traversal query on all finger ID1, finger ID2, and finger ID3 in the first event data. The target finger ID1 in the second event data is 0x19, and there is a finger ID with event data of 0x19 in the first event data, indicating that the first finger in both the first event data and the second event data is in the down state, corresponding to a down event. That is, there is a down event in the first event data with the same finger ID as the target finger ID1 in the second event data.
[0256] In the example given in this embodiment, the finger ID in the first event data corresponding to the finger ID1 in the second event data is finger ID1.
[0257] S305 : The MCU may continue to query the next target finger ID 2 in the second event data.
[0258] Based on the target finger ID2 in the second event data, all finger ID1, finger ID2 and finger ID3 of the first event data are traversed and queried. The target finger ID2 in the second event data is 0x35, which is in the down state. Corresponding to the down event, the event data corresponding to any finger ID in the first event data is not 0x35, that is, there is no finger ID with event data of 0x35 in the first event data. It is determined that there is no down event with the same finger ID as the target finger ID2 in the first event data, indicating that the finger corresponding to the target finger ID2 in the second event data is no longer in the down state in the current frame, and it has changed, which requires further judgment, and executes S306.
[0259] S306 , based on the target finger ID2 in the second event data, the MCU queries whether there is an up event corresponding to the target finger ID in all the finger IDs[i] in the first event data.
[0260] For example, based on the target finger ID2 in the second event data, the MCU performs a traversal query on all finger ID1, finger ID2, and finger ID3 in the first event data. The event data corresponding to any finger ID in the first event data is not the lift event data 0x33 corresponding to 0x35, and it is determined that there is no up event for the finger with the same target finger ID2 in the first event data. This indicates that the up event report of the target finger ID2 is abnormal, and the up event of the target finger ID2 has been missed. In this case, S307 is executed.
[0261] Exemplarily, the missed reporting of the lift event data of finger ID2 in the second event data may occur when the user presses the first finger, the second finger, and the third finger on the touchpad, and the three fingers slide on the touchpad to return to the main display interface of the tablet computer. During the three-finger press and slide process, the user lifts the second finger, but the touchpad fails to detect the lift operation of the second finger in time, and no corresponding up event data of the second finger is generated; or, the touchpad happens to be abnormal, and no corresponding up event data of the second finger is generated. After the touchpad detects that all three fingers are pressed (where the second finger is 0x35), generates and reports the three-finger press event data (second event data), and does not report the event data (0x33) corresponding to the second finger in the lifted state, the first event data to be reported is directly generated. Among them, when the first event data is generated, the second finger is already in a no-touch state, and the first event data only includes the event data 0x00 of the second finger in the no-touch state, thereby missing the event data 0x33 of the second finger in the lifted state.
[0262] S307, the up event report of the target finger ID2 is abnormal, the MCU obtains the up event data (0x33) of the target finger ID2, and increases the number of fingers (fingernum) by 1. The number of fingers increases from 2 in the first event data to 3.
[0263] S308 . After supplementing the up event data of finger ID2 , the MCU determines whether the up event data of finger ID3 in the second event data is underreported.
[0264] S309 , based on the target finger ID3 in the second event data, the MCU queries whether there is an up event corresponding to the target finger ID in all the finger IDs [i] in the first event data.
[0265] For example, based on the target finger ID3 in the second event data, the MCU performs a traversal query on all finger ID1, finger ID2, and finger ID3 in the first event data. The target finger ID3 in the second event data is 0x67, and there is a finger ID with event data of 0x67 in the first event data. It is determined that there is a down event with the same finger ID as the target finger ID3 in the first event data. This indicates that the target finger ID3 is continuously in a pressed state, corresponding to a down event.
[0266] After the traversal query of finger ID1, finger ID2 and finger ID3 is completed.
[0267] S310. The MCU generates third event data based on the down event data corresponding to the finger ID1, the down event data corresponding to the finger ID3, and the supplemented up event data corresponding to the finger ID2, and reports the third event data to the tablet computer.
[0268] Among them, the third event data includes the target finger ID of the abnormal up event report supplemented by the MCU to obtain its corresponding up event data, as well as the event data of other normal finger IDs. The third event data is used to represent the data when the finger corresponding to finger ID2 (the second finger) is lifted, including finger ID1 (0x19), finger ID2 (0x33), finger ID3 (0x67), the number of fingers is 3, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID2; and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID3.
[0269] S311. The MCU reports the first event data to the tablet computer based on a reporting cycle.
[0270] In this embodiment, before the MCU reports the third event data to the tablet computer, the tablet computer is in a state of having responded to the second event data, that is, the tablet computer has processed the page turning or returning to the main interface operation corresponding to the three fingers being in the pressing state; the MCU first reports the third event data supplemented with the up event data of finger ID2 to the tablet computer, so that the tablet computer can release the coordinate information of finger ID2 in time based on the up event data of finger ID2 in the third event data. After the tablet computer responds to the third event data, the MCU reports the first event data to the tablet computer according to the preset reporting cycle, and the tablet computer can now normally respond to the pressing event data of finger ID1 and finger ID3 and the no-touch event data of finger ID2 in the first event data.
[0271] In other embodiments, the data processing method provided by this embodiment is further illustrated by taking the steps in S311 as an example. When the MCU reports the first event data in S311, the pressing state of the finger on the touchpad includes the first finger corresponding to the finger ID1 and the third finger corresponding to the finger ID2 being in the pressing state. That is, the current scene is that only two fingers are pressed on the touchpad, and the user may be performing a two-finger sliding operation to browse the content displayed on the tablet computer. If one finger is lifted during the two-finger sliding process, only the first finger is left pressed on the touchpad, and the remaining fingers are in a non-touch state, and the up event data of the lifted finger is missed. The MCU needs to make up the up event data of the lifted finger, which specifically includes:
[0272] S312: MCU obtains fourth event data.
[0273] The fourth event data is event data to be reported to the tablet computer after the first event data in time sequence. Exemplarily, the fourth event data may include finger ID1 (0x19), finger ID2 (0x00), finger ID3 (0x00), and the number of fingers is 1. The fourth event data includes two fingers (finger ID2 and finger ID3) in a no-touch state, indicating that the current user has only the first finger left pressing on the touchpad.
[0274] S313: When it is determined that the fourth event data is not abnormal event data, the MCU obtains the first event data.
[0275] The first event data is the last frame of data reported before the fourth event data is reported. The first event data includes finger ID1 (0x19), finger ID2 (0x67), finger ID3 (0x00), the number of fingers is 2, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID3.
[0276] The first event data indicates that after the user slides three fingers on the touchpad to return to the main display interface of the tablet computer and lifts the second finger, the first and third fingers are still in a pressing state on the touchpad. The event data reported by the touchpad to the MCU is the data after the finger ID is shifted, including finger ID1 (0x19), finger ID2 (0x67), and finger ID3 (0x00), and the number of fingers is 2.
[0277] S314: The MCU determines that the event type of the two finger IDs in the first event data is a down event, and triggers the MCU to perform an up event mechanism.
[0278] S315. The MCU queries, based on the target finger ID in the first event data, whether there is a down event corresponding to the target finger ID in the fourth event data.
[0279] Similar to the above step S304, the MCU needs to determine whether up event data of each target finger ID in the first event data is missed, and perform corresponding up event data supplementation operations after determining that up event data is missed.
[0280] For example, based on the target finger ID1 in the first event data, the MCU performs a traversal query on all finger ID1, finger ID2, and finger ID3 in the fourth event data. The target finger ID1 in the first event data is 0x19, and there is a finger ID with event data of 0x19 in the fourth event data, indicating that the fourth event data and the first finger in the first event data are both in the down state, corresponding to a down event. That is, there is a down event in the fourth event data with the same finger ID as the target finger ID1 in the first event data.
[0281] In the example given in this embodiment, the finger ID in the fourth event data corresponding to the finger ID1 in the first event data is finger ID1.
[0282] S316: The MCU may continue to query the next target finger ID2 in the first event data.
[0283] Based on the target finger ID2 in the first event data, all the finger ID1, finger ID2 and finger ID3 in the fourth event data are traversed and queried. The target finger ID2 in the first event data is 0x67, which is in the down state. Corresponding to the down event, the event data corresponding to any finger ID in the first event data is not 0x67, that is, there is no finger ID with event data of 0x67 in the first event data. It is determined that there is no down event with the same finger ID as the target finger ID2 in the first event data, indicating that the finger corresponding to the target finger ID2 in the second event data is no longer in the down state in the current frame, and it has changed, which requires further judgment, and executes S317.
[0284] S317 . The MCU queries all the finger IDs [i] in the fourth event data based on the target finger ID 2 in the first event data to see whether there is an up event corresponding to the target finger ID.
[0285] Exemplarily, based on the target finger ID2 in the first event data, the MCU traverses and queries all the finger ID1, finger ID2, and finger ID3 in the fourth event data. The event data corresponding to any finger ID in the first event data is not the lift event data 0x65 corresponding to 0x67, and it is determined that there is no up event for the finger with the same target finger ID2 in the first event data. This indicates that the up event report of the target finger ID2 is abnormal, and the up event of the target finger ID2 has been missed. In this case, execute S318.
[0286] Exemplarily, the missed reporting of the lift event data of finger ID2 in the first event data may occur when the user presses the first finger (corresponding to finger ID1) and the third finger (corresponding to finger ID2) on the touchpad, and the two fingers slide on the touchpad to browse the display interface content of the tablet computer. During the two-finger press and slide process, the user lifts the third finger (corresponding to finger ID2), but the touchpad fails to detect the lift operation of the third finger in time, and no corresponding up event data of the third finger is generated; or, the touchpad happens to be abnormal, and no corresponding up event data of the third finger is generated. After the touchpad detects that both fingers are pressed (where the second finger is 0x67), generates and reports the two-finger press event data (first event data), and does not report the event data (0x65) corresponding to the third finger in the lifted state, the fourth event data to be reported is directly generated. Wherein, when the fourth event data is generated, the third finger is already in a no-touch state, and the fourth event data only includes the event data 0x00 of the third finger in the no-touch state, thereby missing the event data 0x33 of the third finger in the lifted state.
[0287] S318, the up event report of the target finger ID2 is abnormal, the MCU obtains the up event data (0x65) of the target finger ID2, and increases the number of fingers (fingernum) by 1. The number of fingers increases from 1 in the fourth event data to 2.
[0288] S319 . After supplementing the up event data of finger ID2 , the MCU determines whether the up event data of finger ID3 in the first event data is underreported.
[0289] S320 , based on the target finger ID3 in the first event data, the MCU queries whether there is an up event corresponding to the target finger ID in all the finger IDs [i] in the fourth event data.
[0290] Exemplarily, the MCU traverses and queries all finger ID1, finger ID2, and finger ID3 in the fourth event data based on the target finger ID3 in the first event data. The target finger ID3 in the first event data is 0x00, and there is a finger ID with event data of 0x00 in the first event data. It is determined that there is a no-touch event with the same finger ID as the target finger ID3 in the first event data, indicating that the target finger ID3 is continuously in a no-touch state.
[0291] After the traversal query of finger ID1, finger ID2 and finger ID3 is completed.
[0292] S321. The MCU generates fifth event data based on the down event data corresponding to the finger ID1, the supplemented up event data corresponding to the finger ID2, and the no-touch event data corresponding to the finger ID3, and reports the fifth event data to the tablet computer.
[0293] Among them, the fifth event data includes the target finger ID of the abnormal up event report supplemented by the MCU to obtain its corresponding up event data, as well as the event data of other normal finger IDs. The fifth event data is used to represent the data when the finger corresponding to finger ID2 (the third finger) is lifted, including finger ID1 (0x19), finger ID2 (0x65), finger ID3 (0x00), the number of fingers is 2, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1; the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID2.
[0294] S322. The MCU reports the fourth event data to the tablet computer based on the reporting cycle.
[0295] In this embodiment, before the MCU reports the fourth event data to the tablet computer, the tablet computer is in a state of having responded to the first event data, that is, the tablet computer has processed the operation of sliding to turn pages or sliding to browse the display interface corresponding to the two fingers in the pressing state; the MCU first reports the fifth event data supplemented with the up event data of finger ID2 to the tablet computer, so that the tablet computer can release the coordinate information of finger ID2 in time based on the up event data of finger ID2 in the fifth event data. After the tablet computer responds to the fifth event data, the MCU reports the fourth event data to the tablet computer according to the preset reporting cycle, and the tablet computer can now normally respond to the pressing event data of finger ID1 in the fourth event data and the no-touch event data of finger ID2 and finger ID3.
[0296] In this embodiment, in response to the situation of touchpad abnormality or failure to report up event data of the target finger in the multi-finger switching to few-finger scenario, the MCU can judge and perform corresponding supplementary processing on the up event data corresponding to the missed target finger ID based on the previous frame event data (second event data) and the next frame event data (first event data) relative to the missed event data, thereby obtaining the third event data including the up event data corresponding to the target finger ID supplemented, and reporting the third event data to the tablet computer before reporting the first event data, so that the tablet computer can release the coordinates of the target finger ID in time, achieve normal response to the pressing and lifting operations of all finger IDs, and avoid the problem of cursor stuck due to the failure to release the coordinates in time.
[0297] For a scenario where a finger is continuously pressed on the touchpad, the MCU sends a sleep / power-off command to the touchpad, and the touchpad enters sleep mode or power-off mode, and then the finger is lifted from the touchpad, causing the touchpad to be unable to detect and report the up event data corresponding to the finger lift operation, the preset conditions are met, including the MCU of the external device controlling the touchpad to enter sleep or power-off mode. The fourth event data is the last frame of event data in the sequence reported to the main device before the MCU sends a sleep / power-off command to the touchpad. The fifth event data is the event data supplemented by the MCU. The object includes multiple finger IDs.
[0298] refer to Fig.12 In the data processing method provided in this embodiment, when the user performs a continuous pressing operation based on the touchpad, the touchpad reports down event data to the MCU at a preset frequency. When the MCU receives the notification of screen off or cover closing issued by the tablet computer, the MCU sends a sleep / down command to the touchpad, and the touchpad enters sleep mode or power-off mode after receiving the sleep / down command. After the touchpad enters sleep mode or power-off mode, when the finger that continuously presses the touchpad is lifted, the touchpad cannot detect the finger lifting operation and cannot report up event data to the MCU. For this scenario, after the MCU sends the sleep / down command to the touchpad, it obtains the fourth event data (the last frame of event data reported to the host device before the MCU sends the sleep / down command to the touchpad), and the MCU determines whether there is a finger ID with an event type of down event based on the event type in the fourth event data. If the fourth event data includes down event data of at least one target finger ID, the MCU performs supplementary processing on the corresponding up event data of each target finger ID to obtain the third event data. The third event data includes the supplemented up event data of each target finger ID. When the MCU receives the screen-on or cover-open notification sent by the tablet computer, the MCU reports the third event data to the tablet computer, so that the tablet computer can release the coordinates corresponding to the target finger ID in time, and achieve the normal response of the target finger's press-and-lift event, that is, to achieve normal cursor movement or gesture control. The MCU timely reports the missed up event data of the target finger ID based on the last frame of event data reported to the host device before the MCU sends the touchpad to enter sleep mode or power-off mode, thereby avoiding the problem of the coordinates not being connected due to the inability to report the up event data of the target finger ID after the touchpad enters sleep mode or power-off mode, causing the cursor to get stuck in the tablet computer.
[0299] Specifically, the MCU reports the missed up event data based on the last frame of event data reported to the main device before the MCU sends the touch panel to enter sleep / power-off. Fig.13 As shown, including:
[0300] S401. The MCU receives a screen-off or cover-cover instruction from the tablet computer, and sends a sleep / power-off instruction to the touch panel.
[0301] S402: MCU obtains fourth event data.
[0302] The fourth event data is the last frame of event data reported to the host device before the MCU sends the touch panel to enter sleep / power off. The fourth event data also includes information such as each finger ID, the event type corresponding to each finger ID, the coordinates corresponding to each finger ID, and the number of fingers.
[0303] S403: The MCU determines whether there is at least one finger ID in the fourth event data whose event type is a down event.
[0304] In this embodiment, according to the 8-bit finger ID in the reporting data format introduced above, it can be seen that when the finger ID1 is 0x16, it indicates no touch; when the finger ID1 is 0x17, it indicates that the finger 1 is in the state from down→up, and its corresponding event type is an up event; when the finger ID1 is 0x19, it indicates that the finger 1 is in the down state, and its corresponding event type is a down event; when the finger ID1 is 0x18, it indicates that the finger 1 is in the large palm state, which is an abnormal event. Referring to the above description, the MCU can determine the event type corresponding to each finger ID according to the event data.
[0305] If the event type of one or more finger IDs in the fourth event data is a down event, it means that a press operation occurs in the touch panel before the touch panel enters the sleep mode or power-off mode. In this case, the MCU can be triggered to perform the up event compensation mechanism, that is, to perform the up event data missed reporting judgment and up event data compensation operation.
[0306] Specifically, in S404, the MCU obtains up event data of the target finger ID[j] based on the target finger ID[j] in the fourth event data.
[0307] S405. The MCU sets j=j+1, and when j is less than the number of fingers (fingernum), traverses all target finger IDs [j] in the fourth event data.
[0308] In this way, the MCU traverses all target finger IDs in the fourth event data and replenishes the up event data corresponding to all target finger IDs [j].
[0309] S406. The MCU increases the value of the finger number (fingernum) accordingly according to the number of supplemented finger IDs.
[0310] Optionally, the number of fingers (fingernum) cannot be greater than the maximum number of fingers (numMax) supported by the tablet computer to prevent data anomalies.
[0311] S407. The MCU generates fifth event data based on the up event data corresponding to all the finger IDs, and reports the fifth event data to the tablet computer after detecting that the tablet computer turns on the screen or opens the cover.
[0312] The fifth event data includes the up event data of the target finger ID that has been supplemented by the MCU, and the event data of other normal finger IDs.
[0313] In this embodiment, after the tablet computer receives the fifth event data after the screen is turned on, it can promptly release the coordinate information of the target finger ID according to the up event data of the target finger ID compensated in the fifth event data, thereby avoiding the problem of cursor freezing caused by the failure to release the coordinate information of the target finger ID. In this way, the tablet computer can normally respond to the event data generated after the target finger ID.
[0314] based on Fig.13 S401-S407 in the provided embodiment introduces the data processing method of this embodiment in combination with the operation scenario where the touch panel is always in a one-finger pressing state before the touch panel enters the sleep mode or the power-off mode. Exemplarily, the process of the data processing method of this embodiment includes:
[0315] S501. The MCU receives a screen-off or cover-cover instruction from the tablet computer, and sends a sleep / power-off instruction to the touch panel.
[0316] S502: MCU obtains fourth event data.
[0317] Exemplarily, the fourth event data is event data corresponding to one-finger press, including finger ID1 (0x19), finger ID2 (0x00), finger ID3 (0x00), the number of fingers is 1, and the X1 coordinate, X2 coordinate, Y1 coordinate, and Y2 coordinate corresponding to finger ID1.
[0318] Among them, finger ID1 is in the pressing state, and its event type is down event. Finger ID2 and finger ID3 are both in the no-touch state.
[0319] S503: The MCU determines that the event type of the finger ID1 in the fourth event data is a down event, and triggers the MCU to perform an up event compensation mechanism.
[0320] For example, before the touchpad is powered off, the user's first finger is pressed on the touchpad until the touchpad is powered off, and then the finger is lifted from the touchpad. In this case, the touchpad cannot detect and report the lift event of the first finger after it is powered off, so the MCU needs to supplement the up event data of the first finger.
[0321] S504 . The MCU obtains up event data of the target finger ID1 based on the target finger ID1 in the fourth event data.
[0322] S505 , traverse all target finger IDs in the fourth event data.
[0323] S506. The MCU increases the value of the finger number (fingernum) accordingly according to the number of supplemented finger IDs.
[0324] Here, the up event data of the target finger is added, fingernum+1.
[0325] S507 . The MCU generates fifth event data based on the up event data corresponding to all the finger IDs, and reports the fifth event data to the tablet computer after receiving a screen-on or cover-open instruction issued by the tablet computer.
[0326] The fifth event data includes finger ID1 (0x17), finger ID2 (0x00), and finger ID3 (0x00), and the number of fingers is 2. 0x17 indicates that finger ID1 is in the state from being pressed to being lifted, and its event type is an up event. In this way, the supplementary reporting of the up event data of finger ID1 that was not detected and reported before the touchpad enters the sleep mode or power-off mode is completed.
[0327] In this embodiment, in the case where the up event data of the target finger cannot be reported after the touchpad enters sleep mode or power-off mode, the MCU can obtain fourth event data when sending a sleep / power-off instruction to the touchpad, and supplement the up event data corresponding to the target finger ID based on the target finger ID in the fourth event data, thereby obtaining fifth event data including the up event data supplemented with the target finger ID, and after the MCU detects that the tablet computer is turned on or the cover is opened, the fifth event data is reported to the tablet computer, so that the tablet computer can release the coordinates of the target finger ID in time, achieve normal response to all finger ID pressing and lifting operations, and avoid the problem of cursor stuck due to the failure to release the coordinates in time.
[0328] In some embodiments, for example, the main device is a tablet computer and the external device is a key keyboard. The keyboard includes a processor, and the keyboard is the execution subject.
[0329] For the scenario where the keyboard abnormally fails to report keyup event data or the keyboard processor fails to report keyup event data during the process of switching from multiple keys to fewer keys, the data processing method provided in this embodiment includes:
[0330] S601. The keyboard obtains first event data to be reported.
[0331] In this embodiment, the first event data may be event data of the current frame. For example, the event data of the current frame includes the identifier and status (keydown / keyup) of key 1 and the identifier and status (keydown / keyup) of key 2.
[0332] S602: If the first event data is non-abnormal event data, the keyboard obtains second event data.
[0333] The abnormal event data includes that the number of keys in the keydown state is greater than the number threshold, for example, the number threshold may be 5. In the actual use of the keyboard, more than 5 keys will not be pressed at the same time, so this data is considered abnormal data and invalid data.
[0334] If the first event data is not abnormal event data, the keyboard obtains second event data, wherein the second event data is the last event data reported in the time sequence among the reported event data. The second event data also includes information such as the identification and status of each key.
[0335] S603: The keyboard determines whether there is at least one key in the second event data whose event type is a keydown event.
[0336] In this embodiment, the keyboard can determine whether there is at least one key with a keydown event event according to the state of each key. The key in the keydown state corresponds to a keydown event.
[0337] If the event type of one or more keys in the second event data is a keydown event, it means that a key pressing operation has occurred in the keyboard in the past period of time. In this case, the keyboard can be triggered to perform an up event compensation mechanism, that is, to perform a keyup event data missed reporting judgment and a keyup event data compensation operation.
[0338] Specifically, S604: The keyboard queries whether there is a keydown event corresponding to the target key in the first event data based on the identifier of the target key in the second event data.
[0339] The target key includes the key with the event type of keydown. The target key may include one or more keys, and the keyboard needs to determine whether the keyup event data of each target key is missed, and perform corresponding keyup event data supplementation operations after determining that the keyup event data is missed.
[0340] Exemplarily, the keyboard performs a traversal query on all keys in the first event data based on the identifier of the target key in the second event data, and determines whether there is a keydown event of a key having the same identifier as the target key in the first event data.
[0341] If there is a keydown event of a key with the same identifier as the target key in the first event data, it means that the target key is in a continuously pressed state. At this time, the keyboard can continue to query the next target key in the second event data and execute S603; if there is no keydown event of a key with the same identifier as the target key in the first event data, it means that the target key is no longer in the keydown state in the current frame and has changed, which requires further judgment and executes S605.
[0342] S605: Based on the target key in the second event data, the keyboard queries whether there is a keyup event corresponding to the target key among all the keys in the first event data.
[0343] Exemplarily, the MCU performs a traversal query on all keys of the first event data based on the target key in the second event data, and determines whether there is a keyup event of a key with the same identifier as the target key in the first event data. If there is a keyup event of a key with the same identifier as the target key in the first event data, it indicates that the keyup event of the target key is reported normally, and S606 is executed; if there is no keyup event of a key with the same identifier as the target key in the first event data, it indicates that the keyup event of the target key is reported abnormally, and the keyup event of the target key has been missed. In this case, S607 is executed.
[0344] S606: The keyup event of the target key is reported normally, and the process returns to S603 to continue detecting the next target key in the second event data.
[0345] S607: The keyup event of the target key is reported abnormally, and the keyboard obtains the keyup event data of the target key.
[0346] In this way, the keyboard traverses all target keys in the second event data, and obtains the corresponding keyup event data for the target key that reports an abnormal keyup event.
[0347] S608: The keyboard generates third event data based on the keydown event data and the keyup event data corresponding to all the keys, and reports the third event data to the tablet computer.
[0348] The third event data includes the corresponding keyup event data of the target key that has reported an abnormal keyup event supplemented by the keyboard, and the event data of other normal keys.
[0349] In this embodiment, the tablet computer receives the third event data and can perform corresponding operations according to the complete keydown-keyup event data of all keys.
[0350] S609: The keyboard reports the first event data to the tablet computer based on a reporting cycle.
[0351] In this embodiment, the tablet computer receives the first event data and can normally respond to the keydown event data or keyup event data of the corresponding key.
[0352] Exemplarily, the application scenario of the data processing method provided by S601-S609 above can be that the user presses multiple keys on the keyboard at the same time to implement the corresponding functions. For example, press the three keys "ctrl", "alt", and "A" at the same time to implement a screenshot. After pressing the three keys "ctrl", "alt", and "A", lift the finger pressing "A", that is, make the key "A" in the keyup state, and the keys "ctrl" and "alt" are still in the keydown state. This situation of switching two keys from three keys may cause the keyboard to miss the event data of the key "A" in the keyup state, that is, the keyboard needs to supplement the missed keyup event data of the key "A" based on the upper and lower frames of event data.
[0353] Alternatively, when key "A" is in the keyup state and keys "ctrl" and "alt" are still in the keydown state, the user presses the "Z" key on the keyboard. This situation of pressing three keys, releasing one key, and immediately pressing another key may also cause the keyboard to miss the event data of key "A" being in the keyup state. That is, the keyboard needs to make up for the missed keyup event data of key "A" based on the upper and lower frames of event data.
[0354] In the scenario where the keyboard is disconnected from the tablet computer and keyup event data cannot be reported, the data processing method provided in this embodiment includes:
[0355] S701: The keyboard receives a screen-off or cover-operation signal from the tablet computer, and obtains fourth event data.
[0356] The fourth event data is the last frame of event data reported by the keyboard to the host device before the keyboard receives the screen off or cover command from the tablet computer. The fourth event data also includes information such as the identification and status of each key.
[0357] S702: The keyboard determines whether there is at least one key in the fourth event data whose event type is a keydown event.
[0358] If the event type of one or more keys in the fourth event data is a keydown event, it means that before the keyboard detects that the tablet computer is turned off or the cover is turned on, a key is pressed in the keyboard. In this case, the keyboard can be triggered to perform a keyup event supplement mechanism, that is, to perform a keyup event data missed report judgment and keyup event data supplement operation.
[0359] S703: The keyboard obtains keyup event data of the target key based on the target key in the fourth event data.
[0360] S704: The keyboard traverses all target keys in the fourth event data.
[0361] In this way, the keyboard traverses all target keys in the fourth event data and replenishes the keyup event data corresponding to all target keys.
[0362] S705: The keyboard generates fifth event data based on the keyup event data corresponding to all the keys, and after detecting that the tablet computer turns on the screen or opens the cover, the fifth event data is reported to the tablet computer.
[0363] The fifth event data includes the keyup event data of the target key that has been added to the keyboard, and the event data of other normal keys.
[0364] In this embodiment, the tablet computer receives the fifth event data and can perform corresponding operations according to the complete keydown-keyup event data of all keys.
[0365] Exemplarily, the application scenario of the data processing method provided by S701-S705 above can be that the user presses one or more keys on the keyboard, and the pressed keys are in the keydown state. During the pressing process, the keyboard receives the screen-off notification from the tablet computer and enters the power-off mode or the sleep mode; after the keyboard enters the power-off mode or the sleep mode, one or more keys are placed in the keyup state. In this case, the keyboard cannot report the keyup event of the key in the power-off or sleep mode detection, and it is necessary to promptly report the keyup event data corresponding to the keys in the keydown state before entering the power-off mode or the sleep mode to the tablet computer after the keyboard is powered on.
[0366] In this embodiment, in the interaction scenario between the tablet computer and the keyboard, in the case where the keyboard misses reporting the keyup event data of a key or fails to report the keyup event data of a key in time when detecting that the tablet computer screen is turned off or the cover is opened, the keyboard can obtain the fourth event data and, based on the target key in the fourth event data, supplement the keyup event data corresponding to the target key, thereby obtaining the second event data including the keyup event data supplemented with the target key, and report the second event data to the tablet computer after the keyboard detects that the tablet computer screen is turned on or the cover is opened, so that the tablet computer can implement the functional operation of the corresponding key according to the normal keydown event data and keyup event data of each key.
[0367] In some embodiments, in response to the situation where up event data of a target finger ID is missing in a tablet computer, or keyup event data of a target key is missing in a tablet computer, from the perspective of the tablet computer as the execution subject, this embodiment provides another data processing method that can effectively solve this problem.
[0368] For example, after the tablet computer turns on the screen or opens the cover, it can check whether the received event data contains any missing up event data or keyup event data.
[0369] For example, after the tablet turns on the screen or opens the cover, it obtains the event data received last time in the sequence (referred to as the fourth event data). If there is at least one target object (finger ID or key ID) in the fourth event data whose event type is a down event / keydown event, the tablet supplements the corresponding up event data / keyup event data for each target object to obtain the fifth event data. Before receiving new event data (sixth event data) for data processing, the corresponding coordinate release or function implementation operation is performed based on the fifth event data. Then, the corresponding cursor control or function implementation is performed based on the sixth event data.
[0370] For example, when the tablet computer continuously lights up the screen and receives event data reported by an external device at a preset frequency, when the tablet computer receives the current frame event data, if the current frame event data does not include lift event data, the tablet computer can obtain the previous frame event data of the current frame event data in time sequence, and determine whether there is a target object with an event type of down event / keydown event in the previous frame event data. If there is a target object with an event type of down event / keydown event in the previous frame event data, then the up event data / keyup event data corresponding to the target object is supplemented to generate the seventh event data. First, the corresponding coordinate release or function implementation operation is performed based on the seventh event data. Then, the corresponding cursor control or function implementation is performed based on the current frame event data.
[0371] In this embodiment, from the perspective of the tablet computer, the tablet computer can query and judge the up event data / keyup event data in the received event data. When it is determined that there is missing up event data / keyup event data, the up event data / keyup event data of the target object can be supplemented in time, so that the down event / keydown event and up event data / keyup event data of the target object maintain the integrity of the event data. The tablet computer performs corresponding cursor control or function implementation based on the complete event data, avoiding the problem of cursor stuck or function failure.
[0372] Fig.14 A possible structural diagram of the electronic device and the external device involved in the above embodiment is shown. Fig.14 The electronic device 1000 shown includes a processor 1001, a communication module 1002, a display screen 1003 and a storage module 1004; the external device 2000 includes a processor 2001, a communication module 2002 and a storage module 2003. Optionally, the external device 2000 may further include a key module 2004 and a touch panel 2005.
[0373] Among them, processor 1001 and processor 2001 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), an MCU or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor may include an application processor and a baseband processor. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. Storage module 1004 and storage module 2003 may be memories.
[0374] For example, the processor 1001 of the electronic device 1000 may be Figure 8 The processor 310 shown; the communication module 1002 may be as follows Figure 8 The communication module 360 shown; the display screen 1003 can be as follows Figure 8 The display screen 394 is shown; the storage module 1004 can be as follows Figure 8 The internal memory 321 shown. The electronic device 1000 provided in the embodiment of the present application can be Figure 8 An electronic device 300 is shown.
[0375] For example, the processor 2001 of the external device 2000 may be: Figure 7 The processor 101 shown; the communication module 2002 can be as follows Figure 7 The communication module 103 shown; the storage module 2003 can be as follows Figure 7 The memory shown; the key module 2004 can be as follows Figure 7 The key module 105 shown; the touch panel 2005 can be as follows Figure 7 The touch panel 104 shown. The external device 2000 provided in the embodiment of the present application can be Figure 7 The external device 100 is shown.
[0376] The present application also provides a chip system (eg, a system on a chip (SoC)), such as Fig.15As shown, the chip system includes at least one processor 701 and at least one interface circuit 702. The processor 701 and the interface circuit 702 can be interconnected by lines. For example, the interface circuit 702 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 702 can be used to send signals to other devices (such as a processor 701 or a camera of an electronic device). Exemplarily, the interface circuit 702 can read instructions stored in the memory and send the instructions to the processor 701. When the instruction is executed by the processor 701, the electronic device can perform the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0377] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the external device 100 or the electronic device 300 in the above-mentioned method embodiment.
[0378] The embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the external device 100 or the electronic device 300 in the above method embodiment. For example, the computer may be the above external device 100 or the electronic device 300.
[0379] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.
[0380] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0381] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0382] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0383] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0384] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A data processing method, It is characterized in that Applied to an external device, the external device includes at least one of a keyboard and a touchpad; the method includes: The external device acquires first event data, which is event data to be sent by the external device to the electronic device; the event data is used to characterize the objects and event types of the pressing and lifting operations on the keyboard or touchpad of the external device, and the event types include pressing events and lifting events; The external device acquires second event data; the second event data is a frame of event data that the external device has sent to the electronic device before sending the first event data; If the second event data contains a target object whose event type is a press event, and the first event data does not contain press event data and lift event data corresponding to the target object, the external device creates lift event data corresponding to the lift event of the target object based on the target object; If the second event data contains a target object whose event type is a press event, and the first event data contains press event data corresponding to the target object, the external device acquires the press event data of the target object; The external device generates third event data according to the lifting event data of the target object or the pressing event data of the target object; The external device sends the third event data to the electronic device.
2. The method according to claim 1, It is characterized in that If there are N target objects whose event type is a press event in the second event data, where N is a positive integer, the method further includes: The external device traverses and searches for the pressing event data corresponding to the j-th target object of the second event data from the objects included in the first event data, where the value of j ranges from 1 to N; If the event data corresponding to the object in the first event data is not the press event data corresponding to the j-th target object in the second event data, determining that the press event data corresponding to the j-th target object in the second event data does not exist in the first event data; If there is event data corresponding to an object in the first event data which is press event data corresponding to the j-th target object of the second event data, it is determined that there is press event data corresponding to the j-th target object of the second event data in the first event data.
3. The method according to claim 2, It is characterized in that After determining that there is no press event data corresponding to the j-th target object in the second event data in the first event data, the method further includes: The external device traverses and searches for lift event data corresponding to the j-th target object of the second event data from all objects included in the first event data; If the event data corresponding to the object in the first event data is not the lifting event data corresponding to the j-th target object in the second event data, determining that the lifting event data corresponding to the j-th target object in the second event data does not exist in the first event data; If there is event data corresponding to an object in the first event data, which is lift event data corresponding to the j-th target object of the second event data, it is determined that there is lift event data corresponding to the j-th target object of the second event data in the first event data.
4. The method according to claim 3, It is characterized in that The first event data also includes a first number of events whose event type is a press event; and the method further includes: The external device determines that a second number of pressing event data and lifting event data corresponding to the target object of the second event data does not exist in the first event data; determining a sum of the second quantity and the first quantity as a target quantity; The external device acquires event data of objects other than the target object in the second event data; The external device generates third event data according to the lifting event data of the target object, including: The external device generates the third event data according to the number of targets, the lifting event data or pressing event data of the second number of target objects, and the event data of objects other than the target objects in the second event data.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The external device sends the first event data to the electronic device.
6. The method according to any one of claims 1 to 4, It is characterized in that The external device obtains the second event data, including: When the external device determines that the first event data does not belong to preset abnormal event data, the external device obtains second event data; the preset abnormal event data includes no-touch event data and data of abnormal identification object touch.
7. The method according to claim 1, It is characterized in that The method further comprises: When the external device receives the screen-off instruction sent by the electronic device, the external device obtains fourth event data; the fourth event data is a frame of event data sent to the electronic device before the external device receives the screen-off instruction; If there is a target object whose event type is a press event in the fourth event data, the external device acquires a third number of target objects whose event type is a press event in the fourth event; The external device acquires event data of objects other than the target object in the fourth event data; The external device generates fifth event data according to the lift event data of the target object, the third number, and event data of objects other than the target object in the fourth event data.
8. The method according to claim 7, It is characterized in that The method further comprises: When the external device receives the screen-on instruction sent by the electronic device, it sends the fifth event data to the electronic device.
9. A data processing method, It is characterized in that Applied to an electronic device, the electronic device is communicatively connected to an external device, the external device includes at least one of a keyboard and a touchpad; the method includes: The electronic device receives first event data sent by the external device; the first event data is event data to be responded to by the electronic device, and the event data is used to characterize the object of the pressing operation and lifting operation on the keyboard or touchpad of the external device and the event type, and the event type includes a pressing event and a lifting event; The electronic device acquires second event data; the second event data is event data that has been responded to before the first event data; If the second event data contains a target object whose event type is a press event, and the first event data contains no lift event data and press event data corresponding to the target object, the electronic device creates lift event data for the target object according to the target object; If the second event data contains a target object whose event type is a press event, and the first event data contains press event data corresponding to the target object, the electronic device acquires the press event data of the target object; The electronic device generates third event data according to the lifting event data of the target object or the pressing event data of the target object; The electronic device performs a corresponding control operation based on the third event data; the control operation includes controlling cursor movement, controlling gesture movement, or a function control operation corresponding to the target object.
10. The method according to claim 9, It is characterized in that The method further comprises: After the screen is turned on, the electronic device acquires fourth event data; the fourth event data is the last frame of event data received and responded to by the electronic device before the screen is turned off; If the fourth event data contains a target object whose event type is a pressing event, the electronic device creates lifting event data of the target object according to the target object; The electronic device generates fifth event data according to the lifting event data of the target object; The electronic device performs a corresponding control operation based on the fifth event data.
11. An external device, It is characterized in that The external device includes a memory and one or more processors; the memory is coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-8.
12. The external device according to claim 11, It is characterized in that The external device further includes a touch panel; the touch panel is used to detect a pressing event and a lifting event of an object acting on the touch panel; and the event data of the pressing event and the lifting event of the object are sent to the processor; The processor is used to execute the method according to any one of claims 1 to 8.
13. The external device according to claim 12, It is characterized in that The processor is also used to send a control instruction to the touch panel to control the touch panel to enter a sleep mode or a power-off mode when receiving a screen-off instruction sent by the main device.
14. The external device according to claim 11, It is characterized in that The external device further comprises a button; the button is used to detect a pressing event and a lifting event of an object acting on the button, and send event data of the pressing event and the lifting event of the object to the processor; The processor executes the method according to any one of claims 1 to 8.
15. An electronic device, It is characterized in that The electronic device includes a memory, a display screen and one or more processors; the memory and the display screen are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as claimed in claim 9 or 10.
16. A computer-readable storage medium, It is characterized in that The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Touch data missing processing method, device and equipment and storage medium
CN109947287A
