Data acquisition method and system based on Atlas open protocol and electronic equipment
By installing device drivers on the control platform and configuring the Atlas Open Protocol, establishing a long connection and using the heartbeat packet mechanism, the connection stability and timeliness of the Atlas Open Protocol when applied to the EdgeX platform is solved, and the connection stability and timeliness of the Atlas Open Protocol is achieved. More efficient data transmission and processing.
Patent Information
- Application Number
- CN202310707342.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
In the prior art, when the Atlas Open Agreement is applied to the EdgeX platform, there are problems such as connection stability and timeliness due to interface/standard issues.
By installing device drivers on the control platform and configuring the configuration file of the device driver based on the Atlas Open Agreement, a long connection between the control platform and the control device is created, the heartbeat packet mechanism is used to maintain the connection, and the connection status is detected regularly and re-repeated to ensure the stability and timeliness of data transmission.
It effectively improves the connection stability and timeliness between the control platform and the control equipment, improves data transmission efficiency and stability, and ensures real-time event processing and feedback.
Smart Images

Figure CN119155182A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial Internet data collection, and more specifically, to an industrial equipment data collection method based on the Atlas open protocol. In addition, the present application also relates to an industrial equipment data collection system and electronic equipment based on the Atlas open protocol. Background Art
[0002] With the development of industrial Internet of Things, the role of data collection in industrial production management has become increasingly important. In actual industrial production, equipment data collection is one of the important ways to achieve data-driven production. It can obtain the status and performance data of equipment in real time, providing support for the realization of intelligent and automated factories.
[0003] The open protocol is an interface for building applications for remote control or controller data subscription. It is platform-independent and can be implemented on Linux, PLC, printers, and all Windows. At the same time, as a highly flexible and scalable open source edge platform, the EdgeX platform can promote interoperability between IoT edge devices and applications. However, in the existing technology, the Atlas open protocol is applied to the EdgeX platform, which has certain difficulties due to interface / standard issues.
[0004] Therefore, how to provide an industrial equipment data acquisition method based on the Atlas open protocol, which can effectively improve the stability and timeliness of the connection between the control platform and the control equipment, has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides an industrial equipment data acquisition method based on the Atlas open protocol, which can effectively improve the stability and timeliness of the connection between the control platform and the control device. In addition, the present application also relates to an industrial equipment data acquisition system and electronic equipment based on the Atlas open protocol, which also have the above beneficial effects.
[0006] The technical solutions provided by this application are as follows:
[0007] The present application provides an industrial equipment data acquisition method based on the Atlas open protocol, the method comprising the following steps: the control platform is an EdgeX platform; the control platform is connected to a control device through a ProtocolDriver interface; a device driver is installed in the control platform, and a configuration file of the device driver is configured based on the Atlas open protocol, wherein the content of the configuration file includes: a protocol name, a device address, a device port, a connection timeout event processing mechanism, a read timeout event processing mechanism, and a write timeout event processing mechanism; based on the configuration file, a long connection is created between the control platform and the control device; the binary representation of the Atlas open protocol content is converted into a first data structure, and the Atlas open protocol is transmitted in the form of the first data structure; the control device event is subscribed to, and the real-time event related to the subscription fed back by the control device is obtained; the real-time event is processed, and the processing result is sent to the control platform.
[0008] Furthermore, in a preferred embodiment of the present invention, the method further comprises the following steps: regularly detecting the connection status of the long connection, and if the long connection status is abnormal, clearing the connection and reconnecting.
[0009] Furthermore, in a preferred embodiment of the present invention, the "periodic detection of the connection status of the long connection, if the long connection status is abnormal, clearing the connection and reconnecting." specifically includes the following steps: starting a timer in the coroutine, and checking the status of the network connection between the device driver and the control device at regular intervals: if the connection is normal, no processing is performed; if the connection is abnormal or disconnected, the configuration file is used to try to re-establish the connection; if the re-establishment is successful, the connection status is set to normal; if the re-establishment of the connection fails, the connection status is not set, and the next retry cycle is entered.
[0010] Furthermore, in a preferred embodiment of the present invention, the method further comprises the following steps: maintaining the connection between the device driver and the control device based on a heartbeat packet mechanism.
[0011] Furthermore, in a preferred embodiment of the present invention, the heartbeat packet mechanism is as follows: a heartbeat instruction is defined in the Atlas open protocol; when a connection session is established, the device driver periodically sends a heartbeat instruction to the control device; the control device replies with a heartbeat packet to the device driver according to the heartbeat instruction; within a first time threshold, if the device driver does not receive the heartbeat packet, the device driver disconnects from the control device; within a second time threshold, if the control device does not receive the heartbeat instruction, the control device disconnects from the device driver.
[0012] Furthermore, in a preferred embodiment of the present invention, the step of "sending the processing results to the control platform" specifically includes the following steps: assembling the processing results into a unified format file required by the EdgeX platform, and sending it to the EdgeX platform; and the EdgeX platform performing subsequent processing on the processing results.
[0013] Furthermore, in a preferred embodiment of the present invention, the method further comprises the following steps: defining an interface of the EdgeX platform.
[0014] Furthermore, in a preferred embodiment of the present invention, the “creating a long connection between the control platform and the control device based on the configuration file” specifically includes the following steps: the EdgeX platform reads the configuration file and establishes a long connection with the control device; if the configuration file reading fails, an error log is recorded and network initialization is suspended; if the configuration file reading is successful, the connection state is set to initialized, and the device name is used as the key and the network connection is used as the value, and saved in a coroutine-safe hash table.
[0015] In addition, the present application also provides an industrial equipment data acquisition system based on the Atlas open protocol, which is used to execute the above-mentioned industrial equipment data acquisition method based on the Atlas open protocol, and the system includes: a control platform, which is an EdgeX platform; a device driver installed on the EdgeX platform, and the device driver includes a first execution module, a second execution module, a third execution module, a fourth execution module, and a fifth execution module; the first execution module is used to install the device driver in the control platform and configure the configuration file of the device driver based on the Atlas open protocol; the second execution module is used to create a long connection between the control platform and the control device based on the configuration file; the third execution module is used to convert the binary representation of the Atlas open protocol content into a first data structure, and the Atlas open protocol is transmitted in the form of the first data structure; the fourth execution module is used to subscribe to the control device event and obtain the real-time event related to the subscription fed back by the control device; the fifth execution module is used to process the real-time event and send the processing result to the control platform.
[0016] In addition, the present application also provides an electronic device, including: a computer program, the computer program is used to execute the above-mentioned industrial equipment data acquisition method based on the Atlas open protocol; a memory, the memory is used to store the computer program; and a processor, the processor is used to execute the computer program.
[0017] The present invention provides an industrial equipment data acquisition method based on the Atlas open protocol. Compared with the prior art, in this technical solution, by installing a new device driver on the control platform, the control platform can be digitally connected to the industrial control device based on the Atlas open protocol. Further, when installing the device driver, the configuration file is defined so that the control platform can better control the control device. Further, through the technical solution of the present application, the Atlas open protocol is transmitted between the control platform and the control device in the form of a first data structure in the device driver, thereby improving the transmission efficiency. Further, after establishing a long connection, the event of the control device is subscribed through instructions, so that the device driver can timely check the real-time events fed back by the control device; thereby promoting the processing of real-time events and improving the efficiency and stability of data transmission sent to the control platform. The technical solution provided by the present application can effectively improve the stability and timeliness of the connection between the control platform and the control device. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram of a process flow of an industrial equipment data collection method based on the Atlas open protocol provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a method flow node based on timer-based scheduled reconnection provided by an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of the structure of an industrial equipment data acquisition system based on the Atlas open protocol provided by an embodiment of the present invention;
[0022] Figure 4 An architectural diagram of the edgex platform provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of this application.
[0025] It should be noted that when an element is referred to as being "fixed on" or "set on" another element, it can be directly on the other element or indirectly set on the other element; when an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0026] It should be understood that the terms "length", "width", "up", "down", "front", "back", "first", "second", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0027] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0028] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.
[0029] like Figures 1 to 4As shown, the industrial equipment data acquisition method based on the Atlas open protocol provided in the embodiment of the present application, the control platform is the EdgeX platform; the control platform is connected to the control device through the ProtocolDriver interface; the device driver is installed in the control platform, and the configuration file of the device driver is configured based on the Atlas open protocol, and the content of the configuration file includes: protocol name, device address, device port, connection timeout event processing mechanism, read timeout event processing mechanism, write timeout event processing mechanism; based on the configuration file, a long connection is created between the control platform and the control device; the binary representation of the Atlas open protocol content is converted into a first data structure, and the Atlas open protocol is transmitted in the form of the first data structure; the control device event is subscribed to obtain the real-time event related to the subscription fed back by the control device; the real-time event is processed and the processing result is sent to the control platform.
[0030] The present invention provides a technical solution for an industrial equipment data acquisition method based on the Atlas open protocol. In the technical solution, by installing a new device driver on the control platform, the control platform can be digitally connected to the industrial control device based on the Atlas open protocol. Further, when installing the device driver, the configuration file is defined so that the control platform can better control the control device. Further, through the technical solution of the present application, the Atlas open protocol is transmitted between the control platform and the control device in the form of a first data structure in the device driver, thereby improving the transmission efficiency. Further, after establishing a long connection, the event of the control device is subscribed through instructions, so that the device driver can timely check the real-time events fed back by the control device; thereby promoting the processing of real-time events and improving the efficiency and stability of data transmission sent to the control platform. The technical solution provided by the present application can effectively improve the stability and timeliness of the connection between the control platform and the control device. In addition, the present application also relates to an industrial equipment data acquisition system and electronic device based on the Atlas open protocol, which also have the above-mentioned beneficial effects.
[0031] It is necessary to add that, if Figure 4 This is the architecture diagram of the EdgeX platform. EdgeX Foundry is an open source, customizable, and scalable open Internet of Things (IoT) edge computing platform that aims to provide a unified, standardized interface for IoT devices and applications to facilitate interoperability between devices, data, and applications. EdgeX Foundry is a cross-industry, cross-domain open source community project initiated and managed by the Linux Foundation.
[0032] It should be further explained that the first data structure includes two structures: an AsyncValues structure and a CommandValue structure, which are used to asynchronously send read values between device services.
[0033] Specifically, the AsyncValues structure is used to represent the device read value sent asynchronously by the protocol driver. It contains a device name, a source name, and a slice of CommandValues, where CommandValues represents the read value.
[0034] Specifically, the CommandValue structure represents the read value returned by the Get command or the parameter sent to the protocol driver by the Put command. This structure contains the following fields:
[0035] DeviceResourceName: the device resource name of the instruction;
[0036] Type: Indicates the type of value returned from the ProtocolDriver instance;
[0037] Value: contains the value returned by the ProtocolDriver instance;
[0038] Origin: An int64 value identifying the read time contained in CommandValue;
[0039] Tags: Allows device services to add custom information to events before they are sent to NorthSide.
[0040] By using these two structures, the device service can easily send read values asynchronously between components, thereby speeding up the processing of the device service.
[0041] Specifically, in an embodiment of the present invention, the method further includes the following steps: regularly detecting the connection status of the long connection, and if the long connection status is abnormal, clearing the connection and reconnecting.
[0042] It should be noted that by setting a timer in the system to control the timed detection of the connection status of the long connection, if a connection abnormality is found, the connection can be reconnected as soon as possible to improve the stability of the connection between the control platform and the sweeping equipment.
[0043] Specifically, in an embodiment of the present invention, the "periodic detection of the connection status of the long connection, if the long connection status is abnormal, clearing the connection and reconnecting." specifically includes the following steps: starting a timer in the coroutine, and checking the status of the network connection between the device driver and the control device at regular intervals: if the connection is normal, no processing is performed; if the connection is abnormal or disconnected, the configuration file is used to try to re-establish the connection; if the re-establishment is successful, the connection status is set to normal; if the re-establishment of the connection fails, the connection status is not set, and the next retry cycle is entered.
[0044] It should be noted that, specifically in the coroutine, the timer is started to periodically check the connection status of the device driver and the control device. When an abnormal connection is found, reconnection is performed through the configuration file; if the reconnection fails, a retry cycle is entered to improve the reliability of the reconnection.
[0045] Specifically, in an embodiment of the present invention, the method further includes the following steps: maintaining the connection between the device driver and the control device based on a heartbeat packet mechanism.
[0046] Specifically, in an embodiment of the present invention, the heartbeat packet mechanism is: a heartbeat instruction is defined in the Atlas open protocol, and when a connection session is established, the device driver periodically sends a heartbeat instruction to the control device; the control device replies with a heartbeat packet to the device driver according to the heartbeat instruction; within a first time threshold, if the device driver does not receive the heartbeat packet, the device driver disconnects from the control device; within a second time threshold, if the control device does not receive the heartbeat instruction, the control device disconnects from the device driver.
[0047] It should be noted that the heartbeat packet mechanism can ensure in real time that the device driver and the control device are in an effectively connected state. When one party is temporarily disconnected, the other party is automatically disconnected.
[0048] Specifically, in an embodiment of the present invention, the "sending the processing results to the control platform" specifically includes the following steps: assembling the processing results into a unified format file required by the EDGEX platform, and sending it to the EDGEX platform; the EDGEX platform performs subsequent processing on the processing results.
[0049] It should be noted that, through the use of unified format files, the transmission of processing results can be accelerated and the processing efficiency of the control platform can be improved.
[0050] Specifically, in an embodiment of the present invention, the method further includes the following steps: defining the interface of the EDGEX platform.
[0051] It should be further explained that the EDGEX platform is defined through the ProtocolDriver interface. The functions of the ProtocolDriver interface include but are not limited to: initializing device services (Initialize), processing read commands (HandleReadCommands), processing write commands (HandleWriteCommands), shutting down device services (Stop), adding new devices (AddDevice), updating existing devices (UpdateDevice) and deleting devices (RemoveDevice).
[0052] Specifically, the ProtocolDriver interface functions are explained as follows:
[0053] The Initialize() interface is used to initialize the protocol-specific part of the device service, passing a logger, an asynchronous value channel, and a discovery device channel.
[0054] The HandleReadCommands() interface is used to handle command requests for read operations. It will pass a device named deviceName, multiple protocols, and a list of command requests to it. Then, it will return the slice and error returned by the command request.
[0055] The HandleWriteCommands() interface is used to process command requests for write operations. It is very similar to the HandleReadCommands() method, except that it requires configuration operations on parameters.
[0056] The Stop() interface is used to shut down the device services related to the protocol. If the force parameter is true, the service will be shut down directly, otherwise it will be shut down gracefully.
[0057] The AddDevice() interface is used to add a new device to the device service and pass the device's name, protocol information, and management status to it.
[0058] The UpdateDevice() interface is used to update the detailed information of an already added device.
[0059] The RemoveDevice() interface is used to remove a device from the device service.
[0060] Specifically, in an embodiment of the present invention, the "creating a long connection between the control platform and the control device based on the configuration file" specifically includes the following steps: the EDGEX platform reads the configuration file to establish a long connection with the control device; if the configuration file reading fails, an error log is recorded and network initialization is suspended; if the configuration file is read successfully, the connection status is set to initialized, and the device name is used as the key and the network connection is used as the value, and saved in a coroutine-safe hash table.
[0061] It should be noted that in the specific connection process, a direct connection is first made by reading the configuration file. If the configuration file reading fails, an error log is recorded and the network initialization is paused. After the configuration file is successfully read, the device name and the network connection value are saved in a coroutine-safe hash table to facilitate the management of the network connection.
[0062] The present application also provides an industrial equipment data acquisition system based on the Atlas open protocol, which is used to execute the above-mentioned industrial equipment data acquisition method based on the Atlas open protocol, and the system includes: a control platform, which is an EDGEX platform; a device driver installed on the EDGEX platform, and the device driver includes a first execution module, a second execution module, a third execution module, a fourth execution module, and a fifth execution module; the first execution module is used to install the device driver in the control platform, and configure the configuration file of the device driver based on the Atlas open protocol; the second execution module is used to create a long connection between the control platform and the control device based on the configuration file; the third execution module is used to convert the binary Atlas open protocol content into a first data structure, and the Atlas open protocol is transmitted in the form of the first data structure; the fourth execution module is used to subscribe to the control device event, and obtain the real-time event related to the subscription fed back by the control device; the fifth execution module is used to process the real-time event and send the processing result to the control platform. The present application also relates to an industrial equipment data acquisition system based on the Atlas open protocol, which also has the above-mentioned beneficial effects.
[0063] The present application also provides an electronic device, comprising: a computer program, the computer program is used to execute the above-mentioned industrial equipment data acquisition method based on the Atlas open protocol; a memory, the memory is used to store the computer program; and a processor is used to execute the computer program. The present application also relates to an electronic device, which also has the above-mentioned beneficial effects.
[0064] It should be noted that the specific embodiments of the present application are:
[0065] The solution of this application involves the device driver of the EDGEX platform. First, the configuration file of the device driver is defined, including the protocol name, device address, device port, connection timeout event processing mechanism, read timeout event processing mechanism, and write timeout event processing mechanism. Then, the PROTOCOLDRIVER interface of the EDGEX platform is implemented through the device driver.
[0066] Next, use the configuration file in the first step to create a persistent connection between the device driver and the control device. In addition, start a timer in the coroutine to detect the status of the persistent connection. If the status is abnormal, clear the connection and reconnect.
[0067] Furthermore, the device driver converts the binary representation of the Atlas open protocol into a specific structure through protocol parsing. The device driver subscribes to events and processes the received events differently. The device driver sends a heartbeat packet to maintain the connection between the device driver and the device. The device driver assembles the results into a unified format of EDGEX and sends it to EDGEX for subsequent processing.
[0068] It should be noted that for the reconnection logic: Since this device driver is actually running as a resident process in production and involves network connection, it is necessary to consider uncontrollable situations such as network instability, network disconnection, power outage, etc. This function is essential to reduce manpower operation and maintenance, and can also improve stability and user experience.
[0069] It should be noted that the beneficial effect of the present invention is that the present invention provides a universal component supporting the Atlas open protocol to meet the control and monitoring of equipment using the Atlas open protocol in industrial sites. When such equipment has data that needs to be collected, the data can be easily collected by combining EDGEX and the Atlas open protocol component defined in the present invention.
[0070] Using Example 1, the device driver is implemented using the programming language GOLANG.
[0071] First, determine the interface defined by the EDGEX platform. The EDGEX will automatically call the INITIALIZE function to start the execution of the driver.
[0072] Next, read the configuration file defined by the EDGEX platform and establish a network connection with the device.
[0073] If the configuration reading fails, an error is printed in the log and the network connection initialization is exited. At this time, the connection state does not need to be set. If the configuration reading succeeds, the connection state is set to initialized. The device name is used as the key and the network connection is used as the value to save it in a coroutine-safe hash table.
[0074] The establishment of the network connection uses Package net to provide a portable interface for network I / O. This step uses NET.DIAL("TCP","192.168.2.100:4545"), where 192.168.2.100 is the device IP address and 4545 is the default port of the Atlas open protocol.
[0075] For further reconnection, start the timer in the coroutine and check the status of the network connection with the device at regular intervals. If the connection is normal, no processing is done; if the connection is abnormal or disconnected, try to reestablish the connection using the configuration file; if the reestablishment is successful, set the connection status to normal; if the reestablishment fails, the connection status is not set and enters the next retry cycle.
[0076] Furthermore, the timer provides the function of measuring and displaying time according to the Package time.
[0077] Further, according to the requirements of the Atlas Open Protocol, a connection establishment instruction is sent to the control device. If the device responds normally, the connection state is set to connected, which is called a successful connection establishment. The connection establishment instruction is a message of the MI D 0001 type in the Atlas Open Protocol.
[0078] Further processing of heartbeat packets. The Atlas Open Protocol defines a heartbeat instruction. When a connection session is established, the driver will send a heartbeat instruction, and the device will reply to the heartbeat instruction. The heartbeat packet can ensure that both parties of the connection maintain a normal connection. When the heartbeat packet is not received for a period of time, the device driver can disconnect the connection with the device. Similarly, if the device driver does not send a heartbeat packet, the device will also disconnect the connection. The heartbeat instruction is a MI D 9999 type message in the Atlas Open Protocol.
[0079] For further event subscription, the device driver can send a subscription instruction at any time to subscribe to the event, and different types of events use different subscription instructions; and for canceling event subscription, the device driver can cancel the subscription event, which corresponds one to one with the subscription instruction.
[0080] Further event confirmation requires confirmation every time a subscribed event is received; similarly, event confirmation instructions also correspond one-to-one to event subscriptions.
[0081] In further protocol analysis, the Atlas Open Protocol defines the message end character 0X00, so it can be directly read using only READBYTES("0X00") defined in BUFIO; then, different MIDs in the message header are processed differently according to the protocol.
[0082] Further protocol encapsulation, the encapsulation protocol is to package the structure into a binary representation, which is the inverse operation of protocol parsing; the protocol can be sent to the device only after encapsulation is completed. When the device reports an event, it needs to use the encapsulated binary representation to reply.
[0083] For further event processing, when the device driver receives a message of the event type, it will reply to the device with an event confirmation message that complies with the Atlas Open Protocol.
[0084] Finally, the valid data is extracted from the received message, assembled into the unified format of the EdgeX platform, and sent to the EdgeX platform. According to the interface definition of the EdgeX platform, the data will be sent to ASYNCCH CHAN<-*ASYNCVALUES, and then processed by the EdgeX platform.
[0085] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An industrial equipment data collection method based on the Atlas open protocol, characterized in that: The method includes: The control platform is an EdgeX platform, and the control platform is connected to the control device through a ProtocolDriver interface; Install the device driver in the control platform, and configure the configuration file of the device driver based on the Atlas open protocol, wherein the content of the configuration file includes: protocol name, device address, device port, connection timeout event processing mechanism, read timeout event processing mechanism, and write timeout event processing mechanism; Based on the configuration file, a long connection is created between the control platform and the control device; Converting the binary representation of the Atlas Open Protocol content into a first data structure, wherein the Atlas Open Protocol is transmitted in the form of the first data structure; Subscribe to the control device events and obtain the real-time events related to the subscription fed back by the control device; The real-time event is processed and the processing result is sent to the control platform.
2. The industrial equipment data collection method based on the Atlas open protocol according to claim 1 is characterized in that: The method further comprises the following steps: The connection status of the long connection is detected regularly. If the long connection status is abnormal, the connection is cleared and reconnected.
3. The industrial equipment data collection method based on the Atlas open protocol according to claim 2 is characterized in that: The "regularly detecting the connection status of the long connection, and if the long connection status is abnormal, clearing the connection and reconnecting." specifically includes the following steps: Start a timer in the coroutine to check the status of the network connection between the device driver and the control device at regular intervals: If the connection is normal, no processing is done; If the connection is abnormal or disconnected, try to re-establish the connection using the configuration file; If the re-establishment is successful, the connection status is set to normal; If the reconnection fails, the connection status is not changed and the next retry cycle begins.
4. The industrial equipment data collection method based on the Atlas open protocol according to claim 1 is characterized in that: The method further comprises the following steps: Based on the heartbeat packet mechanism, the connection between the device driver and the control device is maintained.
5. The industrial equipment data collection method based on the Atlas open protocol according to claim 4 is characterized in that: The heartbeat packet mechanism is: A heartbeat command is defined in the Atlas open protocol. When a connection session is established, the device driver periodically sends a heartbeat command to the control device. The control device replies a heartbeat packet to the device driver according to the heartbeat instruction; If the device driver does not receive the heartbeat packet within the first time threshold, the device driver disconnects from the control device; If the control device does not receive the heartbeat instruction within the second time threshold, the control device disconnects from the device driver.
6. The industrial equipment data collection method based on the Atlas open protocol according to any one of claims 1 to 5, characterized in that: The "sending the processing results to the control platform" specifically includes the following steps: Assemble the processing results into a unified format file required by the EdgeX platform and send it to the EdgeX platform; The EdgeX platform performs subsequent processing on the processing result.
7. The industrial equipment data collection method based on the Atlas open protocol according to any one of claims 1 to 5, characterized in that: The method further comprises the following steps: The interface of the EdgeX platform is defined.
8. The industrial equipment data collection method based on the Atlas open protocol according to any one of claims 1 to 5, characterized in that: The “creating a long connection between the control platform and the control device based on the configuration file” specifically includes the following steps: The EdgeX platform reads the configuration file and establishes a persistent connection with the control device; If the configuration file fails to be read, an error log is recorded and network initialization is suspended; If the configuration file is read successfully, the connection state is set to initialized, and the device name is used as the key and the network connection is used as the value, which are saved in a coroutine-safe hash table.
9. The industrial equipment data acquisition system based on the Atlas open protocol is characterized by: The system is used to execute the industrial equipment data collection method based on the Atlas open protocol as described in any one of claims 1 to 8, and the system includes: A control platform, wherein the control platform is an EdgeX platform; A device driver installed on the EdgeX platform, the device driver comprising a first execution module, a second execution module, a third execution module, a fourth execution module, and a fifth execution module; The first execution module is used to install a device driver in the control platform and configure a configuration file of the device driver based on the Atlas open protocol; The second execution module is used to create a long connection between the control platform and the control device based on the configuration file; The third execution module is used to convert the binary Atlas open protocol content into a first data structure, and the Atlas open protocol is transmitted in the form of the first data structure; The fourth execution module is used to subscribe to the control device event and obtain the real-time event related to the subscription fed back by the control device; The fifth execution module is used to process the real-time event and send the processing result to the control platform.
10. An electronic device, characterized in that include: A computer program, the computer program being used to execute the industrial equipment data collection method based on the Atlas open protocol as described in any one of claims 1 to 8; A memory, the memory being used to store the computer program; A processor is used to execute the computer program.
