Method, System and Storage Medium for Generating Rules Nodes of Internet of Things Platform Devices
By building rule template nodes based on participant models on the Internet of Things platform, dynamically generating device rule nodes, the problems of concurrency security risks and low data processing efficiency in high concurrency scenarios are solved, and more efficient and secure device data processing is achieved.
Patent Information
- Application Number
- CN202211709796.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-12-29
AI Technical Summary
The existing IoT platforms have high concurrency security risks for sharing resources in high concurrency scenarios, and the real-time and efficiency of device data processing are low.
By building rule template nodes based on participant models, device rule nodes are dynamically generated, including initialization methods and data processing methods, and these methods are called based on virtual device data to generate metadata information and protocol configuration files, thereby dynamically generating device rule nodes.
It effectively alleviates the problem of shared state in high-concurrency environments, reduces the concurrent security risks of shared resources, and improves the real-time and efficiency of device data processing.
Smart Images

Figure CN116094939B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet of Things, and in particular, to a method, a system, and a storage medium for generating device rule nodes of an Internet of Things platform. Background Art
[0002] Facing the access of an increasing number of Internet of Things devices, more and more business scenarios have emerged. Each business scenario contains a large number of business rules, resulting in that system developers may need to frequently change the relevant business logic in the application code to adapt to the changing requirements. At present, the method of decoupling business rules and application code through service orchestration can adjust only the business rules without the need for the entire application to be shut down for update, enabling the application to quickly and smoothly respond to the changing requirements. Service orchestration essentially matches factual data with business rules and then executes the passed rules. In the related art, the implementation method of service orchestration for device rule nodes is mainly non-automated. Moreover, due to a large number of device connections and a huge amount of data transmitted under the Internet of Things platform, the concurrent security risk of shared resources is relatively high in this high-concurrency scenario. In addition, the data uploaded by Internet of Things devices can only be indirectly processed, and the real-time performance and efficiency of data processing are relatively low. Summary of the Invention
[0003] In order to solve at least one of the above technical problems, the present invention proposes a method, a system, and a storage medium for generating device rule nodes of an Internet of Things platform, which can dynamically generate device rule nodes, effectively support the diverse requirements of Internet of Things application scenarios, and effectively reduce the concurrent security risk of shared resources.
[0004] On the one hand, an embodiment of the present invention provides a method for generating device rule nodes of an Internet of Things platform, including the following steps:
[0005] Constructing a rule template node according to a participant model; wherein, the rule template node includes an initialization method and a data processing method;
[0006] Creating a virtual device according to the information of the device to be accessed to obtain virtual device data;
[0007] Invoking the initialization method according to the virtual device data to obtain metadata information;
[0008] Storing the metadata information in a preset database;
[0009] Invoking the data processing method according to the virtual device data to obtain a protocol configuration file;
[0010] Dynamically generating a first device rule node according to the metadata information and the protocol configuration file.
[0011] A method for generating device rule nodes of an Internet of Things platform according to an embodiment of the present invention has at least the following beneficial effects: First, according to the participant model, a rule template node is constructed. By constructing the first device rule node based on the participant model, the problem of shared state in a high-concurrency environment is effectively alleviated, and the concurrency security risk of shared resources is effectively reduced. Among them, the rule template node includes an initialization method and a data processing method. Further, in this embodiment, a virtual device is created according to the information of the device to be accessed to obtain virtual device data. Then, according to the virtual device data, the corresponding initialization method is called to obtain metadata information, and the metadata information is stored in a preset database. Next, according to the virtual device data, the data processing method is called to obtain a protocol configuration file, and thus, according to the metadata information and the protocol configuration file, the corresponding first device rule node is dynamically generated, realizing the dynamic generation of device rule nodes. In this embodiment, by constructing a rule template node and then further configuring the rule template node according to the virtual device data of the device to be accessed, the corresponding device rule node is dynamically generated, which can effectively support the diverse requirements of Internet of Things application scenarios.
[0012] According to some embodiments of the present invention, the step of calling the data processing method according to the virtual device data to obtain a protocol configuration file includes:
[0013] Determine the access protocol type of the device to be accessed according to the virtual device data;
[0014] Match the protocol configuration file through the data processing method according to the access protocol type.
[0015] According to some embodiments of the present invention, the step of calling the initialization method according to the virtual device data to obtain metadata information includes:
[0016] Call the initialization method according to the virtual device data to add node annotations to obtain the metadata information; wherein, the metadata information includes the node type, node name, node configuration parameters, node rule chain, and node UI resources.
[0017] According to some embodiments of the present invention, the method further includes:
[0018] Obtain the data information of the data source;
[0019] Input the data information into a service orchestration system; wherein, the service orchestration system includes a preset rule chain;
[0020] Judge whether there is a second device rule node that meets the preset conditions in the preset rule chain;
[0021] When there is a second device rule node that meets the preset conditions in the preset rule chain, the data information is transmitted through the preset rule chain to the corresponding second device rule node for logical processing to obtain an outbound message, and the step of determining whether there is a second device rule node that meets the preset conditions in the preset rule chain is returned.
[0022] According to some embodiments of the present invention, after performing the step of dynamically generating the first device rule node according to the metadata information and the protocol configuration file, the method further includes:
[0023] Generate a device access credential according to the virtual device data;
[0024] Connect the device to be connected to the first device rule node according to the device access credential.
[0025] According to some embodiments of the present invention, the transmitting the data information through the preset rule chain to the corresponding second device rule node for logical processing to obtain an outbound message includes:
[0026] Perform logical processing on the data information according to the processing behavior encapsulated by the second device rule node itself and the corresponding custom configuration to obtain the outbound information.
[0027] According to some embodiments of the present invention, the rule template node further includes a resource release method;
[0028] After performing the step of dynamically generating the first device rule node according to the metadata information and the protocol configuration file, the method further includes:
[0029] When the first device rule node is generated, call the resource release method to release resources.
[0030] On the other hand, an embodiment of the present invention further provides an Internet of Things platform device rule node generation system, including:
[0031] A first construction module for constructing a rule template node according to the participant model; wherein, the rule template node includes an initialization method and a data processing method;
[0032] A second construction module for creating a virtual device according to the device information to be connected to obtain virtual device data;
[0033] A first call module for calling the initialization method according to the virtual device data to obtain metadata information;
[0034] A storage module for storing the metadata information in a preset database;
[0035] A second calling module, configured to call the data processing method according to the virtual device data to obtain a protocol configuration file;
[0036] A generating module, configured to dynamically generate a first device rule node according to the metadata information and the protocol configuration file.
[0037] On the other hand, an embodiment of the present invention further provides an Internet of Things platform device rule node generation system, including:
[0038] At least one processor;
[0039] At least one memory, configured to store at least one program;
[0040] When the at least one program is executed by the at least one processor, the at least one processor implements the Internet of Things platform device rule node generation method as described in the above embodiment.
[0041] On the other hand, an embodiment of the present invention further provides a computer storage medium, in which a processor-executable program is stored, and the processor-executable program is used to implement the Internet of Things platform device rule node generation method as described in the above embodiment when executed by the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of the Internet of Things platform device rule node generation method provided by an embodiment of the present invention;
[0043] Figure 2 is a schematic block diagram of the Internet of Things platform device rule node generation system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The embodiments described in the embodiments of this application should not be regarded as limitations on this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
[0045] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0047] Before introducing and explaining the embodiments of the present application, the relevant terms involved in the present application are first explained.
[0048] Actor model: It is a classic parallel computing model. An actor model is composed of three elements: state, behavior, and mailbox. The actor model cleverly solves the fatal shared state problem in a high-concurrency environment. In traditional solutions, the security of shared data is ensured through synchronization mechanisms such as atomic memory operations, semaphores, and locks, and other problems such as deadlocks are likely to occur. The actor model reduces the shared state by transferring the state inside the actor, and only that actor can access its internal state. The actor model simply relies on message passing and the mailbox mechanism to ensure state isolation and no longer needs to consider synchronization issues. Message data can be processed asynchronously and non-blockingly.
[0049] Thing model: It is a common term in the Internet of Things platform. That is, the thing model is the digital representation of entities in the physical space, such as sensors, in-vehicle devices, buildings, factories, etc., in the Internet of Things platform. From the two dimensions of attributes and services, it describes what the entity is, what it can do, and the information data that can be provided externally.
[0050] Facing the access of more and more Internet of Things devices, more and more business scenarios have emerged. Each business scenario contains a large number of business rules, which may require system developers to frequently change the relevant business logic in the application code to adapt to the changing requirements. Currently, the method of decoupling business rules and application code through service orchestration can adjust only the business rules without the need to update the entire application, enabling the application to quickly and smoothly respond to the changing requirements. Service orchestration essentially matches factual data with business rules and then executes the passed rules. In related technologies, the implementation method of service orchestration for device rule nodes is mainly non-automated, that is, users need to manually configure device data resources at the device rule nodes to use. And due to the large number of device connections and the massive data transmitted under the Internet of Things platform, the concurrent security risk of shared resources is relatively high in this high-concurrency scenario. In addition, most current service orchestrations lack direct access interfaces for common Internet of Things protocols, and the data uploaded by Internet of Things devices can only be indirectly processed. For example, using ETL buses, device data is first transmitted to a Kafka middleware and converted into a certain database format, and then processed through ETL. In this way, the data uploaded by Internet of Things devices can only be indirectly processed, and the real-time performance and efficiency of data processing are relatively low.
[0051] An embodiment of the present invention provides a method, system, and storage medium for generating device rule nodes in an Internet of Things platform, which can dynamically generate device rule nodes, effectively support the diverse requirements of Internet of Things application scenarios, and effectively reduce the concurrent security risk of shared resources. Refer toFigure 1 , the method of the embodiment of the present invention includes but is not limited to steps S110, S120, S130, S140, S150, and S160.
[0052] Specifically, the application process of the method of the embodiment of the present invention includes but is not limited to the following steps:
[0053] S110: Construct a rule template node according to the participant model. Among them, the rule template node includes an initialization method and a data processing method.
[0054] S120: Create a virtual device according to the information of the device to be accessed to obtain virtual device data.
[0055] S130: Invoke the initialization method according to the virtual device data to obtain metadata information.
[0056] S140: Store the metadata information in a preset database.
[0057] S150: Invoke the data processing method according to the virtual device data to obtain a protocol configuration file.
[0058] S160: Dynamically generate a first device rule node according to the metadata information and the protocol configuration file.
[0059] During the working process of this specific embodiment, this embodiment first constructs a rule template node according to the participant model. Specifically, in this embodiment, the participant (Actor) model is composed of three elements: state, behavior, and mailbox. Among them, the state is the variables and data maintained internally by the participant. Each participant (Actor) maintains its own state independently and is isolated from other participants. The behavior is the computational processing logic defined within the participant, which is used to process the received messages and change the internal state of the participant through the behavior. In addition, the mailbox can be regarded as a FIFO (First In First Out) message queue associated with the receiving participant. In this embodiment, a participant can be both a sender and a receiver. At the same time, in this embodiment, the participant processes messages in a serial mode. The received messages that are not processed in time will enter the mailbox queue and then be retrieved and processed one by one in the order of enqueueing. It is easy to understand that asynchronous messages are the only communication method between participants (Actors). Each participant in the participant model can execute computational tasks in parallel, but each participant runs independently and has no dependency relationships such as lock mechanisms. Therefore, in this embodiment, by constructing a rule template node based on the participant model, the rule template node stores messages of different types of rule template nodes, such as initialization methods and data processing methods. Different rule node implementation classes are defined based on the rule template node to obtain rule nodes of different functional types. All nodes in the service orchestration of the Internet of Things platform are generated based on this rule template node. In this embodiment, the rule template node defines an initialization method and a data processing method, and exposes corresponding interfaces, such as the rule node interface, to complete the dynamic generation of device rule nodes. Exemplarily, the rule node interface exposed by the rule template node in this embodiment provides an initialization method (init) and a data processing method (data). Among them, the initialization method loads the written business rule configuration, and the data processing method encapsulates the data processing behavior of different types of rule nodes.
[0060] Further, in this embodiment, a virtual device is created according to the information of the device to be accessed, and virtual device data is obtained. Specifically, when the device to be accessed is connected to the Internet of Things platform, in the service orchestration of the Internet of Things platform, this embodiment first creates a corresponding virtual device based on the device model, thereby obtaining the corresponding virtual device data. Then, after the device is connected to the Internet of Things platform, the service orchestration creates device rule nodes according to the device protocol. This embodiment first calls the initialization method according to the virtual device data to obtain metadata information, and stores the metadata information in a preset database. Then, this embodiment calls the data processing method according to the virtual device data to match and obtain a protocol configuration file, and thus dynamically generates a first device rule node according to the metadata information and the protocol configuration file. Exemplarily, this embodiment first configures the service rule configuration information of the generated device rule node by calling the corresponding initialization method (init) exposed by the rule template node, and obtains the corresponding metadata information. Then, this embodiment stores the metadata information in a preset database. At the same time, this embodiment persists the device attributes and services in the corresponding device model to the preset data. Then, this embodiment configures the data processing behavior of the generated device rule node by calling the data processing method (data) of the rule node interface, and obtains the corresponding protocol configuration file, thereby completing the dynamic generation of the device rule node and creating the corresponding first device rule node. It is easy to understand that this embodiment can implement device rule nodes of multiple functional types through the rule node interface of the rule template node. Each type of device rule node is implemented using the rule node interface. By loading the written service rule logic and executing its own encapsulated processing behavior, the corresponding first device rule node is dynamically constructed. Among them, different types of device rule nodes are based on different description information, configuration parameters, names, the range of the relationship types of the major functional categories to which they belong, and the node outlets, etc.
[0061] In some embodiments of the present invention, when calling the data processing method according to the virtual device data, the protocol configuration file includes, but is not limited to:
[0062] Determine the access protocol type of the device to be accessed according to the virtual device data.
[0063] Match the protocol configuration file through the data processing method according to the access protocol type.
[0064] In this specific embodiment, the embodiment first determines the access protocol type of the device to be accessed according to the virtual device data, and matches the protocol configuration file through the called data processing method according to the access protocol type. Then, the embodiment executes a preset conversion logic according to the virtual device data and the protocol configuration file, and the protocol configuration file to complete the conversion of the device message. Specifically, the protocol types of different devices to be accessed in this embodiment may be different. The embodiment first determines the protocol type of the corresponding access device, that is, the access protocol type, according to the virtual device data obtained from the virtual device constructed by the Internet of Things platform. Then, the embodiment automatically matches the protocol configuration file according to the access protocol type by calling the data processing method to obtain the corresponding protocol configuration file, so as to realize the configuration of the line processing behavior of the dynamically generated first device rule point. It should be noted that in some embodiments of the present invention, the embodiment executes the conversion logic preset by the protocol on the data of the access device, so as to complete the transformation of the device message.
[0065] In some embodiments of the present invention, the initialization method is called according to the virtual device data to obtain metadata information, including but not limited to:
[0066] The initialization method is called according to the virtual device data to add node annotations to obtain metadata information. The metadata information includes the type to which the node belongs, the node name, the node configuration parameters, the node rule chain, and the node UI resources.
[0067] In this specific embodiment, this embodiment adds node annotations according to the initialization method called by virtual device data to obtain corresponding metadata information. Specifically, in this embodiment, the metadata information includes the type to which the node belongs, the node name, the node configuration parameters, the node rule chain, and the node UI resources. In this embodiment, different types of device rule nodes have different node description information, node configuration parameters, node names, the types to which the nodes belong, and the relationship types of the device rule nodes. These metadata information are defined through custom annotations. Among them, annotations are also known as Java annotations or metadata, which can be understood as special marks in the code and can embed supplementary information in the source code. At the same time, these marks can be read during compilation, class loading, or runtime and corresponding processing can be performed. In addition, this embodiment injects metadata information through annotations at runtime according to the Java reflection mechanism. Exemplarily, when a new type of device rule node needs to be generated, this embodiment first implements the initialization method and data processing method of the rule template node, defines the business rule configuration information of the corresponding device rule node and the processing behavior of loading data. Then, this embodiment adds the @Node annotation and supplements the corresponding metadata information, such as supplementing the information of the type to which the node belongs, the node name, the node configuration parameters, the node rule chain, and the node UI resources, so as to obtain the corresponding metadata information of the device rule node. It should be noted that in some embodiments of the present invention, the metadata information further includes node description information and node details information. This embodiment further annotates the device rule node through the node description information and the node details information. At the same time, the generated device rule nodes in this embodiment communicate through information transmission, and this embodiment constructs a processing link of data messages based on the message transmission between the device rule nodes, that is, the node rule chain.
[0068] In some embodiments of the present invention, the method for generating device rule nodes of the Internet of Things platform provided by this embodiment further includes but is not limited to:
[0069] Obtain the data information of the data source.
[0070] Input the data information into the service orchestration system. Among them, the service orchestration system includes a preset rule chain.
[0071] Judge whether there is a second device rule node that meets the preset conditions in the preset rule chain.
[0072] When there is a second device rule node that meets the preset conditions in the preset rule chain, the data information is transmitted to the corresponding second device rule node through the preset rule chain for logical processing to obtain an outbound message, and return to the step of judging whether there is a second device rule node that meets the preset conditions in the preset rule chain.
[0073] In this specific embodiment, this embodiment processes data messages according to the node rule links between device rule nodes. This embodiment first obtains the data information of the data source. For example, the data information collected by some sensors, devices, etc. that have been connected to the Internet of Things platform. Then, this embodiment inputs the data information into the service orchestration system. Specifically, in this embodiment, the service orchestration system includes a preset rule chain. Each device rule node is provided with a node rule chain, and the node rule chains of each device rule node form a preset rule chain. This embodiment sends data to the service orchestration system through actions such as device triggering, so as to schedule data messages between device rule nodes through the preset rule chain. Further, this embodiment determines whether there is a second device rule node that meets the preset conditions in the preset rule chain. When there is a second device rule node that meets the preset conditions in the preset rule chain, the data information is transmitted to the corresponding second device rule node through the preset rule chain for logical processing to obtain the corresponding outbound message. At the same time, this embodiment returns to the step of determining whether there is a second device rule node that meets the preset conditions in the preset rule chain for the next round of judgment. Exemplarily, after this embodiment obtains the data information sent by the data source, it inputs the data information into the service orchestration system. Then, this embodiment determines whether there is a second device rule node that meets the conditions in the preset rule chain of the service orchestration system, that is, whether there is a device rule node that can process the corresponding data information. Next, when it is determined that there is a second device rule node that meets the preset conditions in the preset rule chain, the preset rule chain in the service orchestration system sends the data information to the target rule node according to the connection relationship between device rule nodes, so that the target rule node can process the data information. Among them, different types of processing behaviors are encapsulated in different device rule nodes in this embodiment. After this embodiment obtains the outbound message through logical processing by the second device rule node, this embodiment re-determines whether there is a second device rule node that meets the preset conditions in the preset rule chain. When there is a second device rule node that meets the preset conditions in the preset rule chain, this embodiment transmits the outbound message obtained by the previous device rule node to the next corresponding second device rule node through the preset rule chain for processing. In addition, when there is no device rule node that meets the preset conditions in the preset rule chain, the corresponding processing process ends. It is easy to understand that in the device rule nodes constructed based on the participant model in this embodiment, the message passing between device rule nodes can connect each device rule node and the node rule chain to form a composite business rule logic to process the data stream in complex Internet of Things scenarios, thereby realizing specific business functions.
[0074] In some embodiments of the present invention, after performing the step of dynamically generating the first device rule node according to the metadata information and the protocol configuration file, the method for generating device nodes of the Internet of Things platform provided by this embodiment further includes, but is not limited to:
[0075] Generate a device access credential based on virtual device data.
[0076] Connect the device to be accessed to the first device rule node based on the device access credential.
[0077] In this specific embodiment, after generating the first device rule node, this embodiment first generates a device access credential according to the virtual device data, and then connects the device to be accessed to the first device rule node according to the device access credential to complete the access of the device. Specifically, this embodiment first creates a virtual device in the Internet of Things platform according to the information of the device to be accessed. This embodiment constructs a corresponding virtual device in the Internet of Things platform according to the device model of the device to be accessed. At the same time, the Internet of Things platform in this embodiment generates a corresponding device access credential according to the constructed virtual device. Correspondingly, after this embodiment dynamically generates the first device rule node according to the metadata information and the protocol configuration file, this embodiment connects the real Internet of Things device, that is, the device to be accessed, to the first device rule node through the device access credential generated by the Internet of Things platform to complete the access of the device to be accessed. It should be noted that when the device to be accessed has not completed the access, this embodiment can perform relevant process debugging in the service orchestration system through the virtual device to alleviate the problem of errors in the access process and improve the efficiency of device access.
[0078] It should be noted that in some embodiments of the present invention, the device node generation system of the Internet of Things platform is provided with a device access module. Among them, the device access module includes a device management sub-module and a device access sub-module. The device access module in this embodiment is mainly used for device access and device management, and dynamically generates device rule nodes for the accessed devices. Specifically, the device management sub-module in this embodiment is used to add or delete devices, change device attributes, view device information, and manage device credentials. In addition, the device access sub-module in this embodiment is used for device access and the dynamic generation of device rule nodes.
[0079] In some embodiments of the present invention, the data information is transmitted to the corresponding second device rule node through a preset rule chain for logical processing to obtain an outbound message, including but not limited to:
[0080] Perform logical processing on the data information according to the processing behavior encapsulated by the second device rule node itself and the corresponding custom configuration to obtain outbound information.
[0081] In this specific embodiment, different data processing behaviors are encapsulated within different device rule nodes. This embodiment performs logical processing on data information based on the processing behavior encapsulated within the second device rule node itself and the corresponding custom configuration to obtain the corresponding outbound information. Specifically, in this embodiment, a rule template node is set as the technical node of the device rule point, and then different implementation classes of device rule nodes are constructed based on the rule template node, thereby implementing device rule nodes of different functional types. In this embodiment, the initialization method is called through the rule node interface to load the written business rule configuration, and the data processing method is called to encapsulate the data processing behavior of the type rule node. Therefore, the dynamically generated device rule nodes in this embodiment are provided with the processing behavior encapsulated within themselves and the custom configuration. In this embodiment, the written business logic is loaded to execute the processing behavior encapsulated within itself, thereby implementing logical processing on data information to obtain the corresponding outbound information.
[0082] In some embodiments of the present invention, the rule template node further includes a resource release method. After performing the step of dynamically generating the first device rule node according to the metadata information and the protocol configuration file, the method for generating an Internet of Things platform device node provided in this embodiment further includes, but is not limited to:
[0083] When the first device rule node is generated, the resource release method is called to release resources.
[0084] In this specific embodiment, the rule template node set in this embodiment is also provided with a resource release method. After the generation of the first device rule point is completed, this embodiment releases resources by calling this resource release method. Specifically, the rule node interface of the rule template node in this embodiment also provides a resource release method (destroy) to release relevant resources through the resource release method. After the first device rule node is dynamically generated, this embodiment releases the relevant resources occupied during the generation process of the device rule node by implementing the resource release method of the rule node interface, so as to release and recycle the memory occupied by the resources that are no longer useful.
[0085] An embodiment of the present invention also provides an Internet of Things platform device rule node generation system, including:
[0086] A first construction module, configured to construct a rule template node according to the participant model. The rule template node includes an initialization method and a data processing method.
[0087] A second construction module, configured to create a virtual device according to the device information to be accessed to obtain virtual device data.
[0088] A first call module, configured to call the initialization method according to the virtual device data to obtain metadata information.
[0089] A storage module for storing metadata information into a preset database.
[0090] A second calling module for calling a data processing method according to virtual device data to obtain a protocol configuration file.
[0091] A generating module for dynamically generating a first device rule node according to the metadata information and the protocol configuration file.
[0092] Referring Figure 2 , an embodiment of the present invention further provides an Internet of Things platform device rule node generation system, including:
[0093] At least one processor 210.
[0094] At least one memory 220 for storing at least one program.
[0095] When the at least one program is executed by the at least one processor 210, the at least one processor 210 implements the Internet of Things platform device rule node generation method described in the above embodiment.
[0096] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by one or more control processors, for example, executing the steps described in the above embodiment.
[0097] Those of ordinary skill in the art will understand that all or some of the steps and systems disclosed in the above methods can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.
[0098] The above is a specific description of the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present invention.
Claims
1. A method for generating device rule nodes in an Internet of Things platform, characterized in that, Including the following steps: Constructing a rule template node according to the participant model; wherein, the rule template node includes an initialization method and a data processing method; the initialization method is used to load the written business rule configuration; Creating a virtual device according to the information of the device to be accessed, and obtaining virtual device data; Invoking the initialization method according to the virtual device data to obtain metadata information; Storing the metadata information into a preset database; Invoking the data processing method according to the virtual device data to obtain a protocol configuration file; Dynamically generating a first device rule node according to the metadata information and the protocol configuration file.
2. The method for generating device rule nodes in an Internet of Things platform according to claim 1, characterized in that, The step of invoking the data processing method according to the virtual device data to obtain a protocol configuration file includes: Determining the access protocol type of the device to be accessed according to the virtual device data; Matching and obtaining the protocol configuration file through the data processing method according to the access protocol type.
3. The method for generating device rule nodes in an Internet of Things platform according to claim 1, characterized in that, The step of invoking the initialization method according to the virtual device data to obtain metadata information includes: Invoking the initialization method according to the virtual device data to add node annotations to obtain the metadata information; wherein, the metadata information includes the node type, node name, node configuration parameters, node rule chain, and node UI resources.
4. The method for generating device rule nodes in an Internet of Things platform according to claim 1, characterized in that, The method further includes: Obtaining data information of a data source; Inputting the data information into a service orchestration system; wherein, the service orchestration system includes a preset rule chain; Judging whether there is a second device rule node that meets the preset conditions in the preset rule chain; When there is a second device rule node that meets the preset conditions in the preset rule chain, passing the data information to the corresponding second device rule node through the preset rule chain for logical processing to obtain an outbound message, and returning to the step of judging whether there is a second device rule node that meets the preset conditions in the preset rule chain.
5. The method for generating device rule nodes in an Internet of Things platform according to claim 1, characterized in that, After executing the step of dynamically generating a first device rule node according to the metadata information and the protocol configuration file, the method further includes: Generating a device access credential according to the virtual device data; Connecting the device to be accessed to the first device rule node according to the device access credential.
6. The method for generating device rule nodes in an Internet of Things platform according to claim 4, characterized in that, The step of passing the data information to the corresponding second device rule node through the preset rule chain for logical processing to obtain an outbound message includes: Performing logical processing on the data information according to the processing behavior encapsulated by the second device rule node itself and the corresponding custom configuration to obtain the outbound message.
7. The method for generating device rule nodes in an Internet of Things platform according to claim 1, characterized in that, The rule template node further includes a resource release method; After executing the step of dynamically generating a first device rule node according to the metadata information and the protocol configuration file, the method further includes: When generating a first device rule node, invoking the resource release method to release resources.
8. An Internet of Things platform device rule node generation system, characterized in that, Including: A first construction module for constructing a rule template node according to the participant model; wherein, the rule template node includes an initialization method and a data processing method; the initialization method is used to load the written business rule configuration; A second construction module for creating a virtual device based on the information of the device to be connected and obtaining virtual device data; A first calling module for calling the initialization method according to the virtual device data to obtain metadata information; A storage module for storing the metadata information in a preset database; A second calling module for calling the data processing method according to the virtual device data to obtain a protocol configuration file; A generation module for dynamically generating a first device rule node according to the metadata information and the protocol configuration file.
9. An Internet of Things platform device rule node generation system, characterized in that, Comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method for generating an IoT platform device rule node according to any one of claims 1 to 7.
10. A computer storage medium storing a program executable by a processor, characterized in that, The program executable by the processor, when executed by the processor, is used to implement the method for generating an IoT platform device rule node according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for improving high concurrency capability of Internet of Things platform rule engine
CN111124392A
Rule engine implementation system and method for flood control Internet of Things sensing equipment
CN112988814A