Event execution method and device, electronic equipment and storage medium

By injecting asynchronous event-driven classes into SaaS applications and creating an asynchronous event function queue, the problem of information and data interaction between components in Web componentization technology is solved, efficient data transmission and event processing across components is achieved, and the quality and stability of SaaS software are improved.

CN120295685AActive Publication Date: 2025-07-11粤港澳大湾区(广东)国创中心
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510220008.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-07-11
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

In the existing Web componentization technology, information and data cannot be directly transmitted between brother components and intergenerational components, and the programming complexity is high, resulting in a degradation in the quality of SaaS application software.

Method used

By injecting asynchronous event-driven classes into the software operation service application, an asynchronous event function queue is created, and events are triggered and executed by the asynchronous event-driven classes between components are triggered and executed, information and data interactions between components are achieved.

Benefits of technology

It reduces programming complexity, improves the ease of use of information and data interaction between components, and enhances the quality and stability of SaaS software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295685A_ABST
    Figure CN120295685A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an event execution method and device, electronic equipment and a storage medium. Asynchronous event driving classes are injected into a software operation service application program by responding to a starting operation of the software operation service application program; then, an asynchronous event function queue is created through the first component according to the asynchronous event drive class, and the asynchronous event function queue comprises an asynchronous execution function; and triggering the event through the second component according to the asynchronous event driving class, and executing the event through the first component according to the asynchronous event function queue. Through application of the asynchronous event-driven class, information and data interaction between modules or components of a software operation service application program is not limited by an original framework, and when a certain component triggers the event, the asynchronous execution function corresponding to the event can be automatically and asynchronously executed in sequence through the associated component, so that the programming complexity is effectively reduced; and the quality and the stability of the SaaS software are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Web componentization, and in particular to an event execution method and apparatus, an electronic device, and a storage medium. Background Art

[0002] With the continuous development of modern information technology, the technology of WEB browsers has also made great progress. In the 1990s and the early 21st century, with JavaScript, HTML, and CSS as the main technical bases, various manufacturers provided many services such as portal websites, news sites, blogs, and forums. With the continuous improvement of Internet speed and the development of communication technologies such as 5G, various manufacturers have begun to provide more and more abundant WEB-based SaaS (Software as a Service) services. As more and more services are provided by SaaS applications, the concept of web componentization development was proposed around 2010. Subsequently, single-page application development frameworks represented by Angular, React, and Vue emerged to solve the difficulties of modular and componentized development on the web side.

[0003] However, with the development of web componentization technology, SaaS application programs often consist of dozens or even hundreds of modules and components, which undoubtedly greatly increases the development complexity of WEB applications; at the same time, information and data need to be transmitted between modules and components to cooperate to complete a certain complex function, which poses a challenge to the usability of the information and data interaction framework mode.

[0004] Taking the information and data interaction mechanism provided by the Angular platform as an example, its direct information transmission can only be carried out between the parent and the child through the @input / @output method. Therefore, its main defects are as follows: (1) Information and data cannot be directly transmitted between sibling components; (2) Data and information cannot be directly interacted between components of different generations; (3) High requirements for the ability of program developers, large programming complexity, and complex information and data interaction modes, which greatly reduce the quality of SaaS application software. Summary of the Invention

[0005] In view of the above problems, an event execution method and apparatus, an electronic device, and a storage medium are proposed to overcome or at least partially solve the above problems, including:

[0006] An event execution method, characterized in that the method includes:

[0007] In response to a startup operation of a software operation service application program, injecting an asynchronous event-driven class into the software operation service application program;

[0008] The first component creates an asynchronous event function queue according to the asynchronous event driving class, where the asynchronous event function queue includes asynchronous execution functions;

[0009] The second component triggers an event according to the asynchronous event driving class, and the first component executes the event according to the asynchronous event function queue.

[0010] Optionally, the method further includes:

[0011] Determine the processing result of the event, and the first component sends the processing result of the event to the second component.

[0012] Optionally, injecting the asynchronous event driving class into the software operation service application includes:

[0013] Inject the asynchronous event driving class into the software operation service application through a dependency injection mechanism.

[0014] Optionally, the step of the first component executing the event according to the asynchronous event function queue includes:

[0015] The first component asynchronously executes the asynchronous execution function corresponding to the event according to the asynchronous event function queue.

