Interaction event processing method and apparatus, electronic device, and computer readable medium

By means of patents, prior art, and prior art problems, the prior art problems are solved.

CN117608452BActive Publication Date: 2026-07-10CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-11-30
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

When there are too many JavaScript interactions with native events, the number of if-else statements increases dramatically, leading to problems such as decreased readability, difficulty in maintenance, poor scalability, code duplication, and high maintenance costs.

Method used

By responding to clicks on the option control, the native method for selecting options is invoked, the attributes of the click operation are determined, and interaction is performed using callback functions or asynchronous frameworks. Based on the interaction method, the event of selecting the option is passed to the management class, encapsulated and registered to the container, and the interaction events are dynamically managed. Annotations on the implementation class are used to avoid data duplication.

Benefits of technology

It achieves centralized object management, loose coupling, dynamism, and ease of maintenance, reduces maintenance costs, avoids code redundancy, has stronger pluggability, and improves the readability and management efficiency of interactive events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117608452B_ABST
    Figure CN117608452B_ABST
Patent Text Reader

Abstract

The application discloses an interactive event processing method and device, electronic equipment and a computer readable medium, relates to the technical field of mobile Internet, and the method comprises the following steps: in response to a click operation on an option control, a method for selecting an option of a native end is triggered; the attribute of the click operation is determined, in response to the attribute corresponding to a non-time-consuming operation, it is determined that the interaction mode with the native end is using a callback function or using event triggering, in response to the attribute corresponding to a time-consuming operation, it is determined that the interaction mode with the native end is using an asynchronous framework, and the interactive event is delivered to the management class based on the interaction mode; the corresponding container and the number of interactive events are determined, in response to the number exceeding a preset threshold, the registration module type corresponding to the interactive event is determined, and then the interactive event is encapsulated and registered to the container; a command object corresponding to the interactive event of selecting the option is found from the container after registration is completed; and the command corresponding to the command object is executed. The object can be centrally managed, and the maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mobile internet technology, and in particular to an interactive event processing method, apparatus, electronic device, and computer-readable medium. Background Technology

[0002] Currently, WebView (a component used to load web pages, similar to a browser) technology is a technique for embedding web pages into native applications. It allows developers to build user interfaces using web technologies while also invoking native application functions and services. With the rise of mobile platforms such as Android and iOS, WebView technology has also expanded to these platforms, allowing developers to use it on different operating systems and devices. However, when JavaScript (JS, a lightweight, interpreted or just-in-time compiled programming language with function priority) interacts with native applications excessively, the number of if-else statements increases dramatically, leading to decreased readability, maintenance difficulties, poor scalability, code duplication, and increased maintenance costs. Summary of the Invention

[0003] In view of this, embodiments of this application provide an interactive event handling method, apparatus, electronic device, and computer-readable medium, which can solve the problems of existing methods where, when there are too many JavaScript and native interactive events, the if-else statements increase dramatically, leading to decreased readability, maintenance difficulties, poor scalability, code duplication, and increased maintenance costs.

[0004] To achieve the above objectives, according to one aspect of the embodiments of this application, an interactive event handling method is provided, comprising:

[0005] In response to a click on the option control, the native method for selecting options is invoked.

[0006] The attributes of the click operation are determined. In response to the attribute corresponding to a non-time-consuming operation, the interaction method with the native client is determined to be either using a callback function or using an event trigger. In response to the attribute corresponding to a time-consuming operation, the interaction method with the native client is determined to be using an asynchronous framework. Based on the interaction method, the corresponding selection option interaction event is passed to the management class. The management class is obtained by calling the native application programming interface from the programming language interface.

[0007] Based on the interaction events of the selected options, determine the corresponding container;

[0008] The number of interaction events is determined. In response to the number exceeding a preset threshold, the registration module type corresponding to the interaction event is determined. An object encapsulation process is invoked to encapsulate the interaction event based on the registration module type and then register it to the container. In response to the container registration being completed, the command object corresponding to the interaction event of the selected option is searched from the registered container.

[0009] Execute the command corresponding to the command object.

[0010] Optionally, interactive events are encapsulated based on the registration module type and then registered to the container, including:

[0011] Based on the registered module type, interactive events are encapsulated into corresponding command objects;

[0012] Register the key and value to the container using the event name of the interactive event as the key and the corresponding command object as the value.

[0013] Optionally, before executing the command corresponding to the command object, the method may also include:

[0014] In response to modification operations on interactive events, the command object is modified within the container based on the modification operations, and the container is updated.

[0015] Optionally, the interactive event handling method also includes:

[0016] In response to an interactive event extension request, the corresponding key-value pair is determined, an implementation class annotation is added to the value of the corresponding key-value pair, and then the container is registered with the corresponding key-value pair based on the implementation class annotation.

[0017] Optionally, the container performs a registration process for the corresponding key-value pairs based on implementation class annotations, including:

[0018] Retrieve the registry entry corresponding to the container, and perform a validation process based on the corresponding key-value pairs, implementation class annotations, and registry entries. If the validation passes, add the corresponding key-value pairs to the registry. If the validation fails, prompt duplicate registration information and delete the corresponding key-value pairs.

[0019] Optionally, execute the command corresponding to the command object, including:

[0020] In response to detecting a modification to the command object during command execution, the execution of the command is stopped; in response to receiving a modification end marker, the command object is updated, and the command corresponding to the updated command object is executed.

[0021] Optionally, the interaction events for passing the corresponding selection options to the management class based on the interaction method include:

[0022] In response to the property corresponding to a non-time-consuming operation, the interaction method with the native side is determined to be either using a callback function or using an event trigger. The following process is then executed: When the interaction method with the native side uses a callback function, in response to the successful invocation of the native side's method for selecting an option, the callback function is invoked to send a success message to the programming language. The programming language then sends the interaction event corresponding to the selected option to the management class. When the interaction method with the native side uses an event trigger, in response to the successful invocation of the native side's method for selecting an option, a preset function event is triggered to notify the programming language of the successful invocation of the native side's method for selecting an option. The programming language then sends the interaction event corresponding to the selected option to the management class.

[0023] In response to the property corresponding to a time-consuming operation, the interaction method with the native side is determined to be using an asynchronous framework. The following process is then executed: the asynchronous framework is called, and the method for selecting options on the native side is executed in a background thread. In response to the successful call to the method for selecting options on the native side, a success message is sent to the programming language, which then sends the interaction event of the selection option corresponding to the method for selecting options to the management class.

[0024] In addition, this application also provides an interactive event handling device, including:

[0025] The trigger unit is configured to respond to a click operation on the option control by triggering a call to the native option selection method;

[0026] An interactive event transmission unit is configured to determine the attribute of the click operation, and in response to the attribute corresponding to a non-time-consuming operation, determine the interaction method with the native client as using a callback function or using event triggering; in response to the attribute corresponding to a time-consuming operation, determine the interaction method with the native client as using an asynchronous framework; and based on the interaction method, transmit the corresponding selection option interaction event to the management class, wherein the management class is obtained by calling the native application programming interface from the programming language interface.

[0027] The container determination unit is configured to determine the corresponding container based on the interaction event of the selected option;

[0028] The command object lookup unit is configured to determine the number of the interaction events, and in response to the number exceeding a preset threshold, determine the registration module type corresponding to the interaction event, call the object encapsulation process to encapsulate the interaction event based on the registration module type, and then register it to the container, and in response to the container registration being completed, search for the command object corresponding to the interaction event of the selected option from the registered container.

[0029] The command execution unit is configured to execute the command corresponding to the command object.

[0030] Optionally, the interactive event handling device further includes a registration unit, configured to:

[0031] Based on the registered module type, interactive events are encapsulated into corresponding command objects;

[0032] Register the key and value to the container using the event name of the interactive event as the key and the corresponding command object as the value.

[0033] Optionally, the interactive event handling device further includes an update unit, configured to:

[0034] In response to modification operations on interactive events, the command object is modified within the container based on the modification operations, and the container is updated.

[0035] Optionally, the interactive event handling device further includes an extension unit configured to:

[0036] In response to an interactive event extension request, the corresponding key-value pair is determined, an implementation class annotation is added to the value of the corresponding key-value pair, and then the container is registered with the corresponding key-value pair based on the implementation class annotation.

[0037] Optionally, the expansion unit is further configured to:

[0038] Retrieve the registry entry corresponding to the container, and perform a validation process based on the corresponding key-value pairs, implementation class annotations, and registry entries. If the validation passes, add the corresponding key-value pairs to the registry. If the validation fails, prompt duplicate registration information and delete the corresponding key-value pairs.

[0039] Optionally, the command execution unit is further configured to:

[0040] In response to detecting a modification to the command object during command execution, the execution of the command is stopped; in response to receiving a modification end marker, the command object is updated, and the command corresponding to the updated command object is executed.

[0041] Optionally, the interactive event delivery unit is further configured to:

[0042] In response to the property corresponding to a non-time-consuming operation, the interaction method with the native side is determined to be either using a callback function or using an event trigger. The following process is then executed: When the interaction method with the native side uses a callback function, in response to the successful invocation of the native side's method for selecting an option, the callback function is invoked to send a success message to the programming language. The programming language then sends the interaction event corresponding to the selected option to the management class. When the interaction method with the native side uses an event trigger, in response to the successful invocation of the native side's method for selecting an option, a preset function event is triggered to notify the programming language of the successful invocation of the native side's method for selecting an option. The programming language then sends the interaction event corresponding to the selected option to the management class.

[0043] In response to the property corresponding to a time-consuming operation, the interaction method with the native side is determined to be using an asynchronous framework. The following process is then executed: the asynchronous framework is called, and the method for selecting options on the native side is executed in a background thread. In response to the successful call to the method for selecting options on the native side, a success message is sent to the programming language, which then sends the interaction event of the selection option corresponding to the method for selecting options to the management class.

[0044] In addition, this application also provides an interactive event processing electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the interactive event processing method described above.

[0045] In addition, this application also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the interactive event handling method described above.

[0046] To achieve the above objectives, according to another aspect of the embodiments of this application, a computer program product is provided.

[0047] A computer program product according to an embodiment of this application includes a computer program that, when executed by a processor, implements the interactive event handling method provided in an embodiment of this application.

[0048] One embodiment of the above invention has the following advantages or beneficial effects: This application, in response to a click operation on an option control, triggers a call to the native option selection method, thereby determining the attribute of the click operation. If the attribute corresponds to a non-time-consuming operation, the interaction method with the native end is determined to be either using a callback function or event triggering. If the attribute corresponds to a time-consuming operation, the interaction method with the native end is determined to be using an asynchronous framework. Based on the interaction method, the corresponding selection option's interaction event is passed to the management class, where the management class is obtained by calling the native application programming interface from the programming language interface. Based on the selection option's interaction event, the corresponding container is determined, and the number of interaction events is determined. If the number exceeds a preset threshold, the registration module type corresponding to the interaction event is determined, and an object encapsulation process is called to encapsulate the interaction event based on the registration module type, thereby registering it to the container. Upon completion of container registration, the command object corresponding to the selection option's interaction event is found in the registered container; the command corresponding to the command object is executed. This achieves centralized object management, loose coupling, dynamism, ease of maintenance, reduced maintenance costs, code reuse, avoidance of code redundancy, and stronger pluggability.

