A touch event processing method, system, device and medium

By constructing an event sorting queue, touch events can be responded to flexibly according to event priority, solving the problem of low accuracy in touch event handling in Cocos2d-x, and achieving more efficient touch event handling and support for complex interactions.

CN122111544APending Publication Date: 2026-05-29ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
Filing Date
2026-01-14
Publication Date
2026-05-29

Smart Images

  • Figure CN122111544A_ABST
    Figure CN122111544A_ABST
Patent Text Reader

Abstract

The application provides a touch event processing method, system, device and medium, wherein the method comprises the following steps: obtaining interface touch data in a target interface and an event priority list corresponding to the target interface; the interface touch data comprises a plurality of event elements; performing event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue, the event sorting queue comprising a plurality of target touch events sorted from high to low according to event priority; the target touch events comprising a plurality of event elements in the interface touch data; the number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data; and performing event response according to the event sorting queue. The method can effectively improve the processing accuracy of touch events, is conducive to reducing the difficulty of realizing complex interaction in the target interface, and can be widely applied in the technical field of digital content service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital content service technology, and in particular to a method, system, device and medium for handling touch events. Background Technology

[0002] In the field of digital content services, generating and responding to touch events based on users' single-finger or multi-finger touch operations on the interface is a key focus for professionals in this field.

[0003] Currently, the relevant technologies are usually based on Cocos2d-x's event dispatcher to dispatch and respond to generated touch events. However, since the event dispatcher uses a fixed processing order to process generated touch events by default, the accuracy of touch event processing is low, making it difficult to implement complex interactions in the interface.

[0004] Therefore, the problems with the relevant technologies still need to be solved and optimized. Summary of the Invention

[0005] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a method, system, device, and medium for handling touch events, wherein the method can effectively improve the accuracy of touch event handling and help reduce the difficulty of implementing complex interactions in the interface.

[0006] To achieve the above objectives, one aspect of the present invention provides a method for processing touch events, comprising: Obtain the touch data of the target interface and the event priority list corresponding to the target interface; the touch data includes several event elements. Based on the event priority list, the interface touch data is analyzed for event priority to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. Event responses are performed according to the event sorting queue.

[0007] According to some embodiments of the present invention, obtaining an event priority list corresponding to the target interface includes: Obtain several front-end interfaces and a list of interface events for each of the front-end interfaces; Based on all the aforementioned front-end interfaces, the target interface is matched to obtain the matched interface; Based on the matching interface, the list of all interface events is filtered to obtain the event priority list corresponding to the target interface.

[0008] According to some embodiments of the present invention, the method further includes: Obtain the interface interaction requirements of the target interface; An interaction complexity analysis was performed on the interface interaction requirements, and the complexity analysis results were obtained. If the complexity analysis result of the interface interaction requirement is complex interaction, then the priority of the event priority list is adjusted to obtain the adjusted event priority list.

[0009] According to some embodiments of the present invention, the step of performing event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue includes: Event analysis is performed on the interface touch data to obtain several raw touch events; Based on the event priority list, all the original touch events are sorted by priority to obtain the event sorting queue.

[0010] According to some embodiments of the present invention, the step of responding to events based on the event sorting queue includes: A first touch event is determined from the event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events in the event sorting queue that have not yet received an event response. The first touch event is responded to, and event response data is obtained; The target interface is updated based on the event response data, and then the process returns to the step of determining the first touch event from the event sorting queue until there are no target touch events in the event sorting queue that have not been responded to.

[0011] According to some embodiments of the present invention, the number of event elements of the previous target touch event in the event sorting queue is greater than or equal to the number of event elements of the next target touch event; The event response based on the event sorting queue includes: The first touch event is determined from the current event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events that have not yet been responded to in the current event sorting queue. The first touch event is responded to, and event response data and response indication information are obtained; If the response indication information indicates that the event response was successful, then the current event sorting queue is updated according to each event element in the first touch event to obtain the updated event sorting queue. The target interface is then updated according to the event response data. Then, the process returns to the step of determining the first touch event from the current event sorting queue until there are no target touch events in the current event sorting queue that have not been responded to.

[0012] According to some embodiments of the present invention, updating the current event sorting queue based on each event element in the first touch event to obtain the updated event sorting queue includes: Determine several second touch events from the current event sorting queue. The second touch events are the target touch events excluding the first touch event among all target touch events in the current event sorting queue that have not yet received an event response. Based on the event element of the first touch event, element matching is performed on the event element of each second touch event to obtain the element matching result corresponding to each second touch event; the element matching result is used to indicate whether there is at least one identical event element between the first touch event and the corresponding second touch event; Based on the matching result of each element, the current event sorting queue is updated to obtain the updated event sorting queue.

