Multi-point touch drawing method and device, terminal equipment and storage medium

By dynamically allocating touch information to native and inter-process communication channels, generating new touch events and data packets, the problem of slow response and stuttering in multi-touch rendering under high concurrency scenarios is solved, achieving cross-platform compatibility and stable multi-touch rendering effects.

CN122240221APending Publication Date: 2026-06-19WUHAN FENGQI INNOVATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN FENGQI INNOVATION TECHNOLOGY CO LTD
Filing Date
2026-02-11
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In high-concurrency scenarios, existing multi-touch drawing solutions on the Android platform suffer from slow response and lag, especially in multi-person collaboration or large-screen teaching environments. The implementation of web view components cannot effectively handle a large number of concurrent touch points, resulting in an unstable real-time interactive experience.

Method used

By parsing the original touch events, touch information is dynamically allocated to the native processing channel or the inter-process communication processing channel, and new touch events and communication data packets are generated and passed to the web page view layer for handwriting drawing. The mapping table is used to determine the historical allocation status of the touch points, optimize the processing load, and ensure cross-platform compatibility and stability in high-concurrency scenarios.

🎯Benefits of technology

It improves the real-time response capability and processing stability of multi-touch drawing, realizes efficient multi-touch drawing with cross-platform compatibility, avoids latency and stuttering caused by excessive load on a single processing channel, and ensures stable interaction in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240221A_ABST
    Figure CN122240221A_ABST
Patent Text Reader

Abstract

This application relates to the field of smart terminal technology and provides a multi-touch drawing method, apparatus, terminal device, and storage medium. The method includes: parsing original touch events to obtain touch information of touch points; dynamically allocating the touch information of the touch points to a native processing channel or an inter-process communication processing channel according to the historical allocation status of the touch points; generating new touch events based on the touch information of touch points allocated to the native processing channel; generating communication data packets based on the touch information of touch points allocated to the inter-process communication processing channel; and transmitting the new touch events and the communication data packets to a web page view layer, whereby the web page view layer performs handwriting drawing based on the new touch events and the communication data packets. This application can effectively improve the real-time response capability and processing stability of multi-touch drawing in high-concurrency scenarios while ensuring cross-platform compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart terminal technology, and in particular to a multi-touch drawing method, apparatus, terminal device and storage medium. Background Technology

[0002] In mobile application development, especially in interactive scenarios such as electronic whiteboards and collaborative editing, achieving smooth and accurate multi-touch rendering is a common requirement. Typically, on the Android platform, one approach relies entirely on the native Android view and drawing APIs for direct processing. While this approach guarantees performance, its implementation is highly coupled with the native platform, making cross-platform reuse difficult. Another approach is based on web view components, which use HTML5 Canvas to render the page, effectively leveraging the cross-platform nature of web technologies. This approach relies on passing system touch events to the web view, where internal script logic responds and drives the Canvas for rendering.

[0003] However, as the number of touch points required for simultaneous operation in interactive scenarios continues to increase, such as in multi-person collaboration or large-screen teaching environments, for implementation solutions based on web view components, when the number of concurrent touch points that need to be processed increases significantly, the inherent latency of touch event transmission becomes more obvious due to the need to go through multiple levels (system, web view kernel to script), which may lead to slow response, rendering stutter, or even application instability, seriously affecting the real-time interactive experience.

[0004] Therefore, how to effectively improve the real-time response capability of multi-touch rendering and the processing stability in high-concurrency scenarios while ensuring cross-platform compatibility is a problem that needs to be considered. Summary of the Invention

[0005] This application provides a multi-touch drawing method, apparatus, terminal device, and storage medium, which can effectively improve the real-time response capability and processing stability of multi-touch drawing in high-concurrency scenarios while ensuring cross-platform compatibility.

[0006] In a first aspect, embodiments of this application provide a multi-touch drawing method, including:

[0007] Parse the raw touch events to obtain the touch information of the touch points; Based on the historical allocation status of the touch points, the touch information of the touch points is dynamically allocated to the native processing channel or the inter-process communication processing channel. Based on the touch information of the touch points assigned to the native processing channel, a new touch event is generated; Based on the touch information of the touch points assigned to the inter-process communication processing channel, a communication data packet is generated; The new touch event and the communication data packet are respectively passed to the web page view layer, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

[0008] In one possible implementation of the first aspect, the touch information includes an identity identifier; the step of dynamically allocating the touch information of the touch point to a native processing channel or an inter-process communication processing channel according to the historical allocation status of the touch point includes: Determine whether the identity identifier of the touch point exists in the first mapping table or the second mapping table. The first mapping table is used to record touch points processed through the native processing channel, and the second mapping table is used to record touch points processed through the inter-process communication processing channel. If the identifier of the touch point exists in the first mapping table, then the touch information of the touch point is assigned to the native processing channel; If the identifier of the touch point exists in the second mapping table, then the touch information of the touch point is assigned to the inter-process communication processing channel.

[0009] In one possible implementation of the first aspect, the method further includes: If the identity identifier of the touch point does not exist in either the first mapping table or the second mapping table, then the touch point is identified as a new touch point; Get the number of touch points currently recorded in the first mapping table; If the number of touch points currently recorded in the first mapping table is less than the preset touch point number threshold, then the touch information of the new touch point is allocated to the native processing channel, and the identity of the new touch point is recorded in the first mapping table. If the number of touch points currently recorded in the first mapping table is greater than or equal to the touch point number threshold, then the touch information of the new touch point is allocated to the inter-process communication processing channel, and the identity of the new touch point is recorded in the second mapping table.

[0010] In one possible implementation of the first aspect, generating a new touch event based on touch information of the touch point allocated to the native processing channel includes: Based on the touch points assigned to the native processing channel, a set of touch points that need to be included in the new touch event is determined; the touch information of each touch point in the set of touch points is integrated and reconstructed to generate a new touch event; The generation of communication data packets based on touch information from touch points allocated to the inter-process communication processing channel includes: The touch information is encapsulated according to a preset format to generate a communication data packet.

[0011] In one possible implementation of the first aspect, the step of transmitting the new touch event and the communication data packet to the webpage view layer respectively includes: The new touch event is delivered directly to the webpage view layer; The communication data packets are sent to the webpage view layer through a communication link. The communication link includes multiple parallel sub-communication channels, wherein the sub-communication channels adopt a load balancing strategy to distribute communication data packets from different touchpoints to different sub-communication channels for transmission.

[0012] In one possible implementation of the first aspect, the method further includes: For a target touch point that is first assigned to the inter-process communication processing channel, when the original touch event is a touch press event, a sub-communication channel is dynamically assigned to the target touch point and a binding relationship is established. The communication data packets of the target touch point are transmitted through the sub-communication channel determined by the binding relationship. When a touch lift event is received at the target touch point, the binding relationship is released.

[0013] In one possible implementation of the first aspect, the webpage view layer performs handwriting drawing based on the new touch event and the communication data packet, including: The communication data packets are parsed to obtain parsed information; The new touch event and the parsed information are uniformly converted into a standard handwriting data format; The drawing is performed by calling the canvas interface through the drawing engine.

[0014] Secondly, embodiments of this application provide a multi-touch drawing device, including: The touch parsing unit is used to parse the original touch events and obtain the touch information of the touch points; The touch point allocation unit is used to dynamically allocate the touch information of the touch point to the native processing channel or the inter-process communication processing channel according to the historical allocation status of the touch point. The first processing unit is used to generate new touch events based on the touch information of the touch points allocated to the native processing channel; The second processing unit is used to generate communication data packets based on the touch information of the touch points allocated to the inter-process communication processing channel; The handwriting drawing unit is used to transmit the new touch event and the communication data packet to the web page view layer respectively, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

[0015] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the multi-touch drawing method as described in the first aspect above.

[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-touch drawing method as described in the first aspect above.

[0017] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the multi-touch drawing method as described in the first aspect above.

[0018] In this embodiment, touch information of the touch point is obtained by parsing the original touch event. The touch information is dynamically allocated to the native processing channel or the inter-process communication processing channel according to the historical allocation state of the touch point. This enables differentiated processing of touch points with different historical allocation states, allowing the two processing channels to perform their respective functions and cooperate with each other, thereby optimizing the processing load and improving the real-time response capability of multi-touch drawing. Generating new touch events based on the touch information allocated to the native processing channel ensures that the output of the native processing channel conforms to the processing specifications of the web page view layer, ensuring low-latency response of basic interactions. Generating communication data packets based on the touch information allocated to the inter-process communication processing channel ensures efficient transmission of this part of the touch information. The two data processing methods are mutually adapted and complementary, further optimizing data transmission and processing efficiency. Finally, the new touch event and the communication data packet are respectively transmitted to the web page view layer for unified handwriting drawing, which enables the drawing logic to be centralized in the web page view layer, avoiding deep binding of the drawing process to a specific operating system platform, and effectively ensuring the cross-platform compatibility of multi-touch drawing. The proposed solution can significantly improve the processing stability of multi-touch rendering in high-concurrency touch scenarios, achieving cross-platform compatibility, high real-time response efficiency, and stable multi-touch rendering performance in high-concurrency scenarios. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the implementation of the multi-touch drawing method provided in this application embodiment; Figure 2 This is a flowchart illustrating a specific implementation of step S102 in the multi-touch drawing method provided in this application embodiment; Figure 3 This is another specific implementation flowchart of step S102 in the multi-touch drawing method provided in the embodiments of this application; Figure 4 This is a flowchart illustrating a specific implementation of step S103 in the multi-touch drawing method provided in this application embodiment; Figure 5 This is a flowchart illustrating a specific implementation of the multi-touch drawing method provided in this application, which transmits data to the webpage view layer. Figure 6 This is a flowchart illustrating a specific implementation of the multi-touch drawing method provided in this application for drawing handwriting. Figure 7 This is a structural block diagram of the multi-touch drawing device provided in the embodiments of this application; Figure 8 This is a schematic diagram of the terminal device provided in the embodiments of this application. Detailed Implementation

[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0024] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0027] By way of example and not limitation, the multi-touch drawing method provided in this application is applicable to various types of terminal devices that need to perform multi-touch drawing. Specific terminal devices may include mobile phones, tablets, wearable devices, laptops, ultra-mobile personal computers (UMPCs), desktop computers, smart screens, and servers, etc. This application does not impose any restrictions on the specific type of terminal device.

[0028] Figure 1 The implementation flow of the multi-touch drawing method provided in this application embodiment is illustrated. The method flow includes steps S101 to S105. The specific implementation principle of each step is as follows: Step S101: Parse the original touch event and obtain the touch information of the touch point.

[0029] Raw touch events are standard input events collected and encapsulated by the input subsystem of the terminal device's operating system (such as Android). For example, the MotionEvent object in Android contains the raw data of all touch points at a given moment. Touch points are the touch locations formed when a user makes contact with the device screen using tools such as fingers or styluses.

[0030] In one possible implementation, the touch information is a structured data set, including but not limited to the identity of each touch point (i.e., a unique ID that remains unchanged throughout the entire lifecycle of the touch point, such as currentPid), screen coordinates (such as X and Y coordinates), pressure value, tool type (such as finger, stylus), contact area, and action type (such as ACTION_DOWN for single-point press, ACTION_POINTER_DOWN for multi-point press, ACTION_MOVE for movement, ACTION_UP / ACTION_POINTER_UP for release, etc.).

[0031] For example, when a user writes on the whiteboard application interface of an Android device with three fingers at the same time, the system generates a raw touch event. This raw touch event encapsulates all the input data of the three fingers pressing and moving. By parsing this raw touch event, complete touch information such as the identity of each of the three touch points, real-time screen coordinates, pressing pressure value, pressing tool type, pressing contact area, and pressing action type can be obtained, clarifying the operation state and position changes of each finger.

