A method, device and equipment for executing aggregated event stream

By checking whether the native event corresponding to the simulated event is blocked in the aggregate event stream and terminating the execution of the simulated event accordingly, the problem that the previous native event is blocked makes the simulated event unable to be revoked is solved, and more accurate event stream execution is achieved.

CN114490001BActive Publication Date: 2025-03-25ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210147514.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2025-03-25
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

In the aggregate event stream, since there is a logical sequence relationship between the simulated event and its corresponding native event, if the previous native event is blocked but not triggered, the corresponding subsequent simulated event cannot be revoked and still triggered, resulting in unexpected event triggering.

Method used

By getting the first event in the aggregate event stream, if it is a simulated event, it determines whether its corresponding native event is blocked. If the native event is blocked, the simulation event is terminated; otherwise, the simulation event is executed and the event is removed in the event stream, generating the updated event stream until there are no more events in the event stream.

Benefits of technology

It realizes that when the pre-event is blocked in the aggregate event stream, its corresponding simulated events will no longer be executed, avoiding unexpected event triggers, and ensuring a more accurate process of simulating native events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490001B_ABST
    Figure CN114490001B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method, device and equipment for executing an aggregate event stream. An aggregate event stream including multiple events is obtained, wherein the types of the events include native events or simulated events; the aggregate event stream is cyclically updated in the following manner: the first event in the aggregate event stream is obtained; when the type of the first event obtained is a simulated event, it is determined whether the native event corresponding to the simulated event is blocked; if the native event is blocked, the execution of the first event is terminated; otherwise, the first event is executed; the first event is removed from the aggregate event stream to generate an updated aggregate event stream; when the first event in the updated aggregate event stream is empty, it is determined that the aggregate event stream has been executed. Thereby, when the preceding event in the aggregate event stream is blocked, its corresponding simulated event is no longer executed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a method, device and apparatus for executing an aggregated event stream. Background Art

[0002] With the development of mobile Internet, more and more types of browsers are used in the front-end. To meet user needs, the front-end framework will unify browser event behaviors by aggregating event streams (i.e., event streams that include native events and simulated events) to achieve a unified event stream across browsers. However, in aggregated events, since there is a logical order relationship between simulated events and their corresponding native events, if the first native event is blocked and not triggered, the corresponding subsequent simulated event will be merged into the event stream, which will cause the subsequent simulated event to be unable to be revoked and will still be triggered.

[0003] Based on this, a more accurate execution plan for aggregating event streams is needed. Summary of the invention

[0004] One or more embodiments of the present specification provide an aggregate event stream execution method, apparatus, device, and storage medium to solve the following technical problem: a more accurate aggregate event stream execution solution is needed to avoid unexpected event triggering.

[0005] To solve the above technical problems, one or more embodiments of this specification are implemented as follows:

[0006] In a first aspect, an embodiment of the present specification provides a method for executing an aggregated event stream, which is applied to an aggregated event stream including multiple events, the method comprising: obtaining an aggregated event stream including multiple events, wherein the types of the events include native events or simulated events; cyclically updating the aggregated event stream in the following manner: obtaining the first event in the aggregated event stream; when the type of the first event obtained is a simulated event, determining whether the native event corresponding to the simulated event is blocked; if the native event is blocked, terminating the execution of the first event; otherwise, executing the first event; removing the first event from the aggregated event stream to generate an updated aggregated event stream; when the first event in the updated aggregated event stream is empty, determining that the execution of the aggregated event stream is complete.

[0007] In a second aspect, an embodiment of the present specification provides an execution device for an aggregate event stream, which is applied to an aggregate event stream including multiple events, and the device includes: an acquisition module, which acquires an aggregate event stream including multiple events, wherein the types of the events include native events or simulated events; a loop update module, which performs a loop update on the aggregate event stream in the following manner: acquiring the first event in the aggregate event stream; when the type of the acquired first event is a simulated event, determining whether the native event corresponding to the simulated event is blocked; if the native event is blocked, terminating the execution of the first event; otherwise, executing the first event; removing the first event from the aggregate event stream to generate an updated aggregate event stream; and a termination module, which determines that the execution of the aggregate event stream is completed when the first event in the updated aggregate event stream is empty.

[0008] In a third aspect, an embodiment of the present specification provides an electronic device, including:

[0009] at least one processor; and,

[0010] a memory communicatively connected to the at least one processor; wherein,

[0011] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0012] In a fourth aspect, an embodiment of the present specification provides a non-volatile computer storage medium storing computer executable instructions. When a computer reads the computer executable instructions in the storage medium, the instructions enable one or more processors to execute the method described in the first aspect.

[0013] At least one of the above technical solutions adopted in one or more embodiments of this specification can achieve the following beneficial effects: by obtaining an aggregate event stream including multiple events, wherein the types of the events include native events or simulated events; the aggregate event stream is cyclically updated in the following manner: obtaining the first event in the aggregate event stream; when the type of the first event obtained is a simulated event, determining whether the native event corresponding to the simulated event is blocked; if the native event is blocked, terminating the execution of the first event; otherwise, executing the first event; removing the first event from the aggregate event stream to generate an updated aggregate event stream; when the first event in the updated aggregate event stream is empty, determining that the aggregate event stream has been executed. Thereby, when the preceding event in the aggregate event stream is blocked, the corresponding simulated event is no longer executed, avoiding unexpected event triggering, and more accurately simulating the process of native events. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0015] Figure 1 A flowchart of a method for executing an aggregated event stream provided in an embodiment of this specification;

[0016] Figure 2 A schematic diagram of the generation of native events and simulated events provided in the embodiments of this specification;

[0017] Figure 3 A schematic diagram of a process of generating simulated events by aggregating event streams provided in an embodiment of this specification;

[0018] Figure 4 A schematic diagram of the structure of an execution device for aggregated event streams provided in an embodiment of this specification;

[0019] Figure 5 A schematic diagram of an electronic structure provided in an embodiment of this specification. DETAILED DESCRIPTION

[0020] The embodiments of this specification provide a method, apparatus, device and storage medium for executing an aggregated event stream.

[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0022] like Figure 1 As shown, Figure 1 A flowchart of a method for executing an aggregate event stream provided in an embodiment of this specification is applied to an aggregate event stream including multiple events. The method includes:

[0023] S101: Obtain an aggregated event stream including multiple events.

[0024] The types of events in the aggregated event stream include native events or simulated events. Among them, native events are events generated by the browser in response to user operations (such as click, selection, or input operations). At the same time, in some operations, accompanying events corresponding to native events may also occur.

[0025] For example, in a browser interface, a user clicks on an option box in the interface. This click operation triggers a "click event"; at the same time, if the option box is an element that can be changed, for example, after the user clicks on the option box, the value or shape in the box changes (for example, the shape in the box changes from empty to a "√" or an "×"), then at this time, a "change event" will also occur accompanying the click operation. This event can be regarded as a companion event of the native event.

[0026] It is easy to understand that not every native event will have a companion event, but every companion event will have a corresponding native event, and logically speaking, the execution of a native event should always precede the corresponding companion event.

[0027] In actual applications, there are more and more types of browsers used in the front end, and different vagrants have different execution environments for accompanying events. At this time, in order to adapt to the execution environments of more different browsers, the development end usually converts accompanying events into corresponding simulation events, and adds interfaces or execution parameters that adapt to different browsers in the simulation events to adapt to browsers in different environments.

[0028] That is, in the embodiments of this specification, the simulated events correspond to the accompanying events one by one. Accordingly, similar to the accompanying events, not every native event has a corresponding simulated event, but every simulated event has a corresponding native event, and the execution of the native event should always precede the corresponding simulated event.

[0029] like Figure 2 As shown, Figure 2 A schematic diagram of the generation of native events and simulated events provided in the embodiments of this specification. In the schematic diagram, a user clicks on an option box, generating a "click" native event. At the same time, the elements in the option box change, and a corresponding "change" companion event is generated. At this time, by encapsulating the companion event, a "change" simulated event that can be executed in various browsers is generated, and the "click" native event and the "change" simulated event are sequentially pressed into the aggregate event stream to wait for execution.

[0030] At this time, in the aggregate event stream, the preceding native event can also be called a preceding event, and the succeeding simulated event can also be called a succeeding event.

[0031] S103, cyclically updating the aggregated event stream. The specific updating method is:

[0032] S1031, obtaining the first event in the aggregate event stream, that is, always taking the first event from the top of the aggregate event stream for execution each time.

[0033] S1033: When the type of the first event obtained is a simulation event, determine whether a native event corresponding to the simulation event is blocked.

[0034] It should be noted that in this process, if the type of the first event obtained is a native event, it is assumed that it can be executed. When the type of the first event is a native event, if it is marked as a blocking event, the native event will not be executed.

[0035] S1035, if the native event is blocked, terminate the execution of the first event; otherwise, execute the first event.

[0036] For example, continuing with the previous example, when executing the "change" simulation event, if its corresponding "click" native event is blocked, the execution of the "change" simulation event is terminated; otherwise, the "change" simulation event continues to be executed so that the "change" simulation event and the "click" native event are logically consistent.

[0037] S1037: Remove the first event from the aggregate event stream to generate an updated aggregate event stream.

[0038] After the aggregate event stream is updated, steps S1031 to S1037 are repeated to loop through all events in the aggregate event stream.

[0039] S105: When the first event in the updated aggregate event stream is empty, it is determined that the aggregate event stream is executed completely.

[0040] By obtaining the first event in the aggregated event stream; when the type of the first event obtained is a simulated event, determining whether the native event corresponding to the simulated event is blocked; if the native event is blocked, terminating the execution of the first event; otherwise, executing the first event; removing the first event from the aggregated event stream to generate an updated aggregated event stream; when the first event in the updated aggregated event stream is empty, determining that the aggregated event stream has been executed. Thus, when the aggregated event stream is traversed and executed, when the preceding event is blocked, the corresponding simulated event is no longer executed, avoiding unexpected event triggering and more accurately simulating the process of native events.

[0041] In one embodiment, the determination of the native event corresponding to the simulated event in S1033 in the aforementioned step may be determined according to the push mode of the event in the aggregated event stream.

[0042] For example, if the simulated event and the corresponding native event are always pressed into the event stream in close sequence, then the previous event corresponding to the simulated event in the event stream can be directly determined as the native event corresponding to the simulated event.

[0043] For another example, if the simulated event and the corresponding native event are not closely adjacent, but there are other events between the two. Then when a simulated event is generated, the value of the reference variable can be used in the simulated event to indicate the native event it references. For example, the native event referenced by the simulated event is indicated by the reference variable "nativeEvent" contained in the simulated event. For example, by assigning "nativeEvent=click" to indicate that the native event referenced by the simulated event is the native click event, or by assigning "nativeEvent=1" to indicate that the native event referenced by the simulated event is native event 1, thereby determining the native event corresponding to the simulated event according to the value of the reference variable, and realizing accurate determination of the correspondence relationship of the native events.

[0044] In one embodiment, the determination of whether the native event corresponding to the simulated event is blocked in S1033 in the aforementioned step may be determined in the following manner:

[0045] For example, the instructions called by the native event corresponding to the simulated event can be obtained, and when the called instructions meet the conditions, it is determined that the native event corresponding to the simulated event is blocked. In actual applications, native events are sometimes called by the development end using several instructions. After being called, it is possible that some instructions are the native events that the development end hopes to block, or some instructions are blocked because the environment of the native event changes after being called.

[0046] That is, a set of blocking instructions consisting of related blocking instructions can be pre-set, and when the instruction called by the native event belongs to the set, it can be determined that the native event corresponding to the simulated event is blocked. For example, when a native event is called by the instruction "preventDefault", if the instruction belongs to the pre-defined set of blocking instructions, it can be considered that the native event is blocked.

[0047] Alternatively, it is also possible to determine whether the native event corresponding to the simulated event contains a blocking mark to determine whether the native event corresponding to the simulated event is blocked. In the native event, a specific blocking mark can be set, for example, "Default = 0" can be used to mark that the native event is not blocked, and "Default = 1" can be used to mark that the native event has been blocked and is no longer executed.

[0048] In one embodiment, the simulated events in the aggregated event stream are pre-generated based on the following method: in response to a user operation, a native event corresponding to the operation is generated; the element type of the node of the native event is detected; when the element type meets a preset type, a simulated event corresponding to the native event is created.

