User interaction operation response method, apparatus, device, and storage medium

By intercepting the UI control call process and using a second object to forward the processing logic to modify information, the problem of low efficiency in UI control response to user interaction methods is solved, and efficient processing logic modification is achieved.

CN119987924BActive Publication Date: 2026-01-09BEIJING 58 INFORMATION TTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510067892.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2026-01-09
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Existing technologies for intercepting and modifying the logic of UI control responses to user interactions are inefficient, especially when the method names are customizable and diverse across different user interfaces, resulting in high manpower consumption.

Method used

By intercepting the call during the process of UI control calling the first object, it is determined that the target event corresponds to the second object, and the processing logic modification information is forwarded to the first object through the second object to modify the processing logic of the target method, thus simplifying the process of modifying the processing logic of multiple target methods.

Benefits of technology

It improves the efficiency of modifying the processing logic of UI control response to user interaction operations, reduces manpower consumption and complexity, and simplifies configuration operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987924B_ABST
    Figure CN119987924B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a user interaction operation response method, device, equipment and storage medium, comprising: obtaining a user interaction operation triggered by a user on a user interface; determining a target event corresponding to the user interaction operation, a first object corresponding to the target event, and a target method in the first object for responding to the user interaction operation; in response to triggering of the target event, in the process of calling the first object, intercepting the call and determining that the target event corresponds to a second object, the second object including processing logic modification information corresponding to the target method; forwarding the processing logic modification information to the first object through the second object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method after processing logic modification, to generate a response to the user interaction operation. The present scheme intercepts the first object instead of intercepting the target method one by one, simplifies the modification process of the processing logic of the target method, and improves the processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of human-computer interaction, and particularly relates to a user interaction operation response method and device, equipment and a storage medium. BACKGROUND

[0002] In a user interface (UI), a user can perform various user interaction operations (such as: clicking, sliding, etc.), and after the UI control listens to the user interaction operations, the UI control triggers corresponding events, in response to the triggering of the events, further, the UI control calls a method in a pre-set object to respond to the user interaction operation.

[0003] In the related art, there is a need to intercept a method executed by a UI control for responding to a user interaction operation and modify the processing logic of the method (such as: adding custom processing logic), that is, the method for responding to the user interaction operation in the UI control needs to be hooked. However, in actual applications, the name of the method for responding to the user interaction operation is often customized, and the methods for responding to the user interaction operation involved in different user interfaces can be the same or different, if each method is identified and intercepted one by one based on the name of the method for responding to the user interaction operation, the human consumption is large, and the efficiency is low. SUMMARY

[0004] The embodiments of the present application provide a user interaction operation response method, device, equipment and storage medium, to improve the efficiency of modifying the processing logic in the method for responding to the user interaction operation.

[0005] In a first aspect, the embodiments of the present application provide a user interaction operation response method, applied to a UI control, the method comprising:

[0006] obtaining a user interaction operation triggered by a user on a user interface;

[0007] determining a target event corresponding to the user interaction operation, a first object corresponding to the target event, and a target method in the first object for responding to the user interaction operation;

[0008] in response to the triggering of the target event, intercepting the calling of the first object in the process of calling the first object and determining that the target event corresponds to a second object, the second object including processing logic modification information corresponding to the target method;

[0009] forward the processing logic modification information to the first object through the second object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and invokes the target method after processing logic modification to generate a response to the user interaction operation.

[0010] Optionally, in the process of invoking the first object, the invocation is intercepted and it is determined that the target event corresponds to a second object, including: in the process of invoking the first object through a first invocation method, a method name of the first invocation method is identified; in response to identifying the method name of the first invocation method, the invocation is intercepted and a second object is invoked through a second invocation method to serve as the object corresponding to the target event.

[0011] Optionally, the method further includes: determining a correspondence between the first object and the second object.

[0012] Optionally, the forwarding of the processing logic modification information to the first object through the second object includes: sending invocation information of a target method to the second object, so that the second object determines a first object containing the target method according to the correspondence, and forwards the invocation information and the processing logic modification information to the first object.

[0013] Optionally, the method further includes: determining the processing logic modification information corresponding to the target method from processing logic modification information respectively corresponding to a plurality of methods contained in the second object according to a method name of the target method.