[0032] In one possible implementation, the touch information also includes a touch point index. The touch point index is used to identify the positional order of the touch points in the processing channel and to distinguish the sequence information of different touch points. The processing channel assigns a unique raw index to each touch point it is assigned to for internal data processing and management.

[0033] In this embodiment, by performing in-depth analysis on the original touch events received by the system, the touch information of all touch points required to construct the subsequent processing flow is completely and accurately extracted, ensuring the smooth progress of the entire multi-touch drawing process.

[0034] Step S102: Based on the historical allocation status of the touch point, dynamically allocate the touch information of the touch point to the native processing channel or the inter-process communication processing channel.

[0035] The historical allocation status of a touch point indicates whether the touch point has been assigned a processing channel before the current original touch event. Based on the historical allocation status of a touch point, it can be determined whether the touch point has been assigned a processing channel before, and to which processing channel it was assigned.

[0036] The native processing channel is a data path that processes touch information based on the native environment of the operating system; the inter-process communication processing channel (IPC channel) is a data path that transmits and processes touch information based on the inter-process communication mechanism.

[0037] In one possible implementation, the native processing channel is used to process contacts whose historical allocation status indicates that they have been managed by it, or whose number does not exceed the preset contact number threshold of the native processing channel, without the need for additional cross-process communication; the inter-process communication processing channel is used to process contacts assigned to the channel, and realizes data interaction with the web page view layer through an independent communication link.

[0038] In one possible implementation, for touch points whose historical allocation status indicates that they have previously been allocated to the native processing channel, their current touch information will continue to be allocated to the native processing channel; for touch points whose historical allocation status indicates that they have previously been allocated to the inter-process communication processing channel, their current touch information will continue to be allocated to the inter-process communication processing channel.

[0039] In one possible implementation, for new touch points without any historical allocation records, they are dynamically allocated to one of the two processing channels based on the resource availability of the two processing channels, thereby achieving intelligent diversion of touch information.

[0040] In this embodiment of the application, by differentiating the touch information of touch points with different historical allocation states, it is ensured that each touch point can be allocated to a suitable processing channel, thereby avoiding all touch data from congesting a single processing channel from the source, which helps to achieve stable high-concurrency processing.

[0041] As one possible implementation of this application, the touch information includes an identity identifier; Figure 2 A specific implementation flow of step S102 in the multi-touch drawing method provided in this application embodiment is shown below: A1: Determine whether the identity identifier of the touch point exists in the first mapping table or the second mapping table. The first mapping table is used to record touch points processed through the native processing channel, and the second mapping table is used to record touch points processed through the inter-process communication processing channel.

[0042] The contact identifier is the unique identification information of the contact, which remains unchanged throughout the entire life cycle of the contact. It is used to accurately track and distinguish different contacts, and is also the key to mapping table recording and querying.

[0043] The first and second mapping tables are two global data structures maintained by the system to continuously record the identity identifiers of contacts managed by different processing channels, thereby representing the historical allocation status of the contacts. Specifically, the first mapping table is used to track and record all contacts processed through the native processing channel in real time. Its recorded content includes the contact's identity identifier, which can be used to directly confirm whether the contact was previously assigned to the native processing channel, i.e., the contact's historical allocation status. The second mapping table is used to track and record all contacts processed through the inter-process communication processing channel in real time. Its recorded content is also the contact's identity identifier, used to confirm whether the contact was previously assigned to the inter-process communication processing channel.

[0044] After parsing and obtaining the contact's identity identifier, the first mapping table and the second mapping table are queried respectively to determine whether the identity identifier is recorded in either of the mapping tables. During the query process, the contact's identity identifier is used as the only query condition to match the records in the two mapping tables one by one. If the same identity identifier is matched, it is determined that the identity identifier exists in the corresponding mapping table. If no match is found, it is determined that the identity identifier does not exist in either mapping table, thereby determining the historical allocation status of the contact.

[0045] For example, when a contact with the identifier 5 is parsed, the system first searches for the identifier 5 in the first mapping table that records native channel contacts and the second mapping table that records IPC channel contacts. If the identifier 5 is matched in the first mapping table, it is determined that the identifier exists in the first mapping table; if the identifier 5 is matched in the second mapping table, it is determined that the identifier exists in the second mapping table; if it is not matched in either mapping table, it is determined that the identifier does not exist in either mapping table.

[0046] A2: If the identity of the touch point exists in the first mapping table, then the touch information of the touch point is assigned to the native processing channel.

[0047] When the identity of the touch point is confirmed to exist in the first mapping table, it means that the touch point has been previously assigned to the native processing channel for processing and belongs to a touch point with a clear historical assignment status. At this time, the touch information of the touch point in this current operation is directly assigned to the native processing channel to ensure that all touch information of the touch point is processed in the same processing channel and to maintain the continuity of touch point processing.

[0048] A3: If the identity of the touch point exists in the second mapping table, then the touch information of the touch point is allocated to the inter-process communication processing channel.

[0049] When the identity of the touch point is confirmed to exist in the second mapping table, it means that the touch point has been previously assigned to the inter-process communication processing channel for processing, and it also belongs to the touch point with a clear historical assignment status. At this time, the touch information of the touch point this time is directly assigned to the inter-process communication processing channel to ensure that all touch information of the touch point is processed in the same processing channel, and to maintain the continuity of touch point processing.

[0050] In this embodiment, the identity of the touch point is queried through the first mapping table and the second mapping table to accurately determine the historical allocation status of the touch point, clarify whether the touch point has been allocated a processing channel before and the specific channel type. For touch points that have been historically allocated to the native processing channel or the inter-process communication processing channel, their original processing channel is continued to ensure that all touch information of the same touch point is processed in the same channel. This avoids touch point status confusion, data loss or processing delay caused by changing the processing channel, ensures the continuity and stability of channel processing, makes full use of the processing advantages of the native processing channel, and fully leverages the transmission and processing advantages of the inter-process communication processing channel in high-concurrency scenarios.