[0049] The elements here may be elements in Hyper Text Markup Language HTML. For example, they may be elements in a web page, including buttons, input boxes, text, images, etc. in the web page. Some of these elements may generate corresponding accompanying events when clicked by a user. Therefore, these elements may be pre-defined as triggerable elements. When the element type of the node of the native event belongs to the triggerable element, a simulated event corresponding to the native event is created.

[0050] In one embodiment, before detecting the element type of the node of the native event in generating a simulated event, it is also possible to pre-acquire a simulated event template corresponding to the simulated event; detect whether the simulated event template is empty, and terminate the creation of the simulated event when the simulated event template is empty.

[0051] The template of the simulated event is pre-configured based on the differences between the browsers. That is, if the execution environment or execution parameters of a companion event are different between different browsers, then it is necessary to pre-configure a simulated event template to generate a simulated event that can be adapted to each browser. However, if the execution environment or execution parameters of a companion event are the same between different browsers, then it is obvious that there is no need to create a corresponding simulated event at this time, and the companion event can be directly regarded as a simulated event and pressed into the event stream. At this time, since there is no need for a corresponding simulated event, the required simulated event template can be regarded as empty. In this way, the number of invalid simulated events created can be reduced and the simulation efficiency can be improved.

[0052] like Figure 3 As shown, Figure 3 A schematic diagram of a process for generating simulated events by aggregating event streams provided in an embodiment of this specification.

[0053] In this diagram, the native event can be immediately encapsulated and pushed into the event stream when it is generated. At the same time, if it is detected that the native event has a corresponding accompanying event, an event template corresponding to the accompanying event can be extracted from the aggregatable event.

[0054] If it is detected that the event template is empty, it means that there is no difference between browsers when the accompanying event is executed, so there is no need to create a corresponding simulation event. The event flow can be executed as usual.

[0055] If it is detected that the event template is not empty, the element type of the node of the native event can be detected. If it is detected that the element type meets the preset type (for example, an input triggerable type, including buttons, option boxes, etc.), a simulation event corresponding to the native event is created and the simulation event is pushed into the event stream.

[0056] When pushing simulated events into the event stream, conventional timely push methods can be adopted, and it is only necessary to indicate the native events referenced by the simulated events through reference marks. In the event stream, simulated events should be placed after the native events they reference, so that they are executed after the native events they reference.

[0057] Based on the same idea, one or more embodiments of this specification also provide devices and apparatuses corresponding to the above methods, such as Figure 4 , Figure 5 shown.

[0058] In the second aspect, Figure 4 As shown, Figure 4 A schematic diagram of the structure of an execution device of an aggregate event stream provided in an embodiment of this specification is applied to an aggregate event stream including multiple events, and the device includes:

[0059] An acquisition module 401 acquires an aggregated event stream including multiple events, wherein the types of the events include native events or simulated events;

[0060] The loop updating module 403 performs loop updating on the aggregated event stream in the following manner: obtaining the first event in the aggregated event stream; when the type of the first event obtained is a simulated event, determining whether the native event corresponding to the simulated event is blocked; if the native event is blocked, terminating the execution of the first event; otherwise, executing the first event; removing the first event from the aggregated event stream to generate an updated aggregated event stream;

[0061] Termination module 405, when the first event in the updated aggregate event stream is empty, determines that the aggregate event stream is executed completely.

[0062] Optionally, the loop updating module 403 obtains the value of a reference variable contained in the simulation event, and determines the native event corresponding to the simulation event according to the value of the reference variable.

[0063] Optionally, the loop update module 403 obtains the instruction called by the native event corresponding to the simulated event, and when the called instruction meets the conditions, determines that the native event corresponding to the simulated event is blocked; or, when the native event corresponding to the simulated event contains a blocking mark, determines that the native event corresponding to the simulated event is blocked.

[0064] Optionally, the device also includes an event generation module 407, which generates a native event corresponding to the operation in response to the user's operation; detects the element type of the node of the native event; and creates a simulated event corresponding to the native event when the element type meets the preset type.

[0065] Optionally, the event generation module 407 obtains a simulation event template corresponding to the simulation event; detects whether the simulation event template is empty, and terminates the creation of the simulation event when the simulation event template is empty.

