Data communication method and device for DCS computing software and external device, and storage medium

Through the hierarchical architecture of the management program and kernel program and multi-threaded processing, the data communication problem between DCS computing software and external devices is solved, efficient and stable communication capabilities are achieved, the system flexibility and scalability are improved, and the hardware cost and maintenance complexity are reduced.

CN120263832APending Publication Date: 2025-07-04XIAN THERMAL POWER RES INST CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510403877.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The data communication problem between DCS computing software and external devices makes it difficult to achieve seamless docking, limiting its flexibility and scalability.

Method used

The hierarchical architecture of the hypervisor and the kernel program is adopted to realize two-way data communication through the sending thread and the receiving thread. Combining read, write, alarm and heartbeat interfaces, the message header is filled and the sending buffer is used to ensure the accuracy and stability of data transmission.

Benefits of technology

It realizes efficient and stable communication between DCS computing software and external devices, optimizes resource allocation, enhances system flexibility and scalability, reduces hardware costs and maintenance complexity, and supports seamless replacement of multiple pairs of controller functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263832A_ABST
    Figure CN120263832A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, in particular to a data communication method and device for DCS computing software and external equipment, and a storage medium. A hierarchical architecture of a management program and kernel programs is adopted, the management program constructs a communication interface used for simulating communication of a DCS controller, a forwarding interface is constructed between the management program and at least one kernel program, and transmission between the communication interface and the forwarding interface is achieved through a sending thread and a receiving thread; under the architecture of the management program, a plurality of DCS computing software can be created and managed, so that the communication capability between the DCS computing software and the external equipment is improved, the resource allocation is optimized, each DCS can efficiently run in a virtual environment, and the flexibility and expandability of the system are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and particularly to a data communication method, device, and storage medium for a DCS calculation software and an external device. Background Art

[0002] The distributed control system (DCS) is the nerve center of power generation production. The DCS was first applied to thermal power plants. With the introduction of new energy power, the DCS has gradually been applied to power plants of energy forms such as hydropower and wind power to meet the power plants' demand for precise and reliable control. Traditional physical DCS controllers are difficult to meet the requirements of modern industrial production for flexibility, efficiency, and cost control due to problems such as high cost and poor scalability. With the increasing demand for industrial production and intelligence, virtual DCS controllers based on calculation software have become an important development direction. They simulate the core functions of physical controllers through algorithms, significantly reducing the hardware input cost and achieving low-cost and highly scalable industrial automation control.

[0003] However, the data communication problem between the DCS calculation software and external devices has always been a key issue restricting its wide application. Most traditional DCSs rely on specific hardware interfaces and proprietary or standardized communication protocols. For example, specific interfaces (such as RS-232, RS-485, Ethernet) and communication protocols (such as Modbus, PROFIBUS, EtherCAT, etc.) are used, making it difficult to achieve seamless docking between the DCS calculation software and external devices and restricting the flexibility and scalability of the DCS calculation software. Summary of the Invention

[0004] Aiming at the problems mentioned in the prior art, the present invention proposes a data communication method, device, and storage medium for a DCS calculation software and an external device, which can efficiently and stably achieve data communication between the DCS calculation software and external data through a hierarchical architecture of a management program and a kernel program.

[0005] To achieve the above object, the present invention adopts the following technical solutions: A data communication method for a DCS calculation software and an external device of the present invention adopts a hierarchical architecture of a management program and a kernel program. The management program constructs a communication interface for simulating DCS controller communication, and a forwarding interface is constructed between the management program and at least one kernel program. Transmission between the communication interface and the forwarding interface is realized through a sending thread and a receiving thread. The data communication method includes: The receiving thread of the management program communication interface obtains a message from an external device, fills in the message header based on a preset communication format, and sends it to the kernel program through the sending thread of the communication interface; The receiving thread of the forwarding interface receives the message sent by the kernel program and sends it to the external device through the sending thread of the forwarding interface.

[0006] As a further improvement of the present invention, the communication interface includes a read interface, a write interface, an alarm interface, and a heartbeat interface.

[0007] As a further improvement of the present invention, the sending thread and the receiving thread run independently to achieve two-way data communication between the management program and the kernel program.

[0008] As a further improvement of the present invention, the filled message header includes: Extract the address information of the kernel program; Calculate the data length and check code of the message, and write the address information, data length, and check code into the message header.