[0014] Optionally, the first object is a delegate object pre-configured for the UI control through a defined protocol or interface.

[0015] Optionally, the first object is an object pre-configured for the UI control through setting of an object and an action to execute an action responding to the user interaction operation.

[0016] In a second aspect, an embodiment of the present application provides a user interaction operation response apparatus applied to a UI control, and the apparatus includes:

[0017] an obtaining module configured to obtain a user interaction operation triggered by a user on a user interface;

[0018] a determining module configured to determine a target event corresponding to the user interaction operation, a first object corresponding to the target event, and a target method in the first object for responding to the user interaction operation;

[0019] The processing module is configured to, in response to triggering of a target event, intercept a call of a first object and determine that the target event corresponds to a second object in a process of calling the first object, wherein the second object comprises processing logic modification information corresponding to the target method; forward the processing logic modification information to the first object through the second object, so that the first object modifies processing logic of the target method according to the processing logic modification information, and calls the target method with modified processing logic to generate a response to the user interaction operation.

[0020] Optionally, the first object is a delegate object pre-configured for the UI control by defining a protocol or an interface, or an object pre-configured for the UI control by setting an object and an action to perform an action in response to a user interaction operation.

[0021] Optionally, the processing module is specifically configured to, in a process of calling the first object through a first calling method, identify a method name of the first calling method; in response to identifying the method name of the first calling method, intercept the call and call a second object through a second calling method as an object corresponding to the target event.

[0022] Optionally, the processing module is further specifically configured to determine a corresponding relationship between the first object and the second object.

[0023] Optionally, the processing module is further specifically configured to send calling information of a target method to the second object, so that the second object determines a first object containing the target method according to the corresponding relationship, and forwards the calling information and the processing logic modification information to the first object.

[0024] Optionally, the processing module is further specifically configured to determine the processing logic modification information corresponding to the target method from processing logic modification information corresponding to a plurality of methods contained in the second object respectively according to a method name of the target method.

[0025] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a communication interface; wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor can at least implement the user interaction operation response method in the first aspect.

[0026] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the processor can at least implement the user interaction operation response method in the first aspect.

[0027] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program or instructions, when executed by a processor of an electronic device, causing the processor to implement at least the user interaction operation response method in the first aspect.

[0028] In the scheme provided by the embodiments of the present application, the first object and the target method in the first object refer to an object and a method pre-set for a UI control for responding to a user interaction operation. When a corresponding target event is triggered by the user interaction operation, the UI control invokes the first object to execute the target method, so as to realize the response to the user interaction operation. When the processing logic of the target method needs to be modified (such as adding a custom processing logic) to generate the response to the user interaction operation, the scheme intercepts the invocation of the first object in the process of invoking the first object by the UI control, and determines that the target event corresponding to the user interaction operation corresponds to the second object, and transmits the processing logic modification information of the target method to the first object through the second object, so that the first object modifies the processing logic of the target method according to the received processing logic modification information, and invokes the target method after the processing logic is modified, to generate the response to the user interaction operation, that is, the modification of the processing logic of the target method in the first object is realized by intercepting the invocation of the first object. Since one first object may contain multiple target methods, in the scheme, the modification process of the processing logic of the target method is simplified and the processing efficiency is improved by intercepting the first object instead of intercepting the target methods one by one. BRIEF DESCRIPTION OF DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0030] Figure 1 A flowchart of a user interaction operation response method provided by an embodiment of the present application;

[0031] Figure 2 A scene diagram of processing logic modification provided by an embodiment of the present application;

[0032] Figure 3 Another scene diagram of processing logic modification provided by an embodiment of the present application;

[0033] Figure 4 A flowchart of another user interaction operation response method provided by an embodiment of the present application;

[0034] Figure 5This is a schematic diagram of the structure of a user interaction operation response device provided in an embodiment of this application;

[0035] Figure 6 To and Figure 5 The illustrated embodiment provides a schematic diagram of the electronic device corresponding to the user interaction operation response device. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0038] Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0039] Before introducing the user interaction operation response method provided in the embodiments of the present invention, the relevant concepts involved in the embodiments of the present invention will be briefly explained.

[0040] User interface controls (UI controls) are interactive elements or components in a user interface, such as buttons, text boxes, checkboxes, and drop-down lists. UI controls are used for user interaction with the application; specifically, they are used to capture user interactions, execute corresponding processing logic, and ultimately display information to the user, thus responding to user interactions.

[0041] User interaction refers to the interactive behaviors that users perform with UI controls through mouse clicks, keyboard key presses, touch screens, etc. For example, clicking a button, entering text in a text box, and selecting a menu item are common user interaction operations. User interaction operations trigger events on UI controls, which in turn execute certain logical processing corresponding to those events.

[0042] Event, refers to an action or a state change occurring on a user interface, is a bridge connecting user behavior and program response, and a developer can define how to respond to user interaction through a specific event.

[0043] Object, refers to an entity in a programming language, which contains data (also known as attributes) and actions (also known as methods) that can be performed on the data, for example, an object can contain methods for responding to user interaction.

[0044] Method, refers to a piece of code belonging to an object, which defines the actions that the object can perform.

[0045] In the application scenario of UI controls, objects and methods for responding to user interaction are usually pre-configured for UI controls, when a user interaction triggers a corresponding event, the UI control calls the pre-configured object and makes it execute the method corresponding to the event contained in it, thereby realizing the response to the user interaction, such as updating the display content, processing form submission, etc.

[0046] However, in actual application, the methods for responding to user interaction pre-configured for UI controls may not fully meet the user's interaction needs. Therefore, in some cases, it is necessary to modify the processing logic in the method for responding to user interaction, such as adding custom processing logic, etc.

[0047] In related technologies, the hook method is usually used to modify the processing logic in the method for responding to user interaction. Specifically, the method for responding to user interaction is intercepted first, and then the processing logic in the intercepted method is modified.

[0048] It can be understood that in order to intercept a method, the method name of the method needs to be known. However, in actual application, the name of the method for responding to user interaction is often customized, and the methods for responding to user interaction involved in different user interfaces may be the same or different, if each method is identified and intercepted one by one based on the name of the method for responding to user interaction, it will consume a lot of manpower and be inefficient.

[0049] For ease of understanding, for example, assume that there are 4 pages, and each page contains 4 UI controls of list A, list B, list B and list D, wherein each UI control is pre-configured with objects and methods for responding to user interaction operations. When the processing logic in the method for responding to user interaction operations needs to be modified, the method name of each UI control corresponding method in each page needs to be obtained, and the interception logic is configured based on the method name. In the case of each UI control corresponding to at least one method for responding to user interaction operations, at least 16 times of method interception logic configuration are required. When the number of pages, the number of UI controls involved in the page, and the number of methods corresponding to the UI controls for responding to user interaction operations are large, the acquisition of the names of the methods for responding to user interaction operations, the configuration of the interception logic and the processing logic modification information will become more complex and consume more manpower.

[0050] To solve at least one of the above technical problems and improve the efficiency of modifying the processing logic in the method for responding to user interaction operations, an embodiment of the present application provides a user interaction operation response method, the basic idea of which is: when the processing logic of the pre-configured target method for responding to user interaction operations needs to be modified, in the process of calling the first object where the target method is located, the call is intercepted, and it is determined that the target event corresponding to the user interaction operation corresponds to the second object. Then, the processing logic modification information corresponding to the target method is forwarded to the first object through the second object, so that the first object modifies the processing logic of the target method according to the received processing logic modification information, and calls the target method after the processing logic is modified, to generate the response of the user interaction operation, that is, the modification of the processing logic of the target method in the first object is realized by intercepting the call of the first object. In this scheme, since one first object may contain multiple target methods, the modification process of the processing logic of the target method is simplified and the processing efficiency is improved by intercepting the first object instead of intercepting the target method one by one in this scheme.

[0051] The user interaction operation response method provided by the embodiments of the present application will be described below in conjunction with the drawings.

[0052] The user interaction operation response method provided by the embodiments of the present application is applied to a UI control and can be executed by an electronic device deploying a computer program corresponding to the UI control. The electronic device can be a terminal device such as a PC, a notebook computer, a smart phone, etc., or a server. The server can be a physical server containing an independent host, or a virtual server, or a cloud server or a server cluster.

[0053] Figure 1 The flowchart of the user interaction operation response method provided by the embodiments of the present application is as follows:Figure 1 As shown, the method can comprise the following steps:

[0054] 101. Acquire a user interaction operation triggered by a user on a user interface.

[0055] 102. Determine a target event corresponding to the user interaction operation, a first object corresponding to the target event, and a target method in the first object for responding to the user interaction operation.

[0056] 103. In response to triggering of the target event, in a process of calling the first object, intercept the call and determine that the target event corresponds to a second object, and the second object comprises processing logic modification information corresponding to the target method.

[0057] 104. Forward the processing logic modification information to the first object through the second object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method after modification of the processing logic to generate a response to the user interaction operation.

[0058] In the specific implementation process, the UI control listens to a user interaction operation (such as a click, a swipe, etc.) triggered by a user on a user interface, and triggers a corresponding event when the user interaction operation occurs. For example, when a click operation triggered by a user on a user interface is listened to, a click event is triggered; when a swipe operation triggered by a user on a user interface is listened to, a swipe event is triggered.

[0059] Optionally, different events corresponding to different user interaction operations can be set in advance. In addition, objects and methods corresponding to different events for responding to the user interaction operations can also be set in advance, that is, the objects and methods for responding to the user interaction operations set in advance for the UI control mentioned above.

[0060] In the embodiments of the present application, for the convenience of description, the event corresponding to the user interaction operation is referred to as a target event, and the object and the method corresponding to the target event for responding to the user interaction operation are referred to as a first object and a target method, wherein the first object contains the target method. In other words, the first object is an object that needs to be called by the UI control in response to the user interaction operation, and the target method in the first object is a method that needs to be called by the UI control in response to the user interaction operation.

[0061] When the processing logic of the target method does not need to be modified, in response to triggering of the target event, the UI control determines the first object corresponding to the target event, and the target method in the first object for responding to the user interaction operation; then, the UI control calls the first object, so that the first object calls the target method, thereby generating a response to the user interaction operation.

[0062] For the case that the processing logic of the target method needs to be modified, for the convenience of understanding, combined with Figure 2 and Figure 3 are exemplified, Figure 2 a scene diagram of processing logic modification is provided for the embodiments of the present application.

[0063] As Figure 2 shown, in response to the triggering of the target event, the UI control first calls the first object; then, in the process of calling the target method by the first object, the calling is intercepted (i.e., the calling of the target method by the first object is intercepted) based on the method name of the target method, and the processing logic in the target method is modified, such as adding new processing logic in the target method, or modifying the execution order of the processing logic, etc.; finally, the target method with the modified processing logic is called through the first object, so as to realize the response to the user interactive operation corresponding to the target event.

[0064] However, Figure 2 the processing logic modification method shown in the foregoing text needs to configure the interception logic and the processing logic modification information for each target method respectively, when the number of pages, the number of UI controls involved in the pages, and the number of methods corresponding to the UI controls for responding to the user interactive operation are large, the configuration operation will become complex, a large amount of manpower will be consumed, and the efficiency is low.

[0065] Based on this, another way of modifying the processing logic is provided for the embodiments of the present application, as Figure 3 shown, Figure 3 another scene diagram of processing logic modification is provided for the embodiments of the present application.

[0066] As Figure 3 shown, in response to the triggering of the target event, in the process of calling the first object by the UI control, the calling is intercepted (i.e., the calling of the first object by the UI control is intercepted), and it is determined that the target event corresponds to the second object. The second object has pre-configured processing logic modification information corresponding to a plurality of different methods, and the processing logic modification information includes the processing logic modification information corresponding to the target method. Then, the UI control calls the second object to forward the processing logic modification information of the target method to the first object through the second object. After receiving the processing logic modification information of the target method, the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method with the modified processing logic, so as to realize the response to the user interactive operation corresponding to the target event.

[0067] Optionally, the processing logic modification information corresponding to the target method can be determined from the processing logic modification information corresponding to a plurality of methods respectively included in the second object according to the method name of the target method included in the first object.

[0068] It's easy to understand that when the first object contains more than one target method, configuring the corresponding interception logic for one first object is sufficient to intercept multiple different target methods within that first object, effectively simplifying the configuration of the interception logic. Since the processing logic modification information contained in the second object is a collection of processing logic modification information corresponding to various different methods, when the second object contains a sufficient amount of processing logic modification information corresponding to different methods, it's unnecessary to configure separate processing logic modification information for each first object. Different first objects can use the same second object, because the second object can contain the processing logic modification information corresponding to the target methods in each different first object. This effectively simplifies the configuration process of the processing logic information. This solution optimizes both the configuration of the interception logic and the configuration of the processing logic information, effectively reducing the difficulty of modifying the processing logic of target methods and improving the efficiency of modifying the processing logic of target methods.

[0069] Furthermore, it's understandable that when storing modification information for processing logic corresponding to multiple different methods through a second object, if modifications to the processing logic modification information corresponding to the target method are needed, then only the information stored in the second object needs to be modified; that is, only one modification is required. And using... Figure 2 The method shown, if the interception logic and processing logic modification information for the target method are configured on different pages, then when the processing logic modification information corresponding to the target method needs to be modified, the processing logic modification information for the target method on each page needs to be modified, i.e., multiple modifications are required. Therefore, the solution provided in this application embodiment can also improve the efficiency of modifying the processing logic modification information corresponding to the target method, and correspondingly, it can also improve the efficiency of modifying the processing logic corresponding to the target method.

[0070] The overall process of the user interaction operation response method provided in the embodiments of this application has been described above. This includes the modification process of the processing logic in the user interaction operation response method (such as...). Figure 3 The following is a summary of the general description shown (as indicated). Figure 3 The corresponding processing logic modification process will be explained in detail.

[0071] Figure 4 A flowchart of another user interaction operation response method provided in the embodiments of this application is shown below. Figure 4 As shown, it may include the following steps:

[0072] 401. Obtain user interaction actions triggered by the user on the user interface.

[0073] 402. Determine the target event corresponding to the user interaction operation, the first object corresponding to the target event, and the target method in the first object for responding to the user interaction operation.

[0074] 403. In response to triggering of the target event, identify the method name of the first calling method in the process of calling the first object by the first calling method; in response to identifying the method name of the first calling method, intercept the call and call the second object by the second calling method as the object corresponding to the target event, the second object including the processing logic modification information corresponding to the target method.

[0075] 404. Determine the correspondence between the first object and the second object; send the calling information of the target method to the second object, so that the second object determines the first object containing the target method according to the correspondence, and forwards the calling information and the processing logic modification information to the first object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method after modification of the processing logic to generate the response of the user interaction operation.

[0076] In the specific implementation process of steps 401 and 402, reference can be made to the foregoing embodiments, which will not be described herein again. The embodiments of the present application focus on the modification process of the processing logic corresponding to the target method.

[0077] In actual application, the UI control usually uses the corresponding calling method to call each object when calling different objects. For ease of description, in the embodiments of the present application, the calling method for calling the first object is referred to as the first calling method, and the calling method for calling the second object is referred to as the second calling method.

[0078] The method name of the target method is usually self-defined, and the method name of the first calling method is usually specific and not easy to change. Therefore, optionally, the interception of the UI control calling the first object can be implemented based on the method name of the first calling method.

[0079] In the specific implementation process, in response to triggering of the target event, the method name of the first calling method can be identified in the process of calling the first object by the first calling method. In response to identifying the method name of the first calling method, the call is intercepted (i.e., the call of the UI control to the first object is intercepted), and the second object is called by the preconfigured second calling method as the object corresponding to the target event.

[0080] From the perspective of the UI control, after the interception processing, it still calls the object for responding to the user interaction operation, but it actually calls the second object instead of the first object. In the case where the UI control calls the object for responding to the user interaction operation, it further sends the calling information to the called object (i.e., the second object) to make it call the target method for responding to the user interaction operation.

[0081] In the embodiment of the present application, the core role of the second object is to provide processing logic modification information corresponding to different methods. In order to realize the modification of the processing logic of the target method in the first object and the calling of the target method after the processing logic is modified, in the embodiment of the present application, after intercepting the calling of the UI control to the first object, it is further determined that the corresponding relationship between the first object and the second object.

[0082] Therefore, after receiving the calling information sent by the UI control, the second object can determine the first object containing the target method according to the corresponding relationship between the first object and the second object, and forward the calling information and the processing logic modification information to the first object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method after the processing logic is modified, to generate the response of the user interaction operation.