[0013] To achieve the above objectives, another aspect of the present invention provides a touch event processing system, comprising: The first processing unit is used to acquire interface touch data in the target interface, and an event priority list corresponding to the target interface; the interface touch data includes several event elements. The second processing unit is configured to perform event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. The third processing unit is used to respond to events according to the event sorting queue.

[0014] To achieve the above objectives, another aspect of the present invention provides an electronic device, including at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform a touch event processing method as described above.

[0015] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions for performing the touch event processing method as described above.

[0016] To achieve the above objectives, another aspect of the present invention provides a computer program product comprising a computer program stored in a computer-readable storage medium, wherein a processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform a touch event processing method as described above.

[0017] One of the above technical solutions has the following advantages or beneficial effects: This invention provides a method, system, device, and medium for handling touch events. The solution acquires touch data from a target interface and an event priority list corresponding to the target interface. The touch data includes several event elements. Based on the event priority list, the touch data is analyzed for event priority to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low priority. Each target touch event includes several event elements from the touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the touch data. Event response is performed based on the event sorting queue. According to the technical solution of this embodiment, by using an event sorting queue composed of several target touch events sorted from high to low priority for event response, touch events can be handled more flexibly, effectively improving the accuracy of touch event processing and reducing the difficulty of implementing complex interactions in the interface. Attached Figure Description

[0018] Figure 1 This is a flowchart of a touch event processing method provided in one embodiment of the present invention; Figure 2 This is a flowchart of obtaining an event priority list according to an embodiment of the present invention; Figure 3This is an optional flowchart of a touch event processing method provided in one embodiment of the present invention; Figure 4 yes Figure 1 Flowchart of step S120; Figure 5 yes Figure 1 The first flowchart for step S130; Figure 6 yes Figure 1 The second flowchart for step S130; Figure 7 yes Figure 6 Flowchart of step S630; Figure 8 This is a schematic diagram of the structure of a touch event processing system provided in one embodiment of the present invention; Figure 9 This is a structural diagram of an electronic device provided in another embodiment of the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0021] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0022] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0023] Before providing a detailed description of the embodiments of the present invention, some of the nouns and terms involved in the embodiments of the present invention will be explained first. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

[0024] 1) Cocos2d-x is an open-source service development framework that is widely used in developing digital content services such as games, educational software, and web multimedia UI solutions.

[0025] 2) Event Dispatcher: It is one of the core components of the Cocos2d-x framework, responsible for distributing touch events to event listeners. 3) Event Listener: It is one of the core components of the Cocos2d-x framework. It is the carrier of event handling. By listening to touch events dispatched by the event dispatcher, it automatically triggers the corresponding preset event functions to realize the automatic execution response of touch events.

[0026] 4) Touch events, which include single-finger touch events and multi-finger touch events; a single-finger touch event is a touch event based on one event element, while a multi-finger touch event is a touch event based on at least two event elements.

[0027] 5) Event elements refer to input elements such as touch, keyboard, mouse, and sensors (such as accelerometers). For example, each single-finger touch operation by the user on the touchscreen can be defined as an event element; each key press by the user on the keyboard can be defined as an event element; and each mouse action (such as clicking the left mouse button or clicking the right mouse button) can be defined as an event element.

[0028] 6) Storage pool, used to store the Original Touches data structure in the Cocos2d-x framework. The OriginalTouches data structure is an internal data structure used in the Cocos2d-x framework during event dispatching, used to store all event elements in the initial state of each touch event.

[0029] Currently, the relevant technologies are usually based on the Cocos2d-x event dispatcher to dispatch and respond to generated touch events. However, since the event dispatcher uses a fixed processing order to process generated touch events by default, the fixed order is as follows: it first processes single-finger touch events that have been registered in the Cocos2d-x framework (such as Event Listener Touch One By One), and after these events are processed, it removes the consumed event elements in the single-finger touch events from the event stream, so that the remaining touch events do not contain the aforementioned consumed event elements. Then, it passes the remaining multi-finger touch events to the multi-finger touch event listener (such as Event Listener TouchAll At Once).

[0030] This fixed processing sequence has the following drawbacks: 1. Multi-finger operation cannot be triggered: If buttons or other interactive elements on the interface (such as keyboard, mouse and other shortcut keys and corresponding input elements) register and consume single-finger touch events, then subsequent multi-finger touch events (such as two-finger operations required for zooming) may not be recognized and triggered because the touch point information is removed. This can easily lead to situations where the multi-finger touch events that the user wants to trigger are not triggered, resulting in low accuracy of touch event processing.

