Device monitoring method and apparatus, computer device, and readable storage medium
Patent Information
- Application Number
- CN202310788498.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-06-29
AI Technical Summary
传统的设备监控方式存在以下缺点:设备数据分散、数据不一致、接口复杂、可扩展性差等
[0036]本申请实施例提供的设备监控方法、装置、计算机设备及计算机可读存储介质,所述方法包括:获取配置的至少一OPC UA Client的连接参数和针对至少一OPC UA Server的对接参数;所述连接参数包括各OPC UA Client对应需要连接的OPC UA Server信息,所述对接参数包括至少一设备的设备参数与对应OPC UA Server中数据项的映射关系;根据至少一OPC UA Client的连接参数,建立各OPC UA Client与对应OPC UA Server的连接通道;触发各OPC UA Client加载对应OPC UA Server的对接参数,并通过与对应OPC UA Server的连接通道对所述至少一设备的设备参数进行监控。如此,基于配置的OPC UA Client的连接参数建立各OPC UA Client与对应OPC UA Server的连接通道,再触发各OPC UA Client加载配置的对应OPC UA Server的对接参数,进而实现通过与对应OPC UA Server的连接通道对所述至少一设备的设备参数进行监控,可以准确实现设备监控,且设备监控的效率高,进而提高了设备的可靠性和稳定性,降低了维护成本。
Smart Images

