Movatterモバイル変換


[0]ホーム

URL:


CN114490001B - A method, device and equipment for executing aggregated event stream - Google Patents

A method, device and equipment for executing aggregated event stream
Download PDF

Info

Publication number
CN114490001B
CN114490001BCN202210147514.4ACN202210147514ACN114490001BCN 114490001 BCN114490001 BCN 114490001BCN 202210147514 ACN202210147514 ACN 202210147514ACN 114490001 BCN114490001 BCN 114490001B
Authority
CN
China
Prior art keywords
event
native
aggregate
simulated
stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210147514.4A
Other languages
Chinese (zh)
Other versions
CN114490001A (en
Inventor
蒋吉麟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co LtdfiledCriticalAlipay Hangzhou Information Technology Co Ltd
Priority to CN202210147514.4ApriorityCriticalpatent/CN114490001B/en
Publication of CN114490001ApublicationCriticalpatent/CN114490001A/en
Application grantedgrantedCritical
Publication of CN114490001BpublicationCriticalpatent/CN114490001B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The embodiment of the specification discloses an execution method, a device and equipment for an aggregate event stream. The method comprises the steps of obtaining an aggregation event stream comprising a plurality of events, wherein the types of the events comprise original events or simulated events, circularly updating the aggregation event stream in a mode of obtaining a first event in the aggregation event stream, determining whether the original event corresponding to the simulated event is blocked or not when the obtained type of the first event is the simulated event, stopping executing the first event if the original event is blocked, otherwise, executing the first event, removing the first event in the aggregation event stream, generating an updated aggregation event stream, and determining that the aggregation event stream is executed completely when the first event in the updated aggregation event stream is empty. Thus, when the front-end events in the aggregate event stream are blocked, the corresponding simulation events are not executed any more.

Description

Method, device and equipment for executing aggregation event stream
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, and a device for executing an aggregate event stream.
Background
With the development of the mobile internet, the types of browsers used by the front end are increasing. To accommodate the user's needs, the front-end framework unifies the browser event behavior by aggregating event streams (i.e., event streams that contain both native and simulated events) to achieve a unified event stream across the browser. However, in the aggregate event, since the simulation event and the corresponding native event have a sequential logic sequence relationship, if the previous native event is blocked but not triggered, the corresponding subsequent simulation event is still triggered because the event stream is already merged, which results in that the subsequent simulation event cannot be withdrawn.
Based on this, a more accurate implementation of the aggregate event stream is needed.
Disclosure of Invention
One or more embodiments of the present disclosure provide an aggregate event stream execution method, apparatus, device, and storage medium, so as to solve the technical problem that a more accurate aggregate event stream execution scheme is needed to avoid unexpected event triggering.
To solve the above technical problems, one or more embodiments of the present specification are implemented as follows:
In a first aspect, an embodiment of the present disclosure provides an execution method of an aggregate event stream, which is applied to an aggregate event stream including a plurality of events, where the method includes obtaining an aggregate event stream including a plurality of events, where a type of the event includes a native event or a simulation event, and performing a cyclic update on the aggregate event stream in a manner that a first event in the aggregate event stream is obtained, when the obtained type of the first event is the simulation event, it is determined whether a native event corresponding to the simulation event is blocked, if the native event is blocked, execution of the first event is terminated, otherwise, the first event is executed, the first event is removed from the aggregate event stream, an updated aggregate event stream is generated, and when the first event in the updated aggregate event stream is empty, it is determined that the aggregate event stream is executed.
In a second aspect, an embodiment of the present disclosure provides an execution device for an aggregate event stream, where the execution device is applied to the aggregate event stream including a plurality of events, and the device includes an acquisition module for acquiring the aggregate event stream including a plurality of events, where a type of the event includes a native event or a simulation event, a cyclic update module for circularly updating the aggregate event stream, where the cyclic update module acquires a first event in the aggregate event stream, determines whether a native event corresponding to the simulation event is blocked when the acquired type of the first event is the simulation event, and if the native event is blocked, terminates execution of the first event, otherwise executes the first event, removes the first event in the aggregate event stream, generates an updated aggregate event stream, and a termination module determines that the aggregate event stream is executed when the first event in the updated aggregate event stream is empty.
In a third aspect, embodiments of the present disclosure provide an electronic device, including:
at least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In a fourth aspect, embodiments of the present description provide a non-volatile computer storage medium having stored thereon computer-executable instructions that, when read by a computer in the storage medium, cause one or more processors to perform the method as described in the first aspect.
The above at least one technical solution adopted by one or more embodiments of the present disclosure may achieve the following beneficial effects by obtaining an aggregate event stream including a plurality of events, where a type of the event includes a native event or a simulation event, circularly updating the aggregate event stream by obtaining a first event in the aggregate event stream, determining whether a native event corresponding to the simulation event is blocked when the obtained type of the first event is the simulation event, terminating execution of the first event if the native event is blocked, otherwise executing the first event, removing the first event in the aggregate event stream, generating an updated aggregate event stream, and determining that the aggregate event stream is executed when the first event in the updated aggregate event stream is empty. Therefore, when the front-end events in the aggregate event stream are blocked, the corresponding simulation events are not executed any more, unexpected event triggering is avoided, and the flow of the original events is simulated more accurately.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some of the embodiments described in the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an executing method of an aggregate event stream according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating generation of a native event and a simulated event according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of generating a simulation event by aggregating event streams according to the embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an execution device for aggregating event streams according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electron according to an embodiment of the present disclosure.
Detailed Description
The embodiment of the specification provides an execution method, an execution device and a storage medium for an aggregate event stream.
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
As shown in fig. 1, fig. 1 is a flow chart of an execution method of an aggregate event stream according to an embodiment of the present disclosure, which is applied to an aggregate event stream including a plurality of events, and the method includes:
S101, acquiring an aggregate event stream comprising a plurality of events.
The types of events in the aggregate event stream include native events or simulated events. The native event is an event generated by the browser in response to an operation (such as clicking, selecting or inputting operation) of a user. Meanwhile, in part of the operation, an accompanying event corresponding to the native event may also occur.
For example, in a browser interface, a user clicks on a selectable box in the interface. This click triggers a "click event", and if the selectable box is an element that can be changed, for example, after the user clicks on the selectable box, the value or shape within the box changes (e.g., the shape within the box changes from null to a "v" or a "x"), then a "change event" that accompanies the click also occurs. The event may be regarded as an incident to the native event.
It is easy to understand that not every native event will have an accompanying event, but every accompanying event will have a corresponding native event, and logically, execution of the native event should always precede the corresponding accompanying event.
In practical application, the types of browsers used by the front end are more and more, and the execution environments of different wave devices for the accompanying events are different. In this case, in order to adapt to execution environments of more different browsers, the development end generally converts the accompanying event into a corresponding simulation event, and interfaces or execution parameters adapted to different browsers are added in the simulation event to adapt to the browsers of different environments.
That is, in the embodiment of the present specification, the simulation events are in one-to-one correspondence with the accompanying events. Accordingly, similar to the accompanying events, not every native event will have a corresponding simulated event, but every simulated event will have a native event corresponding to it, and execution of the native event should always precede the corresponding simulated event.
Fig. 2 is a schematic diagram illustrating generation of a native event and a simulated event according to an embodiment of the present disclosure. In the diagram, a user clicks a selectable box to generate a "click" native event, meanwhile, elements in the selectable box are changed, and then a corresponding "change" accompanying event is generated, at this time, by packaging the accompanying event, a "change" simulation event which can be executed under various browsers is generated, and the "click" native event and the "change" simulation event are pressed into an aggregate event stream in sequence to wait for execution.
At this time, in the aggregate event stream, the previous native event may also be referred to as a pre-event, and the subsequent simulation event may also be referred to as a post-event.
S103, circularly updating the aggregation event stream. The specific updating mode is as follows:
S1031, obtaining a first event in the aggregate event stream. That is, the first event is always fetched from the top of the aggregate event stream for execution each time.
S1033, when the acquired type of the first event is a simulation event, determining whether the original event corresponding to the simulation event is blocked or not.
It should be noted that, in this process, if the type of the first event obtained is a native event, it may be executed by default. When the first event is of the type of a native event, the native event will not be executed if it is marked as a blocking event.
S1035, if the original event is blocked, stopping executing the first event, otherwise, executing the first event.
For example, in the previous example, when executing the "change" simulation event, if the corresponding "click" native event is blocked, the execution of the "change" simulation event is terminated, otherwise, the execution of the "change" simulation event is continued, so that the "change" simulation event and the "click" native event are logically consistent.
S1037, removing the first event in the aggregation event stream, and generating an updated aggregation event stream.
After the aggregate event stream is updated, the process will repeat to steps S1031 to S1037 to cycle through all events in the aggregate event stream.
S105, when the first event in the updated aggregate event stream is empty, determining that the aggregate event stream is executed.
The method comprises the steps of obtaining a first event in an aggregate event stream, determining whether a primary event corresponding to a simulation event is blocked or not when the obtained type of the first event is the simulation event, terminating execution of the first event if the primary event is blocked, otherwise, executing the first event, removing the first event in the aggregate event stream to generate an updated aggregate event stream, and determining that the aggregate event stream is executed when the first event in the updated aggregate event stream is empty. Therefore, when the aggregate event stream is traversed and executed, when the front event is blocked, the corresponding simulation event is not executed any more, unexpected event triggering is avoided, and the flow of the original event is simulated more accurately.
In one embodiment, for determining the native event corresponding to the simulated event in S1033 in the foregoing step, the determination may be made according to a push manner of the event in the aggregate event stream.
For example, if the simulated event and the corresponding native event are always pressed into the event stream in a tight sequence, 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.
For another example, if the simulated event and the corresponding native event are not in close proximity, but there are other events in between. The native event it references may be indicated in the simulated event by referencing the value of the variable when the simulated event is generated. 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 simulation event is a native click event, or by assigning "NATIVEEVENT =1" to indicate that the native event referenced by the simulation event is a native event 1, the corresponding relationship determination of the native event is accurately achieved by determining the native event corresponding to the simulation event according to the value of the reference variable.
In one embodiment, for determining whether the native event corresponding to the simulated event is blocked in S1033 in the foregoing step, the following manner may be adopted to determine:
For example, an instruction called by a native event corresponding to the simulated event may be obtained, and when the called instruction meets a condition, it is determined that the native event corresponding to the simulated event is blocked. In practical applications, a native event is sometimes called by a developer using several instructions. After being called, some instructions may appear that the development end hopes that the native event is blocked, or some instructions that after being called, the environment of the native event is changed and blocked.
That is, a set of blocking instructions may be preset, where the set includes related blocking instructions, and when an instruction called for a native event belongs to the set, it may be determined that the native event corresponding to the simulated event is blocked. For example, when a native event is called by the call instruction "preventDefault", if the instruction belongs to a predefined set of blocking instructions, the native event can be considered to be blocked.
Or whether the native event corresponding to the simulation event contains a blocking mark can be determined to determine whether the native event corresponding to the simulation event is blocked. In a native event, a specific blocking flag may be set, for example, "default=0" may be used to flag that the native event is not blocked, and "default=1" may be used to flag that the native event has been blocked and is no longer executed.
In one embodiment, the simulation events in the aggregate event stream are pre-generated based on the following manner that a primary event corresponding to an operation is generated in response to the operation of a user, the element type of a node of the primary event is detected, and when the element type meets a preset type, the simulation event corresponding to the primary event is created.
The elements herein may be elements in a hypertext markup language (Hyper Text Markup Language HTML). For example, it may be an element in a web page, including, for example, a button in a web page, an input box, text, an image, and so forth. The part of the elements may generate corresponding accompanying events when the part of the elements is clicked by the user operation, so that the part of the elements can be predefined as triggerable elements, and when the element types of the nodes of the original events belong to the triggerable elements, the simulation events corresponding to the original events are created.
In one embodiment, before the element type of the node for detecting the native event in the simulated event is generated, a simulated event template corresponding to the simulated event can be obtained in advance, whether the simulated event template is empty is detected, and when the simulated event template is empty, the creation of the simulated event is terminated.
Templates for simulation events are preconfigured based on differences between browsers. That is, if the execution environment or execution parameters of one companion event are different between different browsers, one simulation event template needs to be configured in advance to generate a simulation event that can be adapted to each browser. However, if the execution environment or the execution parameters of one companion event are the same among different browsers, it is obvious that the companion event need not be created in this case, but may be directly regarded as a simulation event to be pushed into the event stream. At this time, the required simulation event template can be emptied as required because no corresponding simulation event is needed. In this way, the number of creation of invalid simulation events can be reduced, and the simulation efficiency can be improved.
Fig. 3 is a schematic flow chart of generating a simulation event by aggregating event streams according to an embodiment of the present disclosure.
In this schematic, the native event can be encapsulated and pushed into the event stream immediately upon generation. Meanwhile, if it is detected that there is a corresponding accompanying event in the native event, an event template corresponding to the accompanying event may be extracted from the polymerizable event bid farewell.
If the event template is detected to be empty, the accompanying event is not different among the browsers when being executed, and then the corresponding simulation event is not required to be created. The event stream is executed as usual.
If the event template is detected to be not empty, the element type of the node of the original event can be detected, and if the element type is detected to meet the preset type (for example, the input triggerable type comprises a button, a selectable box and the like), a simulation event corresponding to the original event is created, and the simulation event is pressed into an event stream.
The simulation event can be pressed in the event stream in a conventional timely pressing manner, and the original event referenced by the simulation event is only indicated by the reference mark in the simulation event. In the event stream, the simulated event should be placed after the native event to which it refers in order to execute after the native event to which it refers.
Based on the same thought, one or more embodiments of the present disclosure further provide apparatuses and devices corresponding to the above method, as shown in fig. 4 and fig. 5.
In a second aspect, as shown in fig. 4, fig. 4 is a schematic structural diagram of an execution apparatus for aggregating event streams provided in an embodiment of the present disclosure, where the execution apparatus is applied to an aggregate event stream including a plurality of events, and the apparatus includes:
an acquisition module 401 that acquires an aggregate event stream including a plurality of events, wherein the types of the events include native events or simulated events;
The circulation updating module 403 is configured to perform circulation updating on the aggregate event stream by acquiring a first event in the aggregate event stream, determining whether a native event corresponding to a simulated event is blocked when the acquired first event is of a type of the simulated event, and if the native event is blocked, terminating execution of the first event, otherwise, executing the first event;
And a termination module 405, configured to determine that the aggregate event stream is executed when the first event in the updated aggregate event stream is empty.
Optionally, the loop update module 403 obtains a value of a reference variable included in the simulation event, and determines a native event corresponding to the simulation event according to the value of the reference variable.
Optionally, the loop update module 403 obtains an instruction called by a native event corresponding to the simulated event, and determines that the native event corresponding to the simulated event is blocked when the called instruction meets a condition, or determines that the native event corresponding to the simulated event is blocked when the native event corresponding to the simulated event includes a blocking flag.
Optionally, the device further comprises an event generation module 407, responding to the operation of a user, generating a native event corresponding to the operation, detecting the element type of a node of the native event, and creating a simulation event corresponding to the native event when the element type meets a preset type.
Optionally, the event generating module 407 acquires a simulation event template corresponding to the simulation event, detects whether the simulation event template is empty, and terminates creating the simulation event when the simulation event template is empty.
In a third aspect, as shown in fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the device includes:
at least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In a fourth aspect, based on the same considerations, one or more embodiments of the present disclosure further provide a non-volatile computer storage medium corresponding to the above method, storing computer executable instructions that, when read by a computer in the storage medium, cause one or more processors to perform the method according to the first aspect.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable GATE ARRAY, FPGA)) is an integrated circuit whose logic functions are determined by user programming of the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented with "logic compiler (logic compiler)" software, which is similar to the software compiler used in program development and writing, and the original code before being compiled is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but HDL is not just one, but a plurality of 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), and VHDL (Very-High-SPEED INTEGRATED Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, 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.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that the present description may be provided as a method, system, or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description embodiments may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, devices, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing is merely one or more embodiments of the present description and is not intended to limit the present description. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present description, is intended to be included within the scope of the claims of the present description.

Claims (11)

Translated fromChinese
1.一种聚合事件流的执行方法,应用于包括多个事件的聚合事件流,所述方法包括: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.如权利要求1所述的方法,其中,确定所述模拟事件所对应的原生事件,包括:2. The method of claim 1, wherein determining the native event corresponding to the simulated event comprises:获取所述模拟事件中所包含的引用变量的值,根据所述引用变量的值确定所述模拟事件所对应的原生事件。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.如权利要求2所述的方法,其中,确定所述模拟事件所对应的原生事件是否被阻却,包括:3. The method of claim 2, wherein determining whether the native event corresponding to the simulated event is blocked comprises:获取所述模拟事件所对应的原生事件所调用的指令,当所述所调用的指令符合条件时,确定所述模拟事件所对应的原生事件被阻却;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.如权利要求1所述的方法,其中,所述聚合事件流中的模拟事件基于如下方式预先生成:4. The method of claim 1, wherein the simulated events in the aggregated event stream are pre-generated based on:响应于用户的操作,生成与所述操作对应的原生事件;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.如权利要求4所述的方法,在检测所述原生事件的节点的元素类型之前,所述方法还包括: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.一种聚合事件流的执行装置,应用于包括多个事件的聚合事件流,所述装置包括: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.如权利要求6所述的装置,其中,所述循环更新模块,获取所述模拟事件中所包含的引用变量的值,根据所述引用变量的值确定所述模拟事件所对应的原生事件。7. The device of claim 6, wherein the loop update module obtains the value of the reference variable contained in the simulated event, and determines the native event corresponding to the simulated event according to the value of the reference variable.8.如权利要求7所述的装置,其中,所述循环更新模块,获取所述模拟事件所对应的原生事件所调用的指令,当所述所调用的指令符合条件时,确定所述模拟事件所对应的原生事件被阻却;或者,当所述模拟事件所对应的原生事件中包含阻却标记时,确定所述模拟事件所对应的原生事件被阻却。8. The device as claimed in 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 contains a blocking mark, determines that the native event corresponding to the simulated event is blocked.9.如权利要求6所述的装置,其中,所述装置还包括事件生成模块,响应于用户的操作,生成与所述操作对应的原生事件;检测所述原生事件的节点的元素类型;当所述元素类型满足预设类型时,创建与所述原生事件所对应的模拟事件。9. The device as claimed in claim 6, wherein the device also includes an event generation module, 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 a preset type.10.如权利要求9所述的装置,所述事件生成模块,获取所述模拟事件所对应的模拟事件模板;检测所述模拟事件模板是否为空,当所述模拟事件模板为空时,终止创建所述模拟事件。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.一种电子设备,包括:11. An electronic device, comprising:至少一个处理器;以及,at least one processor; and,与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至5任一项所述的方法。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.
CN202210147514.4A2022-02-172022-02-17 A method, device and equipment for executing aggregated event streamActiveCN114490001B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210147514.4ACN114490001B (en)2022-02-172022-02-17 A method, device and equipment for executing aggregated event stream

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210147514.4ACN114490001B (en)2022-02-172022-02-17 A method, device and equipment for executing aggregated event stream

Publications (2)

Publication NumberPublication Date
CN114490001A CN114490001A (en)2022-05-13
CN114490001Btrue CN114490001B (en)2025-03-25

Family

ID=81481790

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210147514.4AActiveCN114490001B (en)2022-02-172022-02-17 A method, device and equipment for executing aggregated event stream

Country Status (1)

CountryLink
CN (1)CN114490001B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106293971A (en)*2016-08-152017-01-04张家林A kind of method and apparatus of distributed task dispatching

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070055937A1 (en)*2005-08-102007-03-08David CancelPresentation of media segments
CA2414053A1 (en)*2002-12-092004-06-09Corel CorporationSystem and method for manipulating a document object model
US9621932B2 (en)*2012-02-282017-04-11Google Inc.Enhancing live broadcast viewing through display of filtered internet information streams
WO2013169827A1 (en)*2012-05-072013-11-14Armor5, Inc.Enhanced document and event mirroring for accessing content
US20160071027A1 (en)*2014-09-082016-03-10Pivotal Software, Inc.Compute intensive stream processing with concept drift detection
US9928117B2 (en)*2015-12-112018-03-27Vivante CorporationHardware access counters and event generation for coordinating multithreaded processing
CN109240756A (en)*2018-07-062019-01-18沈文策A kind of method and device of dynamically load JavaScript module
CN109597695B (en)*2018-09-302020-08-21阿里巴巴集团控股有限公司Data processing method, device and equipment
CN113296933B (en)*2020-08-142025-03-14阿里巴巴集团控股有限公司 Event processing method, device, equipment and machine-readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106293971A (en)*2016-08-152017-01-04张家林A kind of method and apparatus of distributed task dispatching

Also Published As

Publication numberPublication date
CN114490001A (en)2022-05-13

Similar Documents

PublicationPublication DateTitle
CN115756449B (en) A page multiplexing method, device, storage medium and electronic equipment
CN113259224A (en)Method and device for sending customer service data
CN112000329B (en)Data display method, device, equipment and medium
CN114547024A (en) A SQL statement risk detection method, device, equipment and medium
CN113360385B (en) A test method, device, equipment and medium
CN112732252B (en)Method and device for dynamically generating UI and electronic equipment
CN116185532B (en) A task execution system, method, storage medium and electronic device
CN112364074B (en)Time sequence data visualization method, equipment and medium
CN116893892A (en)Method, equipment and medium for dynamically generating message queue based on service model
CN114490001B (en) A method, device and equipment for executing aggregated event stream
CN111880922A (en)Processing method, device and equipment for concurrent tasks
CN116341642B (en)Data processing method and device, storage medium and electronic equipment
CN117111918A (en)Data processing system for task structure design
CN114253516B (en) A data reporting system UI development method, device and storage medium
CN116755862A (en)Training method, device, medium and equipment for operator optimized scheduling model
CN117311856A (en)Method and device for generating interface calling code
CN116048977A (en)Test method and device based on data reduction
CN114296709A (en)Code processing method, device, equipment and medium
CN111984720A (en)Data acquisition method and device, electronic equipment and interface adaptation device
CN117455015B (en)Model optimization method and device, storage medium and electronic equipment
CN119226385B (en) Data visualization method, device, medium and equipment
CN115033815A (en) A component-based dynamic theme generation method, device and device
CN117591107A (en)Method, equipment and medium for fast rendering front-end interface
CN117952074A (en)Data importing method, device and medium
CN113590481A (en)Automatic testing method, device and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp