Method for processing event message of object model, computer device, medium and program product
By defining standard data structures and built-in node libraries, the visual processing process orchestration of object model event messages is achieved, which solves the problem of inconsistent event message processing complexity and data structure in traditional methods, adapts to multiple IoT scenarios, and reduces system maintenance Cost and improve stability.
Patent Information
- Application Number
- CN202411050782.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-22
AI Technical Summary
The event message processing methods of traditional object models have problems such as high threshold, inconsistent data structure, complex maintenance and high risk, which are difficult to meet the operational needs of non-technical personnel, and the data processing processes of different equipment and platforms cannot be shared.
By defining a standard data structure and a built-in node library, visual event processing process orchestration is achieved. Users can drag and drop the event processing nodes to reduce complexity, and allow custom event processing nodes to cooperate with common nodes to adapt to diverse business needs.
It realizes unified data processing across devices and platforms, reduces system maintenance costs, improves flexibility and stability, and allows non-technical personnel to easily manage and operate the system and adapt to the needs of a variety of IoT scenarios.
Smart Images

Figure CN119003206A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a method for processing event messages of a physical model, a computer device, a medium and a program product. Background Art
[0002] A physical model is a data model obtained by digitally describing entities in physical space, generally including information such as attributes, services, and events.
[0003] In the field of Internet of Things technology, the event message processing process of the traditional object model is mainly developed by coding. However, this method has the following problems and defects: (1) The coding method requires users to have professional knowledge and skills, and the threshold for use is high for non-technical personnel; (2) The diversity of event data structure and data flow structure makes it impossible for different event processing processes to share data processing nodes; (3) The coding method is not intuitive enough and it is difficult to clearly display the details of the entire processing process; (4) Maintenance and updating are complicated. Each change may require a large amount of code rewriting, which increases the maintenance cost of the system; (5) Coding errors may cause system operation instability, increasing system risks.
[0004] Currently, there is still a solution in which users adjust the correspondence between object models and application data in the rule engine editing visual interface, so that after the rules are defined, the reported data of the IoT device will be triggered according to the rule matching. However, this solution still needs to convert the abstract data of the device object model into visual operand nodes, and define the trigger rules for each abstract object model separately, which is troublesome to maintain and update. Summary of the invention
[0005] The first object of the present invention is to provide a method for processing event messages using a flexible, convenient and easy-to-use object model.
[0006] The second object of the present invention is to provide a computer device for implementing the method for processing event messages of the above-mentioned object model.
[0007] A third object of the present invention is to provide a computer-readable storage medium for implementing the method for processing event messages of the above-mentioned object model.
[0008] A fourth object of the present invention is to provide a computer program product for implementing the method for processing event messages of the above-mentioned object model.
[0009] In order to achieve the above-mentioned first purpose, the present invention provides a method for processing event messages of a physical model, which is applied to an Internet of Things platform, and includes the following steps: obtaining a process setting request and creating a visual canvas; obtaining a node selection request, selecting and determining a target event processing node in a node library according to the node selection request, and connecting each target event processing node on the visual canvas according to the node selection request to form a target event processing process; wherein the node library includes multiple event processing nodes, and the event processing nodes are divided into a first type of event processing node, a second type of event processing node, and a third type of event processing node; the first type of event processing node is used to subscribe to event messages and output first output data of the event message in the format of a standard data structure; the second type of event processing node is used to obtain the first output data and transform the first output data and then output the second output data, and the second output data follows the format of a standard data structure; the third type of event processing node is used to obtain the second output data and perform a response operation corresponding to the event message based on the second output data; the event processing node includes processing logic setting information and parameter setting information; receiving the current event message of the device; and processing the current event message according to the target event processing process.
[0010] As can be seen from the above scheme, the present invention defines a standard data structure, and then develops an event processing node based on the standard data structure, so that an event processing node can be added to the visual canvas to form an event processing process. The present invention solves the problem of inconsistent data structure caused by the differences in event processing processes by creating a standard data structure of standardized object model event messages, and can be applied across devices and platforms, adapting to a variety of Internet of Things scenarios, thereby realizing unified processing and circulation of data; the present invention has a built-in node library, and different event message processing rules are realized through the event processing nodes in the node library, so that the configuration of business rules is more flexible, and it can quickly adapt to diversified business needs, provide rich functional options, and meet the requirements of different scenarios; the present invention realizes the arrangement of visual event processing processes, and users configure and connect different event processing nodes on the visual canvas by dragging and dropping. This intuitive and easy-to-use operation method greatly reduces the complexity of automated process configuration, so that non-technical personnel can also easily manage and operate the system. In addition, compared with the definition of trigger rules for each abstract object model separately, the present invention can select the same event processing node for event messages of different object models, which is more flexible.
[0011] A further solution is that the standard data structure includes the following fields: product identity of the product that generates the event message, device identity of the directly connected device that generates the event message, sub-device identity of the gateway device that generates the event message, event unique identifier, event name, event type, event specific information, and event generation time.
[0012] It can be seen that the event messages of different object models can be represented in a standardized manner through the universal data flow structure defined by the standard data structure.
[0013] A further solution is that the event processing nodes include general event processing nodes and custom event processing nodes; before obtaining the process setting request, the setting information of the general event processing node and / or the setting information of the custom event processing node is obtained, and the node library is updated according to the setting information of the general event processing node and the setting information of the custom event processing node.
[0014] It can be seen that the present invention can allow users to develop and integrate custom event processing nodes, which can work seamlessly with general event processing nodes, so that users can expand system functions according to specific needs. Specifically, by providing users with a Java SDK, the complexity of data processing is simplified.
[0015] A further solution is to obtain target node parameters after connecting to form a target event processing flow on the visual canvas and before receiving the current event message of the device, and configure the parameter setting information of the corresponding target event processing node according to the target node parameters.
[0016] This shows that it is convenient for users to intuitively modify parameter setting information of different event processing nodes.
[0017] A further solution is that when the current event message is processed according to the target event processing flow, the process includes: before starting the target event flow, verifying the parameter setting information of each target event processing node.
[0018] It can be seen that the parameter setting information can be verified according to the pre-set verification rules.
[0019] A further solution is that the event processing nodes are implemented based on the Akka communication framework. The first type of event processing nodes corresponds to the data source of the Akka communication framework, the second type of event processing nodes corresponds to the data processing of the Akka communication framework, and the third type of event processing nodes corresponds to the data terminal of the Akka communication framework.
[0020] In order to achieve the above-mentioned second purpose, the present invention provides a computer device, including a processor and a memory, wherein: a computer program is stored in the memory, and when the computer program is executed by the processor, the method for processing event messages of the above-mentioned physical model is implemented.
[0021] In order to achieve the third objective mentioned above, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, the method for processing event messages of the physical model mentioned above is implemented.
[0022] In order to achieve the fourth objective mentioned above, the present invention provides a computer program product, including computer instructions, wherein: when the computer instructions are executed by a processor, the method for processing event messages of the above-mentioned physical model is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a system block diagram of a system for processing event messages of a physical model in an embodiment of a method for processing event messages of a physical model of the present invention.
[0024] Figure 2 It is a flowchart of the preparation stage before processing event messages in the embodiment of the method for processing event messages of the object model of the present invention.
[0025] Figure 3 It is a flowchart of the processing stage after receiving event information in the embodiment of the method for processing event messages of the object model of the present invention.
[0026] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0027] The method for processing event messages of the physical model of the present invention aims at the diversity and complexity of event messages, forms an event processing flow based on a standardized standard data structure and combines selected event processing nodes to reduce the complexity of the event message processing flow. The present invention also provides a computer device, a computer-readable storage medium and a computer program product for implementing the method for processing event messages of the physical model.
[0028] Embodiment of a method for processing event messages of a physical model:
[0029] See also Figure 1 The event message processing system for implementing the physical model of this embodiment includes a device 1 and an Internet of Things platform 2, and data transmission is achieved between the device 1 and the Internet of Things platform 2 through a communication network.
[0030] Device 1 is an IoT device, and this embodiment includes multiple devices 1. For example, device 1 can be a smart home device such as a smart bulb, a smart wearable device such as a smart watch, a smart city device such as a smart street lamp, an industrial IoT device such as a robot.
[0031] After device 1 is connected to the IoT platform 2, the IoT platform 2 can receive the event message uploaded by device 1, and process the event message according to the set event processing flow to perform corresponding response operations. The response operations include pushing information to the mobile terminal through the corresponding application, automatically sending emails, controlling the corresponding device to perform specific operations, etc.
[0032] The event processing flow includes multiple event processing nodes, which are used to process incoming data according to the set rules. The event processing node includes processing logic setting information and parameter setting information. The processing logic setting information is used to indicate the processing logic of the event processing node when acquiring data, and the parameter setting information is used to indicate the parameters used when processing according to the processing logic setting information.
[0033] The Internet of Things platform 2 maintains a node library. A plurality of event processing nodes are arranged in the node library, and the event processing nodes are specifically divided into the first type of event processing node, the second type of event processing node, and the third type of event processing node according to the function and order. The first type of event processing node is used to subscribe to the event message of the device 1 and output the event message in the format of the standard data structure, that is, output the first output data. For different first type event processing nodes, the event messages obtained are different. By setting different first type event processing nodes, different event information can be obtained and output in the format of the standard data structure. The second type of event processing node is used to obtain the first output data and transform the first output data and then output the second output data. The second output data follows the format of the standard data structure. For different second type event processing nodes, the processing of the first output data is different. By setting different second type event processing nodes, different processing can be performed on the obtained first output data, and the processed result can be output in the format of the standard data structure. The third type of event processing node is used to obtain the second output data and perform a response operation corresponding to the event message based on the second output data. For different third type event processing nodes, the response operation is different. For example, the response operation of the application message push processing node is to push the push information of the corresponding application to the user's mobile terminal.
[0034] Event processing nodes can be divided into general event processing nodes and custom event processing nodes according to their sources. Among them, general event processing nodes are written by the Internet of Things Platform 2 and provided by default, and custom event processing nodes are written by users according to actual needs. General event processing nodes and custom event processing nodes belong to one of the first type of event processing nodes, the second type of event processing nodes, and the third type of event processing nodes.
[0035] The method for processing event messages of the physical model of this embodiment is implemented by executing a corresponding computer program on the Internet of Things platform 2, and specifically includes a preparation stage before processing event messages and a processing stage after receiving event information, see Figure 2 ,The preparation phase before processing event messages includes the following steps:
[0036] S11: Get the setting information of the standard data structure.
[0037] Among them, by obtaining the setting information of the standard data structure input by the maintenance personnel of the Internet of Things platform, the standard data structure can be set, so that based on the standard data structure, the event message can flow in a standard form between the various event processing nodes in the event processing flow.
[0038] In this embodiment, the standard data structure includes the following fields: product identity product I d of the product generating the event message, device identity device Code of the directly connected device generating the event message (if the directly connected device is a gateway device, the device identity is the gateway identity), subDev i ce I d of the sub-device identity of the gateway device generating the event message (if it is a directly connected device, the sub-device identity is empty), event unique identifier i dentifier, event name name, event type type (enumeration values include: info, alert, error), event specific information value (specifically a JSON object), and event generation time time.
[0039] An example of data in the standard data structure format is as follows:
[0040]
[0041] S12: Obtain setting information of the general event processing node.
[0042] S13: Get the setting information of the custom event processing node.
[0043] Among them, the Internet of Things platform updates the node library according to the input setting information of the general event processing node or the setting information of the custom event processing node. The updating of the node library here can be to add a general event processing node or a custom event processing node to the node library, or to change the rule information and parameter setting information of the general event processing node or the custom event processing node in the node library.
[0044] The setting information of the general event processing node comes from the development and implementation of the maintenance personnel of the Internet of Things platform. The maintenance personnel of the Internet of Things platform specifically develop the general event processing node through the standard data structure defined in step S11, so as to obtain the setting information of the general event processing node. The development framework of the Internet of Things platform uses distributed computing and akka communication framework. The maintenance personnel of the networking platform develops the general event processing node (including event subscription processing node, custom event subscription processing node, etc.) belonging to the first type of event processing node based on the data source (Source) of the akka communication framework, develops the general event processing node (including condition setting processing node, data buffer processing node, etc.) belonging to the second type of event processing node based on the data processing (F l ow) of the akka communication framework, and develops the general event processing node (including application message push processing node, mail sending processing node, device control processing node, etc.) belonging to the third type of event processing node based on the data terminal (Sink) of the akka communication framework.
[0045] The setting information of the custom event processing node comes from the development and implementation of the user of the Internet of Things platform. Specifically, the Internet of Things platform provides a JAVA SDK (Software Development Kit). When developing the JAVA SDK, an interface is defined, and its input and / or output parameters follow the standard data structure. When the user wants to develop a custom processing rule, the JAVA SDK is first introduced, and then the interface is implemented, and the custom processing logic is written in the interface, and finally it is packaged into a jar package and uploaded to obtain the setting information of the custom event processing node. The Internet of Things platform updates the node library according to the jar uploaded by the user, that is, updates the custom event processing node, thereby defining the JAVA SDK interface based on the standard data structure. The custom event processing node completes the processing of the custom event processing rule on the input data in the standard data structure format by implementing the interface, and outputs the data in the standard data structure format.
[0046] S14: Get the process setting request and create a visualization canvas.
[0047] Among them, the Internet of Things platform obtains the process setting request input by the user, thereby providing a visual graphical user interface, that is, creating a visual canvas, which is used to display the event processing nodes and event processing processes in a visual manner.
[0048] S15: Obtain a node selection request, and determine a target event processing node according to the node selection request.
[0049] Among them, the Internet of Things platform determines the target event processing node in the node library according to the user's node selection request.
[0050] S16: Connecting the target event processing node according to the node selection request to form a target event processing flow.
[0051] The user connects the selected target event processing nodes to each other through dragging and dropping to form a complete process, that is, to obtain the target event processing process. Before or after the target event processing nodes are connected to each other, the user inputs target node parameters of different target event processing nodes, thereby configuring corresponding parameter setting information based on the target node parameters.
[0052] Therefore, after completing the preparation phase before processing the event message, after receiving the node message uploaded by the device, it can be processed according to the target event processing flow, see Figure 3 ,The processing stage after receiving event information includes the following steps:
[0053] S21: Verify the parameter setting information of the target event processing node.
[0054] Among them, by verifying the parameter setting information of the target event processing node, the parameter setting information that does not meet the setting specifications can be excluded, ensuring the correctness of the parameter setting information so as not to affect the subsequent processing of the current event information.
[0055] In this embodiment, multiple parallel target event processing flows are included. In one target event processing flow, there may be multiple target event processing nodes belonging to the first type of event processing nodes, all of which are connected to one target event processing node belonging to the second type of event processing node.
[0056] S21: Receive the current event message of the device.
[0057] The current event message is the event message received by the IoT platform.
[0058] S22: Process the current event message according to the target event processing flow.
[0059] Before the target event processing process is started, the target event processing node belonging to the first type of event processing node subscribes to the corresponding current event message and converts it into the format of a standard data structure, the target event processing node belonging to the second type of event processing node further processes the current event information, and the target event processing node belonging to the third type of event processing node performs a response operation based on the processed current event information. At the same time, the target event processing process is monitored, and the execution log and the data processing volume of each event processing node are output.
[0060] In summary, the present invention solves the problem of inconsistent data structure caused by differences in event processing flow by creating a standard data structure of standardized object model event messages, can be applied across devices and platforms, and adapt to a variety of Internet of Things scenarios, thereby realizing unified processing and circulation of data; the present invention implements different event message processing rules through the built-in node library and the event processing nodes in the node library, so that the configuration of business rules is more flexible, and can quickly adapt to diversified business needs, provide rich functional options, and meet the requirements of different scenarios; the present invention realizes the arrangement of visual event processing flow, and users configure and connect different event processing nodes on the visual canvas by dragging and dropping. This intuitive and easy-to-use operation method greatly reduces the complexity of automated process configuration, so that non-technical personnel can also easily manage and operate the system. In addition, compared with the definition of trigger rules for each abstract object model separately, the present invention can select the same event processing node for event messages of different object models, which is more flexible.
[0061] Computer device embodiment:
[0062] The computer device of this embodiment includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, an embodiment of the method for recording and viewing the model operation log of the above-mentioned machine learning platform is implemented.
[0063] The computer device may include but is not limited to a processor and a memory. Those skilled in the art will appreciate that the computer device may include more or fewer components, or a combination of certain components, or different components, for example, the computer device may also include input and output devices, network access devices, buses, etc.
[0064] For example, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microcontroller or any conventional processor, etc. The processor is the control center of a computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0065] The memory can be used to store computer programs and / or modules, and the controller realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. For example, the memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound receiving function, a sound conversion to text function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, text data, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0066] Computer readable storage medium embodiment:
[0067] If the module integrated in the computer device of the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the process of the embodiment of the method for processing event messages of the physical model can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the controller, the steps of the embodiment of the method for processing event messages of the physical model can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunications signals.
[0068] Computer program product embodiment:
[0069] The computer program product of this embodiment includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes each step of the embodiment of the method for processing event messages of the object model.
Claims
1. A method for processing event messages of a thing model, applied to an Internet of Things platform, characterized in that: The following steps are involved: Get the process setting request and create a visualization canvas; Obtaining a node selection request, selecting and determining a target event processing node in a node library according to the node selection request, and connecting each of the target event processing nodes on the visualization canvas to form a target event processing flow according to the node selection request; Wherein, the node library includes multiple event processing nodes, and the event processing nodes are divided into a first type of event processing node, a second type of event processing node, and a third type of event processing node; the first type of event processing node is used to subscribe to event messages and output first output data of the event message in the format of a standard data structure; the second type of event processing node is used to obtain the first output data and transform the first output data and then output second output data, and the second output data follows the format of the standard data structure; the third type of event processing node is used to obtain the second output data and perform a response operation corresponding to the event message based on the second output data; the event processing node includes processing logic setting information and parameter setting information; Receive current event messages from the device; The current event message is processed according to the target event processing flow.
2. The method for processing event messages of a physical model according to claim 1, characterized in that: The standard data structure includes the following fields: product identity of the generated event message, device identity of the directly connected device that generates the event message, sub-device identity of the gateway device that generates the event message, event unique identifier, event name, event type, event specific information, and event generation time.
3. The method for processing event messages of a physical model according to claim 1, characterized in that: The event processing nodes include general event processing nodes and custom event processing nodes; Before obtaining the process setting request, obtain the setting information of the general event processing node and / or the setting information of the custom event processing node, and update the node library according to the setting information of the general event processing node and the setting information of the custom event processing node.
4. The method for processing event messages of a physical model according to claim 3, characterized in that: After the target event processing flow is connected and formed on the visualization canvas, before the current event message of the device is received, the target node parameters are obtained, and the parameter setting information of the corresponding target event processing node is configured according to the target node parameters.
5. The method for processing event messages of a physical model according to claim 4, characterized in that: When the current event message is processed according to the target event processing flow, it includes: before starting the target event flow, verifying the parameter setting information of each target event processing node.
6. The method for processing event messages of a physical model according to any one of claims 1 to 5, characterized in that: The event processing node is implemented based on the akka communication framework. The first type of event processing node corresponds to the data source of the akka communication framework, the second type of event processing node corresponds to the data processing of the akka communication framework, and the third type of event processing node corresponds to the data terminal of the akka communication framework.
7. A computer device comprising a processor and a memory, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the method for processing event messages of the object model described in any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing event messages of the object model described in any one of claims 1 to 6 is implemented.
9. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for processing event messages of the object model described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
System for providing services of event-driven service-oriented internet of things and working method thereof
CN103458033A
Distributed data stream processing method, system and device and storage medium
CN116896560A
Visual configuration method and device for event processing flow
CN117112262A