[0016] Optionally, the method further includes:

[0017] In response to the closing operation of the software operation service application, stop executing the event by the first component according to the asynchronous event function queue, and clear the asynchronous event function queue.

[0018] Optionally, the scope when injecting the asynchronous event driving class into the software operation service application through the dependency injection mechanism is the entire software operation service application.

[0019] Optionally, after the first component creates an asynchronous event function queue according to the asynchronous event driving class, it further includes:

[0020] Establish an association relationship between the first component and the second component through the asynchronous event driving class.

[0021] An event execution device, the device includes:

[0022] An asynchronous event driving class injection module, configured to inject an asynchronous event driving class into the software operation service application in response to a startup operation of the software operation service application;

[0023] An asynchronous event function queue creation module, configured to create an asynchronous event function queue by a first component according to the asynchronous event driving class, wherein the asynchronous event function queue includes asynchronous execution functions;

[0024] An event execution module, configured to trigger an event by a second component according to the asynchronous event driving class, and execute the event by the first component according to the asynchronous event function queue.

[0025] Optionally, the device further includes:

[0026] A processing result feedback module, configured to determine a processing result of the event, and send the processing result of the event to the second component by the first component.

[0027] Optionally, the asynchronous event driving class injection module includes:

[0028] An asynchronous event driving class injection sub-module, configured to inject the asynchronous event driving class into the software operation service application through a dependency injection mechanism.

[0029] Optionally, the event execution module includes:

[0030] An event execution sub-module, configured to asynchronously execute an asynchronous execution function corresponding to the event by the first component according to the asynchronous event function queue.

[0031] Optionally, the device further includes:

[0032] An application shutdown response module, configured to respond to a shutdown operation of the software operation service application, stop executing the event by the first component according to the asynchronous event function queue, and clear the asynchronous event function queue.

[0033] Optionally, the device further includes:

[0034] An association relationship establishment module, configured to establish an association relationship between the first component and the second component through the asynchronous event driving class.

[0035] An electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor, where when the computer program is executed by the processor, the event execution method described above is implemented.

[0036] A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the event execution method described above is implemented.

[0037] A computer program product includes a computer program which, when executed by a processor, implements the event execution method as described above.

[0038] The embodiments of the present invention have the following advantages:

[0039] The present invention provides an event execution method. By responding to the startup operation of a software operation service application, an asynchronous event-driven class is injected into the software operation service application. Subsequently, a first component creates an asynchronous event function queue according to the asynchronous event-driven class, where the asynchronous event function queue includes asynchronous execution functions. Furthermore, a second component triggers an event according to the asynchronous event-driven class, and the first component executes the event according to the asynchronous event function queue. The application of the asynchronous event-driven class enables information and data interaction between modules or components of the software operation service application to be unrestricted by the original framework. When an event is triggered by a certain component, the associated component can automatically and sequentially execute the asynchronous execution function corresponding to the event asynchronously, effectively reducing the programming complexity, improving the usability of information and data interaction between modules and even components, further improving the quality of SaaS software, and enhancing its stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for the description of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0041] Figure 1 is a flowchart of the steps of an event execution method provided by some embodiments of the present invention;

[0042] Figure 2 is a schematic diagram of the information interaction principle between components of the present invention provided by some embodiments of the present invention;

[0043] Figure 3 is an example diagram of the execution process of the present invention provided by some embodiments of the present invention;

[0044] Figure 4 is a schematic structural diagram of an event execution device provided by some embodiments of the present invention;

[0045] Figure 5 is a block diagram of an electronic device provided by some embodiments of the present invention;

[0046] Figure 6 is a schematic diagram of a computer-readable medium provided by some embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0047] To make the above objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0048] In the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and roles, only for clearly describing the technical solutions of the embodiments of the present application, and should not be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features.

[0049] In the embodiments of the present application, the orientation or positional relationship indicated by terms such as "upper" and "lower" is based on the orientation or positional relationship shown in the accompanying drawings, only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the indicated device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application.

[0050] With the continuous development of modern information technology, the technology of WEB browsers has also made great progress. In the 1990s and the early 2000s, with JavaScript, HTML, and CSS as the main technical bases, various manufacturers provided many services such as portal websites, news sites, blogs, and forums. With the continuous improvement of the Internet speed and the development of communication technologies such as 5G, various manufacturers have begun to provide more and more rich WEB-based SaaS services. As more and more services are provided by SaaS applications, the concept of web component-based development was proposed around 2010. Subsequently, single-page application development frameworks represented by Angular, React, and Vue emerged to solve the difficulties of modular and component-based development on the web side.

