A method, device, equipment and medium for collecting OPCDA protocol data on an Internet of Things platform
By building a non-Windows client to communicate with the OPCDA server, the high cost and complexity issues of Windows systems are resolved, cross-platform data collection and efficient storage are achieved, and it is suitable for data management in the Industrial Internet of Things.
Patent Information
- Application Number
- CN202411532742.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In the existing technology, the data collection of Windows-based OPCDA servers and IoT platforms has the problems of high cost, high professional skills requirements, high system complexity, and difficulty in balancing the real-time and efficiency of data storage.
Build a client running on a non-Windows system, establish a communication connection with the OPCDA server through the OPCDA protocol, convert the data into a format recognizable by the IoT platform, send it to the business end through the message queue, store it in the relational and time series databases, and cancel the connection to release resources.
It realizes cross-platform data collection, reduces development costs, improves system flexibility and stability, and enhances data transmission efficiency and storage capacity. It is suitable for large-scale data processing and management of the Industrial Internet of Things.
Smart Images

Figure CN119544788B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of Internet of Things, and specifically relates to a method, device, equipment and medium for realizing the collection of OPCDA protocol data on an Internet of Things platform. Background Art
[0002] OPCDA is the abbreviation of OPC DA, where OPC is the abbreviation of OLE for Process Control, a set of industrial standard specifications in the field of industrial automation. DA is the abbreviation of Data Access. OPC DA is a component of the OPC standard for real-time data access.
[0003] With the rapid development of the Industrial Internet of Things (IIoT), various embedded devices have been widely used in production. In industrial production control scenarios, data is collected by control servers, many of which are based on Windows systems. Those that communicate using the OPCDA protocol are also called OPCDA servers. To meet the needs of IoT data collection, clients must be developed based on the Windows platform to obtain data from OPCDA servers. Because the data formats of OPCDA servers and IoT platforms differ, middleware is required to convert the data format and then store the converted data in a database. First, while this client approach can directly communicate with the OPCDA server, it requires the OPCDA server and client to be in the same Windows environment. However, developing a client based on the Windows kernel is not only costly but also requires developers to possess high professional skills, resulting in increased human resources costs. Furthermore, sharing the same Windows environment with the client and OPCDA server increases the complexity of the source system and affects operational stability. Second, while middleware can convert data between different formats, its performance and stability hinder the overall data collection performance. Third, traditional databases often struggle to balance real-time performance, storage efficiency, and cost when storing industrial data. Summary of the Invention
[0004] In a first aspect, an embodiment of the present application provides a method for collecting OPCDA protocol data on an Internet of Things platform, comprising the following steps:
[0005] S1. Build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server;
[0006] S2. The client sends a data request to the OPCDA server based on business needs;
[0007] S3. The client converts the data obtained from the OPCDA server into data that can be recognized by the IoT platform based on business needs;
[0008] S4. The client sends the converted data to the business end through the message queue;
[0009] S5. The business end stores the data received from the client in a relational database and a time series database.
[0010] S6. The client requests the OPCDA server to cancel the connection.
[0011] Furthermore, the specific steps of step S1 are as follows:
[0012] S11. Develop clients based on non-Windows kernels;
[0013] S12. Configure the OPCDA server's IP address, port, and connection protocol information on the client;
[0014] S13. The client generates a connection request using the configured IP address, port, and connection protocol information, and converts the connection request into a connection request message in the OPCDA protocol format, and sends the connection request message to the OPCDA server;
[0015] S14. The OPCDA server verifies the received connection request message;
[0016] If the verification passes, proceed to step S15;
[0017] If the verification fails, the connection request is marked as failed and stored in the database, and the information is returned to the client, and the connection is completed;
[0018] S15. Establish a communication connection between the OPCDA server and the client.
[0019] Furthermore, the specific steps of step S2 are as follows:
[0020] S21. The client generates a data request according to business needs, converts the data request into a data request message in the OPCDA protocol format, and sends the data request message to the OPCDA server;
[0021] S22. The OPCDA server identifies whether the corresponding request content exists based on the data request message;
[0022] If yes, go to step S23;
[0023] If not, the OPCDA server does not respond to the client, marks the data request as invalid, stores the information in the database, and returns it to the client;
[0024] S23. The OPCDA server responds to the client and returns a data information message based on the request content to the client.
[0025] Furthermore, the specific steps of step S3 are as follows:
[0026] S31. The client processes the data information returned by the OPCDA server according to business needs and identifies the data type and timestamp;
[0027] S32. The client converts the data type and timestamp into a format recognizable by the IoT platform.
[0028] Furthermore, the specific steps of step S32 are as follows:
[0029] S321. The client identifies the data type;
[0030] If it is numerical data, go to step S322;
[0031] When it is Boolean data, go to step S325;
[0032] If the data is a character string, go to step S326;
[0033] S322. Identify numeric data types;
[0034] If it is an integer, go to step S323;
[0035] When it is a floating point number, go to step S324;
[0036] S323. The client directly maps the data and proceeds to step S327;
[0037] S324. The client rounds the data to two decimal places according to business requirements and proceeds to step S327;
[0038] S325. The client directly maps the data to a Boolean value and proceeds to step S327;
[0039] S326. The client keeps the data in its original form and converts it into the UTF-8 format that complies with the IoT standard.
[0040] S327. The client converts the timestamp in the OPCDA protocol format into the ISO 8601 format recognizable by the IoT platform.
[0041] Furthermore, the specific steps of step S4 are as follows:
[0042] S41. The client constructs an empty JSON object collection, maps each JSON object to the point data returned by the OPCDA server, and fills the data value into the corresponding JSON object's numeric field;
[0043] S42. The client sends the filled JSON object to the message queue, and then sends it to the business end through the message queue.
[0044] Furthermore, the specific steps of step S5 are as follows:
[0045] S51. After receiving the data, the business end identifies the basic information and numerical information of the point data in the JSON object;
[0046] S52. The business end saves the basic information of the point data to a relational database and the numerical information to a time series database, obtaining the stored real-time data and historical data.
[0047] The specific steps of step S6 are as follows:
[0048] S61. The client generates a cancel connection request using the configured IP address, port, and connection protocol information, converts the cancel connection request into a cancel connection request message in the OPCDA protocol format, and sends the cancel connection request message to the OPCDA server.
[0049] S62. The OPCDA server disconnects the communication with the client.
[0050] In a second aspect, an embodiment of the present application further provides a device for enabling an IoT platform to collect OPCDA protocol data, including:
[0051] The communication connection establishment module is used to build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server;
[0052] The data request module is used to send data requests to the OPCDA server based on business needs on the client side;
[0053] The data conversion module is used by the client to convert the data obtained from the OPCDA server into data that can be recognized by the IoT platform according to business needs;
[0054] The data sending module is used to send the converted data from the client to the business end through the message queue;
[0055] The data storage module is used to store the data received from the client into the relational database and time series database on the business side;
[0056] The communication connection disconnection module is used to request the OPCDA server to cancel the connection on the client side.
[0057] In a third aspect, an embodiment of the present application further provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the method for realizing the collection of OPCDA protocol data by the Internet of Things platform as described in the first aspect are implemented.
[0058] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for realizing the collection of OPCDA protocol data by the Internet of Things platform as described in the first aspect are implemented.
[0059] It can be seen from the above technical solutions that the present invention has the following advantages:
[0060] In the method, apparatus, device and medium for realizing the collection of OPCDA protocol data on the Internet of Things platform provided by this application, the client sends a connection request to the server, and the server establishes a communication connection after responding; the client sends a data request to the server and receives the data information sent by the server based on the data request; after receiving the data information sent by the server, the client performs protocol conversion on the data based on business requirements; the client constructs a new JSON object, fills the converted data information into the JSON object, and sends it to the business end via MQTT; after the business end receives the data information sent by MQTT, the data information is saved to the database based on business requirements. By efficiently converting the industrial data information in the OPCDA server into a data format suitable for the Internet of Things platform, the data communication between the industrial system and the Internet of Things application is improved. It improves interaction efficiency, realizes rapid data transmission and sharing, and does not need to maintain the same operating system environment between the client and the OPCDA server, reduces strict dependence on the development environment and hardware, thereby significantly reducing development costs, and reducing dependence on highly professional technical personnel, reducing the occupation of system resources, and improving resource utilization. It is suitable for use in resource-constrained environments. In addition, the time series database improves data storage and reading and writing efficiency, enhances large-scale real-time data processing capabilities, ensures data integrity and consistency, and simplifies data query and retrieval processes. By efficiently converting the data of the OPCDA server into the time series database format, it optimizes data storage in high-frequency acquisition scenarios, ensures the accuracy of time series data and the convenience of analysis, and is particularly suitable for large-scale data processing and management needs in the industrial Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0062] Figure 1 The figure is a flow chart of an embodiment of a method for collecting OPCDA protocol data on an Internet of Things platform implemented by the present invention.
[0063] Figure 2 The figure is a flow chart of another embodiment of the method for collecting OPCDA protocol data on an Internet of Things platform implemented by the present invention.
[0064] Figure 3 This is a schematic diagram of the device for collecting OPCDA protocol data on the Internet of Things platform implemented by the present invention.
[0065] Figure 4 Schematic diagram of an electronic device that stores and implements the method for collecting OPCDA protocol data on an Internet of Things platform according to the present invention. DETAILED DESCRIPTION
[0066] The various embodiments of the present disclosure will be described in more detail below in the specific steps of the method for implementing the collection of OPCDA protocol data by the IoT platform. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather that the present disclosure should be understood to cover all adjustments, equivalents, and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.
[0067] For example, with the rapid development of the Industrial Internet of Things, various embedded devices have been widely used in production and life. In order to meet the needs of the Internet of Things data collection business, it is necessary to develop a client to obtain data information from the open platform communication data interface based on the Windows system, namely the OPCDA server. Generally speaking, if the client wants to obtain data information from the OPCDA server, it needs to ensure that the OPCDA server and the client are in the same Windows system environment, and the OPCDA server cannot achieve remote communication connection. However, developing a client based on the Windows kernel is not only costly, but also requires developers to have high professional skills, resulting in increased labor costs. In addition, the client and the OPCDA server share the same Windows system environment, which also increases the complexity of the source system and affects the stability of its operation.
[0068] To address the above issues, this embodiment provides a method for implementing an IoT platform to collect OPCDA protocol data. This method can efficiently and stably convert data in the OPCDA server into the format required by IoT applications and reliably store it, thereby achieving efficient data transmission and sharing, reducing development difficulties, improving the scalability and stability of the system, and meeting the needs of multi-source data integration and management in the industrial field.
[0069] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0070] See also Figure 1 FIG2 is a flowchart of a method for implementing an Internet of Things platform to collect OPCDA protocol data in a specific embodiment, the method comprising the following steps:
[0071] S1. Build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server;
[0072] It should be noted that the client here is not based on the Windows kernel and is responsible for establishing a communication connection with the OPCDA server to request, receive, convert, and transmit data. The OPCDA server is usually a control system located on the production line, for example, responsible for collecting and storing real-time data from production equipment. The establishment of a communication connection is the basis for subsequent data request, reception, conversion, and transmission.
[0073] S2. The client sends a data request to the OPCDA server based on business needs;
[0074] It should be noted that after the communication connection is established, the client requests data from the OPCDA server based on business needs. The specific business needs involve which data points to collect, such as temperature, pressure, and flow, and the data sampling frequency, such as once per second or once per minute, and request historical data within a specific time period.
[0075] S3. The client converts the data obtained from the OPCDA server into data that can be recognized by the IoT platform based on business needs;
[0076] It should be noted that since the OPCDA server and IoT platform use different data formats and protocols, the client needs to perform data conversion tasks;
[0077] S4. The client sends the converted data to the business end through the message queue;
[0078] It should be noted that message queues can balance system loads, improve system responsiveness and throughput, and distribute requests to different time periods and resources to achieve the effect of peak load shaving and valley filling, thus avoiding system overload caused by sudden peaks. By using message queues as middleware, the coupling between senders and receivers is reduced, allowing for independent evolution and expansion, improving system flexibility and maintainability. They also provide a persistence mechanism to ensure that messages are not lost during the sending and receiving process, and a retry and rollback mechanism to ensure message reliability.
[0079] S5. The business end stores the data received from the client in a relational database and a time series database.
[0080] It should be noted that the time series database adopts a distributed architecture to improve the scalability and fault tolerance of data storage. It packages multiple data points together for writing and sets up a memory cache, which greatly improves writing efficiency. It also has flexible aggregation query capabilities, enabling real-time aggregation calculations while data is being written and saving the aggregation results. When users perform aggregation queries, they can directly obtain pre-calculated results, avoiding the real-time calculation of large amounts of raw data and greatly improving query efficiency.
[0081] S6. The client requests the OPCDA server to cancel the connection.
[0082] It should be noted that after the data request is completed, the connection is canceled to release system resources and improve the overall system.
[0083] By constructing a client running on a non-Windows system, this invention enables cross-platform communication with an OPCDA server, thus overcoming the limitations of Windows systems and improving system flexibility and compatibility. Furthermore, by having the client send data requests to the OPCDA server and converting the acquired data into a format recognizable by the IoT platform, seamless data integration and efficient transmission are achieved, providing strong support for data collection on the IoT platform. Finally, by canceling the connection request, the timely release of communication resources is ensured, improving system stability and resource utilization.
[0084] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for realizing the collection of OPCDA protocol data by the Internet of Things platform is provided, such as Figure 2 As shown, the method includes the following steps:
[0085] The specific steps of step S1 are as follows:
[0086] S11. Develop clients based on non-Windows kernels;
[0087] S12. Configure the OPCDA server's IP address, port, and connection protocol information on the client;
[0088] It should be noted that the client can identify which OPCDA server it needs to connect to through the IP address and port, and the connection protocol is the OPCDA protocol;
[0089] S13. The client generates a connection request using the configured IP address, port, and connection protocol information, and converts the connection request into a connection request message in the OPCDA protocol format, and sends the connection request message to the OPCDA server;
[0090] Where necessary, a connection request message according to the OPCDA protocol includes a request header, a request body, and a checksum field;
[0091] S14. The OPCDA server verifies the received connection request message;
[0092] If the verification passes, proceed to step S15;
[0093] If the verification fails, the connection request is marked as failed and stored in the database, and the information is returned to the client, and the connection is completed;
[0094] S15. Establish a communication connection between the OPCDA server and the client;
[0095] The specific steps of step S2 are as follows:
[0096] S21. The client generates a data request according to business needs, converts the data request into a data request message in the OPCDA protocol format, and sends the data request message to the OPCDA server;
[0097] S22. The OPCDA server identifies whether the corresponding request content exists based on the data request message;
[0098] If yes, go to step S23;
[0099] If not, the OPCDA server does not respond to the client, marks the data request as invalid, stores the information in the database, and returns it to the client;
[0100] It should be noted that the corresponding request content is the requested data point;
[0101] S23. The OPCDA server responds to the client and generates a data information message based on the request content and returns it to the client;
[0102] The specific steps of step S3 are as follows:
[0103] S31. The client processes the data information returned by the OPCDA server according to business needs and identifies the data type and timestamp;
[0104] S32. The client converts the data type and timestamp into a format recognizable by the IoT platform.
[0105] The specific steps of step S4 are as follows:
[0106] S41. The client constructs an empty JSON object collection, maps each JSON object to the point data returned by the OPCDA server, and fills the data value into the corresponding JSON object's numeric field;
[0107] For example, the OPCDA data { "Temperature": 23.5678, "Running": True, "Status": "Operational"} is converted into JSON data as follows:
[0108] { "Temperature": 23.57, "Running": 1, "Status": "Operational", "Timestamp": "2023-10-12T14:30:00Z"};
[0109] S42. The client sends the completed JSON object to the message queue, and then sends it to the business end through the message queue;
[0110] The specific steps of step S5 are as follows:
[0111] S51. After receiving the data, the business end identifies the basic information and numerical information of the point data in the JSON object;
[0112] It should be noted that the basic information of point data includes device name and data type, while the numerical information includes real-time data and historical data for quick access and long-term analysis;
[0113] S52. The business end saves the basic information of the point data to a relational database and the numerical information to a time series database, obtaining the stored real-time data and historical data.
[0114] The specific steps of step S6 are as follows:
[0115] S61. The client generates a cancel connection request using the configured IP address, port, and connection protocol information, converts the cancel connection request into a cancel connection request message in the OPCDA protocol format, and sends the cancel connection request message to the OPCDA server.
[0116] S62. The OPCDA server disconnects the communication with the client.
[0117] In an embodiment of the present invention, based on step S32, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.
[0118] The specific steps of step S32 are as follows:
[0119] S321. The client identifies the data type;
[0120] If it is numerical data, go to step S322;
[0121] When it is Boolean data, go to step S325;
[0122] If the data is a character string, go to step S326;
[0123] S322. Identify numeric data types;
[0124] If it is an integer, go to step S323;
[0125] When it is a floating point number, go to step S324;
[0126] S323. The client directly maps the data and proceeds to step S327;
[0127] S324. The client rounds the data to two decimal places according to business requirements and proceeds to step S327;
[0128] S325. The client directly maps the data to a Boolean value and proceeds to step S327;
[0129] Specifically, “True” in the OPCDA protocol is converted to “1” in the IoT data, and “False” in the OPCDA protocol is converted to “0” in the IoT data;
[0130] S326. The client keeps the data in its original form and converts it into the UTF-8 format that complies with the IoT standard.
[0131] S327. The client converts the timestamp in the OPCDA protocol format into the ISO 8601 format recognizable by the IoT platform.
[0132] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0133] like Figure 3As shown, the following is an embodiment of the device for realizing the collection of OPCDA protocol data by the Internet of Things platform provided by the embodiment of the present disclosure. The device and the method for realizing the collection of OPCDA protocol data by the Internet of Things platform in the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the device for realizing the collection of OPCDA protocol data by the Internet of Things platform, please refer to the embodiment of the method for realizing the collection of OPCDA protocol data by the Internet of Things platform mentioned above.
[0134] The device includes:
[0135] The communication connection establishment module is used to build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server;
[0136] The data request module is used to send data requests to the OPCDA server based on business needs on the client side;
[0137] The data conversion module is used by the client to convert the data obtained from the OPCDA server into data that can be recognized by the IoT platform according to business needs;
[0138] The data sending module is used to send the converted data from the client to the business end through the message queue;
[0139] The data storage module is used to store the data received from the client into the relational database and time series database on the business side;
[0140] The communication connection disconnection module is used to request the OPCDA server to cancel the connection on the client side.
[0141] The device provided in this application for realizing the collection of OPCDA protocol data on the Internet of Things platform improves the data interaction efficiency between the industrial system and the Internet of Things application by efficiently converting the industrial data information in the OPCDA server into a data format suitable for the Internet of Things platform, realizes the rapid transmission and sharing of data, and does not need to maintain the same operating system environment between the client and the OPCDA server, reducing the strict dependence on the development environment and hardware, thereby significantly reducing development costs, and reducing the dependence on highly professional technical personnel, reducing the occupation of system resources, and improving resource utilization. It is suitable for use in resource-constrained environments. In addition, the time series database improves data storage and reading and writing efficiency, enhances large-scale real-time data processing capabilities, ensures data integrity and consistency, and simplifies data query and retrieval processes. By efficiently converting the data of the OPCDA server into the time series database format, it optimizes data storage in high-frequency acquisition scenarios, ensures the accuracy of time series data and the convenience of analysis, and is particularly suitable for large-scale data processing and management needs in the industrial Internet of Things.
[0142] Figure 4A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0143] The method for implementing the Internet of Things platform to collect OPCDA protocol data provided in the embodiment of the present application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiment of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiment of the present invention, the electronic device includes but is not limited to a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.
[0144] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0145] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0146] The above-mentioned electronic device implements the method of the present application for realizing the collection of OPCDA protocol data by the Internet of Things platform. The subject name is constructed and runs on a client of a non-Windows system, establishing a communication connection between the client and the OPCDA server; the client sends a data request to the OPCDA server according to business needs; the client converts the data obtained from the OPCDA server into data recognizable by the Internet of Things platform according to business needs; the client sends the converted data to the business end through a message queue; the business end stores the data received from the client in a relational database and a time series database. The technical solution achieves the goal of efficiently and stably converting the data in the OPCDA server into the format required for the Internet of Things application and reliably storing it, thereby realizing efficient transmission and sharing of data, reducing development difficulty, improving the scalability and stability of the system, and meeting the needs of multi-source data integration and management in the industrial field.
[0147] The storage medium provided in this application stores a program product that can implement a method for collecting OPCDA protocol data on an Internet of Things platform.
[0148] The method for collecting OPCDA protocol data on the IoT platform includes the following steps:
[0149] Build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server;
[0150] The client sends data requests to the OPCDA server based on business needs;
[0151] The client converts the data obtained from the OPCDA server into data that can be recognized by the IoT platform according to business needs;
[0152] The client sends the converted data to the business end through the message queue;
[0153] The business side stores the data received from the client in relational databases and time series databases;
[0154] The client requests the OPCDA server to cancel the connection.
[0155] In some possible implementations, the method disclosed herein for implementing an Internet of Things platform to collect OPCDA protocol data can be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of this specification.
[0156] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0157] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one 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 is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for collecting OPCDA protocol data on an Internet of Things platform, characterized in that: The steps include: S1. Build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server; the specific steps of step S1 are as follows: S11. Develop clients based on non-Windows kernels; S12. Configure the OPCDA server's IP address, port, and connection protocol information on the client; S13. The client generates a connection request using the configured IP address, port, and connection protocol information, and converts the connection request into a connection request message in OPCDA protocol format, and sends the connection request message to the OPCDA server; S14. The OPCDA server verifies the received connection request message; If the verification passes, proceed to step S15; If the verification fails, the connection request is marked as failed and stored in the database, and the information is returned to the client, and the connection is completed; S15. The OPCDA server establishes a communication connection with the client. S2. The client sends a data request to the OPCDA server based on business needs. The specific steps of step S2 are as follows: S21. The client generates a data request according to business needs, converts the data request into a data request message in the OPCDA protocol format, and sends the data request message to the OPCDA server; S22. The OPCDA server identifies whether the corresponding request content exists based on the data request message; If yes, go to step S23; If not, the OPCDA server does not respond to the client, marks the data request as invalid, stores the information in the database, and returns it to the client; S23. The OPCDA server responds to the client and generates a data information message based on the request content and returns it to the client; S3. The client converts the data obtained from the OPCDA server into data that can be recognized by the IoT platform based on business needs. The specific steps of step S3 are as follows: S31. The client processes the data information returned by the OPCDA server according to business needs and identifies the data type and timestamp; S32. The client converts the data type and timestamp into a format recognizable by the IoT platform. The specific steps of step S32 are as follows: S321. The client identifies the data type; If it is numerical data, go to step S322; When it is Boolean data, go to step S325; If the data is a character string, go to step S326; S322. Identify numeric data types; If it is an integer, go to step S323; When it is a floating point number, go to step S324; S323. The client directly maps the data and proceeds to step S327; S324. The client rounds the data to two decimal places according to business requirements and proceeds to step S327; S325. The client directly maps the data to a Boolean value and proceeds to step S327; S326. The client keeps the data in its original form and converts it into the UTF-8 format that complies with the IoT standard. S327. The client converts the timestamp in the OPCDA protocol format into the ISO 8601 format recognizable by the IoT platform; S4. The client sends the converted data to the business end through the message queue. The specific steps of step S4 are as follows: S41. The client constructs an empty JSON object collection, maps each JSON object to the point data returned by the OPCDA server, and fills the data value into the corresponding JSON object's numeric field; S42. The client sends the completed JSON object to the message queue, and then sends it to the business end through the message queue; S5. The business end stores the data received from the client in the relational database and the time series database. The specific steps of step S5 are as follows: S51. After receiving the data, the business end identifies the basic information and numerical information of the point data in the JSON object; S52. The business end saves the basic information of the point data to a relational database and the numerical information to a time series database, obtaining the stored real-time data and historical data. S6. The client requests the OPCDA server to cancel the connection; the specific steps of step S6 are as follows: S61. The client generates a cancel connection request using the configured IP address, port, and connection protocol information, converts the cancel connection request into a cancel connection request message in the OPCDA protocol format, and sends the cancel connection request message to the OPCDA server; S62. The OPCDA server disconnects the communication with the client.
2. A device for collecting OPCDA protocol data on an Internet of Things platform, using the method for collecting OPCDA protocol data on an Internet of Things platform according to claim 1, characterized in that: include: The communication connection establishment module is used to build a client running on a non-Windows system and establish a communication connection between the client and the OPCDA server; The data request module is used to send data requests to the OPCDA server based on business needs on the client side; The data conversion module is used by the client to convert the data obtained from the OPCDA server into data that can be recognized by the IoT platform according to business needs; The data sending module is used to send the converted data from the client to the business end through the message queue; The data storage module is used to store the data received from the client into the relational database and time series database on the business side; The communication connection disconnection module is used to request the OPCDA server to cancel the connection on the client side.
3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for realizing the collection of OPCDA protocol data by the Internet of Things platform as claimed in claim 1 are implemented.
4. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for realizing the collection of OPCDA protocol data by an Internet of Things platform as claimed in claim 1 are implemented.
Citation Information
Patent Citations
Implementation method, device and equipment of industrial internet platform and storage medium
CN117591700A
Cross-platform OPC DA data acquisition system and method based on industrial Internet of Things gateway
CN118316989A