[0051] As one possible implementation of this application Figure 3 Another specific implementation flow of step S102 in the multi-touch drawing method provided in the embodiments of this application is shown below: B1: If the identity identifier of the touch point does not exist in either the first mapping table or the second mapping table, then the touch point is identified as a new touch point.

[0052] If, after verification, the contact's identity is not recorded in either the first or second mapping table, then the contact is determined to have no historical allocation status and is identified as a new contact.

[0053] B2: Get the number of touch points currently recorded in the first mapping table.

[0054] The number of contacts currently recorded in the first mapping table is the total number of contacts that are currently being processed through the native processing channel and are in an active state. This number of contacts reflects the current load and remaining processing capacity of the native processing channel.

[0055] B3: If the number of touch points currently recorded in the first mapping table is less than the preset touch point number threshold, then the touch information of the new touch point is allocated to the native processing channel, and the identity of the new touch point is recorded in the first mapping table.

[0056] B4: If the number of touch points currently recorded in the first mapping table is greater than or equal to the touch point number threshold, then the touch information of the new touch point is allocated to the inter-process communication processing channel, and the identity of the new touch point is recorded in the second mapping table.

[0057] The preset touch point number threshold is a pre-set value, such as MAX_POINTERS, used to define the maximum processing capacity of the native processing channel. It is a configurable parameter used to limit the number of touch points processed by the native processing channel, preventing processing delays or anomalies due to excessive load, thereby ensuring the processing efficiency and stability of the native processing channel. In one possible implementation, the preset touch point number threshold can be customized based on the device type, touch tool type, or application scenario.

[0058] The number of touch points currently recorded in the first mapping table is compared with a preset touch point threshold. If the current number of touch points is less than the preset threshold, it indicates that the native processing channel has remaining processing capacity. In this case, the touch information of the new touch point is allocated to the native processing channel, and the identity of the new touch point is added to the first mapping table for recording, updating the touch point management status of the first mapping table. If the current number of touch points is greater than or equal to the preset touch point threshold, it indicates that the native processing channel has no remaining processing capacity. In this case, the touch information of the new touch point is allocated to the inter-process communication processing channel, and the identity of the new touch point is added to the second mapping table for recording, updating the touch point management status of the second mapping table. Real-time updates to the touch point management status of the mapping table facilitate quick querying of its historical allocation status when the touch point generates touch information again.

[0059] For example, if a touch point has been previously assigned to the native processing channel for processing during the writing process, and this touch point moves to form new touch information, the touch information corresponding to the move will continue to be assigned to the native processing channel according to its historical assignment status; if a new touch point has no historical assignment record and the native processing channel still has remaining processing resources, its touch information will be assigned to the native processing channel; if the native processing channel has no remaining processing resources, its touch information will be assigned to the inter-process communication processing channel.

[0060] In this embodiment, orderly and differentiated processing of touch points with different historical allocation states is achieved, so that the native processing channel and the inter-process communication processing channel perform their respective functions and cooperate with each other, avoiding processing congestion caused by a single processing channel bearing the entire touch point load, thereby improving the overall processing efficiency of touch point touch information.

[0061] Step S103: Generate a new touch event based on the touch information of the touch points assigned to the native processing channel.

[0062] The new touch events are formed by integrating and reconstructing the touch information allocated to the native processing channel, and they conform to the web page view layer processing specifications. Compared with the original touch events, the format and semantics of the new touch events have been optimized, and they can be directly recognized and processed by the web page view layer. Converting the touch information of the native processing channel into a form that the web page view layer can directly recognize and process avoids rendering anomalies caused by format incompatibility, ensuring that the touch information of the native processing channel can be effectively utilized.

[0063] As one possible implementation of this application Figure 4 A specific implementation flow of step S103 in the multi-touch drawing method provided in this application embodiment is shown below: C1: Based on the touches assigned to the native processing channel, determine the set of touches that should be included in the new touch event.

[0064] The touch points assigned to the native processing channel refer to all touch points that are assigned to the native processing channel for subsequent processing after the traffic splitting decision in step S102. The touch point set is the collection of all valid touch points assigned to the native processing channel that need to be included in the same new touch event after filtering. This set contains multiple touch points and their corresponding complete touch information. The new touch event is formed by integrating and reconstructing the touch information of the touch points assigned to the native processing channel. It is a touch event that conforms to the webpage view layer processing specifications and can be directly recognized and processed by the webpage view layer.

[0065] In one possible implementation, all touchpoints assigned to the native processing channel are screened for validity, and invalid touchpoints are removed. Invalid touchpoints include, but are not limited to, touchpoints that have been released and have no subsequent operation, touchpoints with missing or abnormal touch information. The remaining valid touchpoints are then integrated into a touchpoint set, ensuring that the touch information of each touchpoint included in the set is complete and valid. The touchpoint set is a dynamic collection that reflects the current valid native interaction state.

[0066] For example, for a touch point that has just undergone an ACTION_UP action, after updating the first mapping table to clear its state record, the touch point will no longer be included in subsequent synthesized new touch events.

[0067] C2: Integrate and reconstruct the touch information of each touch point in the set of touch points to generate new touch events.

[0068] In one possible implementation, the integration and reconstruction includes remapping the touch point index and reconstructing the action semantics. Remapping the touch point index involves assigning each touch point an internal index position in the new touch event based on the new order in the touch point set. Reconstructing the action semantics involves recalculating the masked action type identifier (actionMasked value) based on the original action type (press, move, release) that triggered the touch event and the touch point's index position in the new touch point set, ensuring that the action semantics remain accurate after the touch point index remapping. This actionMasked value can be calculated using bitwise operations.

[0069] In one possible implementation, the reconstruction of action semantics is based on the touch information of each touch point in the touch point set. The original action type (press, move, release) of each touch point is extracted, and the original action type is validated to eliminate abnormal action types (such as invalid actions without corresponding touch operations or actions that do not match coordinate changes). Based on the action timestamps of each touch point, the action sequence of different touch points is associated to clarify the order of actions between multiple touch points. The validated action type and the associated action sequence are bound to the remapped touch point index to form a complete and coherent action semantics, ensuring that the web page view layer can accurately identify the operation intention and operation sequence of each touch point.

