Touch message fusion method, terminal, and computer-readable storage medium
By integrating the touch information of multiple touch screens into B protocol data and reporting it, the problem of dual-screen terminal devices being unable to recognize multiple fingers is solved, and effective tracking and response to cross-screen operations is achieved.
Patent Information
- Application Number
- CN201710789940.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-09-05
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2038-10-04
AI Technical Summary
Existing dual-screen terminal devices cannot properly respond to multiple fingers and track the touch trajectory of each finger when two touch screens are working at the same time, resulting in the system being unable to recognize multiple fingers operating simultaneously across screens.
Put the touch information from different touch screens into the cache queue, generate a reporting data array, and realize the fusion and reporting of multi-finger touch information through B protocol data encapsulation and synchronization event processing, so that the operating system can identify and track cross-screen operations.
It realizes the recognition and tracking of multiple fingers on multi-screen terminal devices, solves the technical problem of the system being unable to recognize multiple fingers and track each finger, and improves the responsiveness of cross-screen operations.
Smart Images

Figure CN109426430B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a touch message fusion method and terminal, and a computer-readable storage medium. Background Art
[0002] With the development of terminal technology, dual-screen terminal devices have emerged. In the dual-screen terminal devices in the prior art, each touch screen works independently, and the system can respond normally to the events of each touch screen. However, if the two touch screens work at the same time, the system will not be able to respond normally. This is because each individual touch screen device reports its own touch events, and the system cannot automatically integrate these protocols. Therefore, when the fingers across the screen operate simultaneously, the system cannot identify multiple fingers and track the touch trajectory of each finger. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a touch message fusion method and terminal, and a computer-readable storage medium to solve the technical problem that when two or more touch screens work simultaneously, the system cannot recognize multiple fingers and track the touch trajectory of each finger.
[0004] The technical solution adopted by the present invention to solve the above technical problems is as follows:
[0005] According to one aspect of the present invention, a touch message fusion method is provided, comprising:
[0006] Put the touch information of all touching fingers from at least two different touch screens into different cache queues for caching;
[0007] Intercept the header data of each cache queue and generate a reporting data array;
[0008] The state of the touching finger is acquired according to the reported data and encapsulated into a plurality of B protocol data.
[0009] In a possible design, the touch information includes coordinate information of a touching finger; and the step of placing the touch information from at least two different touch screens into a specific cache queue for caching includes:
[0010] Obtain the absolute coordinate information of the touching finger and the number information of the panel where the touching finger is located;
[0011] Converting the coordinate information of the touching finger according to the number information of the panel where the touching finger is located to obtain relative coordinate information;
[0012] The relative coordinate information is used as the coordinate information of the touching finger.
[0013] In a possible design, after acquiring the state of the touching finger according to the reported data and encapsulating it into a plurality of B protocol data, the method further includes:
[0014] The multiple B protocol data are reported through the same input device.
[0015] In a possible design, obtaining the state of the touching finger according to the reported data and encapsulating it into a plurality of B protocol data includes:
[0016] Traversing each touching finger in the reported data, generating Slot ID information, and encapsulating the touch information corresponding to the touching finger into a B protocol message and appending it to the corresponding Slot ID message;
[0017] When each touching finger in the reported data is updated, a synchronization event is reported.
[0018] In a possible design, acquiring the touch finger state according to the reported data and encapsulating it into a multi-finger touch B protocol includes:
[0019] When a touch screen starts to have a finger touching it from a state where all touch screens are not touched by a finger, a touch down message is reported.
[0020] In a possible design, obtaining the state of the touching finger according to the reported data and encapsulating it into a plurality of B protocol data includes:
[0021] When at least one touch screen is touched by a finger, and no finger is touched on any touch screen, a touch up message is reported.
[0022] In a possible design, after acquiring the state of the touching finger according to the reported data and encapsulating it into a plurality of B protocol data, the method further includes:
[0023] The reporting speed of the plurality of B protocol data is controlled according to a preset time interval.
[0024] In a possible design, the preset time interval t=1 / f*1000*1000-Tc-Tr; wherein Tc is the time required to obtain touch information of the touching finger, and Tr is the time required to encapsulate and report the B protocol data packet.
[0025] According to another aspect of the present invention, a terminal is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the touch message fusion method according to any embodiment of the present invention are implemented.
[0026] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a touch message fusion program is stored. When the touch message fusion program is executed by a processor, the steps of the touch message fusion method according to any embodiment of the present invention are implemented.
[0027] The touch message fusion method, terminal, and computer-readable storage medium provided in the embodiments of the present invention reorganize and fuse the touch information of all touching fingers from at least two different touch screens, so that the multi-finger data across the screens are fused into multiple B protocol data, which are reported to the operating system through an input device, so that the operating system can identify and track the simultaneous operations of all fingers across the screens. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of a flow chart of a touch message fusion method according to an embodiment of the present invention;
[0029] Figure 2 It is a schematic diagram of the flow of a touch message fusion method according to another embodiment of the present invention;
[0030] Figure 3 A schematic diagram of a dual-screen touch device according to an embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of touch information of the first touch screen and the second touch screen before fusion according to an embodiment of the present invention;
[0032] Figure 5 A schematic diagram of touch information of a first touch screen and a second touch screen after fusion according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of the structure of a terminal according to an embodiment of the present invention;
[0034] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0035] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and more understandable, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0036] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0037] like Figure 1 As shown, an embodiment of the present invention provides a touch message fusion method, including:
[0038] 101. Start.
[0039] 102. Put the touch information of all touching fingers from at least two different touch screens into different cache queues for cache.
[0040] The touch information includes at least one of the following: x and y coordinate information ABS_MT_POSITION_X and ABS_MT_POSITION_Y of the touching finger, area information ABS_MT_TOUCH_MAJOR and ABS_MT_TOUCH_MINOR of the touching finger, pressure information ABS_MT_PRESSURE of the touching finger, number information SLOT of the touching finger, and number information of the panel where the touching finger is located.
[0041] 103. Intercept the header data of each cache queue and generate a reporting data array.
[0042] Generally, the head data of the cache queue can be intercepted once every predetermined time, for example, 10ms; the predetermined time can also be the same or similar to the interval of the touch information acquisition time. It can be seen that each reported data array includes the touch information of all touching fingers at a time point.
[0043] 103. Acquire the state of the touching finger according to the reported data and encapsulate it into a plurality of B protocol data.
[0044] The touch information of each touching finger is obtained according to the reported data. Generally, starting from the first touching finger of the first touch screen, each touching finger of each screen is traversed to generate Slot ID information, and the corresponding x and y coordinates, area information, and pressure information are encapsulated into a B protocol message and attached to the corresponding Slot ID message.
[0045] 105. The end.
[0046] exist Figure 1 On the basis of the corresponding embodiment, the embodiment of the present invention further provides a touch message fusion method, after acquiring the state of the touch finger according to the reported data and encapsulating it into a plurality of B protocol data, it also includes:
[0047] The reporting speed of the plurality of B protocol data is controlled according to a preset time interval.
[0048] In one embodiment of the present invention, the preset time interval t=1 / f*1000*1000-Tc-Tr; wherein Tc is the time required to obtain touch information of the touching finger, and Tr is the time required to encapsulate and report the B protocol data packet.
[0049] On the basis of any of the above embodiments, an embodiment of the present invention further provides a touch message fusion method, wherein the touch information includes coordinate information of a touching finger; Figure 2 As shown, the step of placing the touch information from at least two different touch screens into a specific cache queue for caching includes:
[0050] 201, start;
[0051] 202. Obtain the absolute coordinate information of the touching finger and the number information of the panel where the touching finger is located.
[0052] The absolute coordinate information refers to the coordinates of the touching finger on the corresponding touch panel.
[0053] 203 . Convert the coordinate information of the touching finger according to the number information of the panel where the touching finger is located to obtain relative coordinate information.
[0054] Generally, according to the number of touch panels and their arrangement and combination, after selecting a panel with an origin, the coordinates of the x-axis or y-axis can be expanded so that all touch panels are in the same expanded coordinate system. Figure 3 For example, the multi-screen device includes a first touch screen 301 and a second touch screen 302 arranged side by side in a horizontal direction. At this time, the touch screen where the origin is located is the first touch screen 301; then the x-axis coordinates of the coordinates corresponding to the touching finger on the second touch screen need to increase the maximum value of the x-axis of the first touch screen 301. If the first touch screen and the second touch screen are arranged side by side in the vertical direction, the y-axis is expanded.
[0055] 204. Use the relative coordinate information as coordinate information of the touching finger.
[0056] 205. End.
[0057] On the basis of any of the above embodiments, an embodiment of the present invention further provides a touch message fusion method, wherein intercepting the header data of each cache queue and generating a reporting data array comprises:
[0058] The size of the reported data array is unchanged, and the cache queue may be empty, which means that there is no touching finger in the cache queue.
[0059] More specifically, the number of cache queues is fixed and is determined by the maximum number of touch fingers supported at the same time. For example, if each touch screen supports a maximum of 10 fingers and data information of n touch screens needs to be fused, the number of cache queues is 10n.
[0060] After the touch screen outputs an interrupt, the information of the finger is placed in the corresponding cache queue according to the finger id (number of fingers) reported by the firmware. Assuming that each touch screen supports 10 fingers, the 1st to 10th fingers of the first touch screen are placed in queues 0-9; the 1st to 10th fingers of the second touch screen are placed in queues 10-19; and so on, the mth finger of the nth screen is placed in queue (n-1)*10+(m-1); the data updated by each finger each time will be cached at the end of the corresponding cache queue.
[0061] In this embodiment, the multi-screen device includes a first touch screen and a second touch screen arranged side by side, and the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10; the coordinate information of the first touch screen and the second touch screen is as follows: Figure 4 As shown, at this time, the first touch screen and the second touch screen both have two touch fingers; in this embodiment, since the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10, there are 20 cache queues, and cache queues 0, 1 and cache queues 10, 11 all have data corresponding to the touch fingers, and the remaining cache queues do not have data corresponding to the touch fingers. At this time, the reported data array has a total of 20 header data, of which 16 header data are null values; in a specific implementation, the 20 header data can be arranged according to the arrangement order of the cache queues.
[0062] It should be noted that the coordinate information of the touching fingers in the cache queues may be absolute coordinate information, without the need to use relative coordinate information.
[0063] If relative coordinate information is used, there is no need to display all null values. After determining the total number of touching fingers, only null values can be retained for the touching fingers that leave subsequently. For example, at 160ms, the value corresponding to the first touching finger of the first touch screen is null.
[0064] On the basis of any of the above embodiments, an embodiment of the present invention further provides a touch message fusion method, wherein obtaining the state of the touch finger according to the reported data and encapsulating it into a plurality of B protocol data comprises:
[0065] Traversing each touching finger in the reported data, generating Slot ID information, and encapsulating the touch information corresponding to the touching finger into a B protocol message and appending it to the corresponding Slot ID message;
[0066] When each touching finger in the reported data is updated, a synchronization event is reported.
[0067] Each time the coordinates of the finger and other information are updated, the first reported Slot ID information is encapsulated into the input_mt_slot event report, and the information that needs to be updated is encapsulated into the corresponding protocol B information and reported to the system. After all finger information is updated, a synchronization event is reported to notify the system that the update is complete.
[0068] Generally, it may also include:
[0069] When a finger starts to touch a certain touch screen from a state where no finger is touching all touch screens, a touch down message is reported. That is, when a finger starts to touch a certain touch screen from a state where no finger is pressing on all touch screens, a touch down message is reported.
[0070] When at least one touch screen has a finger touching it, and no finger is touching any touch screen, a touch up message is reported. That is, after each update of the finger information, it is determined whether all fingers on the touch screen have been released. If all fingers have been released, a touch up message is reported to tell the system that all fingers have been released.
[0071] For example, a multi-screen device includes a first touch screen and a second touch screen arranged side by side, and the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10; if the first touch screen and the second touch screen both have two touch fingers; before the touch message is merged, the corresponding cache queue is as follows Figure 4 As shown; after the touch message is fused, the data that needs to be uploaded is as follows Figure 5 shown.
[0072] On the basis of any of the above embodiments, an embodiment of the present invention further provides a touch message fusion method, wherein after acquiring the state of the touch finger according to the reported data and encapsulating it into a plurality of B protocol data, the method further includes:
[0073] The multiple B protocol data are reported through the same input device.
[0074] The embodiment of the present invention also provides a terminal, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the touch message fusion method provided in the embodiment of the present invention when executed by the processor.
[0075] It should be noted that the above-mentioned computer program embodiment and method embodiment belong to the same concept, and their specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the device embodiment.
[0076] In specific implementation, Figure 6 As shown, the terminal may include an input buffer module 601 , a buffer interception module 602 , a data sorting and protocol encapsulation module 603 , and a reporting rate control module 604 .
[0077] The input buffer module 601 is used to put the touch information of all the touching fingers from at least two different touch screens into different buffer queues for buffering. The touch information includes at least one of the following: the x and y coordinate information ABS_MT_POSITION_X and ABS_MT_POSITION_Y of the touching finger, the area information ABS_MT_TOUCH_MAJOR and ABS_MT_TOUCH_MINOR of the touching finger, the pressure information ABS_MT_PRESSURE of the touching finger, the number information SLOT of the touching finger and the number information of the panel where the touching finger is located.
[0078] The cache interception module 602 is used to intercept the header data of each cache queue and generate a report data array. Generally, the header data of the cache queue can be intercepted once every predetermined time, for example, 10ms; the predetermined time can also be the same as or close to the interval of the touch information acquisition time. It can be seen that each report data array includes the touch information of all touching fingers at a time point.
[0079] The data sorting and protocol encapsulation module 603 is used to obtain the state of the touch finger according to the reported data and encapsulate it into a plurality of B protocol data. According to the reported data, the touch information of each touch finger is obtained. Generally, each touch finger of each screen is traversed from the first touch finger of the first touch screen, and SlotID information is generated. The corresponding x and y coordinates, area information, and pressure information are encapsulated into a B protocol message and attached to the corresponding Slot ID message.
[0080] The reporting rate control module 604 is used to control the reporting speed of the multiple B protocol data to the input system according to a preset time interval. In one embodiment of the present invention, the preset time interval t=1 / f*1000*1000-Tc-Tr; wherein Tc is the time required to obtain the touch information of the touch finger, and Tr is the time required to encapsulate and report the B protocol data packet.
[0081] In one embodiment of the present invention, the size of the reported data array is constant, and the cache queue may be empty, which indicates that there is no touching finger in the cache queue. More specifically, the number of cache queues is fixed, which is determined by the maximum number of touching fingers supported at the same time. For example, if each touch screen supports a maximum of 10 fingers, and currently needs to merge data information of n touch screens, the number of cache queues is 10n.
[0082] After the touch screen outputs an interrupt, the information of the finger is placed in the corresponding cache queue according to the finger id (number of fingers) reported by the firmware. Assuming that each touch screen supports 10 fingers, the 1st to 10th fingers of the first touch screen are placed in queues 0-9; the 1st to 10th fingers of the second touch screen are placed in queues 10-19; and so on, the mth finger of the nth screen is placed in queue (n-1)*10+(m-1); the data updated by each finger each time will be cached at the end of the corresponding cache queue.
[0083] In this embodiment, the multi-screen device includes a first touch screen and a second touch screen arranged side by side, and the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10; the coordinate information of the first touch screen and the second touch screen is as follows: Figure 4 As shown, at this time, the first touch screen and the second touch screen both have two touch fingers; in this embodiment, since the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10, there are 20 cache queues, and cache queues 0, 1 and cache queues 10, 11 all have data corresponding to the touch fingers, and the remaining cache queues do not have data corresponding to the touch fingers. At this time, the reported data array has a total of 20 header data, of which 16 header data are null values; in a specific implementation, the 20 header data can be arranged according to the arrangement order of the cache queues.
[0084] It should be noted that the coordinate information of the touching fingers in the cache queues may be absolute coordinate information, without the need to use relative coordinate information.
[0085] If relative coordinate information is used, there is no need to display all null values. After determining the total number of touching fingers, only null values can be retained for the touching fingers that leave subsequently. For example, at 160ms, the value corresponding to the first touching finger of the first touch screen is null.
[0086] In one embodiment of the present invention, the input buffer module 601 can obtain the absolute coordinate information of the touching finger and the number information of the panel where the touching finger is located. The absolute coordinate information refers to the coordinates of the touching finger on the corresponding touch panel. Then the input buffer module 601 can convert the coordinate information of the touching finger according to the number information of the panel where the touching finger is located to obtain relative coordinate information, and use the relative coordinate information as the coordinate information of the touching finger. Generally, according to the number of touch panels and their arrangement and combination, after selecting a panel with an origin, the coordinates of the x-axis or y-axis can be expanded so that all touch panels are in the same expanded coordinate system. Figure 3 For example, the multi-screen device includes a first touch screen 301 and a second touch screen 302 arranged side by side in a horizontal direction. At this time, the touch screen where the origin is located is the first touch screen 301; then the x-axis coordinates of the coordinates corresponding to the touching finger on the second touch screen need to increase the maximum value of the x-axis of the first touch screen 301. If the first touch screen and the second touch screen are arranged side by side in the vertical direction, the y-axis is expanded.
[0087] The data sorting and protocol encapsulation module 603 traverses each touch finger in the reported data, generates Slot ID information, and encapsulates the touch information corresponding to the touch finger into a B protocol message and appends it to the corresponding Slot ID message;
[0088] When each touching finger in the reported data is updated, a synchronization event is reported.
[0089] Each time the coordinates of the finger and other information are updated, the first reported Slot ID information is encapsulated into the input_mt_slot event report, and the information that needs to be updated is encapsulated into the corresponding protocol B information and reported to the system. After all finger information is updated, a synchronization event is reported to notify the system that the update is complete.
[0090] Generally, the data sorting and protocol encapsulation module 603 is also used to report touch down messages and touch up messages.
[0091] More specifically, when the user starts to touch at least one touch screen, that is, when a finger starts to touch a certain touch screen from a state where no finger is touching all the touch screens, a touch down message is reported.
[0092] When the user's fingers leave all touch screens, that is, when at least one touch screen is touched by a finger and all touch screens are no longer touched by a finger, a touch up message is reported to inform the system that all fingers have been released.
[0093] For example, a multi-screen device includes a first touch screen and a second touch screen arranged side by side, and the maximum number of touch fingers supported by the first touch screen and the second touch screen is 10; if the first touch screen and the second touch screen both have two touch fingers; before the touch message is merged, the corresponding cache queue is as follows Figure 4 As shown; after the touch message is fused, the data that needs to be uploaded is as follows Figure 5 shown.
[0094] An embodiment of the present invention further provides a computer-readable storage medium, on which a touch message fusion program is stored. When the touch message fusion program is executed by a processor, the steps of the touch message fusion method provided by the embodiment of the present invention are implemented.
[0095] It should be noted that the output program embodiment of the SDK library file on the above-mentioned computer-readable storage medium and the method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the device embodiment, which will not be repeated here.
[0096] The present invention provides a touch message fusion method and terminal, and a computer-readable storage medium, which simultaneously receives touch information of multiple touch fingers on multiple touch screens, reorganizes the fusion reported data and encapsulates it into multiple B protocol data, and reports it to the operating system through an input device, so that the operating system can identify and track the simultaneous operation of all fingers across the screen.
[0097] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. A person skilled in the art may implement the present invention in a variety of variations without departing from the scope and essence of the present invention, such as using a feature of one embodiment to obtain another embodiment. Any modification, equivalent substitution and improvement made within the technical concept of the present invention shall be within the scope of the present invention.
Claims
1. A touch message fusion method, characterized in that: include: Put the touch information from at least two different touch screens into a specific cache queue for caching; Each touching finger corresponds to one of the cache queues, and the touch information generated by each touching finger each time is arranged in the corresponding cache queue in chronological order; intercepting the header data of each cache queue and generating a reporting data array; each of the reporting data arrays includes touch information of all touching fingers of all touch screens at a time point; the touch information includes relative coordinate information of all touching fingers in a coordinate system obtained by expanding the coordinate system of any touch screen; Acquire the state of the touch finger according to the reported data array and encapsulate it into a plurality of B protocol data; The step of obtaining the state of the touch finger according to the reported data array and encapsulating it into a plurality of B protocol data comprises: Traversing each touching finger in the reported data array, generating Slot ID information, and encapsulating the touch information corresponding to the touching finger into a B protocol message and appending it to the corresponding SlotID message; The first reported Slot ID information is encapsulated into an input_mt_slot event report, and the information to be updated is encapsulated into corresponding protocol B information and reported to the system. When each touch finger in the reported data array is updated, a synchronization event is reported.
2. The touch message fusion method according to claim 1, characterized in that: The touch information includes coordinate information of the touching finger; and the step of placing the touch information from at least two different touch screens into a specific cache queue for caching includes: Get the absolute coordinate information of the touching finger and the number information of the panel where the touching finger is located; Converting the coordinate information of the touching finger according to the number information of the panel where the touching finger is located to obtain relative coordinate information; The relative coordinate information is used as the coordinate information of the touching finger.
3. The touch message fusion method according to claim 1, characterized in that: After acquiring the state of the touch finger according to the reported data array and encapsulating it into a plurality of B protocol data, the method further includes: The multiple B protocol data are reported through the same input device.
4. The touch message fusion method according to claim 1, characterized in that: The step of acquiring the touch finger state according to the reported data array and encapsulating it into a plurality of B protocol data further includes: When a touch screen starts to have a finger touching it from a state where all touch screens are not touched by a finger, a touch down message is reported.
5. The touch message fusion method according to claim 1, characterized in that: The step of acquiring the state of the touch finger according to the reported data array and encapsulating it into a plurality of B protocol data further includes: When at least one touch screen is touched by a finger, and no finger is touched on any touch screen, a touchup message is reported.
6. The touch message fusion method according to claim 1, characterized in that: After acquiring the state of the touch finger according to the reported data array and encapsulating it into a plurality of B protocol data, the method further includes: The reporting speed of the plurality of B protocol data is controlled according to a preset time interval.
7. The touch message fusion method according to claim 6, characterized in that: The preset time interval t=1 / f*1000*1000-Tc-Tr; wherein f is the reporting frequency, Tc is the time required to obtain the touch information of the touching finger, and Tr is the time required to encapsulate and report the B protocol data packet.
8. A terminal, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the touch message fusion method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a touch message fusion program, and when the touch message fusion program is executed by the processor, the steps of the touch message fusion method according to any one of claims 1 to 7 are implemented.
