Event processing method and device on display page, electronic device and medium
By pre-configuring handling functions and execution conditions for multiple event types for page elements, the inefficiency caused by the single event handling process in the existing technology is solved, and more efficient multi-event page processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C BIG DATA TECH CO LTD
- Filing Date
- 2021-12-10
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the method of injecting only one event handling process into each page element results in low processing efficiency when handling multiple event page processes.
Multiple event handling functions and execution conditions for different event types are pre-configured for page elements, and the corresponding processing flow is executed according to the event type and conditions.
It improves the processing efficiency of multi-event page flows and avoids the inefficiency caused by single-event processing flows.
Smart Images

Figure CN114153636B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to data communication technology, and particularly to an event processing method and device on a display page, an electronic device and a medium. BACKGROUND
[0002] With the advent of the Internet era, data visualization applications have achieved good results in the Internet, and their core value is also constantly being realized. Among them, a visualization page needs to use multiple complex components to combine and display.
[0003] To implement page interaction, a specific event needs to be injected into the DOM element in the page, and an event processing flow is set. Then, when the user triggers the event, the event processing program executes the corresponding function, thereby realizing page interaction.
[0004] However, there is a problem in the related art that the method of injecting only one event processing flow for each page element can cause low processing efficiency when processing multi-event page flows. SUMMARY
[0005] The embodiments of the present application provide an event processing method and device on a display page, an electronic device and a medium, which are used to solve the problem of low processing efficiency caused by the method of injecting only one event processing flow for each page element in the related art.
[0006] According to an aspect of the embodiments of the present application, an event processing method on a display page is provided, which includes:
[0007] Detecting that a trigger event exists on a target page for a target page element, the target page element being pre-configured with a processing flow of at least one event type;
[0008] Determining an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event;
[0009] Based on the event type, executing a processing flow corresponding to the trigger event on the target page.
[0010] Optionally, in another embodiment based on the above-mentioned method of the present application, after determining the event type corresponding to the trigger event, the method further includes:
[0011] Based on an execution condition configured for the target page element, detecting whether to process the trigger event;
[0012] If the execution condition is met, based on the difference between the event types, executing a processing flow corresponding to the trigger event on the target page.
[0013] Optionally, in another embodiment of the method described above, the detecting whether to process the trigger event based on the execution condition configured for the target page element comprises:
[0014] if it is determined that the event type corresponds to a page loading event, obtaining a page loading parameter required for implementing the page loading event;
[0015] determining whether the page loading parameter matches the target page; if yes, it is determined that the execution condition of the trigger event is met.
[0016] Optionally, in another embodiment of the method described above, the detecting whether to process the trigger event based on the execution condition configured for the target page element comprises:
[0017] if it is determined that the event type corresponds to a user operation event, obtaining an operated object, an operation action and a user permission corresponding to the user operation event;
[0018] determining whether the user permission matches the operation action and whether the operated object matches the operation action;
[0019] if yes, it is determined that the execution condition of the trigger event is met.
[0020] Optionally, in another embodiment of the method described above, the executing the processing flow corresponding to the trigger event on the target page based on the event type comprises:
[0021] if it is determined that the event type corresponds to a page loading event, calling a first action event processing function configured for the target page element from a preset storage area, the first action event processing function being pre-configured and used for executing a processing flow associated with the page loading event;
[0022] executing the processing flow corresponding to the trigger event on the target page based on the first action event processing function.
[0023] Optionally, in another embodiment of the method described above, the executing the processing flow corresponding to the trigger event on the target page based on the event type comprises:
[0024] if it is determined that the event type corresponds to a user operation event, obtaining an ID value pre-generated for the target page element;
[0025] The ID value is one-to-one compared with an ID set associated with the user operation event, to determine whether the ID value exists in the ID set;
[0026] If the ID value exists, based on the event type, a processing flow corresponding to the trigger event is executed on the target page.
[0027] Optionally, in another embodiment based on the above method of the present application, if the ID value exists, based on the event type, a processing flow corresponding to the trigger event is executed on the target page, including:
[0028] A second action event processing function configured for the target page element is called from a preset storage area, the second action event processing function being pre-configured for executing a processing flow associated with the user operation event;
[0029] Based on the second action event processing function, a processing flow corresponding to the trigger event is executed on the target page.
[0030] According to an aspect of an embodiment of the present application, including:
[0031] The detection module is configured to detect that a trigger event for a target page element exists on a target page, the target page element being pre-configured with a processing flow of at least one event type;
[0032] The determination module is configured to determine an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event;
[0033] The execution module is configured to execute, based on the event type, a processing flow corresponding to the trigger event on the target page.
[0034] According to still another aspect of an embodiment of the present application, an electronic device is provided, including:
[0035] A memory for storing executable instructions; and
[0036] A display for executing the executable instructions with the memory to complete the operation of the event processing method on the display page as described above.
[0037] According to still another aspect of an embodiment of the present application, a computer readable storage medium is provided for storing computer readable instructions, the instructions being executed to perform the operation of the event processing method on the display page as described above.
[0038] In the present application, it can be detected that there is a trigger event for a target page element on the target page, and the target page element is pre-configured with a processing flow of at least one event type; determine the event type corresponding to the trigger event, the event type corresponds to one of the page loading event and the user operation event; based on the event type, execute the processing flow corresponding to the trigger event on the target page. By applying the technical solution of the present application, each target page element existing on the page can be pre-configured with a processing function corresponding to one or more different event types and an execution condition, so that when a trigger event for a page element is detected, the processing function can be triggered on the target page according to the pre-configured processing function when the event type of the trigger event meets the execution condition. Further, the method of injecting one event processing flow for each page element in the related art can cause low processing efficiency when processing multiple event page flows.
[0039] The technical solutions of the present application will be described in detail below with the help of the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0040] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the present application.
[0041] Referring to the drawings, the present application can be more clearly understood in light of the following detailed description, in which:
[0042] Figure 1 A method for displaying event processing on a page is proposed in the present application.
[0043] Figure 2 A flowchart of a method for displaying event processing on a page is proposed in the present application.
[0044] Figure 3 A structural diagram of an electronic device for displaying event processing on a page is proposed in the present application.
[0045] Figure 4 A structural diagram of an electronic device for displaying event processing on a page is proposed in the present application. DETAILED DESCRIPTION
[0046] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application unless otherwise specifically stated.
[0047] It should be understood that the size of each part shown in the drawings is not drawn in accordance with the actual proportional relationship for the convenience of description.
[0048] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application or its application and uses.
[0049] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the specification.
[0050] It should be noted that like reference numerals and letters refer to like items throughout the attached drawings, and thus, once certain items are defined in one drawing, further discussion of such items in subsequent drawings need not be repeated.
[0051] In addition, the technical solutions among various embodiments of the present application can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize the combination, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the protection scope of the present application.
[0052] It should be noted that all directional indications, such as upper, lower, left, right, front, back, etc., in the embodiments of the present application are only used to explain the relative positional relationship, movement condition, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directional indications will also change accordingly.
[0053] The event processing method on a display page according to the exemplary embodiments of the present application will be described below in conjunction with Figures 1-2 It should be noted that the following application scenarios are only shown for the purpose of facilitating understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
[0054] Further, the present application also proposes an event processing method on a display page, an apparatus, a target terminal and a medium.
[0055] Figure 1 A flowchart of an event processing method on a display page according to an embodiment of the present application is schematically shown. As Figure 1 shown, the method comprises:
[0056] S101, it is detected that there is a trigger event for a target page element on a target page, and the target page element is pre-configured with a processing flow of at least one event type.
[0057] With the continuous development of communication technology, data visualization application has been well received in the Internet, and its core value is also constantly embodied. Often an excellent visualization page needs to use multiple complex components to combine and display, and needs to build complex and interactive visualization pages. Therefore, how to implement event management of the visualization page is the most critical step. To implement page interaction, first, specific events need to be injected into page elements (i.e. DOM elements), and event handlers need to be set. Then, when the user triggers the event, the event handler executes the corresponding function, thereby realizing page interaction.
[0058] Among them, for a page element, that is, a display element on the display page, in one way, it can be a small icon. For example, a checkmark, a cross, a small window, etc. on the display page. The user can enter the next interaction process with the terminal by operating the page element.
[0059] In related technologies, there are generally two methods for handling page events. One is to directly inject events into DOM elements in HTML documents, which is called DOM0 events. The other is to dynamically inject events into DOM elements through DOM2-level events, and different event handlers can be injected at the same time.
[0060] Further, in order to realize page interaction, the related technology is to assign an event handler to the DOM element. That is, the more DOM elements that need to inject events, the more event handlers that need to be injected. It can be understood that this method is simple, but each DOM element can only inject one event handler at the same time. If you want to inject multiple event handlers again, you will inevitably overwrite the original content.
[0061] In summary, the related technology has a problem that the method of injecting only one event handling process for each page element will cause low processing efficiency when handling multiple event page processes.
[0062] To solve the above problem, the present application can pre-configure each target page element on the page with one or more processing functions corresponding to different event types and execution conditions in advance, so that when a triggering event for the page element is detected, the processing function corresponding to the target page element can be executed on the target page according to the pre-configured processing function when it is determined that the type of the triggering event meets the execution condition. Further avoid the problem that the method of injecting only one event handling process for each page element in the related technology will cause low processing efficiency when handling multiple event page processes.
[0063] Specifically, the application can first detect whether there is a trigger event for the target page element on the target page. It should be noted that the target page element needs to be pre-configured with at least one event type processing flow and the corresponding execution condition. Among them, the event type can correspond to one of the page loading event and the user operation event.
[0064] S102, determine the event type corresponding to the trigger event, the event type corresponding to one of the page loading event and the user operation event.
[0065] In one way, the embodiments of the application can be configured with one or more event type processing flows and corresponding execution conditions for each target page element. So as to realize the purpose of executing different processing flows for different event types of trigger events when detecting different event types of trigger events.
[0066] It should be noted that in the process of pre-configuring the page element with at least one event type processing flow and the corresponding execution condition in the embodiments of the application, different event types of trigger events can be bound to the DOM element object on the editor page, and the event processing function can be saved as an event processing object (such as JSON data structure) separately.
[0067] Among them, the page element can also contain the unique id value of the DOM element object and the object of the event processing flow. That is, different event types can define different event processing flows, and the corresponding event processing flow (defined by the processing function) is stored in the corresponding event type object. And in the parser page, after the page DOM element is parsed and mounted to the page, the event type corresponding to the trigger event can be traversed, and the processing function corresponding to the event type can be executed.
[0068] Among them, the user operation event can be an event generated by the user using mouse input or keyboard input. For example, delete data event, close window event, add information event, etc.
[0069] S103, based on the event type, execute the processing flow corresponding to the trigger event on the target page.
[0070] Further, the application proposes a method for displaying events on a page:
[0071] Step one: The application can store in a preset storage area at least one event type processing flow (defined by the operation event function) configured for each page element (i.e. DOM element) and the corresponding execution condition. In one way, the same event type stores the page element and its corresponding operation event function. This step corresponds to the eventName in the following JSON data structure.
[0072] Step two: In one way, when at least one event type processing flow and the corresponding execution condition are configured for a certain DOM element, the unique ID of the corresponding DOM element can also be stored as a key value in the corresponding area of the DOM element in the preset storage area, and the corresponding event processing function and event execution condition are stored in the value corresponding to the key.
[0073] In which a DOM element can correspond to multiple different event processing functions, so it is stored in the form of an array. The key value in this step corresponds to the elId function in the following JSON data structure; the event processing function corresponds to the action function in the following JSON data structure; and the event execution condition corresponds to the condition function in the following JSON data structure.
[0074] Step three: When detecting that there is a trigger event for the target page element on the target page, at this time, distinguish whether the event type is a page loading event (such as an HTML type event) or a user operation event (such as an event generated by the user using mouse input or keyboard input).
[0075] Step four: If it is determined that the event type corresponds to a page loading event, the page loading parameter of the page loading event can be obtained, so as to determine whether the execution condition (condition) of the page loading event is established according to whether the page loading parameter matches the target page.
[0076] Step five: If it is established, the action event processing function corresponding to the page loading event type for the target page element is directly executed, and the trigger event processing flow of the page loading event type corresponding to the target page element on the target page is realized.
[0077] Step six: If it is determined that the event type corresponds to a user operation event, the operated object, operation action and user permission of the user operation event can be obtained, so as to determine whether the execution condition of the trigger event is established according to whether the operated object, operation action and user permission match.
[0078] Step seven: if true, obtain the ID value corresponding to the target page element, and compare the ID value with the ID set associated with the user operation event to determine whether the ID value exists in the ID set. It can be understood that if it is determined that it exists, it means that the target page element has been previously configured with a corresponding user operation event. Then the corresponding action event processing function can be executed to realize the processing flow corresponding to the trigger event on the target page.
[0079] In this application, it can be detected that there is a trigger event for the target page element on the target page, and the target page element is previously configured with at least one event type processing flow; determine the event type corresponding to the trigger event, the event type corresponds to one of the page loading event and the user operation event; based on the event type, execute the processing flow corresponding to the trigger event on the target page. By applying the technical solution of the present application, each target page element on the page can be previously configured with one or more processing functions corresponding to different event types and execution conditions, so that subsequent detection of a trigger event for a page element can be performed when the event type meets the execution condition. The processing function triggers the processing flow corresponding to the trigger event on the target page. Further, the method of injecting one event processing flow for each page element in the related art can cause low processing efficiency when processing multiple event page flows.
[0080] Optionally, in a possible embodiment of the present application, after S102 (determining the event type corresponding to the trigger event), the following steps can be implemented:
[0081] Based on the execution condition configured for the target page element, it is detected whether the trigger event is processed;
[0082] If the execution condition is true, the processing flow corresponding to the trigger event on the target page is executed based on the difference of the event type.
[0083] In the embodiment of the present application, after determining the event type corresponding to the trigger event, it is further judged whether the trigger event meets the execution condition corresponding to the event type. It can be understood that if it does not meet, no processing is performed on the trigger event. Only when the execution condition of the trigger event is met, the processing flow corresponding to the trigger event on the target page is executed.
[0084] Optionally, in the process of detecting whether the trigger event is processed, the present application can include the following processing steps:
[0085] If it is determined that the event type corresponds to the page loading event, the page loading parameter of the page loading event is obtained;
[0086] determining whether the page loading parameter matches the target page; if so, processing the trigger event.
[0087] In one approach, in determining whether the current trigger event meets the execution condition corresponding to the event type, the page loading parameter of the page loading event can be obtained when it is determined that the event type corresponds to a page loading event, so that the execution condition of the trigger event is determined based on whether the page loading parameter matches the target page.
[0088] For example, after obtaining the page loading parameter, it can be determined whether the current display page meets the page loading condition based on the page loading parameter, such as whether the traffic meets the requirement of the display page, whether the layout meets the requirement of the display page, and the like. It can be understood that only when the page loading parameter meets the condition of the display page loading, it can be determined whether the page loading parameter matches the target page, and then it is determined whether to process the trigger event.
[0089] Optionally, in detecting whether to process the trigger event, the following processing steps can be included:
[0090] If it is determined that the event type corresponds to a user operation event, the operated object, operation action, and user permission corresponding to the user operation event are obtained;
[0091] It is determined whether the user permission matches the operation action, and whether the operated object matches the operation action;
[0092] If so, it is determined to process the trigger event.
[0093] In one approach, in determining whether the current trigger event meets the execution condition corresponding to the event type, the operated object, operation action, and user permission corresponding to the user operation event can be obtained when it is determined that the event type corresponds to a user operation event, so that the execution condition of the trigger event is determined based on whether the operated object, operation action, and user permission match each other.
[0094] For example, after obtaining the user operation event, it can be determined that the user operation event is an event in which user A deletes data A. Then, the operated object (data A), operation action (deletion), and user permission (permission of user A) corresponding to the user operation event can be obtained.
[0095] Further, the application can determine whether the data A can be deleted according to the execution condition of the page element configured, and / or whether the user A has the permission to delete the data A in the case that the data A can be deleted. It can be understood that only in the case that the data A can be deleted and the user A has the permission to delete the data A, it can be determined that the execution condition of the trigger event of deleting the data A is established.
[0096] Optionally, the application executes the processing flow corresponding to the trigger event on the target page based on the event type, including:
[0097] If it is determined that the event type corresponds to the page loading event, a first action event processing function configured for the target page element is called from a preset storage area, the first action event processing function being preconfigured for executing the processing flow associated with the page loading event;
[0098] The processing flow corresponding to the trigger event is executed on the target page based on the first action event processing function.
[0099] Further optionally, the application executes the processing flow corresponding to the trigger event on the target page based on the event type, including:
[0100] If it is determined that the event type corresponds to the user operation event, an ID value pre-generated for the target page element is acquired;
[0101] The ID value is compared with an ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set;
[0102] If yes, the processing flow corresponding to the trigger event is executed on the target page based on the event type.
[0103] Optionally, if yes, the processing flow corresponding to the trigger event is executed on the target page based on the event type, including:
[0104] A second action event processing function configured for the target page element is called from a preset storage area, the second action event processing function being preconfigured for executing the processing flow associated with the user operation event;
[0105] The processing flow corresponding to the trigger event is executed on the target page based on the second action event processing function.
[0106] In the application, in the process of performing the processing flow corresponding to the trigger event on the target page based on the event type, at least one event type processing flow (defined by the operation event function) configured for each page element (i.e. DOM element) and the corresponding execution condition can be first stored in the preset storage area. In one way, the page element and the corresponding operation event function are stored under the same event type. This step corresponds to the eventName in the following JSON data structure.
[0107] When at least one event type processing flow and the corresponding execution condition are configured for a certain DOM element, the unique ID of the corresponding DOM element can also be stored as a key value in the area corresponding to the DOM element in the preset storage area, and the corresponding event processing function and event execution condition are stored in the value corresponding to the key. In one way, one DOM element can correspond to multiple different event processing functions, and therefore is stored in the form of an array. In this step, the key value corresponds to the elId function in the following JSON data structure; the event processing function corresponds to the action function in the following JSON data structure; and the event execution condition corresponds to the condition function in the following JSON data structure.
[0108] In addition, in the embodiments of the application, when it is detected that there is a trigger event for the target page element on the target page, at this time, it is distinguished whether the event type is a page loading event (such as an HTML type event) or a user operation event (such as an event generated by the user using mouse input or keyboard input). The following is divided into two cases:
[0109] The first case:
[0110] If it is determined that the event type corresponds to a page loading event, the page loading parameter of the page loading event can be obtained, so as to determine whether the execution condition (condition condition) of the page loading event is established according to whether the page loading parameter matches the target page. And if it is established, the first action event processing function corresponding to the page loading event type is directly executed, and then the event processing flow of the page loading event type corresponding to the target page element on the target page is realized.
[0111] The second case:
[0112] If it is determined that the event type corresponds to a user operation event, the object operated, the operation action, and the user authority of the user operation event are obtained, so as to determine whether the execution condition of the trigger event is established according to whether the object operated, the operation action, and the user authority match. If the execution condition is established, the ID value corresponding to the target page element is obtained, and the ID value is compared with the ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set.
[0113] It can be understood that if it is determined that the ID value exists, it means that the target page element is previously configured with a corresponding user operation event. Then the corresponding second action event processing function is executed, so as to realize the processing flow corresponding to the trigger event on the target page.
[0114] For example, a flowchart for event processing on a display page is shown, which includes: Figure 2 For example, a flowchart for event processing on a display page is shown, which includes:
[0115] In the present application, after detecting that the trigger event for the target page element exists on the target page, the event type corresponding to the trigger event is determined, wherein the event type corresponds to one of a page loading event and a user operation event. The target page element is previously configured with at least one processing flow of the event type.
[0116] In one way, if it is determined that the event type corresponds to a page loading event, the page loading parameter of the page loading event is obtained, and it is determined whether the page loading parameter matches the target page. If the page loading parameter matches the target page, it is determined that the trigger event is processed. Finally, based on the first action event processing function, the processing flow corresponding to the trigger event on the target page is executed.
[0117] In another way, if it is determined that the event type corresponds to a user operation event, the object operated, the operation action, and the user authority corresponding to the user operation event are obtained, and it is determined whether the user authority matches the operation action and whether the object operated matches the operation action. Then, the ID value corresponding to the target page element is compared with the ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set. It can be understood that if the ID value exists, it is determined that the trigger event is processed. The second action event processing function corresponding to the target page element is called from the preset storage area, and the processing flow corresponding to the trigger event on the target page is executed.
[0118] In one mode, by applying the technical solution of the present application, each target page element existing on the page can be pre-configured with a processing function corresponding to one or more different event types and an execution condition, so that when it is detected that there is a triggering event for the page element, the processing flow corresponding to the event can be triggered on the target page according to the pre-configured processing function when it is determined that the event type of the triggering event meets the execution condition. Thus, the problem of low processing efficiency in processing multi-event page flow caused by the method of injecting only one event processing flow for each page element in the related art is avoided.
[0119] In another embodiment of the present application, as shown in Figure 3 the present application further provides an event processing apparatus on a display page. The apparatus comprises:
[0120] The detection module 201 is configured to detect that there is a triggering event for a target page element on a target page, the target page element being pre-configured with a processing flow of at least one event type;
[0121] The determination module 202 is configured to determine an event type corresponding to the triggering event, the event type corresponding to one of a page loading event and a user operation event;
[0122] The execution module 203 is configured to execute the processing flow corresponding to the triggering event on the target page based on the event type.
[0123] In the present application, a triggering event for a target page element on a target page can be detected, the target page element being pre-configured with a processing flow of at least one event type; an event type corresponding to the triggering event is determined, the event type corresponding to one of a page loading event and a user operation event; and the processing flow corresponding to the triggering event is executed on the target page based on the event type. By applying the technical solution of the present application, each target page element existing on the page can be pre-configured with a processing function corresponding to one or more different event types and an execution condition, so that when it is detected that there is a triggering event for the page element, the processing flow corresponding to the event can be triggered on the target page according to the pre-configured processing function when it is determined that the event type of the triggering event meets the execution condition. Thus, the problem of low processing efficiency in processing multi-event page flow caused by the method of injecting only one event processing flow for each page element in the related art is avoided.
[0124] In another embodiment of the present application, the detection module 201 is configured to perform the following steps:
[0125] detecting whether to process the triggering event based on the execution condition configured for the target page element;
[0126] If the execution condition is met, based on the difference of the event type, the processing flow corresponding to the trigger event is executed on the target page.
[0127] In another embodiment of the present application, the detection module 201 is configured to perform the following steps:
[0128] If it is determined that the event type corresponds to a page loading event, a page loading parameter required for implementing the page loading event is obtained;
[0129] It is determined whether the page loading parameter matches the target page; if so, it is determined that the trigger event is processed.
[0130] In another embodiment of the present application, the execution module 203 is configured to perform the following steps:
[0131] If it is determined that the event type corresponds to a user operation event, an operated object, an operation action and a user permission corresponding to the user operation event are obtained;
[0132] It is determined whether the user permission matches the operation action, and whether the operated object matches the operation action;
[0133] If so, it is determined that the trigger event is processed.
[0134] In another embodiment of the present application, the execution module 203 is configured to perform the following steps:
[0135] If it is determined that the event type corresponds to a page loading event, a first action event processing function configured for the target page element is called from a preset storage area, the first action event processing function being preconfigured for executing a processing flow associated with the page loading event;
[0136] Based on the first action event processing function, the processing flow corresponding to the trigger event is executed on the target page.
[0137] In another embodiment of the present application, the execution module 203 is configured to perform the following steps:
[0138] If it is determined that the event type corresponds to a user operation event, an ID value generated in advance for the target page element is obtained;
[0139] The ID value is compared with an ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set;
[0140] If the trigger event exists, a processing flow corresponding to the trigger event is executed on the target page based on the event type.
[0141] In another embodiment of the present application, the execution module 203 is configured to perform the following steps:
[0142] The second action event processing function configured for the target page element is called from a preset storage area, the second action event processing function being preconfigured to execute a processing flow associated with the user operation event;
[0143] The processing flow corresponding to the trigger event is executed on the target page based on the second action event processing function.
[0144] Figure 4 is a logical structure block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 300 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0145] In exemplary embodiments, a non-transitory computer readable storage medium including instructions, such as a memory including instructions, is also provided, the instructions being executable by an electronic device processor to perform the above-described network monitoring method, the method including: detecting that a trigger event exists on a target page for a target page element, the target page element being preconfigured with a processing flow for at least one event type; determining an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event; and executing a processing flow corresponding to the trigger event on the target page based on the event type. Optionally, the instructions can also be executable by the electronic device processor to perform other steps involved in the above-described exemplary embodiments. For example, the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0146] In the example embodiment, an application program / computer program product is also provided, including one or more instructions executable by a processor of an electronic device to complete the above network monitoring method, which includes: detecting that a target page exists a trigger event for a target page element, the target page element being pre-configured with a processing flow of at least one event type; determining an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event; and executing a processing flow corresponding to the trigger event on the target page based on the event type. Optionally, the above instructions can also be executed by the processor of the electronic device to complete other steps involved in the above example embodiment.
[0147] Figure 4 An example diagram of the computer device 300 is shown. Those skilled in the art can understand that the schematic diagram of the computer device 300 is only an example and does not constitute a limitation on the computer device 300. The computer device 300 can include more or fewer components than those shown in the figure, or combine certain components, or include different components, for example, the computer device 300 can also include an input / output device, a network access device, a bus, etc. Figure 4 The computer device 300 shown in the figure is only an example and does not constitute a limitation on the computer device 300. The computer device 300 can include more or fewer components than those shown in the figure, or combine certain components, or include different components, for example, the computer device 300 can also include an input / output device, a network access device, a bus, etc.
[0148] The processor 302 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor. The processor 302 is the control center of the computer device 300, and connects all parts of the computer device 300 through various interfaces and lines.
[0149] The memory 301 can be used to store computer readable instructions, and the processor 302 implements various functions of the computer device 300 by running or executing the computer readable instructions or modules stored in the memory 301, and calling data stored in the memory 301. The memory 301 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like; and the storage data area can store data created according to the use of the computer device 300, etc. In addition, the memory 301 can include a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash storage device, a read-only memory (ROM), a random access memory (RAM), or other non-volatile / volatile storage devices.
[0150] The modules integrated in the computer device 300, if implemented in the form of software functional modules and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method in the above-mentioned embodiments can also be implemented by computer readable instructions instructing related hardware to complete, and the computer readable instructions can be stored in a computer readable storage medium. When the computer readable instructions are executed by a processor, the steps of the above-mentioned various method embodiments can be implemented.
[0151] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the application be limited only by the scope of the claims, which will be determined in light of the specification and the practice of the application. The specification and examples are to be considered exemplary only, with the true scope and spirit of the application indicated by the following claims.
[0152] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the claims that follow.
Claims
1. A method of handling events on a display page, characterized by, The method comprises: detecting that a trigger event exists on a target page element of a target page, the target page element being pre-configured with a processing flow of at least one event type and a corresponding execution condition; determining an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event; detecting whether to process the trigger event based on the execution condition configured for the target page element; if the execution condition is met, executing the processing flow corresponding to the trigger event on the target page based on the different event types; The method further comprises: obtaining a page loading parameter of the page loading event, and determining whether the execution condition of the page loading event is met according to whether the page loading parameter matches the target page; obtaining an operated object, an operation action and a user permission of the user operation event, and determining whether the execution condition of the user operation event is met according to whether the operated object, the operation action and the user permission match; if it is determined that the execution condition of the user operation event is met, obtaining an ID value corresponding to the target page element, and performing one-to-one comparison between the ID value and an ID set associated with the user operation event to determine whether the ID value exists in the ID set; if it is determined that the ID value exists, executing a corresponding action event processing function to realize the processing flow corresponding to the trigger event on the target page.
2. The method of claim 1, wherein, The method further comprises: obtaining a page loading parameter of the page loading event, and determining whether the execution condition of the page loading event is met according to whether the page loading parameter matches the target page; obtaining an operated object, an operation action and a user permission of the user operation event, and determining whether the execution condition of the user operation event is met according to whether the operated object, the operation action and the user permission match; if it is determined that the execution condition of the user operation event is met, obtaining an ID value corresponding to the target page element, and performing one-to-one comparison between the ID value and an ID set associated with the user operation event to determine whether the ID value exists in the ID set; if it is determined that the ID value exists, executing a corresponding action event processing function to realize the processing flow corresponding to the trigger event on the target page. The method further comprises: obtaining a page loading parameter of the page loading event, and determining whether the execution condition of the page loading event is met according to whether the page loading parameter matches the target page; obtaining an operated object, an operation action and a user permission of the user operation event, and determining whether the execution condition of the user operation event is met according to whether the operated object, the operation action and the user permission match; if it is determined that the execution condition of the user operation event is met, obtaining an ID value corresponding to the target page element, and performing one-to-one comparison between the ID value and an ID set associated with the user operation event to determine whether the ID value exists in the ID set; if it is determined that the ID value exists, executing a corresponding action event processing function to realize the processing flow corresponding to the trigger event on the target page. The method further comprises: obtaining a page loading parameter of the page loading event, and determining whether the execution condition of the page loading event is met according to whether the page loading parameter matches the target page; obtaining an operated object, an operation action and a user permission of the user operation event, and determining whether the execution condition of the user operation event is met according to whether the operated object, the operation action and the user permission match; if it is determined that the execution condition of the user operation event is met, obtaining an ID value corresponding to the target page element, and performing one-to-one comparison between the ID value and an ID set associated with the user operation event to determine whether the ID value exists in the ID set; if it is determined that the ID value exists, executing a corresponding action event processing function to realize the processing flow corresponding to the trigger event on the target page.
3. The method of claim 1, wherein, 4. The method of claim 1, wherein, 5. The method of claim 1, wherein, If it is determined that the event type corresponds to a user operation event, an ID value previously generated for the target page element is obtained; The ID value is compared with an ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set; If the ID value exists, a processing flow corresponding to the trigger event is executed on the target page based on the event type.
6. The method of claim 5, wherein, The execution of the processing flow corresponding to the trigger event on the target page based on the event type if the ID value exists includes: A second action event processing function configured for the target page element is called from a preset storage area, the second action event processing function being previously configured to execute a processing flow associated with the user operation event; The processing flow corresponding to the trigger event is executed on the target page based on the second action event processing function.
7. An event handling apparatus on a display page, characterized by comprising: It includes: A detection module configured to detect that a trigger event for a target page element exists on a target page, the target page element being previously configured with a processing flow of at least one event type; A determination module configured to determine an event type corresponding to the trigger event, the event type corresponding to one of a page loading event and a user operation event; An execution module configured to detect whether the trigger event is processed based on an execution condition configured for the target page element; If the execution condition is met, a processing flow corresponding to the trigger event is executed on the target page based on the event type; It further includes: obtaining a page loading parameter of the page loading event, and determining whether the execution condition of the page loading event is met according to whether the page loading parameter matches the target page; obtaining an operated object, an operation action and a user permission of the user operation event, and determining whether the execution condition of the user operation event is met according to whether the operated object, the operation action and the user permission match; if it is determined that the execution condition of the user operation event is met, an ID value corresponding to the target page element is obtained, and the ID value is compared with an ID set associated with the user operation event one by one to determine whether the ID value exists in the ID set; if it is determined that the ID value exists, a corresponding action event processing function is executed to realize the execution of the processing flow corresponding to the trigger event on the target page.
8. An electronic device, comprising: It includes: A memory for storing executable instructions; and A processor for executing the executable instructions with the memory to complete the operations of the event processing method on the display page in any of claims 1-6.
9. An electronic device, comprising: It includes: A memory for storing executable instructions; and A processor for executing the executable instructions with the memory to complete the operations of the event processing method on the display page in any of claims 1-6. It includes: A memory for storing executable instructions; and A processor for executing the executable instructions with the memory to complete the operations of the event processing method on the display page in any of claims 1-6.
Citation Information
Patent Citations
Techniques for programming event-driven transactions in mobile applications
US7013329B1