[0049] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0050] The accompanying drawings are provided to better understand this application and do not constitute an undue limitation thereof. Wherein:

[0051] Figure 1 This is a schematic diagram of the main flow of an interactive event handling method according to an embodiment of this application;

[0052] Figure 2 This is a schematic diagram of the main flow of an interactive event handling method according to an embodiment of this application;

[0053] Figure 3 This is a schematic diagram of the main flow of an interactive event handling method according to an embodiment of this application;

[0054] Figure 4 This is a schematic diagram of the main units of the interactive event handling device according to an embodiment of this application;

[0055] Figure 5 This is an exemplary system architecture diagram to which embodiments of this application can be applied;

[0056] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers in the embodiments of this application. Detailed Implementation

[0057] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the collection, analysis, use, transmission, and storage of user personal information involved in the technical solutions of this application comply with relevant laws and regulations, are used for legitimate and reasonable purposes, are not shared, disclosed, or sold outside of these legitimate uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0058] When used, including in certain relevant applications, data is deidentified to protect user privacy, for example by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and / or other methods.

[0059] Figure 1 This is a schematic diagram of the main flow of an interactive event handling method according to an embodiment of this application, as shown below. Figure 1 As shown, the interactive event handling methods include:

[0060] Step S101: In response to the click operation on the option control, the native method for selecting options is triggered.

[0061] In this embodiment, the execution entity of the interactive event handling method (e.g., a server) can detect in real time whether there is a click operation on the option control. The option control can be a "select image button," "select link button," or "select text button," etc., and this embodiment does not specifically limit the option control. After detecting a user's click operation on the option control, the execution entity triggers a call to the native option selection method (e.g., image selection).

[0062] Step S102: Determine the attributes of the click operation. If the attribute corresponds to a non-time-consuming operation, determine whether the interaction method with the native client is to use a callback function or an event trigger. If the attribute corresponds to a time-consuming operation, determine whether the interaction method with the native client is to use an asynchronous framework. Based on the interaction method, pass the corresponding selection option interaction event to the management class. The management class is obtained by calling the native application programming interface API from the JavascriptInterface programming language interface.

[0063] JavaScript (JS) is a lightweight, interpreted or just-in-time (JIT) programming language with a function-first approach. For example, the executable can use HTML5 to call a JS method to select an image. JS then calls the native application programming interface (API) method `selectPic`, which is mounted on the `window` window. The executable can then use the `JavascriptInterface` to call the API manager class `apimanager`. The `selectPic` event is passed from JS to the `apimanager` class.

[0064] In this embodiment of the application, the attributes of the click operation on the option control can correspond to a time-consuming operation and a non-time-consuming operation.

[0065] When the attribute of a click operation corresponds to a non-time-consuming operation, it can be determined that the interaction with the native client is either using a callback function or using an event trigger.

[0066] When the attribute of a click operation corresponds to a time-consuming operation, it can be determined that the interaction method with the native client is to use an asynchronous framework, such as using the asynchronous framework AsyncTask (AsyncTask is a lightweight asynchronous processing tool, which is essentially an asynchronous framework that encapsulates a thread pool and a handler).

[0067] Based on the determined interaction method (such as using callback functions, event triggering, or using an asynchronous framework), execute the interaction event that passes the corresponding selection options to the management class.

[0068] Step S103: Determine the corresponding container based on the interaction event of the selected option.

[0069] The executing entity can determine the corresponding container based on the size of the space occupied by the interaction event or the type of the interaction event, so as to facilitate subsequent lookup and use.

[0070] Step S104: Determine the number of interaction events. In response to the number exceeding a preset threshold, determine the registration module type corresponding to the interaction event, call the object encapsulation process to encapsulate the interaction event based on the registration module type, and then register it to the container. In response to the container registration being completed, find the command object corresponding to the interaction event of the selected option in the registered container.

[0071] In this embodiment of the application, the registration module (e.g., loginModule) can be a module located in the container corresponding to the interaction event for storing key-value pairs. The type of the registration module can correspond to the type of the interaction event to achieve a better data storage experience.

[0072] The executing entity can invoke an object encapsulation process to encapsulate interactive events into corresponding command objects based on the type of the registered module, and then execute the container registration process based on these command objects. Specifically, the executing entity can register interactive events and their corresponding command objects as key-value pairs to the corresponding containers for later lookup and use. After container registration is complete, the entity can find and execute the corresponding command object based on the required interactive event.

[0073] In this embodiment, a container corresponding to the selected interaction event type can be determined. A container registration process based on the interaction event and the determined container is then executed. This allows for the identification of the container corresponding to the interaction event to be processed by category during interaction event processing after container registration. The corresponding command object for the interaction event can then be searched, and the interaction event can be processed based on the found command object. This improves the speed and accuracy of interaction event processing.

[0074] After container registration is complete, the container stores key-value pairs of interaction events and corresponding command objects. By matching the interaction events for selection options transmitted in this embodiment with the key-value pairs in the container, the command objects in the key-value pairs corresponding to the interaction events can be determined. The command object defines the specified commands to be executed on the data source; these commands can be SQL statements, tables, or stored procedures.

[0075] Specifically, the interactive event handling method also includes: responding to the interactive event extension request, determining the corresponding key-value pair, adding an implementation class annotation to the value of the corresponding key-value pair, and then performing a registration process for the corresponding key-value pair on the container based on the implementation class annotation.