[0066] In the third aspect, Figure 5 As shown, Figure 5 A schematic diagram of an electronic structure provided in an embodiment of this specification, the device includes:

[0067] at least one processor; and,

[0068] a memory communicatively connected to the at least one processor; wherein,

[0069] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0070] In the fourth aspect, based on the same idea, one or more embodiments of the present specification also provide a non-volatile computer storage medium corresponding to the above method, storing computer executable instructions. When the computer reads the computer executable instructions in the storage medium, the instructions enable one or more processors to execute the method described in the first aspect.

[0071] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0072] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0073] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0074] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0075] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0076] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0077] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0079] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0080] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0081] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0082] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0083] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0084] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0085] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0086] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A method for executing an aggregate event stream, applied to an aggregate event stream including a plurality of events, the method comprising: Obtaining an aggregate event stream including multiple events, wherein the event type includes a native event or a simulated event, and the aggregate event stream is used by the front-end framework to unify browser event behaviors; The aggregate event stream is cyclically updated in the following manner: Get the first event in the aggregate event stream; When the type of the first event obtained is a simulated event, determining whether a native event corresponding to the simulated event is blocked; If the native event is blocked, terminate the execution of the first event; otherwise, execute the first event; Removing the first event from the aggregate event stream to generate an updated aggregate event stream; When the first event in the updated aggregate event stream is empty, it is determined that the aggregate event stream is completed.

2. The method of claim 1, wherein: Determining the native event corresponding to the simulated event includes: The value of the reference variable contained in the simulated event is obtained, and the native event corresponding to the simulated event is determined according to the value of the reference variable.

3. The method of claim 2, wherein: Determining whether the native event corresponding to the simulated event is blocked includes: Acquire an instruction called by a native event corresponding to the simulated event, and when the called instruction meets a condition, determine that the native event corresponding to the simulated event is blocked; Alternatively, when the native event corresponding to the simulated event includes a blocking mark, it is determined that the native event corresponding to the simulated event is blocked.

4. The method of claim 1, wherein: The simulated events in the aggregated event stream are pre-generated based on the following method: In response to a user operation, generating a native event corresponding to the operation; Detecting the element type of the node of the native event; When the element type meets the preset type, a simulation event corresponding to the native event is created.

5. The method according to claim 4, before detecting the element type of the node of the native event, the method further comprises: Obtaining a simulation event template corresponding to the simulation event; Detect whether the simulation event template is empty, and when the simulation event template is empty, terminate the creation of the simulation event.

6. An execution device for an aggregate event stream, applied to an aggregate event stream including a plurality of events, the device comprising: An acquisition module is used to acquire an aggregate event stream including multiple events, wherein the event types include native events or simulated events, and the aggregate event stream is used by the front-end framework to unify browser event behaviors; A loop updating module is used to loop update the aggregate event stream in the following manner: obtain the first event in the aggregate event stream; when the type of the first event obtained is a simulation event, determine whether the native event corresponding to the simulation event is blocked; if the native event is blocked, terminate the execution of the first event; otherwise, execute the first event; remove the first event from the aggregate event stream to generate an updated aggregate event stream; The termination module determines that the execution of the aggregate event stream is completed when the first event in the updated aggregate event stream is empty.

7. The device according to claim 6, wherein: The loop updating module obtains the value of the reference variable contained in the simulation event, and determines the native event corresponding to the simulation event according to the value of the reference variable.

8. The device according to claim 7, wherein: The loop update module obtains the instruction called by the native event corresponding to the simulated event, and when the called instruction meets the conditions, determines that the native event corresponding to the simulated event is blocked; or when the native event corresponding to the simulated event includes a blocking mark, determines that the native event corresponding to the simulated event is blocked.

9. The device according to claim 6, wherein: The device also includes an event generation module, which generates a native event corresponding to the operation in response to a user's operation; detects the element type of the node of the native event; and creates a simulation event corresponding to the native event when the element type meets a preset type.

10. The device according to claim 9, wherein the event generation module obtains a simulation event template corresponding to the simulation event; detects whether the simulation event template is empty, and terminates the creation of the simulation event when the simulation event template is empty.

11. An electronic device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Distributed task scheduling method and device

    CN106293971A