[0083] Optionally, in order to realize the above-mentioned forwarding function, the second object does not contain any target method for responding to the user interaction operation. In the specific implementation process, after receiving the calling information sent by the UI control, the second object first judges whether the second object contains the target method corresponding to the calling information, if not, according to the corresponding relationship between the first object and the second object, the first object containing the target method is determined, and the calling information and the processing logic modification information are forwarded to the first object.

[0084] In summary, in the embodiment of the present application, since the method name of the first calling method is usually not easy to change, by identifying the method name of the first calling method to intercept the calling of the UI control to the first object, the interception difficulty can be effectively reduced, and the efficiency and accuracy of modifying the processing logic of the target method are improved.

[0085] The above-mentioned user interaction operation response method is illustrated by two specific application scenarios.

[0086] In an optional embodiment, the first object is a delegate object pre-configured for the UI control by defining a protocol or an interface.

[0087] In actual application, the corresponding delegate object can be configured for the UI control through the delegate mode, and the delegate object contains the target method for responding to the user interactive operation. The delegate mode is a design mode for defining a protocol or interface, so that one object (i.e., the UI control) can notify another object (i.e., the delegate object) of what event occurs and instruct the delegate object to respond to the event, such as calling the target method to respond to the target event corresponding to the user interactive operation.

[0088] In the scenario where the first object is the delegate object, the UI control listens to the user interactive operation triggered by the user on the user interface and triggers the corresponding target event when the user interactive operation occurs. In response to the triggering of the target event, the UI control determines the delegate object corresponding to the target event and the target method in the delegate object for responding to the user interactive operation based on the pre-configuration.

[0089] After that, if the processing logic of the target method needs to be modified, the method name of the first calling method can be identified in the process of calling the delegate object through the first calling method. In response to identifying the method name of the first calling method, the call (i.e., the call of the UI control to the delegate object) is intercepted, and the second object is called through the pre-configured second calling method to serve as the actual delegate object corresponding to the target event, and the corresponding relationship between the delegate object (the original delegate object) and the second object (the actual delegate object) is determined.

[0090] After receiving the call information sent by the UI control, the second object determines the delegate object containing the target method according to the corresponding relationship between the delegate object and the second object, and forwards the call information and the processing logic modification information to the delegate object, so that the delegate object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method after the processing logic is modified to generate the response of the user interactive operation.

[0091] According to the corresponding relationship between the delegate object and the second object, the delegate object containing the target method is determined, including: through a message searching process, in the case where the second object does not contain the target method corresponding to the call information, the delegate object containing the target method is determined according to the corresponding relationship between the delegate object and the second object, and the call information and the processing logic modification information are forwarded to the delegate object.

[0092] In another optional embodiment, the first object is an object for performing an action for responding to a user interactive operation, which is pre-configured for the UI control by setting the object and the action.

[0093] In practical applications, the UI control can be configured with a corresponding object (i.e., Target, also referred to as the first object) and action (i.e., action, also referred to as the target method) for responding to user interaction operations through the addTarget(_:action:for:) method.

[0094] For example, take addTarget: (id) target action: (SEL) action forContro lEvents: (UIContro l Events) contro l Events as an example, where id represents the id of the first object configured for the UI control to respond to user interaction operations, (SEL) action is the method name of the target method, and contro lEvents (i.e., control events) specifies the target event that triggers the call of the target method.

[0095] Suppose that the first object configured for the UI control through the addTarget(_:action:for:) method is Target a, the target method is action b contained in Target a, and Target a and action b are called under the target event, then in response to the triggering of the target event, the UI control determines the Target a corresponding to the target event and the action b in Target a for responding to user interaction operations based on the pre-configuration.

[0096] After that, if it is necessary to modify the processing logic of action b, the method name of the first calling method can be identified in the process of calling Target a through the first calling method. In response to identifying the method name of the first calling method, the call is intercepted (i.e., the call of the UI control to Target a is intercepted), and a second object is called through a pre-configured second calling method to serve as the actual Target a corresponding to the target event, and the corresponding relationship between Target a (the original Target) and the second object (the actual Target) is determined.