[0070] In this embodiment, valid touch points allocated to the native processing channel are selected and integrated to form a touch point set. The scope and object of event reconstruction are clarified to avoid the touch information of invalid or abnormal touch points affecting the generation quality of new touch events. Then, the touch information in the touch point set is reconstructed to generate new touch events, ensuring that the valid touch information of the native processing channel can be accurately identified and utilized by the web page view layer.

[0071] Step S104: Generate a communication data packet based on the touch information of the touch point assigned to the inter-process communication processing channel.

[0072] Communication data packets are data carriers formed by extracting and serializing the touch information from the touch points allocated to the inter-process communication processing channel. They are used for efficient transmission of inter-process communication data packets, which can effectively reduce the amount of data transmitted and improve transmission efficiency. In one possible implementation, the touch information is encapsulated according to a preset format to generate a communication data packet.

[0073] A preset format is a predefined set of data organization rules and serialization protocols for efficient and standardized cross-process data exchange. It specifies the data arrangement order, field separation method, data type, and encoding rules in communication data packets, aiming to eliminate redundant information, extract core interactive data, and form a compact and easily parsed data structure. For example, one preset format is to combine key fields in touch information, such as identity identifier, action type, X coordinate, Y coordinate, and tool type, in sequence, separated by commas, into a single string. For instance, touch information can be serialized into a standard data structure string like id, action, x, y, tooltype, etc.

[0074] In one possible implementation, before encapsulating the touch information according to a preset format, the acquired touch information is filtered for validity, and invalid touch information (such as touch information where the touch point has been released and there is no subsequent operation, missing data, or abnormal touch information) is removed, while complete and valid touch information is retained.

[0075] In this embodiment, touch information is standardized and encapsulated through a preset format, ensuring that all generated communication data packets have a unified structure and standardized format. This converts the touch information of the inter-process communication processing channel into a form suitable for cross-process transmission, effectively reducing the amount of data transmission, improving the data transmission efficiency between processes, and ensuring that the touch information of the inter-process communication processing channel can be transmitted to the web page view layer quickly and accurately, avoiding rendering stuttering caused by transmission delay.

[0076] Step S105: The new touch event and the communication data packet are respectively transmitted to the web page view layer, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

[0077] The web view layer is a component embedded in a native mobile application, used to directly display and interact with web page content within the application's interface without launching a separate external browser. On the Android platform, the web view layer is typically implemented as a WebView; on other operating system platforms, such as iOS, HarmonyOS, or desktop environments, similar or identical web view layers exist (such as WKWebView, UIWebView, or webview components based on corresponding frameworks). The web view layer is the core layer that carries the handwriting drawing logic and receives and processes touch-related data. The web view layer can receive data from different processing channels.

[0078] In this embodiment, the touch information from the two processing channels is uniformly summarized and transmitted to the web page view layer to ensure that the web page view layer can obtain complete touch information of all touch points, thus ensuring the integrity and accuracy of handwriting drawing. At the same time, the drawing logic is centralized in the web page view layer to complete the entire multi-touch drawing process, achieving real-time and stable handwriting presentation and avoiding deep binding of the drawing logic to specific operating system platforms.

[0079] As one possible implementation of this application Figure 5 This paper illustrates a specific implementation flow of the multi-touch drawing method provided in this application, which involves transmitting new touch events and communication data packets to the webpage view layer. The details are as follows: D1: Deliver the new touch event directly to the webpage view layer.

[0080] Direct delivery refers to utilizing the built-in event dispatch mechanism provided by the operating system itself. In this embodiment, the generated new touch event is treated as a standard system input event and passed to the web view layer, which is one of the current interface components. In one possible implementation, on the Android platform, direct delivery is achieved by calling system APIs such as View.dispatchTouchEvent. The web view layer, as the event receiver, receives this event directly through its internal native event handling interface. For example, a MotionEvent object containing multiple touch point information can be directly dispatched to the WebView component through the event pipeline of the Android framework layer.

[0081] By delivering new touch events directly to the webpage view layer, a transmission path with the lowest latency and processing overhead is provided for touch information allocated to the native processing channel, fully leveraging the efficiency of the operating system's native mechanisms to ensure real-time response of basic interactions.

[0082] D2: The communication data packet is sent to the webpage view layer through the communication link. The communication link contains multiple parallel sub-communication channels. The sub-communication channels adopt a load balancing strategy to distribute communication data packets from different touchpoints to different sub-communication channels for transmission.

[0083] A communication link is a dedicated data transmission channel established to enable data transmission between the inter-process communication processing channel and the web page view layer. Sub-communication channels are multiple parallel data transmission channels divided within the communication link. Each sub-communication channel can independently handle the transmission of communication data packets. Multiple sub-communication channels working in parallel can improve the overall transmission capacity and efficiency of the communication link. For example, a connection pool composed of multiple parallel WebSocket connections. A load balancing strategy refers to a pre-configured strategy for distributing communication data packets from different points to various sub-communication channels. Its key is to evenly distribute communication data packets from different points to each sub-communication channel based on the current load of each sub-communication channel (such as the number of communication data packets currently being transmitted and the transmission latency), avoiding transmission delays caused by excessive load on a single sub-communication channel.

[0084] For example, a communication link containing six sub-WebSocket channels can send communication data packets from contacts A, C, and E through channels 1, 3, and 5, while sending communication data packets from contacts B, D, and F through channels 2, 4, and 6, thus distributing the transmission load. By using multi-channel parallel transmission and load balancing, it avoids the congestion of all high-concurrency communication data packets on a single communication channel, preventing serialization and queuing delays. This significantly improves the overall throughput of data transmission, reduces average latency, and ensures that high-concurrency contact data is delivered to the web page view layer in a timely manner.

[0085] In one possible implementation, for a target touch point that is first assigned to the inter-process communication processing channel, when the original touch event is a touch press event, a sub-communication channel is dynamically allocated to the target touch point and a binding relationship is established. The communication data packets of the target touch point are transmitted through the sub-communication channel determined by the binding relationship. When a touch release event of the target touch point is received, the binding relationship is released.

[0086] A target touchpoint refers to the touchpoint that is first assigned to the inter-process communication channel. A touch press event is a type of touchpoint action, referring to the touch action formed when the user presses the device screen for the first time using an operating medium (finger, stylus). It is the first touch action generated by the target touchpoint and corresponds to the press action in the touch information. A touch release event is another type of touchpoint action, referring to the touch action formed when the user removes the device screen using an operating medium. It marks the end of the target touchpoint's lifecycle.

[0087] Dynamic allocation refers to dynamically allocating and associating a specific sub-communication channel with a target touch point. The binding relationship refers to the unique correspondence between the target touch point's identifier and the allocated and associated sub-communication channel. After the binding relationship is established, all communication data packets generated by the target touch point during the current touch session (from press to release) are transmitted through this allocated sub-communication channel until the touch release event occurs. At this point, the binding relationship is released, the sub-communication channel resource is released, and it can be reused by other touch points.

[0088] For example, when a contact with contact ID 5 is pressed for the first time and assigned to an IPC channel, it is assigned to sub-communication channel 2 through a load balancing strategy; thereafter, all communication data packets corresponding to the movement and release events of the contact with ID 5 are transmitted through the assigned sub-communication channel 2.

[0089] In this embodiment, by dynamically allocating and unbinding the sub-communication channel with the target touch point, it is ensured that all communication data packets of the target touch point initially allocated to the inter-process communication processing channel are transmitted through the same sub-communication channel. This avoids problems such as transmission timing disorder and data discontinuity caused by different communication data packets being allocated to different sub-communication channels, thus ensuring the continuity of touch information transmission of the target touch point. At the same time, when the target touch point finishes its touch operation, the binding relationship is released, releasing the load of the sub-communication channel, realizing the rational use of sub-communication channel resources, avoiding resource waste, further optimizing the load balancing effect, and improving the overall transmission efficiency and stability of the communication link.

[0090] In one possible implementation, the webpage view layer includes a driver module, a data standardization layer, and a rendering engine. These three components work collaboratively to receive, process, and render new touch events and communication data packets. The driver module, the control module of the webpage view layer, receives new touch events and communication data packets from external sources, performs preliminary data verification, and coordinates the timing of the data standardization layer and the rendering engine to ensure the orderly execution of data processing and rendering. The data standardization layer, responsible for data format unification, standardizes new touch events and communication data packets transmitted by the driver module, ensuring consistent format and data items for touch information from multiple sources, providing standardized rendering data for the rendering engine. The rendering engine, the core module responsible for rendering, receives standardized touch information from the data standardization layer, performs path drawing and rendering update operations based on the touch information, and converts touch operations at the touch points into visual handwriting in real time, completing the presentation of multi-touch handwriting.

[0091] As one possible implementation of this application Figure 6 This paper illustrates a specific implementation flow of drawing handwriting in a webpage view layer in the multi-touch drawing method provided in this application embodiment, detailed below: E1: The communication data packet is parsed to obtain parsed information.

[0092] Parsing communication data packets refers to the operations performed by the data normalization layer of the web page view layer, including deserialization, data extraction, and validity verification, on the received communication data packets. The purpose is to convert the encapsulated communication data packets into raw touch-related data that can be recognized and utilized by subsequent processing modules in the web page view layer. Parsed information refers to the complete and valid touch information extracted after parsing the communication data packets. Its data content is consistent with the touch information before encapsulation and can be directly used for subsequent format conversion operations.

[0093] In one possible implementation, the driver module transmits communication data packets to the data standardization layer. The data standardization layer first verifies the integrity and format validity of the communication data packets, eliminating damaged or abnormally formatted data packets to ensure the reliability of the data to be parsed. Subsequently, it performs deserialization processing on the verified communication data packets, extracting the touch information contained in the data packets according to the preset format when the communication data packets were encapsulated. It then verifies the validity of the extracted core touch data, eliminating invalid data (such as coordinates exceeding the screen range, abnormal pressure values, etc.), and integrates the verified touch information to form the parsed information.

[0094] E2: Convert the new touch event and the parsed information into a standard handwriting data format.

[0095] The standard handwriting data format is a unified data format pre-configured in the webpage view layer, suitable for the drawing engine to recognize and draw. It clarifies the data type, arrangement order, and precision requirements of key data items required for handwriting drawing (such as touch point identification, action type, X and Y coordinates, pressure value, drawing sequence, etc.), and is the key to ensuring that the drawing engine can uniformly process multi-source data and achieve coherent handwriting drawing.

[0096] In one possible implementation, the data standardization layer of the webpage view layer performs format adaptation and calibration on the touch information in the new touch event and the parsed information obtained by parsing the communication data packet, respectively, to convert the two types of data from different sources and with different initial formats into unified data that meets the requirements of the standard handwriting data format, ensuring that the structure, accuracy and data items of the two types of data are completely consistent.

[0097] E3: Performs drawing by calling the canvas interface through the drawing engine.

[0098] The canvas interface is the interaction interface between the drawing engine and the device's display canvas. It is provided by the web page view layer and is used to receive drawing instructions and standard handwriting data sent by the drawing engine. It converts the drawing instructions into display operations that can be executed by the device, so as to realize the visual presentation of handwriting on the canvas.

[0099] In this embodiment, the encapsulated communication data packet is converted into parsed information that can be used in subsequent processing stages, and the new touch event and parsed information are uniformly converted into a standard handwriting data format. This ensures that the touch information from the two sources has a unified structure, consistent data items, and clear timing, avoiding drawing anomalies caused by format chaos. Then, the drawing engine calls the canvas interface to realize efficient interaction between drawing instructions and the device display canvas, ensuring the real-time performance and accuracy of handwriting drawing, thereby completing the real-time presentation of multi-touch handwriting.