[0051] However, with the development of web component technology, SaaS applications often consist of dozens or even hundreds of modules and components, which undoubtedly greatly increases the development complexity of WEB applications; at the same time, information and data need to be transmitted between modules and components to cooperate to complete a certain complex function, which poses a challenge to the usability of the information and data interaction framework model.

[0052] Taking the information and data interaction mechanism provided by the Angular platform as an example, its direct information transmission can only be carried out between the parent and the child, and is realized through the @input / @output method. Therefore, the main existing defects are as follows: (1) Information and data cannot be directly transmitted between sibling components; (2) Data and information cannot be directly interacted between components of different generations; (3) It has high requirements for the capabilities of program developers, with a large programming complexity, and a complex information and data interaction mode, which greatly reduces the quality of SaaS application software.

[0053] In order to solve the above problems, based on the core technical concept that the information and data interaction between modules or components of a software operation service application program is not restricted by the original framework through the application of an asynchronous event-driven class, the present invention improves the event execution method in the related art. The following will describe the present invention in detail with reference to the accompanying drawings:

[0054] Refer to Figure 1 , which shows a step flowchart of an event execution method provided by some embodiments of the present invention. Specifically, it may include the following steps:

[0055] Step 101, in response to the startup operation of the software operation service application program, inject an asynchronous event-driven class into the software operation service application program;

[0056] In a specific implementation, after starting the SaaS application program, the asynchronous event-driven class can be automatically injected into the SaaS application program through the dependence injection mechanism, and its scope can be the entire SaaS application program.

[0057] Through the application of the asynchronous event-driven class, the communication restriction between Angular native parent and child components can be broken in subsequent steps, allowing direct communication between any components (parent-child, sibling, different generations), without explicitly defining the hierarchical relationship, thereby reducing the component coupling degree.

[0058] In some embodiments of the present invention, the injecting the asynchronous event-driven class into the software operation service application program includes:

[0059] Injecting the asynchronous event-driven class into the software operation service application program through the dependence injection mechanism.

[0060] In practical applications, after starting the SaaS application, the asynchronous event-driven class can be automatically injected into the SaaS application through the dependency injection mechanism, and its scope can be the entire SaaS application, thus ensuring the global accessibility of the asynchronous event-driven class in the application. By means of dependency injection, the complexity of hard coding can be reduced, and the flexibility of the system can be increased, enabling multiple components in the application to conveniently interact with events.

[0061] In some embodiments of the present invention, the scope when injecting the asynchronous event-driven class into the software operation service application through the dependency injection mechanism is the entire software operation service application.

[0062] In specific implementation, after starting the SaaS application, the asynchronous event-driven class can be automatically injected into the SaaS application through the dependency injection mechanism, and its scope can be the entire SaaS application, thus ensuring the global accessibility of the asynchronous event-driven class in the application; it can ensure that each component in the SaaS application can share the same event-driven mechanism. This design of the global scope reduces the need to instantiate the asynchronous event-driven class multiple times in the application, thus simplifying the structure and management of the system. Each module of the application can more efficiently perform data interaction and event processing through this global event mechanism, enhancing the scalability and flexibility of the system.

[0063] Step 102, create an asynchronous event function queue by a first component according to the asynchronous event-driven class, where the asynchronous event function queue includes asynchronous execution functions;

[0064] In specific implementation, in the created Component 1 (the first component), an asynchronous event function queue can be created through the on method provided by the asynchronous event-driven class, and the asynchronous processing function associated with the event can be automatically added to the asynchronous event function queue. When a certain event is triggered, the asynchronous event-driven class will asynchronously execute the corresponding asynchronous execution functions in the asynchronous event function queue in sequence; while in the created Component 2 (the second component), the emit method provided by the asynchronous event-driven class can be used to automatically trigger the asynchronous execution of the event. This method can attach all data objects in JavaScript as the required data types to be processed; the triggered event will be automatically asynchronously executed in sequence by the asynchronous event function queue, and the data will be returned to the component that triggered the event through a Promise object;