[0097] After receiving the call information sent by the UI control, the second object determines Target a containing action b according to the corresponding relationship between Target a and the second object, and forwards the call information and processing logic modification information to Target a, so that Target a modifies the processing logic of action b according to the processing logic modification information, and calls the processing logic modified action b to generate a response to the user interaction operation.

[0098] The Target a containing the action b is determined according to the correspondence between the Target a and the second object, including: in the case that the second object does not contain the action b corresponding to the calling information through the message searching process, the Target a containing the action b is determined according to the correspondence between the Target a and the second object, and the calling information and the processing logic modification information are forwarded to the Target a.

[0099] Optionally, the message searching process can be implemented through a forwardingTargetForSe lector method.

[0100] Based on the above examples, in the embodiments of the present application, in the scenario where the processing logic of the target method needs to be modified, the second object acts as an intermediary in the process of calling the first object by the UI object, on the one hand, for receiving the calling information sent by the UI control, and on the other hand, for determining the processing logic modification information corresponding to the target method, and forwarding the calling information and the processing logic modification information to the first object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method with modified processing logic, to generate a response to the user interaction operation. By taking the second object as an intermediary, the difficulty of modifying the processing logic of the target method can be effectively reduced, and the efficiency of modifying the processing logic of the target method can be improved.

[0101] The user interaction operation response device of one or more embodiments of the present application will be described in detail below. Those skilled in the art can understand that these devices can be configured using commercially available hardware components through the steps taught by the present application.

[0102] Figure 5 A structural schematic diagram of a user interaction operation response device provided by an embodiment of the present application is shown in FIG. 1, which includes an acquisition module 11, a determination module 12, and a processing module 13. Figure 5

[0103] The acquisition module 11 is configured to acquire a user interaction operation triggered by a user on a user interface.

[0104] The determination module 12 is configured to determine a target event corresponding to the user interaction operation, a first object corresponding to the target event, and a target method in the first object for responding to the user interaction operation.

[0105] ​The processing module 13 is configured to, in response to triggering of the target event, intercept the call in the process of calling the first object and determine that the target event corresponds to a second object, the second object including processing logic modification information corresponding to the target method; forward the processing logic modification information to the first object through the second object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method with modified processing logic to generate a response to the user interaction operation.

[0106] Optionally, the first object is a delegate object pre-configured for the UI control by defining a protocol or an interface, or an object pre-configured for the UI control by setting an object and an action to perform an action in response to a user interaction operation.

[0107] Optionally, the processing module 13 is specifically configured to, in the process of calling the first object through a first calling method, identify a method name of the first calling method; in response to identifying the method name of the first calling method, intercept the call and call a second object through a second calling method as an object corresponding to the target event.

[0108] Optionally, the processing module 13 is further specifically configured to determine a corresponding relationship between the first object and the second object.

[0109] Optionally, the processing module 13 is further specifically configured to send calling information of a target method to the second object, so that the second object determines a first object containing the target method according to the corresponding relationship, and forwards the calling information and the processing logic modification information to the first object.

[0110] Optionally, the processing module 13 is further specifically configured to determine the processing logic modification information corresponding to the target method from processing logic modification information corresponding to a plurality of methods contained in the second object respectively.

[0111] Figure 5 The apparatus can perform the steps introduced in the foregoing embodiments, and the detailed execution process and technical effects can be referred to the descriptions in the foregoing embodiments, which will not be repeated here.

[0112] In one possible design, the above Figure 5 The structure of the user interaction operation response apparatus can be implemented as an electronic device, such as a mobile phone, a tablet computer, a computer, a server, or the like. Figure 6As shown, the electronic device can include a memory 21, a processor 22, and a communication interface 23. The memory 21 stores a computer program, which, when executed by the processor 22, causes the processor 22 to implement at least the user interaction operation response method provided in the foregoing embodiments.

[0113] The memory 21 can be implemented by any type of volatile or nonvolatile memory device or a combination thereof, such as a static random-access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.

[0114] Accordingly, the embodiments of the present application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement each step in the above method embodiments. The computer-readable storage medium can be implemented by volatile or nonvolatile memory or a combination thereof, and can be removable or non-removable. Examples of the computer-readable storage medium include, but are not limited to, a phase-change random access memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), other types of random access memory (RAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a flash memory, or other memory technologies, a compact disc read-only memory (CD-ROM), a digital video disc (DVD), or other optical storage, a magnetic cassette, a magnetic tape disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store computer programs

[0115] Accordingly, the embodiments of the present application also provide a computer program product, which comprises computer programs or instructions, and when the computer programs or instructions are executed by a processor, the processor can realize each step in the above-mentioned method embodiments. It should be understood that each process or a combination of multiple processes in the above-mentioned method flow can be realized by the computer programs or instructions. In addition, these computer programs or instructions can be applied to a general-purpose computer, a special-purpose computer, an embedded processor or a processor of other programmable user interactive operation responsive devices, so that the general-purpose computer, the special-purpose computer, the embedded processor or the processor of other programmable user interactive operation responsive devices can be realized as an apparatus for realizing the corresponding functions in the above-mentioned method embodiments.

[0116] The apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate. Part or all of the modules can be selected according to actual needs to achieve the purposes of the embodiments. Those skilled in the art can understand and implement without creative labor.

[0117] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of a general hardware platform as necessary, and of course can also be realized by means of a combination of hardware and software. Based on such understanding, the above technical solutions can be embodied in the form of a computer product in essence or in the form of a contribution to the prior art. The present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0118] Finally, it should be noted that the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices comprising a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of another identical element in the process, method, article or device comprising the element.

[0119] The above is only an embodiment of the present application and is not intended to limit the present application. The present application can have various changes and modifications for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the scope of claims of the present application.

Claims

1. A user interaction operation response method, characterized in that, Applied to UI controls, including: Get user interaction actions triggered by the user on the user interface; Determine the target event corresponding to the user interaction operation, the first object corresponding to the target event, and the target method in the first object used to respond to the user interaction operation; In response to the triggering of the target event, during the invocation of the first object, the invocation is intercepted and it is determined that the target event corresponds to a second object, the second object including the processing logic modification information corresponding to the target method; The second object forwards the processing logic modification information to the first object, so that the first object modifies the processing logic of the target method according to the processing logic modification information and calls the target method after the processing logic modification to generate the response of the user interaction operation.

2. The method according to claim 1, characterized in that, The step of intercepting the call and determining that the target event corresponds to the second object during the invocation of the first object includes: During the process of calling the first object through the first calling method, the method name of the first calling method is identified; In response to the identification of the method name of the first calling method, the call is intercepted and a second object is invoked through a second calling method as the object corresponding to the target event.

3. The method according to claim 2, characterized in that, The method further includes: Determine the correspondence between the first object and the second object.

4. The method according to claim 3, characterized in that, The step of forwarding the processing logic modification information to the first object through the second object includes: The second object sends the call information of the target method to the second object, so that the second object determines the first object containing the target method according to the correspondence, and forwards the call information and the processing logic modification information to the first object.

5. The method according to claim 1, characterized in that, The method further includes: Based on the method name of the target method, the processing logic modification information corresponding to the target method is determined from the processing logic modification information corresponding to the various methods contained in the second object.

6. The method according to any one of claims 1 to 5, characterized in that, The first object is a delegate object pre-configured for the UI control by defining a protocol or interface.

7. The method according to any one of claims 1 to 5, characterized in that, The first object is an object pre-configured for the UI control by setting objects and actions to perform actions in response to user interaction.

8. A user interaction operation response device, characterized in that, Applied to UI controls, including: The acquisition module is used to acquire user interaction operations triggered by the user on the user interface; The determination module is used to determine the target event corresponding to the user interaction operation, the first object corresponding to the target event, and the target method in the first object used to respond to the user interaction operation. The processing module is used to respond to the triggering of a target event, intercept the call during the invocation of the first object and determine that the target event corresponds to a second object, the second object including the processing logic modification information corresponding to the target method; and forward the processing logic modification information to the first object through the second object, so that the first object modifies the processing logic of the target method according to the processing logic modification information, and calls the target method with modified processing logic to generate the response of the user interaction operation.

9. An electronic device, characterized in that, include: The system includes a memory, a processor, and a communication interface; wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the user interaction response 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 a computer program that, when executed by a processor of an electronic device, causes the processor to perform the user interaction operation response method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • User interface production method and device, storage medium and computer equipment

    CN112494940A

  • Modifying system-defined user interface control functionality on a computing device

    US10235216B1