[0076] By implementing class annotations, a large number of duplicate key-value pairs can be avoided in the container, ensuring the uniqueness of key-value pairs in the container and improving the speed and accuracy of handling interactive events.

[0077] Specifically, the registration process for the corresponding key-value pairs of the container is performed based on the implementation class annotation, including: obtaining the registry corresponding to the container; performing a verification process based on the corresponding key-value pairs, the implementation class annotation, and the registry; adding the corresponding key-value pairs to the registry in response to successful verification; and prompting duplicate registration information and deleting the corresponding key-value pairs in response to failed verification.

[0078] During the verification process, if the implementation class annotation has not appeared in the registered data in the registry, the verification passes and the corresponding key-value pair can be stored in the registry. If the implementation class annotation has already appeared in the registered data in the registry, the verification fails, prompts a duplicate registration message, deletes the corresponding key-value pair, and does not store the corresponding key-value pair in the registry.

[0079] By centrally managing and storing all registered interaction events (i.e., instances of all modules), the creation, retrieval, and management of native APIs become more convenient and consistent. Furthermore, implementation class annotations prevent duplicate data storage, ensuring the uniqueness of data stored in the container and improving the accuracy of interaction event handling. It is worth noting that in this embodiment, the addition, removal, and replacement of new APIs correspond to the addition, removal, and replacement of corresponding interaction events, and consequently, the addition, removal, and replacement of corresponding command objects.

[0080] In this embodiment, the API functionality is implemented by defining an `apiModule` interface, defining an abstract class, providing a default implementation, creating an API implementation class that inherits from the defined abstract class, initializing the API, and registering the `apiModule`. First, the `Module` interface specification is defined, adding `invoke` and `invokeSync` methods to support asynchronous and synchronous methods respectively. Synchronous methods refer to JavaScript calling a native method, and JavaScript execution is blocked until the call is complete and the native method returns a result. In this way, WebView does not respond to other events during the execution of the native method. Asynchronous methods refer to JavaScript calling a native method, but not waiting for the native method to complete; instead, JavaScript continues to execute while the native method is executing. After the native method completes, the result can be returned to JavaScript through a callback mechanism or other means. In asynchronous methods, the following methods can be used to implement interaction between JavaScript and native code: Callback function: Define a callback function in the native method and then pass a reference to the callback function to the native method. When the native method completes, call the callback function to pass the result back to JavaScript. Event triggering: A JavaScript event can be triggered after the native method completes to notify JavaScript that the native method has finished executing. Using Handler or AsyncTask: For time-consuming operations, Android's Handler or AsyncTask can be used to execute them in a background thread, and then the results can be passed to JavaScript upon completion. Define a common base class `BaseApiModule` for APIs to centrally manage shared logic, data, or behaviors (such as error and exception handling). Define your own `apiModule`s according to business needs, inheriting from this base class, and implement the API functions respectively. This includes the APIs to be implemented and their specific implementations. Register the implemented modules by using the event name as the key and the module as the value, adding them to a map collection. Use the `auto-service` library for registration, which helps simplify the process of registering custom annotation handlers, making it easier to integrate them into the Android build process. Add the `@AutoService` annotation to each specific module for unified processing, avoiding a lot of repetitive code like `map.put("key", "value")`, and uniformly obtaining the API registration method through the `@AutoService` annotation.

[0081] Step S105: Execute the command corresponding to the command object.

[0082] Specifically, executing the command corresponding to the command object includes: stopping the execution of the command in response to detecting a modification to the command object during command execution; updating the command object in response to receiving a modification end marker; and executing the command corresponding to the updated command object.

[0083] In this embodiment, interactive events can be dynamically added, removed, and replaced at runtime, ultimately leading to the dynamic addition, removal, and replacement of command objects (i.e., corresponding to the dynamic addition, removal, and replacement of APIs). This makes the application more flexible and scalable, allowing new API types to be introduced without modifying the client code.

[0084] This embodiment, in response to a click on an option control, triggers a call to the native option selection method, thereby determining the attribute of the click operation. If the attribute corresponds to a non-time-consuming operation, the interaction method with the native application is determined to be either a callback function or an event trigger. If the attribute corresponds to a time-consuming operation, the interaction method is determined to be an asynchronous framework. Based on the interaction method, the corresponding interaction event of the selected option is passed to the management class. The management class is obtained by calling the native application programming interface from the programming language interface. Based on the interaction event of the selected option, the corresponding container is determined, and the number of interaction events is determined. If the number exceeds a preset threshold, the registration module type corresponding to the interaction event is determined, and an object encapsulation process is called to encapsulate the interaction event based on the registration module type, and then register it to the container. Upon completion of container registration, the command object corresponding to the interaction event of the selected option is found in the registered container, and the command corresponding to the command object is executed. This approach enables centralized object management, loose coupling, dynamism, ease of maintenance, reduced maintenance costs, code reuse, avoidance of code redundancy, and stronger pluggability.

[0085] Figure 2 This is a schematic diagram of the main flow of an interactive event handling method according to an embodiment of this application, as shown below. Figure 2 As shown, the interactive event handling methods include:

[0086] Step S201: In response to the click operation on the option control, the native method for selecting options is triggered.

[0087] The option control can be "select text", "capture image", etc., and this application embodiment does not specifically limit the option control. After the executing entity detects the user's click operation on the option control, it triggers the invocation of the native option selection method (such as text selection or image capture).

[0088] Step S202: Determine the attributes of the click operation. If the attribute corresponds to a non-time-consuming operation, determine whether the interaction method with the native client is to use a callback function or an event trigger. If the attribute corresponds to a time-consuming operation, determine whether the interaction method with the native client is to use an asynchronous framework. Based on the interaction method, pass the corresponding selection option interaction event to the management class. The management class is obtained by calling the native application programming interface from the programming language interface.

[0089] The executing entity can determine the attributes of the click operation based on the complexity of the logic corresponding to the option control. For example, if the length of the logic corresponding to the option control or the space occupied exceeds a preset threshold, the attribute of the corresponding click operation can be determined to be a time-consuming operation; if the length of the logic corresponding to the option control or the space occupied does not exceed the preset threshold, the attribute of the corresponding click operation can be determined to be a non-time-consuming operation. The above are merely examples and are not intended to limit the attributes of the click operation in this application.

[0090] Specifically, the interaction events for passing the corresponding selection options to the management class based on the interaction method include: In response to an attribute corresponding to a non-time-consuming operation, determining whether the interaction method with the native end is using a callback function or event triggering, and then executing the following process: When the interaction method with the native end is using a callback function, in response to the successful invocation of the native end's selection option method, triggering the callback function to send a success message to the programming language, and then invoking the programming language to send the interaction events for the selection options corresponding to the selection option method to the management class; When the interaction method with the native end is using event triggering, in response to the successful invocation of the native end's selection option method, triggering a preset function event to send a notification to the programming language that the invocation of the native end's selection option method was successful, and then invoking the programming language to send the interaction events for the selection options corresponding to the selection option method to the management class; In response to an attribute corresponding to a time-consuming operation, determining whether the interaction method with the native end is using an asynchronous framework, and then executing the following process: Invoking the asynchronous framework, executing the invocation of the native end's selection option method in a background thread, in response to the successful invocation of the native end's selection option method, sending a success message to the programming language, and then invoking the programming language to send the interaction events for the selection options corresponding to the selection option method to the management class.

[0091] Specifically, in asynchronous methods, the following methods can be used to achieve interaction between JavaScript and native code: Callback functions: Define a callback function in the native method and then pass a reference to the callback function to the native method. When the native method finishes execution, call the callback function and pass the result back to JavaScript. Event triggering: Notify JavaScript that the native method has finished executing by triggering a JavaScript event after the native method finishes execution. Using Handler or AsyncTask: If time-consuming operations are involved, Android's Handler or AsyncTask can be used to execute them in a background thread and then pass the result to JavaScript after completion. Define a common base class `BaseApiModule` for the API interface to centrally manage shared logic, data, or behaviors (such as error and exception handling). Define your own `apiModule` according to business needs, inheriting from this base class, and implement the API functions respectively. This includes the API to be implemented and its specific implementation. Registration: Add the implemented `Module` to a map collection using the event name as the key and the `Module` as the value. Registration uses the `auto-service` library, which helps simplify the process of registering custom annotation handlers, making it easier to integrate them into the Android build process. Add the AutoService annotation to each specific module for unified processing, avoiding a lot of repetitive code writing map.put("key", "value"), and obtaining the API registration method uniformly through the autoservice annotation.

[0092] Step S203: Determine the corresponding container based on the interaction event of the selected option.

[0093] The executing entity can determine the corresponding type of interaction event based on the type of interaction event, thereby improving the quality of data storage and the convenience of subsequent queries.

[0094] Step S204: Determine the number of interaction events. In response to the number exceeding a preset threshold, determine the registration module type corresponding to the interaction event.

[0095] The preset threshold can be the limit value of the interactive events processed by the executing entity per unit time. This application does not limit the specific value of the preset threshold in its embodiments.

[0096] By executing a container registration process when the number of interaction events exceeds a preset threshold, centralized management of objects can be achieved, enhancing the readability of interaction events.

[0097] The interaction event based on the selected option is matched with the key-value pairs stored in the container to obtain the command object corresponding to the interaction event based on the matched key-value pairs.

[0098] When the number of interaction events exceeds a preset threshold, it can be determined that the number of interaction events is too large and needs to be registered with the container for centralized management. First, the type of interaction event must be determined, and then the corresponding registration module type must be determined based on the interaction event type. The registration module is a key-value pair in the container used to store the interaction event and its corresponding command object.

[0099] Step S205: Encapsulate the interactive events into corresponding command objects based on the registered module type.

[0100] Specifically, when there are too many JS and native interaction events (for example, the number of interaction events exceeds a preset threshold), the if-else judgment increases sharply. It is necessary to encapsulate the interaction events into corresponding command objects, i.e., event modules, based on the registered module type.

[0101] Step S206: Register the key and value to the container using the event name of the interactive event as the key and the corresponding command object as the value.

[0102] For example, the executing entity can register the event module with the event name as the key and the module as the value to the same container.

[0103] Step S207: In response to the completion of container registration, find the command object corresponding to the interaction event of the selected option in the registered container.

[0104] Specifically, in response to modification operations on interactive events, the executing entity can modify the command object within the container based on the modification operations and update the container.

[0105] Modifications to interactive events can include, for example, changing the creation method of the API corresponding to the interactive event. If it is necessary to modify the creation method of the API, only the specific Module needs to be modified (i.e., the command object in the container corresponding to the operation is modified) without affecting the client code. After modifying the command object in the container, the corresponding container is updated based on the modified command object to keep the data stored in the container up-to-date and ensure the accuracy of processing related interactive events.

[0106] Step S208: Execute the command corresponding to the command object.

[0107] For example, when a JS event is interacted with, the corresponding Module (i.e., command object) is retrieved from the container using the key, and then the corresponding command is executed in the Module.