[0100] As can be seen from the above, in this embodiment, by parsing the original touch events to obtain the touch information of the touch points, and dynamically allocating the touch information to the native processing channel or the inter-process communication processing channel according to the historical allocation state of the touch points, differentiated processing of touch points with different historical allocation states can be achieved. This allows the two processing channels to perform their respective functions and cooperate with each other, thereby optimizing the processing load and improving the real-time response capability of multi-touch drawing. Generating new touch events based on the touch information allocated to the native processing channel ensures that the output of the native processing channel conforms to the processing specifications of the web page view layer, ensuring low-latency response of basic interactions. Generating communication data packets based on the touch information allocated to the inter-process communication processing channel ensures efficient transmission of this part of the touch information. The two data processing methods are mutually compatible and complementary, further optimizing data transmission and processing efficiency. Finally, the new touch events and communication data packets are respectively transmitted to the web page view layer for unified handwriting drawing, which enables the drawing logic to be centralized in the web page view layer, avoiding deep binding of the drawing process to specific operating system platforms, and effectively ensuring the cross-platform compatibility of multi-touch drawing. The proposed solution can significantly improve the processing stability of multi-touch rendering in high-concurrency touch scenarios, achieving cross-platform compatibility, high real-time response efficiency, and stable multi-touch rendering performance in high-concurrency scenarios.

[0101] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0102] Corresponding to the multi-touch drawing method described in the above embodiments, Figure 7 A structural block diagram of a multi-touch drawing device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0103] Reference Figure 7 The multi-touch drawing device includes: a touch parsing unit 71, a touch point allocation unit 72, a first processing unit 73, a second processing unit 74, and a handwriting drawing unit 75, wherein: Touch parsing unit 71 is used to parse the original touch event and obtain the touch information of the touch point; The touch point allocation unit 72 is used to dynamically allocate the touch information of the touch point to the native processing channel or the inter-process communication processing channel according to the historical allocation status of the touch point. The first processing unit 73 is used to generate a new touch event based on the touch information of the touch point allocated to the native processing channel; The second processing unit 74 is used to generate communication data packets based on the touch information of the touch points allocated to the inter-process communication processing channel; The handwriting drawing unit 75 is used to transmit the new touch event and the communication data packet to the web page view layer respectively, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

[0104] As one possible implementation of this application, the touch information includes an identity identifier; the touch point allocation unit 72 includes: An identification presence determination module is used to determine whether the identity identifier of the touch point exists in a first mapping table or a second mapping table. The first mapping table is used to record touch points processed through the native processing channel, and the second mapping table is used to record touch points processed through the inter-process communication processing channel. The first allocation module is used to allocate the touch information of the touch point to the native processing channel if the identity identifier of the touch point exists in the first mapping table. The second allocation module is used to allocate the touch information of the touch point to the inter-process communication processing channel if the identity identifier of the touch point exists in the second mapping table.

[0105] As one possible implementation of this application, the contact allocation unit 72 further includes: The new touch point determination module is used to determine the touch point as a new touch point if the identity identifier of the touch point does not exist in either the first mapping table or the second mapping table. The quantity acquisition module is used to acquire the number of touch points currently recorded in the first mapping table; The third allocation module is used to allocate the touch information of the new touch point to the native processing channel if the number of touch points currently recorded in the first mapping table is less than a preset touch point number threshold, and to record the identity of the new touch point in the first mapping table. The fourth allocation module is used to allocate the touch information of the new touch point to the inter-process communication processing channel if the number of touch points currently recorded in the first mapping table is greater than or equal to the touch point number threshold, and to record the identity of the new touch point in the second mapping table.

[0106] As one possible implementation of this application, the first processing unit 73 is specifically used for: Based on the touch points assigned to the native processing channel, a set of touch points that need to be included in the new touch event is determined; the touch information of each touch point in the set of touch points is integrated and reconstructed to generate a new touch event.

[0107] As one possible implementation of this application, the second processing unit 74 is specifically used for: The touch information is encapsulated according to a preset format to generate a communication data packet.

[0108] As one possible implementation of this application, the handwriting drawing unit 75 includes: The first delivery module is used to directly deliver the new touch event to the webpage view layer; The second transmission module is used to send the communication data packet to the web page view layer through the communication link. The communication link includes multiple parallel sub-communication channels, wherein the sub-communication channels adopt a load balancing strategy to distribute the communication data packets of different touchpoints to different sub-communication channels for transmission.

[0109] As one possible implementation of this application, the second transmission module is further configured to: For a target touch point that is first assigned to the inter-process communication processing channel, when the original touch event is a touch press event, a sub-communication channel is dynamically assigned to the target touch point and a binding relationship is established. The communication data packets of the target touch point are transmitted through the sub-communication channel determined by the binding relationship. When a touch lift event is received at the target touch point, the binding relationship is released.

[0110] As one possible implementation of this application, the handwriting drawing unit 75 further includes a drawing module, used for: The communication data packets are parsed to obtain parsed information; The new touch event and the parsed information are uniformly converted into a standard handwriting data format; The drawing is performed by calling the canvas interface through the drawing engine.

[0111] As can be seen from the above, in this embodiment, by parsing the original touch events to obtain the touch information of the touch points, and dynamically allocating the touch information to the native processing channel or the inter-process communication processing channel according to the historical allocation state of the touch points, differentiated processing of touch points with different historical allocation states can be achieved. This allows the two processing channels to perform their respective functions and cooperate with each other, thereby optimizing the processing load and improving the real-time response capability of multi-touch drawing. Generating new touch events based on the touch information allocated to the native processing channel ensures that the output of the native processing channel conforms to the processing specifications of the web page view layer, ensuring low-latency response of basic interactions. Generating communication data packets based on the touch information allocated to the inter-process communication processing channel ensures efficient transmission of this part of the touch information. The two data processing methods are mutually compatible and complementary, further optimizing data transmission and processing efficiency. Finally, the new touch events and communication data packets are respectively transmitted to the web page view layer for unified handwriting drawing, which enables the drawing logic to be centralized in the web page view layer, avoiding deep binding of the drawing process to specific operating system platforms, and effectively ensuring the cross-platform compatibility of multi-touch drawing. The proposed solution can significantly improve the processing stability of multi-touch rendering in high-concurrency touch scenarios, achieving cross-platform compatibility, high real-time response efficiency, and stable multi-touch rendering performance in high-concurrency scenarios.

