Processing method and device and electronic equipment
Through a processing method, responding to touch signals and processing touch events, the delay problem of interactive applications on the touch screen is solved, achieving a smoother and instant user interaction experience.
Patent Information
- Application Number
- CN202411999537.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
The delay problem of interactive applications on the touch screen leads to poor user experience and affects the smooth operation.
Through a processing method, touch events are obtained in response to touch signals and passed to the target application for processing, supporting the application to present corresponding display information. The method includes obtaining target information for accelerated rendering, or building a collection of information to optimize touch event processing when the target application enables acceleration requests.
Reduces touch event processing delays, improves users' instant feedback experience during touch operations, and makes interactions more smooth and efficient.
Smart Images

Figure CN119937820A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a processing method, device and electronic device. Background Art
[0002] The goal is to create interactive applications (such as whiteboards, drawing tools, and touch notes) that use touch screens to achieve an intuitive and convenient interactive experience. However, a common technical challenge faced by such applications is touch latency, which is the time difference between when a user touches the screen or inputs an input device and when the application responds and displays the corresponding result. Touch latency reduces the user's sense of operational fluency and results in a poor user experience. Summary of the invention
[0003] The technical solutions provided by this application are as follows:
[0004] The first aspect of the present application provides a processing method, comprising:
[0005] In response to the touch signal, a touch event is obtained;
[0006] delivering the touch event to a target application; and
[0007] Processing the touch event and transmitting the processed touch event to the target application;
[0008] The touch event and the processed touch event are used to support the target application to present display information corresponding to the touch event.
[0009] The processing method also includes:
[0010] Obtaining target information, where the target information is used to indicate that a current view object corresponding to the target application accelerates presentation of display information corresponding to the touch event;
[0011] In response to being able to obtain the target information, passing the touch event to a target application; and processing the touch event and passing the processed touch event to the target application;
[0012] In response to the inability to obtain the target information, the touch event is processed and the processed touch event is transmitted to the target application.
[0013] The processing method also includes:
[0014] In response to an accelerated enabling request of at least one view object of the target application, construct an information set; the information set includes at least one target information, and the at least one target information is used to identify the at least one view object;
[0015] The obtaining of target information comprises:
[0016] Reading the at least one target information from the information set;
[0017] In response to being able to obtain the target information, the method includes:
[0018] In response to the at least one target information including the target information corresponding to the current view object of the target application.
[0019] Another aspect of the present application provides a processing method, comprising:
[0020] Receive touch events;
[0021] Based on the touch event, determining whether to use the touch event;
[0022] If so, presenting display information according to the touch event;
[0023] If not, display information is presented according to the received processed touch event, where the obtained time of the processed touch event is later than the obtained time of the touch event.
[0024] The determining, based on the touch event, whether to use the touch event comprises at least one of the following:
[0025] Upon receiving the touch event, determining whether the target application has enabled a target display mechanism; under the target display mechanism, using the touch event and ignoring the processed touch event;
[0026] Determine whether the touch event satisfies a target interaction condition; the target interaction condition is used to filter touch events required for accelerated display.
[0027] Determining whether the touch event satisfies a target interaction condition includes at least one of the following:
[0028] determining whether the target application is in the first mode of a first mode and a second mode; in the second mode, the touch event is used to mark or select an object in the target application; the first mode and the second mode are different;
[0029] According to the position information in the touch event, it is determined whether the touch position is in the first area of the first area and the second area; the second area is used to trigger the execution of the target operation; the first area and the second area are different.
[0030] The second area includes:
[0031] The target functional area in the current view object; the control in the target functional area is used to trigger the execution of the target operation; or,
[0032] A target view object different from the current view object; the target view object is displayed overlaid on the display content of the current view object.
[0033] The processing method also includes:
[0034] Obtaining attribute information of the touch event;
[0035] If the attribute information indicates that the touch event is a touch start event, determining whether to use the touch event based on the touch event to obtain a determination result;
[0036] If the attribute information characterizes that the touch event is a touch move event or a touch end event, the step of presenting display information according to the touch event or the step of presenting display information according to the received processed touch event is performed based on the determination result.
[0037] A third aspect of the present application provides a processing device, including:
[0038] An acquisition module, used for acquiring a touch event in response to a touch signal;
[0039] a transfer module, used to transfer the touch event to a target application, and to process the touch event and transfer the processed touch event to the target application;
[0040] The touch event and the processed touch event are used to support the target application to present display information corresponding to the touch event.
[0041] A fourth aspect of the present application provides an electronic device, including:
[0042] The memory is used to store computer programs;
[0043] The processor is used to execute the computer program so that the electronic device can implement the processing method of any one of the processing methods described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0045] Figure 1 A schematic diagram of a process for a treatment method provided in Example 1 of the present application;
[0046] Figure 2A schematic diagram of the interaction between an operating system and a target application provided in this application;
[0047] Figure 3 A schematic diagram of a process flow of a processing method provided in Example 2 of the present application;
[0048] Figure 4 A schematic diagram of a process for a treatment method provided in Example 3 of the present application;
[0049] Figure 5 A schematic diagram of a process for a treatment method provided in Example 4 of the present application;
[0050] Figure 6 A schematic diagram of a process for a treatment method provided in Example 6 of the present application;
[0051] Figure 7 A schematic diagram of the structure of a processing device provided in this application;
[0052] Figure 8 A schematic diagram of the structure of a processing device provided in this application. DETAILED DESCRIPTION
[0053] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0054] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0055] The terms "first", "second" etc. in the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable in appropriate circumstances, and this is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0056] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0057] Reference Figure 1 , is a flow chart of a processing method provided in Example 1 of the present application, such as Figure 1 As shown, the method may include but is not limited to the following steps:
[0058] Step S101: obtaining a touch event in response to a touch signal.
[0059] In this embodiment, the touch screen hardware can detect a sliding, clicking or long pressing action on the touch screen, and convert the detected action into a touch signal.
[0060] The touch signal may be transmitted to an input processing module (eg, InputManagerService) of the operating system. After receiving the touch signal, the input processing module may parse and encapsulate the touch signal to generate a touch event.
[0061] A touch event may include, but is not limited to, detailed information such as the coordinates of the touch point, the action type (such as ACTION_DOWN, ACTION_MOVE, ACTION_UP, etc.), and a timestamp.
[0062] ACTION_DOWN can indicate that the user pressed the touch screen.
[0063] ACTION_MOVE can indicate that the user moved a finger or stylus on the touch screen.
[0064] ACTION_UP can indicate that the user has lifted their finger or stylus.
[0065] InputManagerService: Packages touch point coordinates into touch events.
[0066] The touch event may be used to support the target application in presenting display information corresponding to the touch event.
[0067] Step S102: delivering the touch event to a target application.
[0068] In this embodiment, the touch event can be sent to the input event receiver of the currently active window (such as WindowInputEventReceiver in ViewRootImpl). The operating system can determine the target application based on the identifier of the currently active window, and pass the touch event to the current view object (view) of the currently active window of the target application through the input event receiver.
[0069] In this embodiment, the View may override the onPreTouchEvent() method, and the onPreTouchEvent() method may be used to provide the View with an opportunity to present display information in advance according to a touch event.
[0070] For example, Figure 2 As shown, after generating a touch event, WindowInputEventReceiver in ViewRootImpl can call the onPreTouchEvent() method of View to pass the touch event to View.
[0071] View can choose whether to use the touch event as needed. If used, it can present display information according to the touch event. For example, View's onPreTouchEvent() method can perform corresponding operations according to the action type of the touch event. If the action type is ACTION_MOVE, the user's sliding trajectory can be rendered and presented according to the position of the touch point. Among them, the acceleration layer API (such as OpenGL ES or other graphics rendering libraries) can be called to efficiently render the sliding trajectory. If the action type is ACTION_DOWN or ACTION_UP, the touch event can be determined as the beginning or end of the user's click, and the corresponding click event processing logic can be triggered accordingly.
[0072] Step S103: Process the touch event and transmit the processed touch event to the target application.
[0073] The processed touch event may be used to support the target application in presenting display information corresponding to the touch event.
[0074] In this embodiment, the touch event can be sent to the input event receiver of the currently active window (such as WindowInputEventReceiver in ViewRootImpl), and the input event receiver can pass the touch event to the InputStage responsibility chain.
[0075] like Figure 2 As shown, InputStage can divide the processing of input events into several stages (such as processing before input method: NativePrelmelnputStage and ViewPrelMEInputStage; input method processing: ImelnputStage; processing after input method: EarlyPostlmelnputStage, NativePostlmelnputStage, ViewPostlmelnputStage; comprehensive processing: SyntheticlnputStage).
[0076] In InputStage, if there is an input method editor window (IME), the processing flow of input events (such as keyboard events and touch events) will start from NativePreImeInputStage. This stage is mainly used to process pre-processing events related to the input method to ensure that the input method can correctly receive and process user input.
[0077] If there is no input method window currently, the input event processing flow will start from EarlyPostImeInputStage. This stage is mainly used to process early events after the input method, which may be directly generated by the user through touching the screen or other input devices.
[0078] For input events, they will pass through each stage in turn according to the processing flow of InputStage. In each stage, if the event is not marked as "Finished", the stage will process the event and return the processing result Forward or Finish. If the return result is Forward, it means that the stage has partially processed the event, but other stages are still needed to continue processing. Therefore, the event will continue to be distributed to the next stage for processing.
[0079] If the return result is Finish, it means that the event has been completely processed in this stage and no other stage needs to process it. At this point, the event will be simply forwarded to the next level (in fact, "forward to the next level" here refers more to the continuation of the event processing process, rather than the real event distribution, because the event has been marked as Finished and the subsequent stages usually do not process it substantially). But it should be noted that even if the event is marked as Finished, it will still go through the subsequent stages until it reaches the last level, SyntheticInputStage. This is to ensure the integrity and reliability of the entire input processing process.
[0080] Among them, NativePrelmelnputStage:
[0081] This phase is mainly responsible for processing input events before the input method (IME). If the application uses NativeActivity (an Activity implemented in the native layer), these events will be distributed to NativeActivity for processing. Since NativeActivity is usually more efficient, this phase is very useful in game development. However, it should be noted that NativeActivity usually does not support touch events.
[0082] ViewPrelMEInputStage:
[0083] This phase also handles input events earlier than IME, but it distributes the events to the View framework for processing. In this phase, the onKeyPreIme method of the View with input focus is called, allowing the View to receive the message and process it first before the input method processes the key event. But similarly, this phase does not support touch events.
[0084] ImelnputStage:
[0085] This stage is responsible for distributing input events to the input method (IME) for processing. It calls the onProcess method of ImeInputStage and processes the message through the dispatchInputEvent method of InputMethodManager. This stage also does not support touch events and mainly handles text input events such as keyboard input.
[0086] EarlyPostImelnputStage:
[0087] This stage is related to the touch mode. It will first determine whether the event is an input event or a touch event. If it is a touch event, it will perform the following operations:
[0088] Translate the pointer event for compatibility: If necessary, translate the pointer event to ensure compatibility. This typically involves converting the touch coordinates to coordinates in the view coordinate system.
[0089] Enter touch mode on down or scroll from any type of a device: Enter touch mode on touch press or any type of device scroll. Touch mode is a state that indicates that touch events are currently being processed.
[0090] If down event,Upon motion event within app window,close autofill ui: If it is a down event and a motion event occurs within the app window, close the autofill UI. This is to avoid interfering with the user's operation when they are typing.
[0091] Offset the scroll position: Adjust the scroll position to ensure that touch events are correctly mapped to the view.
[0092] Remember the touch position for possible drag-initiation: Record the touch position for possible initiation of a drag operation.
[0093] NativePostImplputStage:
[0094] This stage distributes input events to NativeActivity for processing (if the application uses NativeActivity). Unlike EarlyPostImelnputStage, this stage supports touch events. It submits events to the local method processing stage of NativeActivity and builds a deferrable reuse queue. This means that the execution of the operation may result in asynchronous callback results and delays.
[0095] ViewPostImplInputStage:
[0096] In this phase, input events are distributed to the View framework for processing. It is a key step for input events to enter the application layer. In this phase, input events are judged (such as touch events, key events, track events, and gesture events), and the relevant methods of the View with input focus (such as onTouchEvent, onKeyDown, onKeyUp, etc.) are called to process the events. The main steps are as follows:
[0097] mHandwritingInitiator.onTouchEvent(event): If the application supports handwriting input, the onTouchEvent method of the handwriting input initiator is called to handle touch events.
[0098] boolean handled = mView.dispatchPointerEvent(event): Dispatches the touch event to DecorView (the root view of the application) and calls its dispatchPointerEvent method to handle the event. This method returns a Boolean value indicating whether the event is handled.
[0099] As the root view of the window, DecorView can distribute the touch events processed by the InputStage responsibility chain to the View of the target application, and pass the processed touch events to the Activity.
[0100] Activity can call the dispatchTouchEvent method of the target application's View to pass the touch event to the target application's View.
[0101] After receiving the processed touch event, if View has chosen to use the touch event to present display information, it can choose not to call the onTouchEvent() method.
[0102] After receiving the processed touch event, if View does not choose to use the touch event to present display information, the View can call the onTouchEvent() method and pass the touch event as a key parameter to the onTouchEvent() method.
[0103] The onTouchEvent() method can perform corresponding operations according to the action type of the touch event. If the action type is ACTION_MOVE, the user's sliding trajectory can be rendered and presented according to the location of the touch point. Among them, the acceleration layer API (such as OpenGL ES or other graphics rendering libraries) can be called to efficiently render the sliding trajectory. If the action type is ACTION_DOWN or ACTION_UP, the touch event can be determined to be the start or end of the user's click, and the corresponding click event processing logic can be triggered accordingly.
[0104] Because the touch event is processed by the InputStage responsibility chain before being passed to the view object of the target application, the time when the target application obtains the processed touch event will be later than the time when it directly obtains the original touch event.
[0105] In this embodiment, by directly transmitting the touch event to the target application, the target application can have the opportunity to process the touch event in advance, thereby reducing processing delays and improving the speed at which the target application presents display information corresponding to the touch event, ensuring that the user can see the feedback on the screen more quickly when performing touch operations, thereby allowing the user to experience a smoother and more instant interactive experience.
[0106] Although the system layer provides an opportunity to directly pass the original touch event to the target application, and a method to pass the touch event to the target application after being processed by InputStage, the target application can receive both the touch event and the processed touch event. However, if the target application chooses to present display information based on the touch event, when the target application receives the processed touch event, since it has already presented display information based on the touch event, the target application will not repeatedly present the same display information based on the processed touch event. If the target application does not choose to present display information based on the touch event, the target application can ignore the received touch event, and when the target application receives the processed touch event, it presents display information based on the processed touch event.
[0107] As another optional embodiment of the present application, refer to Figure 3 , is a flow chart of a processing method provided in Example 2 of the present application, such as Figure 3 As shown, the method may include but is not limited to the following steps:
[0108] Step S201: obtaining a touch event in response to a touch signal.
[0109] The detailed process of step S201 can refer to the relevant introduction of step S101 in embodiment 1, which will not be repeated here.
[0110] Step S202: Obtain target information, where the target information is used to indicate that the current view object corresponding to the target application accelerates presentation of display information corresponding to the touch event.
[0111] In this embodiment, the operating system may attempt to obtain target information. The target information may include but is not limited to: at least one of first target information and second target information.
[0112] The first target information can represent whether the target application is in a state with high sensitivity to touch input and instant feedback requirements, such as the fast-paced interaction in a game application. In this state, rapid response to touch events is particularly important.
[0113] The second target information may represent whether the user has enabled touch response acceleration settings for specific applications or globally based on personal needs, and these settings reflect the user's expectations for system response speed.
[0114] Step S203: in response to being able to obtain the target information, passing the touch event to the target application; and processing the touch event and passing the processed touch event to the target application.
[0115] If the operating system can obtain the target information, it can indicate that the current view object of the target application needs to accelerate the presentation of the display information corresponding to the touch event, and the touch event can be passed to the target application, providing the target application with an opportunity to process the touch event in advance and accelerate the presentation of the display information corresponding to the touch event. In addition, the touch event can be processed according to a predetermined process, and the processed touch event can be passed to the target application.
[0116] In this step, the touch event is passed to the target application; and the touch event is processed and the processed touch event is passed to the target application. The detailed process can be referred to the relevant introduction of step S102 and step S103 in embodiment 1, which will not be repeated here.
[0117] Step S204: In response to failing to obtain the target information, processing the touch event, and transmitting the processed touch event to the target application.
[0118] If the operating system cannot obtain the target information, it may indicate that the current view object of the target application does not need to accelerate the presentation of the display information corresponding to the touch event. The operating system may process the touch event according to a predetermined process and pass the processed touch event to the target application.
[0119] In this step, the touch event is processed. The detailed process of transmitting the processed touch event to the target application can refer to the relevant introduction of step S103 in embodiment 1, which will not be repeated here.
[0120] In this embodiment, by obtaining target information, the operating system can more intelligently select the most appropriate delivery method to deliver touch events or processed touch events to the target application, which can not only improve the user experience, but also optimize the overall performance and power consumption of the electronic device to a certain extent.
[0121] As another optional embodiment of the present application, refer to Figure 4 , is a flow chart of a processing method provided in Example 3 of the present application, such as Figure 4 As shown, the method may include but is not limited to the following steps:
[0122] Step S301: In response to an accelerated activation request of at least one view object of the target application, construct an information set; the information set includes at least one target information, and the at least one target information is used to identify the at least one view object.
[0123] When one or more view objects of the target application need to enable the function of accelerating the presentation of touch events, they can send an acceleration enablement request to the operating system. The acceleration enablement request can be sent based on the user's settings (for example, the user has enabled the touch response acceleration setting for a specific application or globally), or based on the logic inside the target application (for example, in a handwriting note or drawing application, in order to reduce writing delay and smoothly display the user's writing trajectory, automatically request acceleration when it is detected that the user starts writing).
[0124] Each target information in the information set can uniquely identify a view object for which accelerated processing has been requested. The target information can include but is not limited to at least one of the following: the ID, class name, position in the view tree, etc. of the view object.
[0125] For example, in the scenario of a whiteboard application, when the function of accelerating the presentation of touch events needs to be enabled for the ForegroundView that renders the writing track, the ForegroundView of the whiteboard application can perform specific operations to request acceleration at an appropriate stage of its life cycle (such as when the onAttachedToWindow() method is called). Specifically, ForegroundView can call the setPreTouchEnabled(true) method in the View class through the reflection mechanism to indicate to the operating system that ForegroundView wants to enable accelerated processing of touch events. When the setPreTouchEnabled(true) method in the View class is called, the operating system can record the relevant information of the ForegroundView (such as view ID, class name, etc.) into the information collection.
[0126] Step S302: obtaining a touch event in response to the touch signal.
[0127] The detailed process of step S302 can refer to the relevant introduction of step S201 in embodiment 2, which will not be repeated here.
[0128] Step S303: Read the at least one target information from the information set.
[0129] Step S304: in response to the at least one target information including the target information corresponding to the current view object of the target application, passing the touch event to the target application; and processing the touch event and passing the processed touch event to the target application;
[0130] Responsive to the at least one target information including the target information corresponding to the current view object of the target application is an implementation manner of responding to being able to obtain the target information in Example 2.
[0131] Step S305: In response to the at least one target information not including the target information corresponding to the current view object of the target application, the touch event is processed, and the processed touch event is transmitted to the target application.
[0132] Responsive to the fact that the at least one target information does not include the target information corresponding to the current view object of the target application is an implementation manner of responding to the failure to obtain the target information in Example 2.
[0133] In this embodiment, by responding to an acceleration enablement request of at least one view object of the target application and constructing an information set, the view objects that need to be accelerated can be recorded in advance, so that the operating system can respond quickly when receiving a touch event and pass the touch event to the corresponding view object, thereby reducing processing delays and improving the speed at which the target application presents display information corresponding to the touch event.
[0134] As another optional embodiment of the present application, refer to Figure 5 , is a flow chart of a processing method provided in Example 4 of the present application, such as Figure 5 As shown, the method may include but is not limited to the following steps:
[0135] Step S401: receiving a touch event.
[0136] In this embodiment, when the onPreTouchEvent() method of the current view object (view) of the currently active window of the target application is called, the onPreTouchEvent() method may receive the touch event transmitted by the operating system.
[0137] Step S402: Based on the touch event, determine whether to use the touch event.
[0138] In this embodiment, in the onPreTouchEvent() method, it may be determined whether to use the touch event based on the touch event.
[0139] If yes, execute step S403; if no, execute step S404.
[0140] Step S403: presenting display information according to the touch event.
[0141] In this embodiment, display information may be presented according to the touch event in the onPreTouchEvent() method.
[0142] Step S404: presenting display information according to the received processed touch event, wherein the acquisition time of the processed touch event is later than the acquisition time of the touch event.
[0143] In this embodiment, when the dispatchTouchEvent method of the current view object of the target application is called, the processed touch event can be received. The processed touch event can refer to the relevant introduction in step S103 in embodiment 1, which will not be repeated here.
[0144] The current view object of the target application can call the onTouchEvent() method and pass the touch event as a key parameter to the onTouchEvent() method.
[0145] The onTouchEvent() method can perform corresponding operations according to the action type of the touch event.
[0146] In this embodiment, an early touch event capture mechanism is introduced before the established processing flow (i.e., after the operating system obtains the touch event, it can process the touch event and pass the processed touch event to the target application), that is, the touch event is received in the onPreTouchEvent() method of the current view object of the target application. This mechanism allows the target application to directly obtain the original touch event before the operating system completely processes the touch event and generates the processed touch event. If it is decided to use the touch event directly, the presentation of the display information will be able to bypass the delay in the processing of the touch event by the operating system in the established processing flow, which can ensure that the user can see the feedback on the screen more quickly when performing the touch operation, so that the user can experience a smoother and more immediate interactive experience.
[0147] When accelerated presentation is not required, the target application can still receive the processed touch events according to the established process and perform corresponding operations in the onTouchEvent() method, thereby ensuring the accuracy of touch event processing and providing the ability to accelerate response when needed.
[0148] As another optional embodiment of the present application, a processing method is provided for embodiment 5 of the present application. This embodiment is mainly an implementation method of step S402 in embodiment 4. Step S402 may include but is not limited to at least one of the following:
[0149] Step S4021, when receiving the touch event, determining whether the target application has enabled the target display mechanism; under the target display mechanism, using the touch event, and ignoring the processed touch event.
[0150] In this embodiment, when the target application is initialized, the view object of the target application can call the setPreTouchEnabled(true) method in the View class through the reflection mechanism to indicate to the operating system that it wishes to enable the target display mechanism. When the setPreTouchEnabled(true) method in the View class is called, the operating system can record the relevant information of the view object (such as the view ID, class name, etc.) into the information collection.
[0151] When receiving the touch event, the target application can determine whether the target display mechanism has been enabled according to the result of calling the setPreTouchEnabled(true) method before. If the result of calling the setPreTouchEnabled(true) method before is that the operating system has recorded the relevant information of the view object into the information collection, it can be determined that the target display mechanism has been enabled. Otherwise, it can be determined that the target display mechanism is not enabled.
[0152] Step S4022: Determine whether the touch event meets the target interaction condition.
[0153] The target interaction condition may be used to filter touch events required for accelerated display.
[0154] In the onPreTouchEvent() method, the target application can determine whether the received touch event meets the target interaction condition. If so, the target application can directly use the touch event to present display information.
[0155] In this embodiment, by enabling the target display mechanism and / or determining whether the touch event meets the target interaction condition, the target application can directly obtain and use the touch event before the operating system processes the touch event, thereby bypassing the operating system's processing delay of the touch event according to the established processing flow, and ensuring that the user can see the feedback on the screen more quickly when performing a touch operation, so that the user can experience a smoother and more instant interactive experience.
[0156] As another optional embodiment of the present application, a processing method is provided for Embodiment 6 of the present application. This embodiment is mainly an implementation method of step S4022 in Embodiment 5. Step S4022 may include but is not limited to at least one of the following:
[0157] Step S40221: Determine whether the target application is in the first mode between the first mode and the second mode.
[0158] In the second mode, the touch event is used to mark or select an object in the target application.
[0159] In this embodiment, marking the object in the target application may include but is not limited to: highlighting or marking an object on the interface of the target application so that the user can identify the object.
[0160] The selection of the object in the target application can be understood as: the user has selected an object in some way (such as clicking, long pressing, etc.) and is ready to perform further operations or processing on the object.
[0161] When the touch event is used to mark or select an object in the target application, the user's attention is mainly focused on selecting or confirming the object, rather than immediately seeing the display information presented by the touch event. In this scenario, the delay in display has relatively little impact on the user, so in the second mode, the touch event does not meet the target interaction condition.
[0162] The first mode is different from the second mode. In the first mode, the user expects to see feedback or changes on the screen immediately when performing a touch operation. Therefore, in the first mode, if the touch event meets the target interaction condition, it can be determined to use the touch event.
[0163] In this embodiment, by distinguishing between the first mode and the second mode, and determining the use of touch events or processed touch events according to different modes, the target application can provide users with a more personalized and customized interactive experience. In the first mode, users can enjoy smoother and more immediate feedback; while in the second mode, users can mark or select the desired object more accurately and stably.
[0164] Step S40222: Determine whether the touch position is in the first area or in the second area according to the position information in the touch event.
[0165] The second area may be used to trigger the execution of a target operation. In this embodiment, the target operation may be used to implement a specific function or behavior in a target application, such as opening a menu or starting an animation effect.
[0166] When a touch event occurs in the second area, the user's intention is usually to trigger a specific operation or function, rather than immediately seeing the screen changes or feedback caused by the touch event. In this case, the user is more concerned about the execution result of the operation rather than the instant feedback during the operation. Even if there is a certain display delay, it will not have much impact on the user's operating experience. Therefore, if the touch position is determined to be in the second area based on the position information in the touch event, it can be determined that the touch event does not meet the target interaction condition.
[0167] The first area is different from the second area. In the first area, the user's touch action can be regarded as a demand for instant feedback, so when the target application receives a touch event, it can choose to use the touch event and present display information according to the touch event.
[0168] For example, if the target application is a whiteboard application, the first area can be an area dedicated to writing. When the user performs a touch operation in this area, the operating system can obtain a touch event and directly transmit the touch event to the target application. The target application determines that the touch position is within the first area and can choose to use the touch event, which can bypass the delay in the operating system's processing of the touch event in the established processing flow, and can ensure that the user can see the writing results on the screen more quickly when performing a touch operation, so that the user can experience a smoother and more immediate writing experience.
[0169] In this embodiment, the combination of steps S40221 and S40222 is taken as an example to illustrate the implementation method of determining whether the touch event meets the target interaction condition. Figure 6 As shown, in the onPreTouchEvent() method, it can be determined whether the target application is in the first mode of the first mode and the second mode; in the second mode, the touch event is used to mark or select an object in the target application.
[0170] If in the first mode, it is determined whether the touch position is in the first area between the first area and the second area, and the second area is used to trigger the execution of the target operation.
[0171] If in the first area, display information is presented according to the touch event.
[0172] If in the second mode or in the second area, in the onTouchEvent() method, display information is presented according to the received processed touch event.
[0173] In this embodiment, if the target application is in the second mode or the touch position is in the second area, the touch event can be ignored, and the display information can be presented according to the processed touch event. If the target application is in the first mode and the touch position is in the first area, the display can be presented according to the touch event and the processed touch event can be ignored, which can bypass the processing delay of the operating system for the touch event according to the established processing flow, and can ensure that the user can see the feedback on the screen more quickly when performing the touch operation, so that the user can experience a smoother and more immediate interactive experience.
[0174] As another optional embodiment of the present application, a processing method is provided for embodiment 7 of the present application. This embodiment is mainly an implementation method of the second area of the step in embodiment 6. The second area may include but is not limited to any of the following:
[0175] The target functional area in the current view object; the controls in the target functional area are used to trigger the execution of the target operation.
[0176] The target functional area may contain one or more controls, such as buttons, sliders, switches, etc., and users may trigger corresponding functions or behaviors by interacting with these controls.
[0177] For example, the target application may include a whiteboard application. The interface of the whiteboard application may include a toolbar area, and the toolbar may include multiple target function areas. Each target function area may include a specific control or button, such as a brush selection area (including brush options of different colors and thicknesses), an eraser area, a text input area, etc. When the user wants to use a brush to draw on the whiteboard, he can directly click the corresponding brush button in the brush selection area and then start drawing on the whiteboard.
[0178] A target view object different from the current view object; the target view object is displayed overlaid on the display content of the current view object.
[0179] The target view object can be used to provide additional functions or information without interfering with the main display content of the current view object. The target view object can be a floating menu, a floating button, a floating prompt box, etc.
[0180] For example, the target application may include a whiteboard application. For example, on the interface of the whiteboard application, there is a floating menu, which may contain multiple options or functions related to whiteboard operations, such as adding shapes, adding pictures, adjusting page layout, etc. When users need to perform these operations, they can trigger the execution by clicking or dragging the corresponding options in the floating menu. The floating menu can be designed to automatically hide when the user performs whiteboard operations to avoid blocking the current whiteboard content. However, when the user needs to use the floating menu again, they can redisplay it in some way (such as clicking a button on the screen or performing a gesture operation).
[0181] In whiteboard applications, the use of target view objects (such as floating menus) can greatly improve the user's operating efficiency and convenience. By centralizing these commonly used functions or options in an easy-to-access menu, users can find and use them more quickly, thereby completing whiteboard operations more efficiently. At the same time, since the floating menu can be automatically hidden when the user does not need it, it can also avoid unnecessary interference or confusion for the user.
[0182] As another optional embodiment of the present application, a processing method is provided for Embodiment 8 of the present application, which may include but is not limited to the following steps:
[0183] Step S501: receiving a touch event.
[0184] Step S502: Obtain attribute information of the touch event.
[0185] In this embodiment, the attribute information may include but is not limited to: action type, such as ACTION_DOWN, ACTION_MOVE, ACTION_UP, etc.
[0186] Step S503: If the attribute information indicates that the touch event is a touch start event, determine whether to use the touch event based on the touch event to obtain a determination result.
[0187] If the attribute information includes ACTION_DOWN, it can be determined that the touch event is a touch start event.
[0188] If the determination result is yes, execute step S504; if the determination result is no, execute step S505.
[0189] Step S504: presenting display information according to the touch event.
[0190] Step S505: Present display information according to the received processed touch event.
[0191] Step S506: If the attribute information characterizes that the touch event is a touch move event or a touch end event, based on the determination result, execute the step of presenting display information according to the touch event or execute the step of presenting display information according to the received processed touch event.
[0192] If the attribute information includes ACTION_MOVE, it can be determined that the touch event is a touch move event.
[0193] If the attribute information includes ACTION_UP, it can be determined that the touch event is a touch end event.
[0194] In this embodiment, since it has been determined whether to use the touch event when the touch starts, the target application will no longer make a new judgment when the touch moves and ends, but will directly process these touch events based on the previous determination results. This mechanism can avoid repeated judgments every time a touch event occurs, thereby reducing unnecessary computing resource consumption, and can shorten the time required for the target application to present display information based on the touch event, further speeding up the presentation of display information, so that users can experience a smoother and more immediate interactive experience.
[0195] Next, the processing device provided in the present application is introduced. The processing device introduced below and the processing methods introduced in the above embodiments 1-3 can be referenced to each other.
[0196] Reference Figure 7 The processing device includes: a first obtaining module 100 and a transmitting module 200.
[0197] The first obtaining module 100 is used to obtain a touch event in response to a touch signal.
[0198] The transfer module 200 is used to transfer the touch event to the target application, and to process the touch event and transfer the processed touch event to the target application.
[0199] The touch event and the processed touch event are used to support the target application to present display information corresponding to the touch event.
[0200] The processing device may also include:
[0201] A second obtaining module is used to obtain target information, where the target information is used to indicate that the current view object corresponding to the target application accelerates the presentation of display information corresponding to the touch event;
[0202] The transmission module 200 may be specifically used for:
[0203] In response to being able to obtain the target information, passing the touch event to a target application; and processing the touch event and passing the processed touch event to the target application;
[0204] In response to the inability to obtain the target information, the touch event is processed and the processed touch event is transmitted to the target application.
[0205] In this embodiment, the processing device may further include:
[0206] A construction module is used to construct an information set in response to an accelerated activation request of at least one view object of the target application; the information set includes at least one target information, and the at least one target information is used to identify the at least one view object.
[0207] The second acquisition module can be used specifically for:
[0208] The at least one target information is read from the information set.
[0209] In response to being able to obtain the target information, the transmission module 200 may include:
[0210] In response to the at least one target information including the target information corresponding to the current view object of the target application.
[0211] Next, the processing device provided in the present application is introduced. The processing device introduced below and the processing methods introduced in Examples 4-8 above can be referenced to each other.
[0212] Reference Figure 8 , the processing device may include:
[0213] The receiving module 300 is used to receive a touch event;
[0214] A determination module 400, configured to determine whether to use the touch event based on the touch event;
[0215] A first presentation module 500, for presenting display information according to the touch event if it is determined to use the touch event;
[0216] The second presentation module 600 is used to present display information according to the received processed touch event if it is determined not to use the touch event, and the acquisition time of the processed touch event is later than the acquisition time of the touch event.
[0217] The determination module 400 determines whether to use the touch event based on the touch event, which may include at least one of the following:
[0218] Upon receiving the touch event, determining whether the target application has enabled a target display mechanism; under the target display mechanism, using the touch event and ignoring the processed touch event;
[0219] Determine whether the touch event satisfies a target interaction condition; the target interaction condition is used to filter touch events required for accelerated display.
[0220] The determination module 400 determines whether the touch event satisfies the target interaction condition, which may include at least one of the following:
[0221] determining whether the target application is in the first mode of a first mode and a second mode; in the second mode, the touch event is used to mark or select an object in the target application; the first mode and the second mode are different;
[0222] According to the position information in the touch event, it is determined whether the touch position is in the first area of the first area and the second area; the second area is used to trigger the execution of the target operation; the first area and the second area are different.
[0223] In this embodiment, the second area may include:
[0224] The target functional area in the current view object; the control in the target functional area is used to trigger the execution of the target operation; or,
[0225] A target view object different from the current view object; the target view object is displayed overlaid on the display content of the current view object.
[0226] The processing device may also include:
[0227] A third obtaining module, used to obtain attribute information of the touch event;
[0228] The determination module 400 may be specifically used to: if the attribute information indicates that the touch event is a touch start event, determine whether to use the touch event based on the touch event to obtain a determination result;
[0229] An execution module is used to execute the step of presenting display information according to the touch event or the step of presenting display information according to the received processed touch event based on the determination result if the attribute information characterizes that the touch event is a touch move event or a touch end event.
[0230] In another embodiment of the present application, an electronic device is provided.
[0231] Electronic equipment may include:
[0232] The memory is used to store computer programs;
[0233] The processor is used to execute the computer program so that the electronic device can implement the processing method described in any one of Examples 1-3 or the processing method described in any one of Examples 4-8.
[0234] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0235] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0236] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0237] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A processing method comprising: In response to the touch signal, a touch event is obtained; Passing the touch event to a target application; as well as Processing the touch event and transmitting the processed touch event to the target application; The touch event and the processed touch event are used to support the target application to present display information corresponding to the touch event.
2. The processing method according to claim 1, further comprising: Obtaining target information, where the target information is used to indicate that a current view object corresponding to the target application accelerates presentation of display information corresponding to the touch event; In response to being able to obtain the target information, delivering the touch event to a target application; and processing the touch event and transmitting the processed touch event to the target application; In response to the inability to obtain the target information, the touch event is processed and the processed touch event is transmitted to the target application.
3. The processing method according to claim 2, further comprising: In response to an acceleration enabling request of at least one view object of the target application, constructing an information set; The information set includes at least one target information, and the at least one target information is used to identify the at least one view object; The obtaining of target information comprises: Reading the at least one target information from the information set; In response to being able to obtain the target information, the method includes: In response to the at least one target information including the target information corresponding to the current view object of the target application.
4. A processing method comprising: Receive touch events; Based on the touch event, determining whether to use the touch event; If so, presenting display information according to the touch event; If not, display information is presented according to the received processed touch event, where the obtained time of the processed touch event is later than the obtained time of the touch event.
5. The processing method according to claim 4, wherein the determining whether to use the touch event based on the touch event comprises at least one of the following: Upon receiving the touch event, determining whether the target application has enabled a target display mechanism; under the target display mechanism, using the touch event and ignoring the processed touch event; Determine whether the touch event satisfies a target interaction condition; the target interaction condition is used to filter touch events required for accelerated display.
6. The processing method according to claim 5, wherein determining whether the touch event satisfies a target interaction condition comprises at least one of the following: determining whether the target application is in the first mode of a first mode and a second mode; In the second mode, the touch event is used to mark or select an object in the target application; The first mode and the second mode are different; Determine, according to the position information in the touch event, whether the touch position is in the first area of the first area and the second area; The second area is used to trigger the execution of the target operation; The first region and the second region are different.
7. The processing method according to claim 6, wherein the second region comprises: The target functional area in the current view object; The control in the target functional area is used to trigger the execution of the target operation; or, A target view object different from the current view object; the target view object is displayed overlaid on the display content of the current view object.
8. The processing method according to claim 4, further comprising: Obtaining attribute information of the touch event; If the attribute information indicates that the touch event is a touch start event, determining whether to use the touch event based on the touch event to obtain a determination result; If the attribute information characterizes that the touch event is a touch move event or a touch end event, the step of presenting display information according to the touch event or the step of presenting display information according to the received processed touch event is performed based on the determination result.
9. A processing device comprising: An acquisition module, used for acquiring a touch event in response to a touch signal; a transfer module, used to transfer the touch event to a target application, and to process the touch event and transfer the processed touch event to the target application; The touch event and the processed touch event are used to support the target application to present display information corresponding to the touch event.
10. An electronic device comprising: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the processing method as described in any one of claims 1 to 3 or the processing method as described in any one of claims 4 to 8.