[0065] Specifically, such as Figure 2As shown, a framework system based on an asynchronous event-driven method can be developed based on the Angular application framework. The system can include multiple modules, and the modules can further include multiple components, as well as an asynchronous event function queue. When information and data are exchanged between components, Component 1-3-1 with the ability to handle Event A can add an asynchronous execution function of Event A to the asynchronous event function queue through the on method of the asynchronous event-driven class. Component 2-3-1 that needs to handle Event A can trigger Event A through the emit method of the asynchronous event-driven class and attach relevant data, and after Component 1-3-1 finishes processing, it will return the data to Component 2-3-1 through a promise object. As described above, the requirements for cross-module and cross-component information and data interaction based on asynchronous event-driven can be achieved.

[0066] In some embodiments of the present invention, after the first component creates an asynchronous event function queue according to the asynchronous event-driven class, the following is further included:

[0067] Establish an association relationship between the first component and the second component through the asynchronous event-driven class.

[0068] In practical applications, the components created in a software operation service application do not need to mark their mutual relationships, such as parent-child components, sibling components, or intergenerational components, that is, there is no need to explicitly associate the mutual relationships between components. Their association relationships can be automatically established through the on method of the asynchronous event-driven class after the first component creates an asynchronous event function queue according to the asynchronous event-driven class; enabling information and data interaction between modules and components without being restricted by the original framework, thereby avoiding developers from manually managing the dependencies between components and simplifying the interaction method between components. Through the automatically established event association relationship, the system can process cross-component data transfer and event execution more efficiently, improving the readability and maintainability of the code and reducing the occurrence of errors.

[0069] Step 103, trigger an event through the second component according to the asynchronous event-driven class, and execute the event through the first component according to the asynchronous event function queue.

[0070] In a specific implementation, in the created Component 2 (the second component), the emit method provided by the asynchronous event-driven class can be used to automatically trigger the asynchronous execution of an event. This method can attach all data objects in JavaScript as the required data types to be processed; the triggered event will be automatically and sequentially asynchronously executed by the asynchronous event function queue, and return data to the component that triggered the event through a Promise object;

[0071] Specifically, such as Figure 2As shown, a framework system based on an asynchronous event-driven method can be developed based on the Angular application framework. The system can include multiple modules, and the modules can further include multiple components, as well as an asynchronous event function queue. When information and data are exchanged between components, Component 1-3-1 with the ability to handle Event A can add the asynchronous execution function of Event A to the asynchronous event function queue through the on method of the asynchronous event-driven class. Component 2-3-1 that needs to handle Event A can trigger Event A through the emit method of the asynchronous event-driven class and attach relevant data. After Component 1-3-1 finishes processing, it will return the result to Component 2-3-1 through a promise object. As described above, the requirements for cross-module and cross-component information and data exchange based on asynchronous event-driven can be achieved.

[0072] In some embodiments of the present invention, the method further includes:

[0073] Determine the processing result of the event, and send the processing result of the event to the second component through the first component.

[0074] In practical applications, in the created Component 2 (the second component), the emit method provided by the asynchronous event-driven class can be used to automatically trigger the asynchronous execution of the event. This method can attach all data objects in JavaScript as the required data types to be processed. The triggered event will be automatically and sequentially asynchronously executed by the asynchronous event function queue, and the data will be returned to the component that triggered the event through a Promise object; thus further optimizing the fluency and accuracy of information transmission. The processing result of the event can be timely feedback to the component that triggered the event, ensuring the collaborative work of each component during asynchronous execution, and avoiding problems such as information loss or improper processing. It increases the transparency and reliability of event processing, ensuring the efficient flow of data and information between components.

[0075] In some embodiments of the present invention, the step of executing the event by the first component according to the asynchronous event function queue includes:

[0076] The first component asynchronously executes the asynchronous execution function corresponding to the event according to the asynchronous event function queue.

[0077] In a specific implementation, a framework system based on an asynchronous event-driven method can be developed based on the Angular application framework. The system can include multiple modules, and the modules can further include multiple components, as well as an asynchronous event function queue. When information and data are exchanged between components, component 1-3-1 with the ability to handle event A can add the asynchronous execution function of event A to the asynchronous event function queue through the on method of the asynchronous event-driven class. Component 2-3-1 that needs to handle event A can trigger event A through the emit method of the asynchronous event-driven class and attach relevant data. After component 1-3-1 finishes processing, it returns to component 2-3-1 through a promise object. As described above, the requirements for cross-module and cross-component information and data interaction based on asynchronous event-driven can be achieved, and the response speed and processing ability of the system can be improved.

[0078] In some embodiments of the present invention, the method further includes:

[0079] In response to the closing operation of the software operation service application, stop executing the event by the first component according to the asynchronous event function queue, and clear the asynchronous event function queue.

[0080] In practical applications, when the software operation service application is closed, it can be controlled that the asynchronous event function queue will automatically terminate the events being executed and empty the asynchronous event function queue, ensuring the robust operation of the SaaS application, improving its stability, and avoiding possible abnormal states or deadlocks.

[0081] The following will be combined with Figure 3 to further illustrate the embodiments of the present invention:

[0082] As Figure 3 shown in the execution flow example diagram of the present invention provided by the embodiments of the present invention, it specifically may include the following steps:

[0083] Start the SaaS application based on the WEB browser;

[0084] The application automatically injects the asynchronous event-driven class through the dependency injection mechanism of Angular;

[0085] Create component 1, and establish an asynchronous event function queue corresponding to a certain event or certain events through the on method of the asynchronous event-driven class;

[0086] Create component 2, trigger a certain event through the emit method of the asynchronous event-driven class, and the data type attached by this method supports JavaScript data objects;

[0087] The triggered events will be asynchronously executed in order by the asynchronous event function queue automatically, and the result data will be returned to Component 2 through a Promise object;

[0088] There is no need to explicitly establish an association between Component 1 and Component 2. Their association relationship is automatically established through the on method of the asynchronous event-driven class. The processing result of the event by Component 1 will also be automatically returned to Component 2;

[0089] When closing the SaaS application, the asynchronous event function queue will automatically terminate the events being executed and empty the asynchronous event function queue to ensure the stability of the SaaS application.

[0090] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0091] Refer to Figure 4 , which shows a schematic structural diagram of an event execution device provided by some embodiments of the present invention; specifically, it may include the following modules:

[0092] The asynchronous event-driven class injection module 401 is used to inject the asynchronous event-driven class into the software operation service application in response to the startup operation of the software operation service application;

[0093] The asynchronous event function queue creation module 402 is used to create an asynchronous event function queue by a first component according to the asynchronous event-driven class, where the asynchronous event function queue includes asynchronous execution functions;

[0094] The event execution module 403 is used to trigger an event by a second component according to the asynchronous event-driven class and execute the event by the first component according to the asynchronous event function queue.

[0095] In some embodiments of the present invention, the device further includes:

[0096] The processing result feedback module is used to determine the processing result of the event and send the processing result of the event to the second component through the first component.

[0097] In some embodiments of the present invention, the asynchronous event-driven class injection module 401 includes:

[0098] An asynchronous event-driven class injection sub-module for injecting the asynchronous event-driven class into the software operation service application through a dependency injection mechanism.

[0099] In some embodiments of the present invention, the event execution module 403 includes:

[0100] An event execution sub-module for asynchronously executing the asynchronous execution function corresponding to the event according to the asynchronous event function queue by the first component.

[0101] In some embodiments of the present invention, the device further includes:

[0102] An application shutdown response module for responding to the shutdown operation of the software operation service application, stopping the execution of the event according to the asynchronous event function queue by the first component, and clearing the asynchronous event function queue.

[0103] In some embodiments of the present invention, the device further includes:

[0104] An association relationship establishment module for establishing an association relationship between the first component and the second component through the asynchronous event-driven class.

[0105] Some embodiments of the present invention also provide a computer program product, including a computer program, which implements the above event execution method when executed by a processor.

[0106] In addition, an embodiment of the present invention also provides an electronic device, as Figure 5 shown, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0107] The memory 503 is used to store a computer program;

[0108] When the processor 501 executes the program stored in the memory 503, the following steps are implemented:

[0109] In response to the startup operation of the software operation service application, inject the asynchronous event-driven class into the software operation service application;

[0110] Create an asynchronous event function queue according to the asynchronous event-driven class through a first component, wherein the asynchronous event function queue contains asynchronous execution functions;

[0111] Trigger an event according to the asynchronous event-driven class through a second component, and execute the event according to the asynchronous event function queue through the first component.

[0112] In an alternative embodiment of the present invention, the method further includes:

[0113] Determine the processing result of the event, and send the processing result of the event to the second component through the first component.

[0114] In an alternative embodiment of the present invention, injecting the asynchronous event-driven class into the software operation service application includes:

[0115] Inject the asynchronous event-driven class into the software operation service application through a dependency injection mechanism.

[0116] In an alternative embodiment of the present invention, the first component executing the event according to the asynchronous event function queue includes:

[0117] Asynchronously execute the asynchronous execution function corresponding to the event through the first component according to the asynchronous event function queue.

[0118] In an alternative embodiment of the present invention, the method further includes:

[0119] In response to the close operation of the software operation service application, stop executing the event through the first component according to the asynchronous event function queue, and clear the asynchronous event function queue.

[0120] In an alternative embodiment of the present invention, the scope of action when injecting the asynchronous event-driven class into the software operation service application through the dependency injection mechanism is the entire software operation service application.

[0121] In an alternative embodiment of the present invention, after creating the asynchronous event function queue by the first component according to the asynchronous event-driven class, it further includes:

[0122] Establish an association relationship between the first component and the second component through the asynchronous event-driven class.

[0123] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0124] The communication interface is used for communication between the above terminal and other devices.

[0125] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0126] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0127] As Figure 6 shown, in another embodiment provided by the present invention, there is also provided a computer-readable storage medium 601, in which instructions are stored. When it runs on a computer, it causes the computer to execute the event execution method described in the above embodiment.

[0128] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiment.

[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0130] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, refer to each other.

[0131] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, an apparatus, or a computer program product. Therefore, the embodiments of the present invention can take the form of an all-hardware embodiment, an all-software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0132] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0133] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal devices, such that a series of operation steps are executed on the computer or other programmable terminal devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0135] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.

[0136] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the above elements.

[0137] The above provides a detailed introduction to an event execution method, apparatus, electronic device, and storage medium. In this text, specific examples are used to illustrate the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An event execution method, characterized in that, The method includes: In response to a startup operation of a software operation service application, injecting an asynchronous event-driven class into the software operation service application; Creating an asynchronous event function queue by a first component according to the asynchronous event-driven class, where the asynchronous event function queue includes asynchronous execution functions; Triggering an event by a second component according to the asynchronous event-driven class, and executing the event by the first component according to the asynchronous event function queue.

2. The method according to claim 1, wherein The method further includes: Determining a processing result of the event, and sending the processing result of the event to the second component by the first component.

3. The method according to claim 1, characterized in that, The injecting the asynchronous event-driven class into the software operation service application includes: Injecting the asynchronous event-driven class into the software operation service application through a dependency injection mechanism.

4. The method according to claim 1, wherein The executing the event by the first component according to the asynchronous event function queue includes: Asynchronously executing an asynchronous execution function corresponding to the event by the first component according to the asynchronous event function queue.

5. The method according to claim 2, characterized in that, The method further includes: In response to a shutdown operation of the software operation service application, stopping executing the event by the first component according to the asynchronous event function queue, and clearing the asynchronous event function queue.

6. The method according to claim 3, characterized in that, The scope of action when injecting the asynchronous event-driven class into the software operation service application through the dependency injection mechanism is the entire software operation service application.

7. The method according to claim 1, wherein After creating the asynchronous event function queue by the first component according to the asynchronous event-driven class, it further includes: Establishing an association relationship between the first component and the second component through the asynchronous event-driven class.

8. An event execution device, characterized in that, The device includes: An asynchronous event-driven class injection module, configured to inject an asynchronous event-driven class into the software operation service application in response to a startup operation of the software operation service application; An asynchronous event function queue creation module, configured to create an asynchronous event function queue by a first component according to the asynchronous event-driven class, where the asynchronous event function queue includes asynchronous execution functions; An event execution module, configured to trigger an event by a second component according to the asynchronous event-driven class, and execute the event by the first component according to the asynchronous event function queue.

9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the event execution method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements the event execution method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Event driving method and device, equipment and readable storage medium

    CN108563493A

  • Asynchronous operation processing method for computer application program and corresponding system

    CN113032118A

  • Transaction data processing method, device and equipment based on event-driven architecture

    CN115099972A

  • Event stream processing method and device, computer equipment and storage medium

    CN115390920A

  • Asynchronous event-driven MessageEngine framework

    CN115686780A