Event execution method and device, and electronic device

By building an event pool and independent interface and business logic modules, maintenance difficulties and redundant code problems caused by the integration of interface functions and business logic in the existing technology are solved, and system performance is improved.

CN111142982BActive Publication Date: 2024-11-26HITEVISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811300107.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-02
Publication Date
2024-11-26
Estimated Expiration
2038-11-02

AI Technical Summary

Technical Problem

In existing software development, interface functions and business logic are integrated into implementation, resulting in maintenance difficulties and redundant code, affecting system performance.

Method used

By building an event pool, the interface module is independently separated from the business logic module, the corresponding business logic is called using the event execution interface, and the event identifier is updated according to the dynamic attribute information to execute specific business logic.

Benefits of technology

Reduces code complexity and redundancy, facilitates subsequent maintenance and function expansion, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111142982B_ABST
    Figure CN111142982B_ABST
Patent Text Reader

Abstract

The present invention discloses an event execution method and device, and an electronic device, comprising: constructing an event pool, the event pool comprising an event execution interface identifier and its corresponding event identifier; executing an event on the interface, calling the event execution interface; searching the event pool according to the event execution interface identifier corresponding to the event execution interface, obtaining the corresponding event identifier, determining the event to be executed according to the event identifier, and executing the business logic corresponding to the event. The present invention facilitates later maintenance and function expansion, and reduces code complexity and redundancy by independently separating the functional module for implementing the interface from the functional module for executing the business logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software technology, and in particular to an event execution method and device, and electronic equipment. Background Art

[0002] In the current software development process, interface functions and business logic are generally integrated together. That is, when an event button is clicked on the interface, the event button calls the corresponding business logic to implement the interface function. The interface code and the business logic code are all implemented in one module. This is not only difficult to maintain, but also not conducive to the expansion of business functions. When different modules implement the same or similar business logic, a large amount of repeated redundant code will appear, affecting system performance. Summary of the invention

[0003] In view of this, the purpose of the present invention is to propose an event execution method and device, and an electronic device, which separates the interface module from the module that implements the business logic, thereby facilitating subsequent maintenance and function expansion and reducing code complexity.

[0004] Based on the above purpose, the present invention provides an event execution method, comprising:

[0005] Constructing an event pool, wherein the event pool includes an event execution interface identifier and its corresponding event identifier;

[0006] Execute events on the interface and call the event execution interface;

[0007] The event pool is searched according to the event execution interface identifier corresponding to the event execution interface, a corresponding event identifier is obtained, an event to be executed is determined according to the event identifier, and the business logic corresponding to the event is executed.

[0008] Optionally, the method further includes:

[0009] The event pool includes an event execution interface identifier and its corresponding event identifier and dynamic attribute information;

[0010] Setting attribute information on the interface, executing an event, and calling the event execution interface, wherein the event execution interface carries the attribute information;

[0011] Search the event pool according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information.

[0012] Optionally, the method further includes: determining the underlying interface to be called from the control layer according to the business logic, and calling the underlying interface to implement specific business logic.

[0013] Optionally, the method further includes: determining an underlying interface to be called from the control layer according to the business logic, and calling the underlying interface to implement specific business logic according to the updated dynamic attribute information.

[0014] The embodiment of the present invention further provides an event execution device, comprising:

[0015] An event pool module, used to store event execution interface identifiers and their corresponding event identifiers;

[0016] The interface module is used to execute events on the interface and call the event execution interface;

[0017] The execution module is used to search the event pool module according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event.

[0018] Optionally, the device further comprises:

[0019] The event pool module is used to store the event execution interface identifier and its corresponding event identifier and dynamic attribute information;

[0020] The interface module is used to set attribute information on the interface, execute events, and call the event execution interface, and the event execution interface carries the attribute information;

[0021] An execution module is used to search the event pool module according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information.

[0022] Optionally, the device further comprises:

[0023] The control layer is used to store business logic identifiers and corresponding underlying interfaces;

[0024] The underlying interface module is used to store the underlying interface and the corresponding business logic code.

[0025] The present invention also discloses an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the method is implemented when the processor executes the program.

[0026] From the above description, it can be seen that the event execution method and device, and electronic device provided by the present invention construct an event pool, which includes an event execution interface identifier and its corresponding event identifier; execute an event on the interface and call the event execution interface; search the event pool according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event. The present invention facilitates later maintenance and function expansion and reduces code complexity and redundancy by independently separating the functional module that implements the interface from the functional module that executes the business logic. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0028] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;

[0029] Figure 2 Schematic diagram of the device structure of an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0031] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0032] Figure 1 Schematic diagram of the method flow of an embodiment of the present invention. As shown in the figure, the event execution method disclosed in the embodiment of the present invention includes:

[0033] S10: construct an event pool, which includes an event execution interface identifier and its corresponding event identifier;

[0034] S11: Execute the event on the interface and call the event execution interface;

[0035] S12: Search the event pool according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event.

[0036] As shown in the figure, in the embodiment of the present invention, the functional module for implementing the interface is separated from the functional module for implementing the business logic. An event pool is constructed, and the corresponding relationship between the event execution interface identifier and the event identifier is stored in the event pool. The interface is only used to execute events (such as clicking a specific function button), triggering the call of the event execution interface, and then searching and obtaining the corresponding event identifier from the event pool according to the event execution interface identifier, determining the business logic to be executed according to the event identifier, determining the underlying interface to be called from the control layer according to the business logic, and calling the underlying interface to implement the specific business logic.

[0037] If the interface sets attribute information, the event execution interface carries attribute parameters, and the event execution method further includes:

[0038] S20: construct an event pool, which includes an event execution interface identifier and its corresponding event identifier and dynamic attribute information;

[0039] S21: Setting attribute information on the interface, executing an event, and calling an event execution interface, the event execution interface carrying the set attribute information;

[0040] S22: Search the event pool according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information.

[0041] In an embodiment of the present invention, the event pool stores the correspondence between the event execution interface identifier and the event identifier, and dynamic attribute information. The attribute information is set through the interface to trigger the call of the event execution interface, and the event execution interface carries the set attribute information. Thereafter, the corresponding event identifier is searched and obtained from the event pool according to the call event execution interface identifier, and the dynamic attribute information corresponding to the event identifier is updated according to the attribute information carried by the event execution interface. The business logic to be executed is determined according to the event identifier, and the underlying interface to be called is determined from the control layer according to the business logic, and the underlying interface is called to implement specific business logic according to the dynamic attribute information.

[0042] For example, set the object's "color attribute to blue, width to 10 units" on the interface, click the OK button, call the event execution interface, search the event pool according to the event execution interface identifier, obtain the event identifier to be executed, and set the dynamic attribute information of the event identifier to "color attribute to blue, width to 10 units". According to the event identifier, determine the business logic to be executed, and the execution ends, with the color set to blue and the width set to 10 units.

[0043] Figure 2Schematic diagram of the device structure of an embodiment of the present invention. As shown in the figure, the event execution device provided by the embodiment of the present invention includes:

[0044] An event pool module, used to store event execution interface identifiers and their corresponding event identifiers;

[0045] The interface module is used to execute events on the interface and call the event execution interface;

[0046] The execution module is used to search the event pool module according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event.

[0047] If the interface sets the attribute information, the event execution interface carries the attribute parameters, and the event execution device further includes:

[0048] The event pool module is used to store the event execution interface identifier and its corresponding event identifier and dynamic attribute information;

[0049] The interface module is used to set attribute information on the interface, execute events, and call the event execution interface, which carries the set attribute information;

[0050] The execution module is used to search the event pool module according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information.

[0051] For the specific execution of the business logic, the event execution device further includes:

[0052] The control layer is used to store business logic identifiers and corresponding underlying interfaces;

[0053] The underlying interface module is used to store the underlying interface and the corresponding business logic code.

[0054] After determining the business logic to be executed according to the event identifier, determine the underlying interface to be called from the control layer according to the business logic identifier corresponding to the business logic, and call the underlying interface to execute the corresponding business logic code to implement the specific business logic. If the attribute information is set, determine the business logic to be executed according to the event identifier, determine the underlying interface to be called from the control layer according to the business logic identifier corresponding to the business logic, and call the underlying interface to execute the business logic code according to the updated dynamic attribute information to implement the specific business logic.

[0055] Based on the above purpose, the embodiment of the present invention also proposes an embodiment of a device for executing the event execution method. The device includes:

[0056] One or more processors and memory.

[0057] The device for executing the event execution method may further include: an input device and an output device.

[0058] The processor, memory, input device and output device may be connected via a bus or other means.

[0059] As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the event execution method in the embodiment of the present invention. The processor executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory, that is, the event execution method of the above method embodiment is implemented.

[0060] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the device for executing the event execution method, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the member user behavior monitoring device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0061] The input device can receive input digital or character information and generate key signal input related to user settings and function control of the device for executing the event execution method. The output device can include display devices such as display screens.

[0062] The one or more modules are stored in the memory, and when executed by the one or more processors, the event execution method in any of the above method embodiments is executed. The embodiment of the device for executing the event execution method has the same or similar technical effect as any of the above method embodiments.

[0063] The embodiment of the present invention further provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the processing method of the list item operation in any of the above method embodiments. The embodiment of the non-transitory computer storage medium has the same or similar technical effect as any of the above method embodiments.

[0064] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The technical effect of the embodiment of the computer program is the same or similar to that of any of the above-mentioned method embodiments.

[0065] In addition, typically, the devices and equipment described in the present disclosure may be various electronic terminal devices, such as mobile phones, personal digital assistants (PDAs), tablet computers (PADs), smart TVs, etc., or large terminal devices, such as servers, etc. Therefore, the protection scope of the present disclosure should not be limited to a specific type of device or equipment. The client described in the present disclosure may be applied to any of the above electronic terminal devices in the form of electronic hardware, computer software, or a combination of the two.

[0066] In addition, the method according to the present disclosure may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method of the present disclosure are performed.

[0067] In addition, the above method steps and system units may also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.

[0068] In addition, it should be understood that the computer-readable storage medium (e.g., memory) described herein can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. As an example and not by way of limitation, a non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory can include a random access memory (RAM), which can act as an external cache memory. As an example and not by way of limitation, RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.

[0069] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0070] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present invention, the above embodiments or technical features in different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.

[0071] In addition, to simplify the description and discussion, and in order not to obscure the present invention, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the devices may be shown in the form of block diagrams to avoid obscuring the present invention, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present invention will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present invention, it will be apparent to those skilled in the art that the present invention may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0072] Although the invention has been described in conjunction with specific embodiments of the invention, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0073] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An event execution method for setting the properties of an interface, characterized in that: include: Constructing an event pool, wherein the event pool includes an event execution interface identifier and its corresponding event identifier, and dynamic attribute information corresponding to the event identifier; Setting the attribute information on the interface, executing the event on the interface, and calling the event execution interface, wherein the event execution interface carries the attribute information; Search the event pool according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information; The underlying interface to be called is determined from the control layer according to the business logic, and the underlying interface is called to implement specific business logic according to the updated dynamic attribute information, and the business logic is used to implement the interface function.

2. An event execution device, used to set the properties of an interface, characterized in that: include: An event pool module is used to store the event execution interface identifier and its corresponding event identifier, and dynamic attribute information corresponding to the event identifier; An interface module is used to set attribute information on the interface, execute events on the interface, and call an event execution interface, wherein the event execution interface carries the attribute information; An execution module, used to search the event pool module according to the event execution interface identifier corresponding to the event execution interface, obtain the corresponding event identifier, update the dynamic attribute information corresponding to the event identifier according to the attribute information carried by the event execution interface, determine the event to be executed according to the event identifier, and execute the business logic corresponding to the event according to the updated dynamic attribute information; The control layer is used to store the business logic identifier and the corresponding underlying interface, so that the underlying interface to be called is determined from the control layer according to the business logic, and the underlying interface is called to implement specific business logic according to the updated dynamic attribute information, and the business logic is used to implement the interface function; The underlying interface module is used to store the underlying interface and the corresponding business logic code.

3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to claim 1 is implemented.