[0031] 2. Ambiguous hierarchical relationships: The fixed processing order does not provide a clear hierarchical relationship for each touch event in the structure, making it difficult for developers to intuitively control and plan the event response priority and transmission logic between different layers or UI elements, which further increases the difficulty of implementing complex interactions, that is, it is more difficult to implement complex interactions in the interface.

[0032] It should be noted that the related technologies mentioned above are only used to assist in understanding the technical solutions of this invention, and do not mean that they belong to the publicly disclosed prior art.

[0033] In view of this, embodiments of the present invention provide a method, system, device, and medium for handling touch events. This solution acquires interface touch data from a target interface and an event priority list corresponding to the target interface. The interface touch data includes several event elements. Based on the event priority list, event priority analysis is performed on the interface touch data to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements from the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. Event response is performed based on the event sorting queue. According to the technical solution of this embodiment, by performing event response through an event sorting queue composed of several target touch events sorted from high to low event priority, a hierarchical touch event queue can be provided, and touch events can be handled more flexibly, effectively improving the accuracy of touch event processing and reducing the difficulty of implementing complex interactions in the interface.

[0034] Furthermore, this scheme responds to events by using an event sorting queue where the number of event elements in the previous target touch event is greater than or equal to the number of event elements in the next target touch event. This can solve the problem of single-finger touch events monopolizing the event flow of the Cocos2d-x framework, effectively avoid the situation where multi-finger touch events are blocked by single-finger touch events, and further improve the accuracy of touch event processing.

[0035] Furthermore, this solution adjusts the event priorities in the event priority list based on the interface interaction requirements of the target interface. In practical applications, it can flexibly adapt to the interaction requirements of different interfaces, reducing the risk of global transformation. Specifically, it decouples complex interfaces from simple interfaces, eliminating the need for a full refactoring in service interface development. Instead, it adopts the corresponding event priority list according to the interaction requirements of each interface, thus achieving risk isolation.

[0036] In this invention, a method, system, device, and medium for handling touch events are provided, which will be described in detail in the following embodiments.

[0037] The touch event processing method provided by this invention covers most touch event processing application scenarios in digital content services, enabling response processing for single-finger or multi-finger touch events in these scenarios. Specifically, upon receiving touch data provided by a user on a target interface, an event priority list of the target interface can be obtained. Based on this event priority list, an event sorting queue corresponding to all event elements of the touch data can be determined. This event sorting queue includes several target touch events sorted from high to low priority. Event response is then performed based on this event sorting queue, which can effectively improve the accuracy of touch event processing and reduce the difficulty of implementing complex interactions in the interface.

[0038] The touch event processing method provided in this invention can be applied to the interaction between a terminal and a server, or it can be software running on the server for fault analysis. The terminal, as a user interface, can display a front-end interface to the user and receive touch data from the user on a certain front-end interface. Then, it obtains an event priority list from the server and performs event analysis and response on the touch data. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the touch event processing method, but is not limited to the above forms.

[0039] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0040] Reference Figure 1 , Figure 1A flowchart of a touch event processing method provided in an embodiment of the present invention includes, but is not limited to, steps S110 to S130: Step S110: Obtain the touch data of the target interface and the event priority list corresponding to the target interface; the touch data includes several event elements. In this embodiment of the invention, the target interface can be a terminal interface displayed on a user terminal, which can be an interface that requires complex interaction or an interface with only simple interaction; wherein, the interface that requires complex interaction can be a world map interface, an online store interface, a settings interface, an office interface, etc., and such an interface that requires complex interaction often has multiple buttons or interactive elements that can be triggered by the user by touch, keyboard, mouse, etc.

[0041] A simple interactive interface can be a prompt box interface in a digital content service. Such an interface typically has only a few buttons or interactive elements, such as 0, 1, 2, etc. For example, a prompt box interface may contain 0 buttons or interactive elements. In this case, after the prompt box interface is displayed on the user's terminal, the display time of the prompt box interface can be detected, and the prompt box interface can be automatically closed when the display time exceeds a certain time threshold (such as 1 second, 3 seconds, 5 seconds, etc.).

[0042] Interface touch data can be a collection of event elements generated by a user's actions on the target interface within the current time window when the target interface is displayed on the user terminal. Specifically, in one feasible example, if the target interface has multiple interactive elements (such as buttons, skill icons, office icons, etc.), denoted as the first interactive element, the second interactive element, etc., the user can use one finger to click the first interactive element on the target interface of the user terminal to form the first event element; the user can use another finger to drag the second interactive element on the target interface of the user terminal to form the second event element; and the user can simultaneously press the "ctrl" key and the "A" key on the keyboard to form the third event element corresponding to the "ctrl" key and the fourth event element corresponding to the "A" key; then the user terminal integrates the aforementioned four event elements to obtain the interface touch data.

[0043] Understandably, the server can obtain the touch data about the target interface sent by the user terminal and obtain the event priority list of the target interface. The event priority list is used to indicate the event priority of each touch event, which can be a single-finger touch event or a multi-finger touch event.

[0044] Specifically, examples of single-finger touch events can be single-finger touch events formed based on the first event element in the aforementioned interface touch data (clicking the first interactive element in the target interface), single-finger touch events formed based on the second event element in the aforementioned interface touch data (dragging the second interactive element in the target interface), etc.

[0045] Specific examples of multi-finger touch events can be multi-finger touch events formed by the third and fourth event elements in the aforementioned interface touch data, that is, multi-finger touch events formed by the combined event element "ctrl+A", or multi-finger touch events formed by the first and second event elements in the aforementioned interface touch data, etc.; these multi-finger touch events are shortcut key trigger events for a certain interface function in the target interface, or drag and move events of a certain button in the target interface, and the embodiments of the present invention do not limit this.

[0046] It is worth mentioning that, for ease of understanding, the above examples of multi-finger touch events only introduce multi-finger touch events composed of two event elements; in actual applications, the number of event elements constituting a multi-finger touch event can often be greater than or equal to 2. The content of multi-finger touch events with other event element counts is similar to the content of the aforementioned multi-finger touch events with an event element count of 2, which can be easily deduced, and will not be elaborated further in this invention.

[0047] Step S120: Based on the event priority list, perform event priority analysis on the interface touch data to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. In this embodiment of the invention, the server can use the event dispatcher in the Cocos2d-x framework to determine all target touch events corresponding to all event elements of the interface touch data, as well as the event elements of each target touch event, based on the event priority of each touch event indicated by the event priority list.

[0048] In practical applications, all possible target touch events can be determined by iterative enumeration or other methods based on all event elements of the interface touch data. The specific method for determining the target touch event is relatively simple and has many implementation methods, which will not be elaborated here. For example, for the four event elements in the aforementioned interface touch data, the target touch event in the event sorting queue can be a single-finger touch event formed based on the first event element, a single-finger touch event formed based on the second event element, a multi-finger touch event formed based on the third and fourth event elements, or a multi-finger touch event formed based on the first and second event elements.

[0049] Understandably, in practical applications, the event dispatcher in the Cocos2d-x framework can create a global Original Touches array in the storage pool after determining the event sorting queue and before event dispatching. Each target touch event in the event sorting queue is then stored in the Original Touches array in the storage pool. The Original Touches array records information such as the storage location, storage timestamp, event response status, and event element for each target touch event. Before event dispatching, the event response status of each target touch event in the Original Touches array is in the unresponsive state.

[0050] Step S130: Respond to events according to the event sorting queue.

[0051] In this embodiment of the invention, the event dispatcher in the Cocos2d-x framework can dispatch target touch events in the event sorting queue one by one to the corresponding event listeners, so that the dispatched target touch events are executed by the preset event functions in the event listeners. Specifically, the event listener can be a single-finger touch event listener for executing single-finger touch events, or a multi-finger touch event listener for executing multi-finger touch events.

[0052] In practical applications, after detecting a received target touch event, the event listener can also combine several target touch events in the Original Touches array of the storage pool to determine whether the event listener needs to respond to the received target touch event. Specifically, it can determine whether the event listener needs to respond to the received target touch event based on the event response status of each target touch event in the Original Touches array of the storage pool.

[0053] Reference Figure 2 In some embodiments, obtaining the event priority list corresponding to the target interface includes: Step S210: Obtain several front-end interfaces and a list of interface events for each front-end interface; Step S220: Based on all the aforementioned front-end interfaces, perform interface matching on the target interface to obtain a matching interface; Step S230: Based on the matching interface, filter all the interface event lists to obtain the event priority list corresponding to the target interface.

[0054] In this embodiment of the invention, since digital content services typically include multiple terminal interfaces that can be displayed on a user terminal, and these interfaces need to be selectively displayed based on user needs, the front-end interface can be any one of all terminal interfaces that can be displayed on a user terminal. The front-end interface can be the target interface that is being displayed or the remaining terminal interfaces that are not being displayed.

[0055] For any front-end interface's event list, the event list can be a list containing each touch event and its priority, which can be obtained by the developer in advance; or it can be an adjusted event priority list determined by the front-end interface during the handling of the previous touch event.