[0009] As a further improvement of the present invention, after filling the message header, the filled message is pushed into the sending buffer of the communication interface and scanned in real time by the sending thread of the communication interface, and the message is sent to the kernel program according to the information in the message header.

[0010] As a further improvement of the present invention, after the receiving thread of the forwarding interface receives the message sent by the kernel program, the message is written into the sending buffer of the forwarding interface according to the information in the message header and scanned in real time by the sending thread of the forwarding interface, and the message is sent to the external device.

[0011] As a further improvement of the present invention, the sending buffer manages the messages in a first-in, first-out manner.

[0012] As a further improvement of the present invention, the message sent by the sending thread of the forwarding interface to the external device needs to clear the message header.

[0013] A terminal device, the terminal device includes a processor and a memory connected to the processor; the memory is used to store program data, and the processor is used to execute the program data to implement the method as described above.

[0014] A computer storage medium, the computer storage medium is used to store program data, and the program data, when executed by a processor, is used to implement the method as described above.

[0015] The present invention has achieved the following technical effects compared with the prior art: Under the management program architecture of the present invention, multiple DCS computing software can be created and managed, enhancing the communication ability between the DCS computing software and external devices. It not only optimizes resource allocation, enabling each DCS to operate efficiently in a virtual environment, but also enhances the flexibility and scalability of the system. Through this method, only a pair of hosts can be used to replace the functions of multiple pairs of controllers, effectively reducing the hardware costs, energy consumption, and maintenance complexity brought by the one-to-one controller configuration in the traditional mode.

[0016] The full compatibility of the communication method of the present invention with the existing DCS network communication protocol means that the DCS computing software can be seamlessly deployed without the need to transform and upgrade the existing DCS infrastructure. Through this compatibility, seamless connection with various external industrial devices can be achieved, promoting the improvement of the industrial automation level.

[0017] In order to improve the efficiency and stability of data communication, the present invention adopts a multi-threaded processing and buffer mechanism. The separate design of the sending thread and the receiving thread effectively avoids problems in the data processing process, ensuring the continuous smoothness of the data stream. At the same time, the sending buffer follows the first-in, first-out principle, which not only optimizes the data transmission order but also reduces the risk of data loss and disorder, guaranteeing the real-time and accuracy of the data.

[0018] The present invention also has fault detection and automatic recovery measures. Once a communication link interruption or data anomaly is detected, the system will immediately start the fault recovery process, attempt to reconstruct the connection or adopt an alternative communication path to minimize the impact on production operations, realizing the protection of data transmission and storage and ensuring the security and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic flowchart of the data communication method of the present invention; Figure 2 It is a schematic structural diagram of an embodiment of the terminal device of the present invention; Figure 3 It is a schematic structural diagram of an embodiment of the computer storage medium of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] In the following, only some exemplary embodiments are simply described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the spirit or scope of the present invention. Therefore, the drawings and the description are considered to be exemplary in nature rather than restrictive.

[0021] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying 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 construed as a limitation of the present invention.

[0022] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.

[0023] In the present invention, unless otherwise clearly specified and defined, the terms "mounted", "connected", "coupled", "fixed", etc. should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection, an electrical connection, or a communication connection; it may be directly connected, or indirectly connected through an intermediate medium, and may be the internal communication of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0024] In the present invention, unless otherwise clearly specified and defined, the first feature being "on" or "under" the second feature may include the first and second features being in direct contact, or may include the first and second features not being in direct contact but in contact through additional features therebetween. Moreover, the first feature being "above", "over" and "on" the second feature includes the first feature being directly above and obliquely above the second feature, or merely indicating that the first feature has a higher horizontal height than the second feature. The first feature being "under", "beneath" and "under" the second feature includes the first feature being directly below and obliquely below the second feature, or merely indicating that the first feature has a lower horizontal height than the second feature.

[0025] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0026] It should also be understood that the terms used in the specification of the present invention are merely for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0027] It should be further understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0028] Schematic diagrams of various structures according to the disclosed embodiments of the present invention are shown in the drawings. These figures are not drawn to scale, where for the purpose of clear expression, some details are enlarged and some details may be omitted. The shapes of various regions and layers shown in the figures and their relative sizes and positional relationships are merely exemplary, and may actually deviate due to manufacturing tolerances or technical limitations, and those skilled in the art can design regions / layers with different shapes, sizes and relative positions according to actual needs.

[0029] As Figure 1 shown, it should be noted that Figure 1 the noun relationships, including the Manager (management program), Calculation (kernel program), Send (send thread), and Recv (receive thread).

[0030] The embodiments of the present invention will be described in detail below with reference to the drawings.

[0031] The present invention provides a data communication method between a DCS calculation software and an external device, adopting a hierarchical architecture of a management program and a kernel program, as Figure 1 shown in the flowchart. Step 1: Start the management program for simulating a physical DCS controller and create multiple communication interfaces, including a read interface, a write interface, an alarm interface, and a heartbeat interface, to achieve data exchange with an external device.

[0032] The read interface is configured to receive a status query instruction from an external device; the write interface is configured to send a control instruction to the external device; the alarm interface collects device exception signals in real time and generates an alarm message; the heartbeat interface sends a link detection signal at a preset period (for example, 300 - 500 ms); the heartbeat interface in the embodiment can monitor the status of each node, ensuring the status of the communication connection; the alarm interface in the embodiment can transmit alarm information in real time, ensuring that the system can receive an alarm notification in the first time, and at the same time setting an alarm threshold, which can accurately identify and trigger alarm conditions, reducing the occurrence of false alarms and missed protections.

[0033] Step 2: Create a forwarding interface. In the embodiment, the forwarding interface is used to establish a communication connection between the hypervisor and the kernel program software. The forwarding interface and the communication interface achieve transmission through a sending thread and a receiving thread. In the embodiment, the sending thread and the receiving thread run independently, thus realizing two-way data communication between the hypervisor and the kernel program software.

[0034] Step 3: When an external device sends a data packet, the receiving thread of the communication interface between the hypervisor and the external device is responsible for receiving these packets. After receiving the packets, the hypervisor will fill the corresponding packet header information for the packets according to the communication format defined with the kernel program software. In the embodiment, the packet header information includes parameters such as the target kernel program software address, data length, checksum, etc., to ensure that the packets can be accurately forwarded to the target kernel program software.

[0035] In the embodiment, the target kernel program software address is used to specify the kernel program to which the packet is sent, avoiding mistransmission or loss of packets, and improving the accuracy and reliability of data transmission. Preferably, the physical address and logical address of the target kernel program software are mapped through a hash table; the data length indicates the actual length of the data, and the kernel program can accurately parse according to the actual length of the data, avoiding parsing errors or data loss caused by unclear data length; the checksum generally uses the cyclic redundancy check algorithm, which can detect possible errors in the data packet during transmission, thus reducing the risk of data corruption or loss caused by transmission errors.

[0036] Step 4: After the packet is filled, the receiving thread of the communication interface will push the packet into the sending buffer of the forwarding interface. In the embodiment, the sending buffer serves to temporarily store the packets, ensuring that the packets will not be lost or disordered during the sending process. At the same time, the sending buffer also adopts the first-in-first-out (FIFO) principle, which requires that the packets that enter first are processed first, and the packets that enter later are processed later, ensuring the coherence and consistency of packet processing, avoiding the problem of packet out-of-order, and at the same time, an appropriate queue length needs to be set, which helps to reduce the delay caused by packet waiting for processing, so as to balance the delay and packet loss rate.

[0037] Step 5: The sending thread of the forwarding interface will scan the content in the sending buffer. When it finds that there are new packets to be sent, the sending thread of the forwarding interface will accurately send the packets to the corresponding kernel program software according to the target kernel program software address in the packet header. At the same time, the sending thread will also monitor and manage the sending process to ensure the real-time and accuracy of the packets.

[0038] In the embodiment, the sending thread can monitor the status of the sending process in real time, including information such as sending speed, sending progress, error rate, etc. According to this information, the sending strategy can be dynamically adjusted, such as adjusting the sending speed, retry mechanism, etc., which improves the flexibility and adaptability of the sending process; at the same time, the sending thread can automatically perform recovery operations when a fault is detected during the sending process, such as retrying the sending or switching the sending channel, ensuring the stability and reliability of the sending process.

[0039] Step 6: When the kernel program needs to send a message, the kernel program will send the message to the receiving thread of the forwarding interface; when the receiving thread receives the message, it will write the message into the sending buffer corresponding to the communication interface with the external device according to the information in the message header. The sending thread of the forwarding interface will scan the content in the sending buffer. When it finds that there is a new message to be sent, the sending thread of the forwarding interface will accurately send the message to the corresponding external device according to the information in the message header. In addition, during the process of transmitting to the external device, it is necessary to clear the filling format to avoid interfering with the processing of the target device. This not only reduces the size of the message, reduces the time and bandwidth required for transmission, effectively improves the communication efficiency, but also helps to reduce the error rate during the communication process and ensures that the data can accurately reach the target device.