[0108] It enables centralized object management, loose coupling, dynamism, easy maintenance, reduced maintenance costs, code reuse, avoidance of code redundancy, and stronger pluggability.

[0109] Figure 3 This is a schematic flowchart illustrating the main process of an interactive event handling method according to an embodiment of this application. The interactive event handling method of this embodiment can be applied to scenarios involving selecting photos from an album. Figure 3 As shown, let's take the function of selecting album pictures as an example:

[0110] (1) When browsing the webview page, click the "Select Image" button on the H5 page (BUTTON);

[0111] (2) H5 calling JS to select images;

[0112] (3) The JavaScript calls the native image selection method (selectPic) mounted on the window (window) of the client.

[0113] (4) Call the apiManager, the management class of the native application programming interface API, through JavascriptInterface (i.e. JSInterface);

[0114] (5) The image selection event passed by apiManager via JS finds the registered Module registered in the container during initialization, namely loginModule;

[0115] (6) Call the invoke method of this Module;

[0116] (7) Pass the execution result (i.e., the selected album image) back to JS via callback;

[0117] (8) Complete the entire process of interactive event invocation.

[0118] The interactive event handling method in this application first standardizes the form of parameter passing when JS interacts with the native client, dividing it into event and params. event is the event name, and params is a parameter of type JSONObject. The native client encapsulates the interactive event into a corresponding command object, i.e., event Module, based on the registered module type. The event Module is registered in the same container with the event name as the key and the Module as the value. When the JS event interacts, the corresponding Module is retrieved by the key, and then the corresponding command is executed in the Module.

[0119] This application's interactive event handling method employs a registry pattern to handle native API methods, easily decoupling them, avoiding numerous if-else statements, and significantly reducing maintenance difficulty. It utilizes an autoservice mechanism to manage the APIModule. This approach offers several advantages: Centralized object management: By centrally managing and storing instances of all modules, the creation, retrieval, and management of native APIs become more convenient and consistent. Loose coupling: It reduces the coupling between objects. Client code doesn't need to directly know how to create and manage objects; instead, it operates through the registry, reducing code complexity. Dynamism: It allows APIs to be dynamically added, removed, and replaced at runtime. This makes the application more flexible and scalable, allowing the introduction of new API types (corresponding to new interactive events and conditional branches) without modifying client code. Ease of maintenance: Centralized management of API creation and retrieval logic makes maintenance (extension) and modification easier. If the API creation method needs modification, only the specific module needs modification without affecting the client code. Code reuse: It promotes code reuse. Objects of the same type can be shared and reused in multiple places, avoiding code redundancy. It enables pluggability: When an application needs to support plugins or extensions, this invention can serve as an effective way to manage and integrate plugins, thereby making the application more pluggable.

[0120] Figure 4 This is a schematic diagram of the main units of an interactive event handling device according to an embodiment of this application. Figure 4 As shown, the interactive event handling device 400 includes a triggering unit 401, an interactive event transmission unit 402, a container determination unit 403, a command object lookup unit 404, and a command execution unit 405.

[0121] Trigger unit 401 is configured to trigger the call to the native option selection method in response to a click operation on the option control.

[0122] The interaction event transmission unit 402 is configured to determine the attribute of the click operation, and in response to the attribute corresponding to a non-time-consuming operation, determine that the interaction method with the native client is to use a callback function or to use an event trigger; in response to the attribute corresponding to a time-consuming operation, determine that the interaction method with the native client is to use an asynchronous framework; and based on the interaction method, transmit the corresponding selection option interaction event to the management class, wherein the management class is obtained by calling the native application programming interface from the programming language interface.

[0123] The container determination unit 403 is configured to determine the corresponding container based on the interaction event of the selected option.

[0124] The command object lookup unit 404 is configured to determine the number of the interaction events, and in response to the number exceeding a preset threshold, determine the registration module type corresponding to the interaction event, call the object encapsulation process to encapsulate the interaction event based on the registration module type, and then register it to the container, and in response to the container registration being completed, search for the command object corresponding to the interaction event of the selected option from the registered container.

[0125] The command execution unit 405 is configured to execute the command corresponding to the command object.

[0126] In some embodiments, the interactive event handling device further includes Figure 4 The registration unit, not shown in the diagram, is configured to: encapsulate interactive events into corresponding command objects based on the registration module type; and register the key and value to the container using the event name of the interactive event as the key and the corresponding command object as the value.

[0127] In some embodiments, the interactive event handling device further includes Figure 4 The update unit, not shown, is configured to modify the command object in the container and update the container based on the modification operation in response to the modification operation of the interaction event.

[0128] In some embodiments, the interactive event handling device further includes Figure 4 The extension unit, not shown, is configured to: respond to an interactive event extension request, determine the corresponding key-value pair, add an implementation class annotation to the value of the corresponding key-value pair, and then perform a registration process for the corresponding key-value pair on the container based on the implementation class annotation.

[0129] In some embodiments, the extension unit is further configured to: obtain the registry corresponding to the container, perform a verification process based on the corresponding key-value pairs, implementation class annotations and the registry, add the corresponding key-value pairs to the registry in response to successful verification, and prompt duplicate registration information and delete the corresponding key-value pairs in response to failed verification.

[0130] In some embodiments, the command execution unit 405 is further configured to: stop executing the command in response to detecting a modification to the command object during command execution; update the command object in response to receiving a modification end flag; and execute the command corresponding to the updated command object.

[0131] In some embodiments, the interaction event transmission unit 402 is further configured to: in response to an attribute corresponding to a non-time-consuming operation, determine that the interaction method with the native end is using a callback function or using event triggering, and then execute the following process: when the interaction method with the native end is using a callback function, in response to the successful invocation of the native end's method for selecting an option, trigger the invocation of the callback function to transmit a success message to the programming language, and then invoke the programming language to transmit the interaction event of the selection option corresponding to the method for selecting an option to the management class; when the interaction method with the native end is using event triggering, in response to the successful invocation of the native end's method for selecting an option, trigger a preset function event to send a notification to the programming language that the invocation of the native end's method for selecting an option was successful, and then invoke the programming language to transmit the interaction event of the selection option corresponding to the method for selecting an option to the management class; in response to an attribute corresponding to a time-consuming operation, determine that the interaction method with the native end is using an asynchronous framework, and then execute the following process: invoke the asynchronous framework to execute the invocation of the native end's method for selecting an option in a background thread, in response to the successful invocation of the native end's method for selecting an option, transmit a success message to the programming language, and then invoke the programming language to transmit the interaction event of the selection option corresponding to the method for selecting an option to the management class.

[0132] It should be noted that the interactive event handling method and interactive event handling device of this application are related in terms of specific implementation content, so repeated content will not be described again.

[0133] Figure 5 An exemplary system architecture 500 is shown that can be applied to the interactive event handling method or interactive event handling apparatus of the embodiments of this application.

[0134] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0135] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0136] Terminal devices 501, 502, and 503 can be various electronic devices with interactive event processing screens and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0137] Server 505 can be a server providing various services, such as a backend management server supporting user click operations on option controls submitted by terminal devices 501, 502, and 503 (for example only). The backend management server can respond to the click operation on the option control by triggering a call to the native client's option selection method, thereby determining the attribute of the click operation. If the attribute corresponds to a non-time-consuming operation, it determines the interaction method with the native client to use a callback function or event triggering. If the attribute corresponds to a time-consuming operation, it determines the interaction method with the native client to use an asynchronous framework. Based on the interaction method, it passes the corresponding selection option's interaction event to the management class, where the management class is obtained by calling the native application programming interface from the programming language interface. Based on the selection option's interaction event, it determines the corresponding container, determines the number of interaction events, and if the number exceeds a preset threshold, determines the registration module type corresponding to the interaction event. It then calls the object encapsulation process to encapsulate the interaction event based on the registration module type and register it to the container. Upon completion of container registration, it searches for the command object corresponding to the selection option's interaction event in the registered container and executes the command corresponding to the command object. It enables centralized object management, loose coupling, dynamism, easy maintenance, reduced maintenance costs, code reuse, avoidance of code redundancy, and stronger pluggability.

[0138] It should be noted that the interactive event handling method provided in this application embodiment is generally executed by server 505, and correspondingly, the interactive event handling device is generally set in server 505.

[0139] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0140] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device according to the embodiments of this application. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0141] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0142] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0143] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0144] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0146] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be located in a processor; for example, a processor can be described as including a triggering unit, an interactive event transmission unit, a container determination unit, a command object lookup unit, and a command execution unit. The names of these units do not necessarily limit the specific unit itself.

[0147] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device, in response to a click operation on an option control, triggers a call to the native-side method for selecting an option, thereby determining the attribute of the click operation. If the attribute corresponds to a non-time-consuming operation, the interaction method with the native-side is determined to be using a callback function or event triggering. If the attribute corresponds to a time-consuming operation, the interaction method with the native-side is determined to be using an asynchronous framework. Based on the interaction method, the corresponding interaction event of the selected option is passed to a management class, wherein the management class is obtained by calling the native-side application programming interface from a programming language interface. Based on the interaction event of the selected option, a corresponding container is determined, the number of interaction events is determined, and if the number exceeds a preset threshold, the registration module type corresponding to the interaction event is determined. An object encapsulation process is called to encapsulate the interaction event based on the registration module type, and then registers it to the container. Upon completion of container registration, the command object corresponding to the interaction event of the selected option is found in the registered container; the command corresponding to the command object is executed.

[0148] The computer program product of this application includes a computer program that, when executed by a processor, implements the interactive event handling method in the embodiments of this application.

[0149] According to the technical solution of the embodiments of this application, centralized object management, loose coupling, dynamism, easy maintenance, reduced maintenance costs, code reuse, avoidance of code redundancy, and stronger pluggability can be achieved.

[0150] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An interactive event handling method, characterized in that, include: In response to a click on the option control, the native method for selecting options is invoked. The process involves determining the attributes of the click operation, and in response to the attribute corresponding to a non-time-consuming operation, determining the interaction method with the native client to be either using a callback function or triggering an event. If the attribute corresponds to a time-consuming operation, the interaction method with the native client is determined to be using an asynchronous framework. Based on the interaction method, the corresponding selection option interaction event is passed to the management class. The management class is obtained by calling the native application programming interface from the programming language interface. Passing the corresponding selection option interaction event to the management class based on the interaction method includes: in response to the attribute corresponding to a non-time-consuming operation, determining the interaction method with the native client to be either using a callback function or triggering an event, and then executing the following process: when the interaction method with the native client is using a callback function, in response to the successful call to the native client's selection option method, triggering the call to the callback function to pass a success message to the programming language interface. The system then invokes the programming language to pass the interaction event of the selection option corresponding to the method of the selection option to the management class. When the interaction method with the native end is event-triggered, in response to the successful invocation of the native end's selection option method, a preset function event is triggered to send a notification to the programming language that the invocation of the native end's selection option method was successful. The system then invokes the programming language to pass the interaction event of the selection option corresponding to the method of the selection option to the management class. In response to the attribute corresponding to a time-consuming operation, the system determines that the interaction method with the native end is using an asynchronous framework. The system then executes the following process: invoking the asynchronous framework, executing the invocation of the native end's selection option method in a background thread; in response to the successful invocation of the native end's selection option method, a success message is sent to the programming language, which then invokes the programming language to pass the interaction event of the selection option corresponding to the method of the selection option to the management class. Based on the interaction events of the selected options, determine the corresponding container; The number of interaction events is determined. In response to the number exceeding a preset threshold, the registration module type corresponding to the interaction event is determined. An object encapsulation process is invoked to encapsulate the interaction event based on the registration module type and then register it to the container. In response to the container registration being completed, the command object corresponding to the interaction event of the selected option is searched from the registered container. Execute the command corresponding to the command object.

2. The method according to claim 1, characterized in that, The step of encapsulating the interactive event based on the registration module type and then registering it to the container includes: Based on the registration module type, the interactive event is encapsulated into a corresponding command object; Register the key and the value to the container using the event name of the interaction event as the key and the corresponding command object as the value.

3. The method according to claim 1, characterized in that, Before executing the command corresponding to the command object, the method further includes: In response to a modification operation on the interaction event, the command object is modified and the container is updated based on the modification operation within the container.

4. The method according to claim 1, characterized in that, The method further includes: In response to an interactive event extension request, the corresponding key-value pair is determined, an implementation class annotation is added to the value of the corresponding key-value pair, and then the container is executed to register the corresponding key-value pair based on the implementation class annotation.

5. The method according to claim 4, characterized in that, The process of registering the corresponding key-value pairs for the container based on the implementation class annotation includes: Obtain the registry corresponding to the container, and perform a verification process based on the corresponding key-value pair, the implementation class annotation, and the registry. If the verification passes, add the corresponding key-value pair to the registry. If the verification fails, prompt duplicate registration information and delete the corresponding key-value pair.

6. The method according to claim 1, characterized in that, The execution of the command corresponding to the command object includes: In response to detecting a modification to the command object during command execution, the execution of the command is stopped; in response to receiving a modification end flag, the command object is updated, and the command corresponding to the updated command object is executed.

7. An interactive event handling device, characterized in that, include: The trigger unit is configured to respond to a click operation on the option control by triggering a call to the native option selection method; An interaction event delivery unit is configured to determine the attribute of the click operation; in response to the attribute corresponding to a non-time-consuming operation, determine that the interaction method with the native client is using a callback function or using an event trigger; in response to the attribute corresponding to a time-consuming operation, determine that the interaction method with the native client is using an asynchronous framework; and based on the interaction method, deliver the corresponding selection option interaction event to the management class, wherein the management class is obtained by calling the native application programming interface from the programming language interface. The interaction event delivery unit is further configured to: in response to the attribute corresponding to a non-time-consuming operation, determine that the interaction method with the native client is using a callback function or using an event trigger, and then execute the following process: when the interaction method with the native client is using a callback function, in response to the successful invocation of the native client's selection option method, trigger the invocation of the callback function to deliver a success message to the management class. The program language is then invoked to pass the interaction event of the selection option corresponding to the method of the selection option to the management class; when the interaction method with the native end is event-triggered, in response to the successful invocation of the native end's selection option method, a preset function event is triggered to send a notification to the programming language that the invocation of the native end's selection option method was successful, and then the programming language is invoked to pass the interaction event of the selection option corresponding to the method of the selection option to the management class; in response to the property corresponding to a time-consuming operation, it is determined that the interaction method with the native end is using an asynchronous framework, and then the following process is executed: the asynchronous framework is invoked to execute the invocation of the native end's selection option method in a background thread; in response to the successful invocation of the native end's selection option method, a success message is passed to the programming language, and then the programming language is invoked to pass the interaction event of the selection option corresponding to the method of the selection option to the management class; The container determination unit is configured to determine the corresponding container based on the interaction event of the selected option; The command object lookup unit is configured to determine the number of the interaction events, and in response to the number exceeding a preset threshold, determine the registration module type corresponding to the interaction event, call the object encapsulation process to encapsulate the interaction event based on the registration module type, and then register it to the container, and in response to the container registration being completed, search for the command object corresponding to the interaction event of the selected option from the registered container. The command execution unit is configured to execute the command corresponding to the command object.

8. The apparatus according to claim 7, characterized in that, The device further includes a registration unit configured to: Based on the registration module type, the interactive event is encapsulated into a corresponding command object; Register the key and the value to the container using the event name of the interaction event as the key and the corresponding command object as the value.

9. The apparatus according to claim 7, characterized in that, The device further includes an update unit configured to: In response to a modification operation on the interaction event, the command object is modified and the container is updated based on the modification operation within the container.

10. The apparatus according to claim 7, characterized in that, The device further includes an expansion unit configured to: In response to an interactive event extension request, the corresponding key-value pair is determined, an implementation class annotation is added to the value of the corresponding key-value pair, and then the container is executed to register the corresponding key-value pair based on the implementation class annotation.

11. The apparatus according to claim 10, characterized in that, The expansion unit is further configured to: Obtain the registry corresponding to the container, and perform a verification process based on the corresponding key-value pair, the implementation class annotation, and the registry. If the verification passes, add the corresponding key-value pair to the registry. If the verification fails, prompt duplicate registration information and delete the corresponding key-value pair.

12. The apparatus according to claim 7, characterized in that, The command execution unit is further configured to: In response to detecting a modification to the command object during command execution, the execution of the command is stopped; in response to receiving a modification end flag, the command object is updated, and the command corresponding to the updated command object is executed.

13. An interactive event processing electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

14. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.