[0056] It is understandable that interface matching can involve identifying the front-end interface corresponding to the target interface, denoted as the matching interface. Specifically, in one optional implementation, the interface ID of the target interface and the interface ID of each front-end interface can be obtained; then, based on the interface ID of the target interface, it can be matched with the interface ID of each front-end interface, and the front-end interface that matches completely (i.e., has the same interface ID) is identified as the matching interface. List filtering can be based on the mapping relationship between each front-end interface and its interface event list, determining the interface event list corresponding to the matching interface from all interface event lists, and identifying this interface event list corresponding to the matching interface as the event priority list of the target interface.

[0057] Reference Figure 3 In some embodiments, the method further includes: Step S310: Obtain the interface interaction requirements of the target interface; Step S320: Perform interaction complexity analysis on the interface interaction requirements to obtain the complexity analysis results; Step S330: If the complexity analysis result of the interface interaction requirement is complex interaction, then the priority of the event priority list is adjusted to obtain the adjusted event priority list.

[0058] In this embodiment of the invention, the interface interaction requirements of the target interface are used to indicate the interface interaction complexity of the target interface.

[0059] In the first implementation, the interface interaction requirements can be obtained through pre-setting by the developers. In this case, the interface interaction requirements can specifically be indicator characters such as complex interaction requirements or simple interaction requirements. As for the interaction complexity analysis in the first implementation, it can specifically be to extract indicator characters from the interface interaction requirements. There are multiple ways to extract indicator characters. For example, the required indicator characters (such as "complex interaction" or "simple interaction") can be extracted using regular expressions, thereby obtaining the complexity analysis results representing complex interactions or simple interactions.

[0060] In the second embodiment, the interface interaction requirement can be the total number of buttons or interactive elements that can be triggered by the user in the target interface, or the total number of touch events that can be triggered by the user in the target interface. For ease of understanding, this embodiment of the invention takes the total number of touch events that can be triggered by the user in the target interface as an example. In this case, the interaction complexity analysis can be a comparison between a preset complexity threshold and the total number of touch events that can be triggered by the user. The preset complexity threshold can be flexibly set by the developers, such as any one of 5, 10, 13, 18, etc. When the total number of touch events that can be triggered by the user is greater than or equal to the preset complexity threshold, a complexity analysis result representing a complex interaction is generated; or when the total number of touch events that can be triggered by the user is less than the preset complexity threshold, a complexity analysis result representing a simple interaction is generated.

[0061] For step S330, if the complexity analysis result is a simple interaction, the event priority list can be left unchanged, and the content of step S120 can continue to be executed; or, if the complexity analysis result is a complex interaction, the event priorities of several target touch events in the event priority list can be adjusted to obtain an adjusted event priority list. Specifically, the adjustment method can be to adjust the event priority of all multi-finger touch events to the level of all single-finger touch events while retaining the priority ordering relationship between all multi-finger touch events and the priority ordering relationship between all single-finger touch events.

[0062] For example, if there exists an event priority list whose target touch events are sorted from high to low as [first multi-finger touch event, first single-finger touch event, second single-finger touch event, third single-finger touch event, second multi-finger touch event, third multi-finger touch event, fourth single-finger touch event]; then the adjusted event priority list whose target touch events are sorted from high to low as [first multi-finger touch event, second multi-finger touch event, third multi-finger touch event, first single-finger touch event, second single-finger touch event, third single-finger touch event, fourth single-finger touch event].

[0063] Reference Figure 4 In some embodiments, the step of performing event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue includes: Step S410: Perform event analysis on the interface touch data to obtain several raw touch events; Step S420: Sort all the original touch events according to the event priority list to obtain the event sorting queue.

[0064] In this embodiment of the invention, event analysis can be based on all event elements of the interface touch data, and all possible touch events can be determined by iterative enumeration or other methods, which are recorded as original touch events; and based on the event priority of each touch event recorded in the event priority list, the event priority of each corresponding original touch event can be determined, thereby obtaining the event sorting queue.

[0065] Since the number of element touch events determined based on all event elements of the interface touch data is often less than the number of touch events recorded in the actual priority list, in practical applications, for any original touch event, priority sorting can first be performed by determining the touch event corresponding to the original touch event from the event priority list and assigning the event priority value of the corresponding touch event to the original touch event; then, based on the event priority value of each original touch event, all original touch events are sorted to determine the event sorting queue, and the event priority of each target touch event in the event sorting queue is updated based on its sequence number in the event sorting queue.

[0066] Reference Figure 5 In some embodiments, responding to events according to the event sorting queue includes: Step S510: Determine the first touch event from the event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events in the event sorting queue that have not yet been responded to. Step S520: Respond to the first touch event and obtain event response data; Step S530: Update the target interface according to the event response data, and then return to the step of determining the first touch event from the event sorting queue until there are no target touch events that have not been responded to in the event sorting queue.