[0040] The present invention provides an efficient, stable and compatible method for DCS computing software to communicate with external data. By adopting the architecture of kernel program + management program and the multi-thread processing mechanism, the efficient and stable communication between the DCS computing software and external devices is realized. The present invention has broad application prospects and important practical significance in the field of industrial automation control, and helps to promote the further development of industrial automation technology.

[0041] As Figure 2 shown, the terminal device 30 in this embodiment includes a processor 31 and a memory 32 connected to the processor 31; the memory 32 is used to store program data, and the processor 31 is used to execute the program data to implement the following method: The receiving thread of the management program communication interface obtains the message of the external device, fills the message header based on the preset communication format, and sends it to the kernel program by the sending thread of the communication interface; The receiving thread of the forwarding interface receives the message sent by the kernel program and sends it to the external device by the sending thread of the forwarding interface.

[0042] It can be understood that when the processor 31 is used to execute the program data, it is also used to implement the method of any of the above embodiments.

[0043] As Figure 3 shown, Figure 3It is a schematic structural diagram of an embodiment of a computer storage medium provided by this application. The computer storage medium 40 is used to store program data 41. When the program data 41 is executed by a processor, it is used to implement the following method steps: The receiving thread of the management program communication interface obtains a message from an external device, fills in the message header based on a preset communication format, and sends it to the kernel program by the sending thread of the communication interface; the receiving thread of the forwarding interface receives the message sent by the kernel program and sends it to the external device by the sending thread of the forwarding interface.

[0044] In several implementation manners provided by this application, it should be understood that the disclosed method and device can be implemented in other ways. For example, the device implementation manner described above is only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0045] The unit described as a separate component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this implementation manner.

[0046] In addition, each functional unit in various implementation manners of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0047] If the above integrated unit in other implementation manners is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various implementation manners of this application. And the aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0048] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A data communication method between a DCS computing software and an external device, characterized in that, Adopt a hierarchical architecture of a hypervisor and a kernel program, where the hypervisor constructs a communication interface for simulating the communication of a DCS controller, and a forwarding interface is constructed between the hypervisor and at least one kernel program. The transmission between the communication interface and the forwarding interface is realized through a sending thread and a receiving thread. The data communication method includes: The receiving thread of the hypervisor communication interface obtains the message of the external device, fills the message header based on a preset communication format, and sends it to the kernel program by the sending thread of the communication interface; The receiving thread of the forwarding interface receives the message sent by the kernel program and sends it to the external device by the sending thread of the forwarding interface.

2. The data communication method between a DCS computing software and an external device according to claim 1, wherein The communication interface includes a read interface, a write interface, an alarm interface, and a heartbeat interface.

3. A data communication method between a DCS calculation software and an external device according to claim 1, characterized in that, The sending thread and the receiving thread run independently respectively to realize the bidirectional data communication between the hypervisor and the kernel program.

4. A data communication method between a DCS calculation software and an external device according to claim 1, characterized in that, The filling of the message header includes: Extract the address information of the kernel program; Calculate the data length and check code of the message, and write the address information, data length, and check code into the message header.

5. A data communication method between a DCS calculation software and an external device according to claim 1, characterized in that After filling the message header, push the filled message into the sending buffer of the communication interface, which is scanned in real time by the sending thread of the communication interface, and the message is sent to the kernel program according to the information in the message header.

6. The data communication method between a DCS calculation software and an external device according to claim 5, characterized in that, After the receiving thread of the forwarding interface receives the message sent by the kernel program, write the message into the sending buffer of the forwarding interface according to the information in the message header, which is scanned in real time by the sending thread of the forwarding interface, and the message is sent to the external device.

7. The data communication method between a DCS computing software and an external device according to claim 6, characterized in that, The sending buffer manages the messages in a first-in, first-out manner.

8. The data communication method between a DCS computing software and an external device according to claim 1, characterized in that, The message sent by the sending thread of the forwarding interface to the external device needs to clear the message header.

9. A terminal device, characterized in that, The terminal device includes a processor and a memory connected to the processor; The memory is used to store program data, and the processor is used to execute the program data to implement the method according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that, The computer storage medium is used to store program data, and the program data, when executed by the processor, is used to implement the method according to any one of claims 1 to 8.