[0112] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0113] This application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements... Figures 1 to 6 The steps of any multi-touch drawing method are represented.

[0114] This application embodiment also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements... Figures 1 to 6 The steps of any multi-touch drawing method are represented.

[0115] This application also provides a computer program product that, when run on a terminal device, causes the terminal device to execute the implementation of... Figures 1 to 6 The steps of any multi-touch drawing method are represented.

[0116] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. For example... Figure 8As shown, the terminal device 8 in this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, it implements the steps in the various multi-touch drawing method embodiments described above, for example... Figure 1 Steps S101 to S105 are shown. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 7 The functions of units 71 to 75 shown.

[0117] For example, the computer program 82 may be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete this application. The one or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program 82 in the terminal device 8.

[0118] The terminal device 8 may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will understand that... Figure 8 This is merely an example of terminal device 8 and does not constitute a limitation on terminal device 8. It may include more or fewer components than shown, or combine certain components, or different components. For example, terminal device 8 may also include input / output devices, network access devices, buses, etc.

[0119] The processor 80 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0120] The memory 81 can be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. The memory 81 can also be an external storage device of the terminal device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 8. Furthermore, the memory 81 can include both internal and external storage units of the terminal device 8. The memory 81 is used to store the computer program and other programs and data required by the terminal device. The memory 81 can also be used to temporarily store data that has been output or will be output.

[0121] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0122] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0123] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0124] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0125] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A multi-touch drawing method, characterized in that, The method includes: Parse the raw touch events to obtain the touch information of the touch points; Based on the historical allocation status of the touch points, the touch information of the touch points is dynamically allocated to the native processing channel or the inter-process communication processing channel. Based on the touch information of the touch points assigned to the native processing channel, a new touch event is generated; Based on the touch information of the touch points assigned to the inter-process communication processing channel, a communication data packet is generated; The new touch event and the communication data packet are respectively passed to the web page view layer, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

2. The method according to claim 1, characterized in that, The touch information includes an identity identifier; the step of dynamically allocating the touch information of the touch point to the native processing channel or the inter-process communication processing channel according to the historical allocation status of the touch point includes: Determine whether the identity identifier of the touch point exists in the first mapping table or the second mapping table. The first mapping table is used to record touch points processed through the native processing channel, and the second mapping table is used to record touch points processed through the inter-process communication processing channel. If the identifier of the touch point exists in the first mapping table, then the touch information of the touch point is assigned to the native processing channel; If the identifier of the touch point exists in the second mapping table, then the touch information of the touch point is assigned to the inter-process communication processing channel.

3. The method according to claim 2, characterized in that, The method further includes: If the identity identifier of the touch point does not exist in either the first mapping table or the second mapping table, then the touch point is identified as a new touch point; Get the number of touch points currently recorded in the first mapping table; If the number of touch points currently recorded in the first mapping table is less than the preset touch point number threshold, then the touch information of the new touch point is allocated to the native processing channel, and the identity of the new touch point is recorded in the first mapping table. If the number of touch points currently recorded in the first mapping table is greater than or equal to the touch point number threshold, then the touch information of the new touch point is allocated to the inter-process communication processing channel, and the identity of the new touch point is recorded in the second mapping table.

4. The method according to claim 1, characterized in that, The generation of new touch events based on touch information of the touch points allocated to the native processing channel includes: Based on the touch points assigned to the native processing channel, a set of touch points that need to be included in the new touch event is determined; the touch information of each touch point in the set of touch points is integrated and reconstructed to generate a new touch event; The generation of communication data packets based on touch information from touch points allocated to the inter-process communication processing channel includes: The touch information is encapsulated according to a preset format to generate a communication data packet.

5. The method according to claim 1, characterized in that, The step of transmitting the new touch event and the communication data packet to the webpage view layer includes: The new touch event is delivered directly to the webpage view layer; The communication data packets are sent to the webpage view layer through a communication link. The communication link includes multiple parallel sub-communication channels, wherein the sub-communication channels adopt a load balancing strategy to distribute communication data packets from different touchpoints to different sub-communication channels for transmission.

6. The method according to claim 5, characterized in that, The method further includes: For a target touch point that is first assigned to the inter-process communication processing channel, when the original touch event is a touch press event, a sub-communication channel is dynamically assigned to the target touch point and a binding relationship is established. The communication data packets of the target touch point are transmitted through the sub-communication channel determined by the binding relationship. When a touch lift event is received at the target touch point, the binding relationship is released.

7. The method according to any one of claims 1 to 6, characterized in that, The webpage view layer performs handwriting drawing based on the new touch event and the communication data packet, including: The communication data packets are parsed to obtain parsed information; The new touch event and the parsed information are uniformly converted into a standard handwriting data format; The drawing is performed by calling the canvas interface through the drawing engine.

8. A multi-touch drawing device, characterized in that, include: The touch parsing unit is used to parse the original touch events and obtain the touch information of the touch points; The touch point allocation unit is used to dynamically allocate the touch information of the touch point to the native processing channel or the inter-process communication processing channel according to the historical allocation status of the touch point. The first processing unit is used to generate new touch events based on the touch information of the touch points allocated to the native processing channel; The second processing unit is used to generate communication data packets based on the touch information of the touch points allocated to the inter-process communication processing channel; The handwriting drawing unit is used to transmit the new touch event and the communication data packet to the web page view layer respectively, and the web page view layer performs handwriting drawing based on the new touch event and the communication data packet.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the multi-touch drawing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the multi-touch drawing method as described in any one of claims 1 to 7.