[0067] In this embodiment of the invention, each target touch event in the event sorting queue can be responded to in a cyclical manner. Specifically, for any cyclic process, a first touch event can be determined from the event sorting queue. This first touch event is specifically the target touch event with the highest event priority among all target touch events in the event sorting queue that have not yet been responded to. The event response in step S520 can be to execute a preset event function corresponding to the first touch event and obtain the function execution data of the preset event function, which is recorded as the event response data. Step S530 can be based on visualization technology to update the data content of the event response data to the target interface to obtain the updated target interface. Then, if there is still at least one target touch event in the event sorting queue that has not yet been responded to, the process returns to step S510; or the event response cyclic process ends when there are no target touch events in the event sorting queue that have not yet been responded to.

[0068] In practical applications, this can be achieved through a loop of event dispatchers and event listeners in the Cocos2d-x framework. Specifically, for any given loop, the event dispatcher can dispatch the first touch event to the corresponding event listener, and the corresponding event listener can receive and trigger a preset event function to achieve an automatic response to the first touch event. For example, the event dispatcher dispatches a single-finger touch event to a single-finger touch event listener, and the single-finger touch event listener automatically responds to the single-finger touch event through a preset event function; or the event dispatcher dispatches a multi-finger touch event to a multi-finger touch event listener, and the multi-finger touch event listener automatically responds to the multi-finger touch event through a preset event function. Then, the process of the event dispatcher dispatching the first touch event to the corresponding event listener is repeated until all target touch events in the event sorting queue have been responded to.

[0069] Reference Figure 6 In some embodiments, the number of event elements of the previous target touch event in the event sorting queue is greater than or equal to the number of event elements of the next target touch event; The event response based on the event sorting queue includes: Step S610: Determine the first touch event from the current event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events that have not yet been responded to in the current event sorting queue. Step S620: Respond to the first touch event to obtain event response data and response indication information; Step S630: If the response indication information indicates that the event response was successful, then update the current event sorting queue according to each event element in the first touch event to obtain the updated event sorting queue, and update the target interface according to the event response data. Then return to the step of determining the first touch event from the current event sorting queue until there are no target touch events that have not been responded to in the current event sorting queue.

[0070] In this embodiment of the invention, the number of event elements of the previous target touch event in the event sorting queue is greater than or equal to the number of event elements of the next target touch event. This makes the event priority of the target touch event positively correlated with the number of event elements it has. This allows multi-finger touch events of complex interactions to be processed earlier than single-finger touch events of simple interactions, effectively avoiding the situation where multi-finger touch events cannot be recognized and triggered due to the removal of touch point information.

[0071] Understandably, for any given loop, the first touch event can be the target touch event with the highest event priority in the current event sorting queue of the Cocos2d-x framework event dispatcher that has not yet been responded to. Step S620 is similar to the aforementioned step S520, except that the response indication information is used to indicate whether the preset event function was successfully executed. Specifically, if the preset event function executes successfully, response indication information indicating a successful event response can be generated; or, if the preset event function fails to execute successfully, response indication information indicating an unsuccessful event response can be generated.

[0072] If the response indication information indicates that the event response was unsuccessful, the event response to the first touch event can be re-executed, or the event response to the first touch event can be skipped and the event response to the first touch event in the next loop can proceed. Alternatively, if the response indication information indicates that the event response was successful, the target touch event in the current event sorting queue can be updated based on each event element of the first touch event in the current loop to obtain an updated event sorting queue. This updated event sorting queue is then determined as the current event sorting queue in the next loop. Furthermore, the data content of the event response data is updated to the target interface based on visualization technology to obtain an updated target interface. If there is still at least one target touch event in the event sorting queue that has not been responded to, the execution of step S610 is returned. Alternatively, if there is no target touch event in the event sorting queue that has not been responded to, the event response loop process ends.

[0073] In practical applications, for any loop process, after the event dispatcher in the Cocos2d-x framework dispatches the first touch event to the corresponding event listener, the event listener can work with the storage pool to complete the event response to the first touch event in order to obtain event response data and response indication information.

[0074] Specifically, after receiving the first touch event, the event listener can obtain the event response status of the first touch event in the storage pool. If the storage pool reports that the event response status of the first touch event is "event responded", the event listener can directly generate blank event response data and response indication information indicating that the event response was unsuccessful. Alternatively, if the storage pool reports that the event response status of the first touch event is "event not responded", the event listener can trigger the execution of the corresponding preset event function, thereby obtaining event response data containing function execution data and response indication information indicating that the event response was successful.