Figure CN116846880B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of monitoring technology, and in particular to a device monitoring method, apparatus, computer equipment, and computer-readable storage medium. Background Technology
[0002] In the field of industrial automation, equipment monitoring is a crucial task. By monitoring equipment data, abnormal operating conditions can be detected promptly, improving equipment reliability and stability, reducing downtime, and lowering maintenance costs.
[0003] As the number and types of equipment in industrial automation systems increase, equipment monitoring faces growing challenges. Traditional equipment monitoring methods suffer from drawbacks such as scattered equipment data, inconsistent data, complex interfaces, and poor scalability. These problems severely restrict the efficiency of equipment monitoring. However, how to improve equipment monitoring efficiency and, consequently, enhance equipment reliability and stability remains a subject of ongoing research. Summary of the Invention
[0004] The purpose of this application is to provide a device, computer equipment, and computer-readable storage medium for equipment monitoring, which can accurately monitor equipment with high efficiency, thereby improving the reliability and stability of the equipment and reducing maintenance costs.
[0005] To achieve the above objectives:
[0006] In a first aspect, embodiments of this application provide a device monitoring method, the method comprising:
[0007] Obtain the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to, and the docking parameters include the mapping relationship between the device parameters of at least one device and the data items in the corresponding OPC UA Server;
[0008] Based on the connection parameters of at least one OPC UA Client, establish a connection channel between each OPC UA Client and the corresponding OPC UA Server;
[0009] Each OPC UA Client is triggered to load the docking parameters of the corresponding OPC UA Server, and the device parameters of at least one device are monitored through the connection channel with the corresponding OPC UA Server.
[0010] In one embodiment, obtaining the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server includes:
[0011] In response to configuration commands, an interface for configuring docking parameters for at least one OPC UA Server is provided based on the EAM device ledger; the interface for configuring docking parameters includes device parameters and data items set based on defined parameter standards;
[0012] The configuration operation is received through the interface for configuring the docking parameters, and docking parameters for at least one OPC UA Server are generated.
[0013] In one embodiment, it further includes:
[0014] In ZooKeeper, create a master node as the root node for managing the OPC UA Client cluster, and create a child node for each of the at least one server node that starts the OPC UA service; the server node is used to run the OPC UA Client.
[0015] Monitor the list of child nodes and identify inactive server nodes when the list of child nodes changes;
[0016] Based on the number of active server nodes in at least one server node, an OPC UA Client running on an active server node is scheduled to run on an active server node using a preset scheduling algorithm.
[0017] In one embodiment, the step of scheduling the OPC UA Client running on a deactivated server node to a non-deactivated server node based on a preset scheduling algorithm, according to the number of non-deactivated server nodes in at least one server node, includes:
[0018] Indexes are created sequentially for the active server nodes, and each OPC UA Client running on the inactive server nodes is sequentially numbered.
[0019] For the target OPC UA Client, divide the target OPC UA Client's ID value by the number of the corresponding active server nodes and obtain the remainder; the target OPC UA Client is any OPC UA Client running on an active server node.
[0020] If the remainder is not equal to zero, the target OPC UA Client will be scheduled to run on a server node that is not deactivated and has the same index value as the remainder.
[0021] If the remainder is zero, the target OPC UA Client will be scheduled to run on the active server node corresponding to the index value with the same number value.
[0022] In one implementation, before creating a master node in ZooKeeper as the root node for OPC UA Client cluster management, the method further includes:
[0023] Based on the number of at least one server node, at least one OPC UA Client is assigned to each server node according to a preset scheduling algorithm.
[0024] In one embodiment, it further includes:
[0025] Obtain the configured OPC UA service, which includes a service identifier, a target OPC UA Client, an identifier for the target parameter, and the corresponding data item identifier;
[0026] In response to the OPC UA service being invoked through the provided standard interface, the target parameters are written to the data item containing the data item identifier in the corresponding OPC UA Server using the target OPC UA Client and the service identifier.
[0027] In one embodiment, monitoring the device parameters of the at least one device through a connection channel with the corresponding OPC UA Server includes:
[0028] Monitor changes to data items in the OPC UA Server through the connection channel between the OPC UA Client and the corresponding OPC UA Server;
[0029] When a data item changes in the OPC UA Server, the real-time data table of the corresponding device is updated, and the device data change information is pushed to the data bus for upper-layer application systems to subscribe to.
[0030] Secondly, embodiments of this application provide a device monitoring apparatus, comprising:
[0031] The acquisition module is used to acquire the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to, and the docking parameters include the correspondence between the device parameters of at least one device and the data items in the corresponding OPC UA Server.
[0032] The processing module is used to establish a connection channel between each OPC UA Client and the corresponding OPC UA Server based on the connection parameters of at least one OPC UA Client.
[0033] The monitoring module is used to trigger each OPC UA Client to load the docking parameters of the corresponding OPC UA Server, and to monitor the device parameters of the at least one device through the connection channel with the corresponding OPC UA Server.
[0034] Thirdly, embodiments of this application provide a computer device, including: a processor and a memory storing a computer program, wherein when the processor runs the computer program, the steps of the above-described device monitoring method are implemented.
[0035] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described device monitoring method.
[0036] The device monitoring method, apparatus, computer device, and computer-readable storage medium provided in this application embodiment include: acquiring connection parameters of at least one configured OPC UA Client and docking parameters for at least one OPC UA Server; the connection parameters include information about the OPC UA Server that each OPC UA Client needs to connect to, and the docking parameters include a mapping relationship between device parameters of at least one device and data items in the corresponding OPC UA Server; establishing a connection channel between each OPC UA Client and the corresponding OPC UA Server based on the connection parameters of at least one OPC UA Client; triggering each OPC UA Client to load the docking parameters of the corresponding OPC UA Server, and monitoring the device parameters of the at least one device through the connection channel with the corresponding OPC UA Server. In this way, a connection channel is established between each OPC UA Client and the corresponding OPC UA Server based on the configured connection parameters of the OPC UA Client. Then, each OPC UA Client is triggered to load the configured docking parameters of the corresponding OPC UA Server. This enables the monitoring of the device parameters of at least one device through the connection channel with the corresponding OPC UA Server. This can accurately monitor the device with high efficiency, thereby improving the reliability and stability of the device and reducing maintenance costs. Attached Figure Description
[0037] Figure 1This is a flowchart illustrating the device monitoring method provided in an embodiment of the present invention;
[0038] Figure 2 This is a schematic diagram of the architecture of an existing equipment monitoring system;
[0039] Figure 3 This is a schematic diagram of the architecture of the device monitoring system provided in an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram illustrating the operation and scheduling of the OPC UA Client in an embodiment of the present invention;
[0041] Figure 5 This is a schematic diagram of device parameter docking in an embodiment of the present invention;
[0042] Figure 6 This is a schematic diagram of the configuration interface for device parameter docking in an embodiment of the present invention;
[0043] Figure 7 This is a schematic diagram of device control in an embodiment of the present invention;
[0044] Figure 8 This is a schematic diagram of the configuration interface for the OPC UA service in an embodiment of the present invention;
[0045] Figure 9 This is a schematic diagram of the structure of the equipment monitoring device provided in an embodiment of the present invention;
[0046] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0048] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0049] It should be understood that although the terms first, second, third, etc., may be used herein to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, can be interpreted as "when," "when," or "in response to determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising," "including," indicate the presence of the stated feature, step, operation, element, component, item, kind, and / or group, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" as used herein are to be interpreted as inclusive, or mean any one or any combination thereof. Therefore, "A, B, or C" or "A, B, and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A, B, and C". Exceptions to this definition will only occur if the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.
[0050] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0051] It should be noted that step designations such as S1 and S2 are used in this document for the purpose of more clearly and concisely describing the corresponding content, and do not constitute a substantial limitation on the order. In specific implementation, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the protection scope of this application.
[0052] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0053] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.
[0054] The following is a brief explanation of the terms that may be used in this application:
[0055] OPC UA (Open Platform Communications Unified Architecture) is a universal industrial automation data transmission protocol designed to provide an open, cross-platform, secure and reliable communication framework that enables data exchange between different manufacturers and different devices.
[0056] OPC (Open Platform Communications): OPC is a standard communication framework based on the Microsoft Windows platform, designed to solve the problem of data communication between different devices in automation systems.
[0057] UA (Unified Architecture): UA is the next-generation standard of the OPC protocol. Compared with the traditional OPC protocol, the UA protocol has stronger security, cross-platform compatibility, flexibility and scalability.
[0058] Client / Server Architecture: OPC UA adopts a client / server-based architecture. The client (hereinafter referred to as OPC UA Client) can request data or commands from the server (hereinafter referred to as OPC UA Server), and the server is responsible for processing the requests and providing data or commands to the client.
[0059] Node: In OPC UA, a node is a basic data structure that represents an object or variable, such as a device, a sensor, or a data item.
[0060] See Figure 1 This application provides a device monitoring method, which can be executed by a device monitoring device provided in this application. The device monitoring device can be implemented using software and / or hardware. In this embodiment, the executing entity of the device monitoring method is a computer device such as a server. The device monitoring method provided in this embodiment includes:
[0061] Step S1: Obtain the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to, and the docking parameters include the mapping relationship between the device parameters of at least one device and the data items in the corresponding OPC UA Server.
[0062] Optionally, multiple OPC UA Clients can be configured to run as needed, and connection parameters for each OPC UA Client can be configured. These connection parameters include information about the OPC UA Server that each OPC UA Client needs to connect to, including but not limited to IP address, port, and encryption method. Furthermore, to collect device parameters from different devices, such as voltage and operating time, through the OPC UA Server, it is necessary to map these device parameters to data items in the OPC UA Server. That is, at least one mapping relationship must be configured between the device parameters of one device and the corresponding data items in the OPC UA Server. Here, one OPC UA Server can be used to collect parameters from multiple devices belonging to the same or different devices.
[0063] Optionally, obtaining the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server includes:
[0064] In response to configuration commands, an interface for configuring docking parameters for at least one OPC UA Server is provided based on the EAM device ledger; the interface for configuring docking parameters includes device parameters and data items set based on defined parameter standards;
[0065] The configuration operation is received through the interface for configuring the docking parameters, and docking parameters for at least one OPC UA Server are generated.
[0066] Specifically, upon receiving configuration commands input by the user, the system can respond by providing a configuration interface for connection parameters of at least one OPC UA Server based on the EAM device ledger. In this configuration interface, the user can select the OPC UA Server for which connection parameters need to be configured, and configure device parameters and data items based on defined parameter standards. Correspondingly, the server can receive configuration operations through the configuration interface and generate connection parameters for at least one OPC UA Server. This enables rapid connection and configuration of device parameters.
[0067] Step S2: Based on the connection parameters of at least one OPC UA Client, establish a connection channel between each OPC UA Client and the corresponding OPC UA Server.
[0068] Optionally, after the OPC UA Client starts running, a connection channel can be established between each OPC UA Client and the corresponding OPC UA Server based on the connection parameters of at least one OPC UA Client, so as to realize data interaction between the OPC UA Client and the corresponding OPC UA Server through the connection channel.
[0069] Step S3: Trigger each OPC UA Client to load the docking parameters of the corresponding OPC UA Server, and monitor the device parameters of at least one device through the connection channel with the corresponding OPC UA Server.
[0070] Optionally, the server can trigger each OPC UA Client to dynamically load the docking parameters of the corresponding OPC UA Server, so that each OPC UA Client can know the device parameters to be monitored and the data items of the device parameters in the corresponding OPC UA Server, and then monitor the device parameters of the at least one device through the connection channel with the corresponding OPC UA Server.
[0071] In summary, the device monitoring method provided in the above embodiments establishes a connection channel between each OPC UA Client and the corresponding OPC UA Server based on the configured connection parameters of the OPC UA Client, and then triggers each OPC UA Client to load the configured docking parameters of the corresponding OPC UA Server, thereby enabling the monitoring of the device parameters of at least one device through the connection channel with the corresponding OPC UA Server. This method can accurately monitor the device and has high efficiency, thereby improving the reliability and stability of the device and reducing maintenance costs.
[0072] In one embodiment, it further includes:
[0073] In ZooKeeper, create a master node as the root node for managing the OPC UA Client cluster, and create a child node for each of the at least one server node that starts the OPC UA service; the server node is used to run the OPC UA Client.
[0074] Monitor the list of child nodes and identify inactive server nodes when the list of child nodes changes;
[0075] Based on the number of active server nodes in at least one server node, an OPC UA Client running on an active server node is scheduled to run on an active server node using a preset scheduling algorithm.
[0076] Optionally, ZooKeeper is used for OPC UA Client cluster management in this embodiment. Specifically, a master node is first created in ZooKeeper as the root node for OPC UA Client cluster management, and a child node is created for each of the at least one server node that starts the OPC UA service to generate a child node list. Next, the child node list is monitored to detect changes, i.e., to detect whether any server nodes have never been deactivated. When the child node list changes, the deactivated server nodes are identified. Finally, based on the number of surviving server nodes among the at least one server node, an OPC UA Client running on the deactivated server node is scheduled to run on a surviving server node using a preset scheduling algorithm, thereby ensuring that the connection channel between the OPC UA Client running on the deactivated server node and the corresponding OPC UA Server remains unbroken. Here, the deactivated server node can be a server node that cannot provide normal service due to reasons such as being idle. The preset scheduling algorithm can be configured according to actual needs, including evenly distributing OPC UA Clients running on inactive server nodes to active server nodes, or re-distributing all OPC UA Clients evenly to active server nodes, i.e., reallocating server nodes for at least one OPC UA Client. Thus, by using Zookeeper for OPC UA Client cluster management, dynamic management and load balancing of nodes in the cluster can be achieved, improving the performance and reliability of OPC UA Clients.
[0077] In one embodiment, the step of scheduling the OPC UA Client running on a deactivated server node to a non-deactivated server node based on a preset scheduling algorithm, according to the number of non-deactivated server nodes in at least one server node, includes:
[0078] Indexes are created sequentially for the active server nodes, and each OPC UA Client running on the inactive server nodes is sequentially numbered.
[0079] For the target OPC UA Client, divide the target OPC UA Client's ID value by the number of the corresponding active server nodes and obtain the remainder; the target OPC UA Client is any OPC UA Client running on an active server node.
[0080] If the remainder is not equal to zero, the target OPC UA Client will be scheduled to run on a server node that is not deactivated and has the same index value as the remainder.
[0081] If the remainder is zero, the target OPC UA Client will be scheduled to run on the active server node corresponding to the index value with the same number value.
[0082] Optionally, indexes can be created sequentially for each active server node, such as assigning index values 1, 2, 3, etc. Simultaneously, each OPC UA Client running on an active server node is sequentially numbered. For example, if there are a total of 4 OPC UA Clients running on an active server node, they can be assigned numbers 1, 2, 3, and 4. For any OPC UA Client running on an active server node, i.e., the target OPC UA Client, the target OPC UA Client's number is divided by the number of active server nodes. The remainder is obtained. If the remainder is not zero, the target OPC UA Client is scheduled to run on an active server node with the same index value as the remainder. If the remainder is zero, the target OPC UA Client is scheduled to run on an active server node with the same index value as the remainder. It should be noted that both the index value and the number value are positive integers and are set sequentially. For example, suppose there are 4 OPC UA Clients running on inactive server nodes, numbered 1, 2, 3, and 4 respectively. If there are 4 active server nodes, numbered 1, 2, 3, and 4 respectively, then for the OPC UA Client running on the inactive server node with number 1, since the remainder when 1 is divided by 4 (i.e., the number of active server nodes) is 1, the OPC UA Client with number 1 can be assigned to an active server node with index 1. For the OPC UA Client running on the inactive server node with number 2, since the remainder when 2 is divided by 4 is 2, the OPC UA Client with number 2 can be assigned to an active server node with index 2. For the OPC UA Client running on the inactive server node with number 3, since the remainder when 3 is divided by 4 is 3, the OPC UA Client with number 3 can be assigned to an active server node with index 2. The UAClient is assigned to the active server node with index value 3. For the OPC UA Client running on the inactive server node with index value 4, since the remainder of 4 divided by 4 is 0, the OPC UA Client with index value 4 can be assigned to the active server node with index value 4. In this way, the OPC UA Clients running on the inactive server node can be distributed as evenly as possible to the active server nodes, further ensuring load balancing.
[0083] In one implementation, before creating a master node in ZooKeeper as the root node for OPC UA Client cluster management, the method further includes:
[0084] Based on the number of at least one server node, at least one OPC UA Client is assigned to each server node according to a preset scheduling algorithm.
[0085] Optionally, if it is necessary to collect device parameters through the OPC UA Client, before creating a master node in ZooKeeper as the root node for managing the OPC UA Client cluster, at least one OPC UA Client can be allocated to each server node based on a preset scheduling algorithm, according to the number of at least one server node. Specifically, first, an index is created for each of the at least one server node, and at least one OPC UA Client is numbered sequentially. For any OPC UA Client among the at least one OPC UA Client, the number value of the OPC UA Client is divided by the number of at least one server node, and the remainder is obtained. If the remainder is not equal to zero, the OPC UA Client is scheduled to run on the server node corresponding to the index value with the same remainder; if the remainder is equal to zero, the OPC UA Client is scheduled to run on the server node corresponding to the index value with the same number value. In this way, by distributing at least one OPC UA Client as evenly as possible to run on at least one server node, load balancing is further ensured.
[0086] In one embodiment, it further includes:
[0087] Obtain the configured OPC UA service, which includes a service identifier, a target OPC UA Client, an identifier for the target parameter, and the corresponding data item identifier;
[0088] In response to the OPC UA service being invoked, the target parameters are written into the data item containing the data item identifier in the corresponding OPC UA Server using the target OPC UA Client and the service identifier.
[0089] Optionally, based on requirements such as monitoring specific device parameters, the OPC UA service can be configured to obtain a configured OPC UA service including a service identifier, a target OPC UA Client, an identifier for the target parameter, and the corresponding data item identifier. The identifier for the target parameter can include the target parameter value and identifiers for either input or output parameters. Then, a standard interface can be provided for upper-layer application systems to call. After the upper-layer application system calls the OPC UA service through the provided standard interface, it can write the target parameter into the data item containing the data item identifier in the corresponding OPC UA Server using the target OPC UA Client and the service identifier, so that the corresponding OPC UA Server records the data item containing the data item identifier on the device. Thus, by configuring the OPC UA service, device control becomes more flexible, while reducing system complexity and maintenance costs. Furthermore, by providing a standard interface, the integration between device control and upper-layer application systems becomes more convenient and efficient.
[0090] In one embodiment, monitoring the device parameters of the at least one device through a connection channel with the corresponding OPC UA Server includes:
[0091] Monitor changes to data items in the OPC UA Server through the connection channel between the OPC UA Client and the corresponding OPC UA Server;
[0092] When a data item changes in the OPC UA Server, the real-time data table of the corresponding device is updated, and the device data change information is pushed to the data bus for upper-layer application systems to subscribe to.
[0093] Optionally, the server can monitor changes to data items in the OPC UA Server based on the connection channel between the OPC UA Client and the corresponding OPC UA Server. When a data item changes in the OPC UA Server, the server can update the real-time data table of the corresponding device and push the device data change information to the data bus for upper-layer application systems to subscribe to. Simultaneously, a standard Web API interface can be provided for upper-layer application systems to query real-time device parameter values. Here, the data bus can be implemented using controls such as the Kafka message middleware, without specific limitations. This enables timely monitoring of device data, further improving device reliability and stability.
[0094] Based on the same inventive concept as the foregoing embodiments, the foregoing embodiments will be described in detail below through a specific example.
[0095] In the field of industrial automation, equipment monitoring is a crucial task. By monitoring equipment data, abnormal operating conditions can be detected promptly, improving equipment reliability and stability, reducing downtime, and lowering maintenance costs. Equipment control, on the other hand, involves remotely controlling and managing equipment, including functions such as starting and stopping equipment, adjusting parameters, and issuing process parameters, which helps improve the production efficiency and quality of industrial automation systems.
[0096] The OPC UA protocol, as a universal, open, and cross-platform data transmission protocol, boasts advantages such as scalability, security, reliability, and data consistency, and is widely used in industrial environments. Therefore, researching standardized equipment data acquisition and control based on the OPC UA protocol facilitates upper-layer application systems in obtaining and controlling equipment data. It enables rapid real-time acquisition, processing, analysis, visualization, and digital twinning of equipment data, while also facilitating remote control and management of equipment, thus significantly improving equipment utilization.
[0097] See Figure 2 This is a schematic diagram of the architecture of an existing equipment monitoring system based on the OPC UA protocol. For data acquisition from factory PLC equipment, existing technologies propose installing commercial OPC server software on the factory side to collect data points from the DB blocks in the PLC. A data acquisition service is developed to collect the required data points through an OPC UA client and save them to a database for easy querying and analysis by the upper-level MOM system. While the above solutions can achieve data acquisition through configuration, they do not establish a standardized factory equipment data integration solution, nor do they address how to integrate with the Equipment Management System (EAM). Furthermore, known solutions do not consider the high availability of the OPC UA client or multi-node cluster solutions. In addition, while known solutions all involve equipment data acquisition through configuration, they do not address the distribution of equipment parameters through configuration.
[0098] To address the aforementioned problems, this embodiment provides a device monitoring method. This embodiment uses the application of the device monitoring method to a cluster manager as an example. (See also...) Figure 3 This is a schematic diagram of the architecture of the device monitoring system provided in this embodiment, based on Figure 3 The device monitoring method provided in this embodiment mainly includes the following processes:
[0099] (I) OPC UA Client Operation and Scheduling
[0100] Here, by configuring OPC UA connection parameters, the required OPC UA Clients are automatically run, and OPC UA Client cluster management is performed based on Zookeeper, such as... Figure 4 As shown, the specific steps include:
[0101] Step S10: Configure OPC UA Client connection parameters.
[0102] Here, all the necessary OPC UA Client connection parameters will be configured. These parameters may include information about the corresponding OPC UA Server, such as its IP address.
[0103] Step S11: Create a Zookeeper master node.
[0104] Here, a master node is created in ZooKeeper to serve as the root node for managing the OPC UA Client cluster.
[0105] Step S12: Create child nodes.
[0106] Specifically, when a server node running an OPC UA Client starts up, it creates a child node under the Zookeeper master node with the IP address of the current server node as its name.
[0107] Step S13: Monitor the list of child nodes.
[0108] Step S14: Schedule and run the OPC UA Client according to the scheduling algorithm.
[0109] Here, ZooKeeper monitors changes to the child node list. When the number of nodes in the OPC UA Client cluster changes, the cluster manager schedules tasks based on the number of child nodes (i.e., the number of server nodes) and the number of OPC UA Clients. This ensures that each server node in the cluster is evenly distributed across tasks. The scheduling method involves dividing the OPC UA Client's ID by the number of child nodes, calculating the quotient and remainder. If the remainder equals the index of the current child node, that child node is responsible for running the current OPC UA client. The cluster manager then continues to monitor changes to the child node list in ZooKeeper. When the child node list changes, rescheduling is performed to ensure that each child node is evenly distributed across tasks.
[0110] Here, by using Zookeeper for OPC UA Client cluster management, dynamic management and load balancing of nodes in the cluster can be achieved, improving the performance and reliability of OPC UA Client.
[0111] (II) Equipment Parameter Interoperability
[0112] This embodiment proposes a standardized OPC UA protocol data interface scheme, such as... Figure 5As shown, the device parameter docking process is the process of mapping device parameters to OPC UA data items, including the following steps:
[0113] Step S20: Parameter standard setting.
[0114] First, it is necessary to establish standards for equipment parameters, clearly defining the unique number, naming, unit, and value range of each parameter to ensure accurate data exchange during subsequent equipment parameter integration.
[0115] Step S21: Parameter docking configuration.
[0116] Here, the configuration of device parameters based on the EAM device ledger mainly involves establishing the correspondence between device parameters and corresponding data node items in the OPCUA Server, such as... Figure 6 As shown, for example, corresponding parameters can be configured for different Node IDs.
[0117] Step S23: The OPC UA Client dynamically loads the parameter docking configuration and listens for data changes.
[0118] Here, after completing the parameter docking configuration, the OPC UA Client can be triggered to dynamically load the parameter docking configuration and listen for data changes.
[0119] Step S24: Data saving and publishing.
[0120] Here, when data changes, the corresponding real-time device data table is updated, and a standard device data change message is pushed to the data bus for upper-layer applications to subscribe to. The data bus can be implemented through the Kafka message middleware, and at the same time, it provides a standard Web API interface for application systems to query real-time device parameter values.
[0121] (III) Equipment Control
[0122] This embodiment proposes a standard device control method based on the OPC UA protocol, such as... Figure 7 As shown, it includes the following steps:
[0123] Step S30: Configure OPC UA service.
[0124] First, you need to configure the OPC UA service, including defining the service identifier and OPC UA Client, as well as defining the identifiers for input and output parameters and their corresponding Node IDs, such as... Figure 8 As shown.
[0125] Step S31: Provide a standard device control Web API interface.
[0126] After configuring the OPC UA service, a standard interface needs to be provided for application system calls. The input parameter format of the standard interface is defined as follows:
[0127] {
[0128] "serviceIdentifier":"writeTest",
[0129] "data":{
[0130] "a1":"3",
[0131] a2: "3"
[0132] }
[0133] }
[0134] Wherein, serviceIdentifier is the service identifier, data is the list of parameter values, key is the input parameter identifier, and value is the parameter value.
[0135] Step S32: The application system makes a service call.
[0136] Step S33: Batch write operation.
[0137] Here, after the service is invoked, the service configuration is retrieved based on the service's unique identifier. This reveals the OPC UA Client that needs to be written and the list of parameter values to be written. Then, the cluster manager locates the OPC UA Client nodes that need to be distributed and performs batch parameter writing operations.
[0138] In summary, the equipment monitoring method provided in the above embodiments proposes a standardized process for equipment parameter docking based on parameter standards, EAM equipment ledgers, and equipment parameter docking configuration. This process enables rapid docking and configuration of equipment parameters, thereby improving the efficiency of equipment data acquisition. Simultaneously, by configuring OPC UA services, equipment control becomes more flexible, while reducing system complexity and maintenance costs. A standard interface is provided, making integration between equipment control and upper-layer application systems more convenient and efficient. Furthermore, a scheme for OPC UA Client cluster management based on Zookeeper is proposed. This scheme enables automatic management and scheduling of the OPC UA Client cluster, thereby improving system reliability and stability, reducing downtime, and increasing production efficiency. Therefore, the equipment monitoring method provided in this embodiment standardizes equipment monitoring components, facilitating rapid equipment parameter acquisition and control. It enables remote control and management of equipment, as well as monitoring and analysis of equipment data. Simultaneously, it effectively improves the production efficiency and quality of industrial automation systems, reduces downtime and maintenance costs, and minimizes waste of human and material resources, possessing significant practical and commercial value.
[0139] Based on the same inventive concept as the foregoing embodiments, see [link / reference]. Figure 9 This application provides a device monitoring apparatus, including:
[0140] The acquisition module is used to acquire the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to, and the docking parameters include the correspondence between the device parameters of at least one device and the data items in the corresponding OPC UA Server.
[0141] The processing module is used to establish a connection channel between each OPC UA Client and the corresponding OPC UA Server based on the connection parameters of at least one OPC UA Client.
[0142] The monitoring module is used to trigger each OPC UA Client to load the docking parameters of the corresponding OPC UA Server, and to monitor the device parameters of the at least one device through the connection channel with the corresponding OPC UA Server.
[0143] In summary, the device monitoring device provided in the above embodiments establishes a connection channel between each OPC UA Client and the corresponding OPC UA Server based on the configured connection parameters of the OPC UA Client, and then triggers each OPC UA Client to load the configured docking parameters of the corresponding OPC UA Server, thereby realizing the monitoring of the device parameters of at least one device through the connection channel with the corresponding OPC UA Server. This can accurately realize device monitoring with high efficiency, thereby improving the reliability and stability of the device and reducing maintenance costs.
[0144] In one embodiment, the acquisition module is specifically used for:
[0145] In response to configuration commands, an interface for configuring docking parameters for at least one OPC UA Server is provided based on the EAM device ledger; the interface for configuring docking parameters includes device parameters and data items set based on defined parameter standards;
[0146] The configuration operation is received through the interface for configuring the docking parameters, and docking parameters for at least one OPC UA Server are generated.
[0147] In one embodiment, the processing module is further configured to:
[0148] In ZooKeeper, create a master node as the root node for managing the OPC UA Client cluster, and create a child node for each of the at least one server node that starts the OPC UA service; the server node is used to run the OPC UA Client.
[0149] Monitor the list of child nodes and identify inactive server nodes when the list of child nodes changes;
[0150] Based on the number of active server nodes in at least one server node, an OPC UA Client running on an active server node is scheduled to run on an active server node using a preset scheduling algorithm.
[0151] In one embodiment, the processing module is specifically used for:
[0152] Indexes are created sequentially for the active server nodes, and each OPC UA Client running on the inactive server nodes is sequentially numbered.
[0153] For the target OPC UA Client, divide the target OPC UA Client's ID value by the number of the corresponding active server nodes and obtain the remainder; the target OPC UA Client is any OPC UA Client running on an active server node.
[0154] If the remainder is not equal to zero, the target OPC UA Client will be scheduled to run on a server node that is not deactivated and has the same index value as the remainder.
[0155] If the remainder is zero, the target OPC UA Client will be scheduled to run on the active server node corresponding to the index value with the same number value.
[0156] In one embodiment, the processing module is further configured to:
[0157] Based on the number of at least one server node, at least one OPC UA Client is assigned to each server node according to a preset scheduling algorithm.
[0158] In one implementation,
[0159] The acquisition module is also used to acquire the configured OPC UA service, which includes a service identifier, a target OPC UA Client, an identifier for the target parameter, and a corresponding data item identifier.
[0160] The processing module is further configured to, in response to the OPC UA service being invoked through the provided standard interface, write the target parameters into the data item containing the data item identifier in the corresponding OPC UA Server using the target OPC UA Client and the service identifier.
[0161] In one embodiment, the monitoring module is specifically used for:
[0162] Monitor changes to data items in the OPC UA Server through the connection channel between the OPC UA Client and the corresponding OPC UA Server;
[0163] When a data item changes in the OPC UA Server, the real-time data table of the corresponding device is updated, and the device data change information is pushed to the data bus for upper-layer application systems to subscribe to.
[0164] For specific limitations regarding the equipment monitoring device, please refer to the limitations on the equipment monitoring method above, which will not be repeated here. Each module in the aforementioned equipment monitoring device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0165] Based on the same inventive concept as the foregoing embodiments, this invention provides a computer device, such as... Figure 10 As shown, the computer device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 10 The processor 310 shown in the diagram does not indicate that there is only one processor 310, but only indicates the positional relationship of the processor 310 relative to other devices. In practical applications, there can be one or more processors 310; similarly, Figure 10 The memory 311 shown in the diagram has the same meaning, that is, it is only used to indicate the positional relationship of memory 311 relative to other devices. In practical applications, there can be one or more memories 311. When the processor 310 runs the computer program, the device monitoring method applied to the above-mentioned device is implemented.
[0166] The computer device may also include at least one network interface 312. Various components of the computer device are coupled together via a bus system 313. It is understood that the bus system 313 is used to implement communication between these components. In addition to a data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 10 The general designated all buses as Bus System 313.
[0167] The memory 311 can be volatile memory or non-volatile memory, or both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be disk storage or magnetic tape storage. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 311 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0168] The memory 311 in this embodiment of the invention is used to store various types of data to support the operation of the computer device. Examples of this data include: any computer programs used to operate on the computer device, such as operating systems and applications; contact data; phonebook data; messages; pictures; videos, etc. The operating system includes various system programs, such as the framework layer, core library layer, driver layer, etc., used to implement various basic services and handle hardware-based tasks. Applications can include various applications, such as media players, browsers, etc., used to implement various application services. Here, the program implementing the method of this embodiment of the invention can be included in the application.
[0169] Based on the same inventive concept as the foregoing embodiments, this embodiment also provides a computer-readable storage medium storing a computer program. The computer-readable storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it can also be various devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc. When the computer program stored in the computer-readable storage medium is executed by a processor, it implements the above-mentioned device monitoring method. For the specific steps implemented when the computer program is executed by the processor, please refer to [link to relevant documentation]. Figure 1 The description of the illustrated embodiments will not be repeated here.
[0170] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] In this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, which includes not only the elements listed but also other elements not expressly listed.
[0172] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for monitoring equipment, characterized in that, include: Obtain the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to; the docking parameters are configured based on the EAM device ledger to establish a mapping relationship between device parameters and data items in the corresponding OPC UA Server; the docking parameters include the mapping relationship between the device parameters of at least one device and the data items in the corresponding OPC UA Server. Create a master node in ZooKeeper as the root node for managing the OPC UA Client cluster, create multiple child nodes, and monitor the status of the child node list in ZooKeeper. When the list of child nodes changes and it is determined that there are inactive server nodes, indexes are created sequentially for the active server nodes, and the target OPC UA Clients running on the inactive server nodes are numbered sequentially. For the target OPC UA Client, divide the target OPC UA Client's ID value by the number of non-deactivated server nodes, and schedule the target OPC UA Client to run on the corresponding non-deactivated server node based on the remainder in the calculation result. Based on the connection parameters of at least one OPC UA Client, establish a connection channel between each OPC UA Client and the corresponding OPC UA Server; Each OPC UA Client is triggered to load the docking parameters of the corresponding OPC UA Server, and the device parameters of at least one device are monitored through the connection channel with the corresponding OPC UA Server. Obtain the configured OPC UA service; the OPC UA service includes a service identifier, a target OPC UA Client, an identifier for the target parameter, and the corresponding data item identifier; In response to the OPC UA service being invoked via a standard Web API, the target parameters are written to the data item containing the data item identifier in the corresponding OPC UA Server through the target OPC UA Client.
2. The method according to claim 1, characterized in that, The process of obtaining the connection parameters for at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server includes: In response to configuration commands, an interface for configuring docking parameters for at least one OPC UA Server is provided based on the EAM device ledger; the interface for configuring docking parameters includes device parameters and data items set based on defined parameter standards; The configuration operation is received through the interface for configuring the docking parameters, and docking parameters for at least one OPC UA Server are generated.
3. The method according to claim 1, characterized in that, Also includes: Create a master node in ZooKeeper as the root node for managing the OPC UA Client cluster, and create a child node for each of the at least one server node that starts the OPC UA service; the server node is used to run the OPC UA Client. Monitor the list of child nodes and identify inactive server nodes when the list of child nodes changes; Based on the number of active server nodes in at least one server node, an OPC UA Client running on an active server node is scheduled to run on an active server node using a preset scheduling algorithm.
4. The method according to claim 3, characterized in that, The step of scheduling the OPC UA Client running on a deactivated server node to a non-deactivated server node based on a preset scheduling algorithm, according to the number of non-deactivated server nodes in at least one server node, includes: Indexes are created sequentially for the active server nodes, and each OPCUA Client running on the inactive server nodes is sequentially numbered. For the target OPC UA Client, divide the target OPC UA Client's ID value by the number of the corresponding active server nodes and obtain the remainder; the target OPC UA Client is any OPC UA Client running on an active server node. If the remainder is not equal to zero, the target OPC UA Client will be scheduled to run on a server node that is not deactivated and has the same index value as the remainder. If the remainder is zero, the target OPC UA Client will be scheduled to run on the active server node corresponding to the index value with the same number value.
5. The method according to claim 3 or 4, characterized in that, Before creating a master node in ZooKeeper as the root node for managing the OPC UA Client cluster, the following steps are also included: Based on the number of at least one server node, at least one OPC UA Client is assigned to each server node according to a preset scheduling algorithm.
6. The method according to claim 1, characterized in that, The monitoring of device parameters of at least one device through a connection channel with the corresponding OPC UA Server includes: Monitor changes to data items in the OPC UA Server through the connection channel between the OPC UA Client and the corresponding OPC UA Server; When a data item changes in the OPC UA Server, the real-time data table of the corresponding device is updated, and the device data change information is pushed to the data bus for upper-layer application systems to subscribe to.
7. A device for monitoring equipment, characterized in that, The device includes: The acquisition module is used to acquire the connection parameters of at least one configured OPC UA Client and the docking parameters for at least one OPC UA Server; the connection parameters include the OPC UA Server information that each OPC UA Client needs to connect to; the docking parameters are configured based on the EAM device ledger to establish a mapping relationship between the device parameters and the data items in the corresponding OPC UA Server; the docking parameters include the mapping relationship between the device parameters of at least one device and the data items in the corresponding OPC UA Server. The processing module is used to create a master node in ZooKeeper as the root node for managing the OPC UA Client cluster, create multiple child nodes, and monitor the status of the child node list in ZooKeeper. When the child node list changes and it is determined that there are inactive server nodes, it sequentially creates an index for each active server node and sequentially numbers the target OPC UA Client running on the inactive server node. For each target OPC UA Client, it performs a division operation between the target OPC UA Client's number and the number of active server nodes, and schedules the target OPC UA Client to run on the corresponding active server node based on the remainder in the calculation result. It also establishes a connection channel between each OPC UA Client and the corresponding OPC UA Server according to the connection parameters of at least one OPC UA Client. The monitoring module is used to trigger each OPC UA Client to load the docking parameters of the corresponding OPC UA Server, and to monitor the device parameters of the at least one device through the connection channel with the corresponding OPC UA Server.
8. A computer device, characterized in that, include: A processor and a memory storing a computer program, wherein when the processor executes the computer program, the steps of the device monitoring method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the device monitoring method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Equipment management method based on OPC UA
CN115190170A