[0075] Reference Figure 7 In some embodiments, updating the current event sorting queue based on each event element in the first touch event to obtain the updated event sorting queue includes: Step S710: Determine several second touch events from the current event sorting queue. The second touch events are the target touch events excluding the first touch event among all target touch events in the current event sorting queue that have not yet been responded to. Step S720: Based on the event element of the first touch event, perform element matching on the event element of each second touch event to obtain the element matching result corresponding to each second touch event; the element matching result is used to indicate whether the first touch event and the corresponding second touch event have at least one identical event element; Step S730: Update the current event sorting queue according to the matching result of each element to obtain the updated event sorting queue.

[0076] In this embodiment of the invention, for any loop process, event update may be to obtain the second touch event in the current event sorting queue. The second touch event may be a target touch event in the current event sorting queue that does not have the highest event priority and has not responded to the event (i.e., the target touch event excluding the first touch event among all the target touch events in the current event sorting queue that have not responded to the event). For any second touch event, element matching may be to determine whether there is an event element that is the same as the first touch event among all the event elements of the second touch event, so as to obtain the element matching result corresponding to the second touch event.

[0077] For example, if the current event sorting queue sequentially includes a first touch event (event response status is "event responded"), a second touch event E1 (event response status is "event not responded"), a second touch event E2 (event response status is "event not responded"), and a second touch event E3 (event response status is "event not responded"); the event elements of the first touch event are [event element a, event element b, event element f]; the event elements of the second touch event E1 are [event element a, event element b, event element d]; the event elements of the second touch event E2 are [event element c, event element d]; and the event elements of the second touch event E3 are [event element e]. In this case, since the second touch event E1 shares event elements with the first touch event (such as event elements a and b), the element matching result corresponding to the second touch event E1 is that there is at least one shared event element; while the second touch event E2 and the second touch event E3 do not share event elements with the first touch event, the element matching result corresponding to the second touch event E2 and the second touch event E3 is that there is no at least one shared event element.

[0078] In the first embodiment, the queue update in step S730 can be achieved by updating the event response state of the second touch event that has at least one identical event element from the current event sorting queue to an event responded state, thus obtaining an updated event sorting queue. This updated event sorting queue is then determined as the current event sorting queue for the next loop process, and the loop process ends when the updated event sorting queue is empty. Referring to the aforementioned example of the current event sorting queue, the updated event sorting queue sequentially includes the first touch event (event response state is responded), the second touch event E1 (event response state is responded), the second touch event E2 (event response state is not responded), and the second touch event E3 (event response state is not responded).

[0079] In the second implementation, the queue update in step S730 can be to remove the first touch event and the second touch event whose element matching result is that there is at least one identical event element from the current event sorting queue to obtain an updated event sorting queue; and to determine the updated event sorting queue as the current event sorting queue in the next loop process, until the loop process ends when the updated event sorting queue is empty. Referring to the aforementioned example of the current event sorting queue, the updated event sorting queue sequentially includes the second touch event E2 (event response state is event non-response state) and the second touch event E3 (event response state is event non-response state).

[0080] In practical applications, the event update in step S630 can be an update of the event sorting queue stored in the storage pool, or an update of both the event sorting queue stored in the storage pool and the event sorting queue stored in the event dispatcher. The specific queue update content is similar to the aforementioned example and can be easily deduced by analogy.

[0081] Corresponding to the above method embodiments, the present invention also provides embodiments of a touch event processing system. Figure 8 A schematic diagram of the structure of a map resource fault analysis system according to an embodiment of the present invention is shown. Figure 8 As shown, the touch event processing system 801 includes: The first processing unit 802 is used to acquire interface touch data in the target interface and an event priority list corresponding to the target interface; the interface touch data includes several event elements. The second processing unit 803 is configured to perform event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. The third processing unit 804 is used to respond to events according to the event sorting queue.

[0082] The above is an illustrative scheme of a touch event processing system according to this embodiment. It should be noted that the technical solution of this touch event processing system and the technical solution of the touch event processing method described above belong to the same concept. For details not described in detail in the technical solution of the touch event processing system, please refer to the description of the technical solution of the touch event processing method described above.

[0083] like Figure 9 As shown, Figure 9 A structural block diagram of an electronic device 900 according to an embodiment of the present invention is shown. The components of the electronic device 900 include, but are not limited to, a memory 901 and a processor 902. The processor 902 is connected to the memory 901 via a bus 903, and a database 905 is used to store data.

[0084] Electronic device 900 also includes access device 904, which enables electronic device 900 to communicate via one or more networks 906. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. Access device 904 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 1002.11 Wireless Local Area Network (WLAN) wireless interface, a Global System for Microwave Access (GSM) interface, or a Wi-Fi interface. MAX interface, Ethernet interface, Universal Serial Bus (USB) interface, Cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, etc.

[0085] In one embodiment of the present invention, the above-described components of the electronic device 900 and Figure 9 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 9 The illustrated electronic device block diagram is for illustrative purposes only and is not intended to limit the scope of the invention. Those skilled in the art can add or replace other components as needed.

[0086] Electronic device 900 can be any type of stationary or mobile electronic device, including mobile computers or mobile electronic devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable electronic devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary electronic devices such as desktop computers or PCs. Electronic device 900 can also be a mobile or stationary server.

[0087] The processor 902 is used to execute computer-executable instructions for the map resource fault analysis method.

[0088] The above is an illustrative scheme of an electronic device according to this embodiment. It should be noted that the technical solution of this electronic device and the technical solution of the map resource fault analysis method described above belong to the same concept. For details not described in detail in the technical solution of the electronic device, please refer to the description of the technical solution of the map resource fault analysis method described above.

[0089] This invention also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described map resource fault analysis method.

[0090] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0092] The above provides a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A method for handling touch events, characterized in that, include: Obtain the touch data of the target interface and the event priority list corresponding to the target interface; The interface touch data includes several event elements; Based on the event priority list, the interface touch data is analyzed for event priority to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. Event responses are performed according to the event sorting queue.

2. The method according to claim 1, characterized in that, Obtain the event priority list corresponding to the target interface, including: Obtain several front-end interfaces and a list of interface events for each of the front-end interfaces; Based on all the aforementioned front-end interfaces, the target interface is matched to obtain the matched interface; Based on the matching interface, the list of all interface events is filtered to obtain the event priority list corresponding to the target interface.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the interface interaction requirements of the target interface; An interaction complexity analysis was performed on the interface interaction requirements to obtain the complexity analysis results. If the complexity analysis result of the interface interaction requirement is complex interaction, then the priority of the event priority list is adjusted to obtain the adjusted event priority list.

4. The method according to claim 1, characterized in that, The step of performing event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue includes: Event analysis is performed on the interface touch data to obtain several raw touch events; Based on the event priority list, all the original touch events are sorted by priority to obtain the event sorting queue.

5. The method according to any one of claims 1-4, characterized in that, The event response based on the event sorting queue includes: A first touch event is determined from the event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events in the event sorting queue that have not yet received an event response. The first touch event is responded to, and event response data is obtained; The target interface is updated based on the event response data, and then the process returns to the step of determining the first touch event from the event sorting queue until there are no target touch events in the event sorting queue that have not been responded to.

6. The method according to any one of claims 1-4, characterized in that, The number of event elements in the previous target touch event in the event sorting queue is greater than or equal to the number of event elements in the next target touch event; The event response based on the event sorting queue includes: The first touch event is determined from the current event sorting queue. The first touch event is the target touch event with the highest event priority among all target touch events that have not yet been responded to in the current event sorting queue. The first touch event is responded to, and event response data and response indication information are obtained; If the response indication information indicates that the event response was successful, then the current event sorting queue is updated according to each event element in the first touch event to obtain the updated event sorting queue. The target interface is then updated according to the event response data. Then, the process returns to the step of determining the first touch event from the current event sorting queue until there are no target touch events in the current event sorting queue that have not been responded to.

7. The method according to claim 6, characterized in that, The step of updating the current event sorting queue based on each event element in the first touch event to obtain the updated event sorting queue includes: Determine several second touch events from the current event sorting queue. The second touch events are the target touch events excluding the first touch event among all target touch events in the current event sorting queue that have not yet received an event response. Based on the event element of the first touch event, element matching is performed on the event element of each second touch event to obtain the element matching result corresponding to each second touch event; the element matching result is used to indicate whether there is at least one identical event element between the first touch event and the corresponding second touch event; Based on the matching result of each element, the current event sorting queue is updated to obtain the updated event sorting queue.

8. A touch event processing system, characterized in that, include: The first processing unit is used to acquire touch data of the target interface and an event priority list corresponding to the target interface. The interface touch data includes several event elements; The second processing unit is configured to perform event priority analysis on the interface touch data according to the event priority list to obtain an event sorting queue. The event sorting queue includes several target touch events sorted from high to low event priority. Each target touch event includes several event elements in the interface touch data. The number of event elements in each target touch event is less than or equal to the number of event elements in the interface touch data. The third processing unit is used to respond to events according to the event sorting queue.

9. An electronic device, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform the touch event processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the touch event processing method as described in any one of claims 1 to 7.