Bidirectional communication method and computer readable storage medium

By implementing a two-way communication method between the HPC device and the PLC device, using data preprocessing and digital certificate verification in different states, the problem of poor device interaction is solved, and the accuracy of information exchange and system performance are improved.

CN119299180APending Publication Date: 2025-01-10TIANJIN TISCO & TPCO STAINLESS STEEL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411421224.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-07-26
Filing Date
2024-10-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, the interaction between devices is poor, and the server side cannot pass data to the client, resulting in inaccurate service requests.

Method used

A two-way communication method is proposed. HPC equipment and PLC equipment perform data preprocessing and sending in different states to realize two-way communication. HPC equipment and PLC equipment can be used as clients or servers, and improve network connection and digital certificate verification. Security and real-time data transmission.

Benefits of technology

It improves the interactivity, flexibility and interaction efficiency between devices, promotes functional complementarity and collaboration, and improves the overall performance and user experience of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299180A_ABST
    Figure CN119299180A_ABST
Patent Text Reader

Abstract

The invention provides a two-way communication method, which is used for HPC (High Performance Computer) equipment and PLC (Programmable Logic Controller) equipment and comprises the following steps of: establishing network connection between the HPC equipment and the PLC equipment; when the HPC equipment is in a sending state and the PLC equipment is in a receiving state, the HPC equipment performs first preprocessing on the first data to obtain first conversion data, the HPC equipment sends the first conversion data to the PLC equipment, and the PLC equipment sends a first instruction based on the received first conversion data; and when the HPC equipment is in the receiving state and the PLC equipment is in the sending state, the PLC equipment performs second preprocessing on the second data to obtain second conversion data, the PLC equipment sends the second conversion data to the HPC equipment, and the HPC equipment sends a second instruction based on the received second conversion data. The interaction, flexibility and interaction efficiency between the HPC equipment and the PLC equipment are improved, so that the HPC equipment and the PLC equipment can make more accurate and rapid responses and decisions based on richer information exchange.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of two-way communication, and in particular to a two-way communication method and a computer-readable storage medium. Background Art

[0002] At present, in the relevant technology, the network communication mode is mostly implemented by the client and the server. However, in the existing technology, the server is only used to provide services, and the client only makes service requests, which leads to poor interactivity between devices and the server cannot transmit data to the client so that the client can make more accurate service requests. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.

[0004] To this end, a first aspect of the present invention provides a two-way communication method.

[0005] A second aspect of the present invention provides a computer-readable storage medium.

[0006] In view of this, a first aspect of the present invention provides a bidirectional communication method for an HPC device and a PLC device, comprising: the HPC device and the PLC device establish a network connection; when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data; when the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs a second preprocessing on second data to obtain second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data.

[0007] The present invention provides a two-way communication method, which is applied to an HPC device and a PLC device. The HPC device and the PLC device first establish a network connection. After the HPC device and the PLC device establish the network connection, different operations are performed according to different states of the HPC device and the PLC device.

[0008] Wherein, when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device acts as a client (i.e., a sending end) and the PLC device acts as a server, wherein the HPC device performs a first preprocessing on the first data and obtains the first data after the first preprocessing, i.e., the first conversion data, and then the HPC device sends the first conversion data to the PLC device, and then the PLC device issues a first instruction, wherein the PLC device analyzes the received first conversion data and issues a first instruction based on a result obtained by the PLC device from analyzing the first conversion data; and when the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device acts as a client (i.e., a sending end) and the HPC device acts as a server, the PLC device performs a second preprocessing on the second data and obtains the second data after the second preprocessing, i.e., the second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data.

[0009] This application takes into account the characteristics of the HPC device and the PLC device, and allows the HPC device and the PLC device to process the data to be sent differently when in different states, so that the communication between the HPC device and the PLC device can be used as a client or a server, that is, during the communication process between the HPC device and the PLC device, data can be sent or received, which improves the interactivity, flexibility and interaction efficiency between the HPC device and the PLC device, so that the HPC device and the PLC device can make more accurate and rapid responses and decisions based on richer information exchange. In addition, two-way communication also promotes the complementarity and coordination of functions between devices, and provides a solid foundation for building a more intelligent and efficient system. By realizing two-way communication between HPC devices and PLC devices, the information interaction capabilities between devices are greatly enhanced, and the overall performance and user experience of the system are improved.

[0010] In addition, the two-way communication method in the above technical solution provided by the present invention may also have the following additional technical features: In some technical solutions of the present invention, optionally, when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on the first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data, including the HPC device packaging the first data based on a first message format; encrypting the packaged first data based on a first digital certificate stored in the HPC device to obtain first conversion data; decrypting the first conversion data based on a second digital certificate stored in the PLC device; and the PLC device analyzing the first conversion data and issuing a first instruction.

[0011] In this technical solution, the present application sets the HPC device to package the first data based on the first message format, and encrypts the packaged first data to obtain the first conversion data. The first conversion data obtained after the first data is packaged and encrypted improves the security. At the same time, the first data processed by the package can be received by the PLC device, so that the HPC device can transmit data to the PLC device, which enhances the real-time and accuracy of data transmission. In addition, the first conversion data can be decrypted by the second digital certificate stored in the PLC device, further preventing the reception of tampered data and improving the security of the data. Then the PLC device analyzes the first conversion data and issues a first instruction based on the analysis results, so that the two devices can make more accurate judgments and decisions based on the latest information, which promotes the functional complementarity and collaborative work between devices, and greatly improves the overall performance and user experience of the system.

[0012] In some technical schemes of the present invention, optionally, the first message format includes a message header, which is used to verify the target receivability of the first conversion data; a data sending number field, which is used to determine the communication status between the HPC device and the PLC device; an IP address field, which is used to identify the address of the first conversion data; and a task process number field, which is used to verify the number of the first conversion data; wherein the message header, the data sending number field, the IP address field and the task process number field are arranged in this way.

[0013] In the technical scheme, the first message format used for packaging the first data in the present application includes a message header, a data transmission frequency field, an IP address field and a task process number field, wherein the message header, the data transmission frequency field, the IP address field and the task process number field are arranged in this way. Among them, by setting the message header, the PLC device can analyze the data in the message header when receiving the first conversion data, and then verify the source of the first conversion data to ensure the security and integrity of the first conversion data during the transmission process, and prevent the first conversion data from being tampered with or stolen. By setting the data transmission frequency field, the PLC device can analyze the data transmission frequency field, and by comparing the expected number of receptions with the actual number of receptions, it can be used to judge the communication status, which is convenient for troubleshooting and diagnosis, helps to shorten the troubleshooting time, and improves the efficiency of network maintenance. By setting the IP address field, the PLC device can access the data according to the IP address where the first conversion data is stored, and access according to the IP address field can improve security. By setting the task process number field, the first conversion data can be further confirmed, thereby ensuring that the PLC device accesses the data to be sent by the HPC device, effectively distinguishing the number set by the task, avoiding data confusion and errors, and improving work efficiency and accuracy. In addition, the message header, data transmission times field, IP address field, and task process number field are arranged in this way. The message format arranged in the above manner can transmit and process data more efficiently, and access the data after ensuring that the data is correct, so as to enhance the integrity and accuracy of the accessed data, thereby improving the overall performance of the system.

[0014] In some technical schemes of the present invention, optionally, the HPC device and the PLC device establish a network connection, including the HPC device initiating a network connection request; the HPC device determining the connection status of the HPC device and the PLC device; if the HPC device and the PLC device successfully establish a network connection, the HPC device and the PLC device mutually authenticate each other's identities; if the HPC device and the PLC device fail to establish a network connection, the HPC device stops sending network connection requests; or the PLC device initiates a network connection request; the PLC device determines the connection status of the HPC device and the PLC device; if the HPC device and the PLC device successfully establish a network connection, the HPC device and the PLC device mutually authenticate each other's identities; if the HPC device and the PLC device fail to establish a network connection, the PLC device stops sending network connection requests.

[0015] In this technical solution, the application enables the client device to initiate a network connection request, and after the network connection request is successful, the client device and the server device verify each other's identities, which greatly improves the security of the connection and avoids potential security risks.

[0016] In some technical solutions of the present invention, optionally, the HPC device and the PLC device verify their identities, including the HPC device sending a first digital certificate to the PLC device; the HPC device requesting the PLC device to verify the first digital certificate; the PLC device sending a second digital certificate to the HPC device; the PLC device requesting the HPC device to verify the second digital certificate; if both the first digital certificate and the second digital certificate pass the verification, the HPC device detects changes in the first input signal, and the PLC device detects changes in the second input signal, otherwise, the HPC device and the PLC device disconnect from the network.

[0017] In this technical solution, the present application allows the HPC device to send a first digital certificate and the PLC device to send a second digital certificate, that is, both the HPC device and the PLC device send digital certificates, and in addition to requesting each other's authentication, the two devices also verify the digital certificate of the other device. On this basis, after the first digital certificate and the second digital certificate are both verified, the HPC device and the PLC device detect changes in their own input signals. As long as any one of the verifications fails, the HPC device and the PLC device will disconnect the network connection, further improving the security of the connection and reducing operation and maintenance costs.

[0018] In some technical schemes of the present invention, optionally, the HPC device detects changes in a first input signal, and the PLC device detects changes in a second input signal, including when the first input signal changes and the second input signal does not change, the HPC device sends first data to the PLC device; when the first input signal does not change and the second input signal changes, the PLC device sends second data to the HPC device; when both the first input signal and the second input signal change, the HPC device first sends the first data to the PLC device, and then the PLC device sends the second data to the HPC device.

[0019] In this technical solution, the HPC device of the present application detects the change of the first input signal, and the PLC device detects the change of the second input signal. When the first input signal changes and the second input signal does not change, it means that in this communication, the HPC device is the client, the PLC device is the server, and the HPC device sends the first data to the PLC device; when the first input signal does not change and the second input signal changes, it means that in this communication, the PLC device is the client, the HPC device is the server, and the PLC device sends the second data to the HPC device; when both the first input signal and the second input signal change, it means that in this communication, the HPC device and the PLC device both have data to send and both need to receive data. In this case, the HPC device first sends the first data to the PLC device, and then the PLC device sends the second data to the HPC device. This improves the orderliness of data transmission, avoids signal congestion or processing delay caused by the HPC device and the PLC device sending signals at the same time, and reduces the waiting time caused by signal conflicts.

[0020] In some technical solutions of the present invention, optionally, the IP address field includes the first two digits of the IP address of the first data and the last two digits of the IP address of the first data.

[0021] In this technical solution, the present application simplifies the data length, reduces the sending time, and improves the efficiency of data sending while ensuring the uniqueness of the IP address by setting the IP address field to include the first two IP addresses of the first data and the last two IP addresses of the first data.

[0022] In some technical solutions of the present invention, optionally, when the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs a second preprocessing on the second data to obtain second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data, including encrypting the second data based on a second digital certificate stored in the PLC device to obtain second conversion data; decrypting the second conversion data based on a first digital certificate stored in the HPC device; and the HPC device analyzes the second conversion data and issues a second instruction.

[0023] In this technical solution, when the HPC device is in a receiving state and the PLC device is in a sending state, the present application encrypts the second data to obtain second converted data, and sends the second converted data on this basis. The second data is then decrypted and analyzed by the first digital certificate stored in the HPC device, and a second instruction is issued according to the second converted data to prevent the second data from being tampered with, thereby improving security and reducing risks.

[0024] In some technical solutions of the present invention, optionally, the communication protocol of the HPC device and the communication protocol of the PLC device are both UDP communication protocols.

[0025] In this technical solution, the present application adopts the UDP communication protocol. Compared with other protocols, the UDP protocol has little additional overhead, which helps to reduce network bandwidth occupancy and does not require complex flow control. The transmission delay is low, which improves the real-time and flexibility of the interaction between HPC devices and PLC devices.

[0026] According to a second aspect of the present invention, a computer-readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, a two-way communication method as in any of the above technical solutions is implemented. Therefore, the computer-readable storage medium has all the beneficial effects of the two-way communication method in any of the above technical solutions, which will not be described in detail here.

[0027] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 is a flow chart of a two-way communication method according to an embodiment of the present invention; Figure 2 is a flow chart of a two-way communication method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0031] Refer to the following Figure 1 to Figure 2 The bidirectional communication method provided in the embodiment of the present application is described in detail through specific embodiments and their application scenarios.

[0032] In one embodiment of the present invention, Figure 1 As shown, a bidirectional communication method is proposed for HPC equipment and PLC equipment, including: Step 102, the HPC device establishes a network connection with the PLC device; Step 104: when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on the first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data; Step 106: When the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs a second preprocessing on the second data to obtain second converted data, the PLC device sends the second converted data to the HPC device, and the HPC device issues a second instruction based on the received second converted data.

[0033] In this embodiment, the present invention provides a two-way communication method, which is applied to an HPC device and a PLC device. The HPC device and the PLC device first establish a network connection. After the HPC device and the PLC device establish the network connection, different operations are performed according to different states of the HPC device and the PLC device. Wherein, when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device acts as a client (i.e., a sending end) and the PLC device acts as a server, wherein the HPC device performs a first preprocessing on the first data and obtains the first data after the first preprocessing, i.e., the first conversion data, and then the HPC device sends the first conversion data to the PLC device, and then the PLC device issues a first instruction, wherein the PLC device analyzes the received first conversion data and issues a first instruction based on a result obtained by the PLC device from analyzing the first conversion data; and when the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device acts as a client (i.e., a sending end) and the HPC device acts as a server, the PLC device performs a second preprocessing on the second data and obtains the second data after the second preprocessing, i.e., the second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data. This application takes into account the characteristics of the HPC device and the PLC device, and allows the HPC device and the PLC device to process the data to be sent differently when in different states, so that the communication between the HPC device and the PLC device can be used as a client or a server, that is, during the communication process between the HPC device and the PLC device, data can be sent or received, which improves the interactivity, flexibility and interaction efficiency between the HPC device and the PLC device, so that the HPC device and the PLC device can make more accurate and rapid responses and decisions based on richer information exchange. In addition, two-way communication also promotes the complementarity and coordination of functions between devices, and provides a solid foundation for building a more intelligent and efficient system. By realizing two-way communication between HPC devices and PLC devices, the information interaction capabilities between devices are greatly enhanced, and the overall performance and user experience of the system are improved.

[0034] This embodiment provides a two-way communication method. In addition to the technical features of the above embodiment, this embodiment further includes the following technical features: like Figure 2 As shown, in some embodiments, optionally, when the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on the first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data, including: Step 1042: The HPC device packages the first data based on the first message format; Step 1044, encrypting the packaged first data based on the first digital certificate stored in the HPC device to obtain first converted data; Step 1046: decrypt the first conversion data based on the second digital certificate stored in the PLC device; the PLC device analyzes the first conversion data and issues a first instruction.

[0035] In this embodiment, the present application sets the HPC device to package the first data based on the first message format, and encrypts the packaged first data to obtain the first conversion data. The first conversion data obtained after the first data is packaged and encrypted improves the security. At the same time, the first data processed by the package can be received by the PLC device, so that the HPC device can transmit data to the PLC device, which enhances the real-time and accuracy of data transmission. In addition, the first conversion data can use the second digital certificate stored in the PLC device to decrypt the first conversion data, further prevent the reception of tampered data, and improve the security of the data. Then the PLC device analyzes the first conversion data and issues a first instruction based on the analysis results, so that the two devices can make more accurate judgments and decisions based on the latest information, which promotes the functional complementarity and collaborative work between devices, and greatly improves the overall performance of the system and user experience.

[0036] Specifically, the first conversion data is encrypted using the SSL protocol.

[0037] In some embodiments, optionally, the first message format includes a message header, which is used to verify the target receivability of the first conversion data; a data sending times field, which is used to determine the communication status between the HPC device and the PLC device; an IP address field, which is used to identify the address of the first conversion data; a task process number field, which is used to verify the number of the first conversion data; wherein the message header, the data sending times field, the IP address field and the task process number field are arranged in this way.

[0038] In this embodiment, the first message format used for packaging the first data in the present application includes a message header, a data transmission frequency field, an IP address field and a task process number field, wherein the message header, the data transmission frequency field, the IP address field and the task process number field are arranged in this way. Among them, by setting the message header, the PLC device can analyze the data in the message header when receiving the first conversion data, and then verify the source of the first conversion data to ensure the security and integrity of the first conversion data during the transmission process, and prevent the first conversion data from being tampered with or stolen. By setting the data transmission frequency field, the PLC device can analyze the data transmission frequency field, and by comparing the expected number of receptions with the actual number of receptions, it can be used to judge the communication status, which is convenient for troubleshooting and diagnosis, helps to shorten the troubleshooting time, and improves the efficiency of network maintenance. By setting the IP address field, the PLC device can access the data according to the IP address where the first conversion data is stored, and access according to the IP address field can improve security. By setting the task process number field, the first conversion data can be further confirmed, thereby ensuring that the PLC device accesses the data to be sent by the HPC device, effectively distinguishing the number set by the task, avoiding data confusion and errors, and improving work efficiency and accuracy. In addition, the message header, data transmission times field, IP address field, and task process number field are arranged in this way. The message format arranged in the above manner can transmit and process data more efficiently, and access the data after ensuring that the data is correct, so as to enhance the integrity and accuracy of the accessed data, thereby improving the overall performance of the system.

[0039] In some embodiments, optionally, the HPC device and the PLC device establish a network connection, including the HPC device initiating a network connection request; the HPC device determining the connection status between the HPC device and the PLC device; if the HPC device and the PLC device successfully establish a network connection, the HPC device and the PLC device mutually authenticate each other's identities; if the HPC device and the PLC device fail to establish a network connection, the HPC device stops sending network connection requests; or the PLC device initiates a network connection request; the PLC device determines the connection status between the HPC device and the PLC device; if the HPC device and the PLC device successfully establish a network connection, the HPC device and the PLC device mutually authenticate each other's identities; if the HPC device and the PLC device fail to establish a network connection, the PLC device stops sending network connection requests.

[0040] In this embodiment, the application causes the client device to initiate a network connection request, and after the network connection request is successful, the client device and the server device authenticate each other, greatly improving the security of the connection and avoiding potential security risks.

[0041] In some embodiments, optionally, the HPC device and the PLC device verify their identities, including the HPC device sending a first digital certificate to the PLC device; the HPC device requesting the PLC device to verify the first digital certificate; the PLC device sending a second digital certificate to the HPC device; the PLC device requesting the HPC device to verify the second digital certificate; if both the first digital certificate and the second digital certificate pass the verification, the HPC device detects changes in the first input signal, and the PLC device detects changes in the second input signal, otherwise, the HPC device and the PLC device disconnect from the network.

[0042] In this embodiment, the present application allows the HPC device to send a first digital certificate and the PLC device to send a second digital certificate, that is, both the HPC device and the PLC device send digital certificates, and in addition to requesting each other's authentication, the two devices also verify the digital certificate of the other device. On this basis, after the first digital certificate and the second digital certificate are both verified, the HPC device and the PLC device detect changes in their own input signals. As long as any one of the verifications fails, the HPC device and the PLC device will disconnect the network connection, further improving the security of the connection and reducing operation and maintenance costs.

[0043] In some embodiments, optionally, the HPC device detects changes in a first input signal and the PLC device detects changes in a second input signal, including when the first input signal changes and the second input signal does not change, the HPC device sends first data to the PLC device; when the first input signal does not change and the second input signal changes, the PLC device sends second data to the HPC device; when both the first input signal and the second input signal change, the HPC device first sends the first data to the PLC device, and then the PLC device sends the second data to the HPC device.

[0044] In this embodiment, the HPC device of the present application detects the change of the first input signal, and the PLC device detects the change of the second input signal. When the first input signal changes and the second input signal does not change, it means that in this communication, the HPC device is the client, the PLC device is the server, and the HPC device sends the first data to the PLC device; when the first input signal does not change and the second input signal changes, it means that in this communication, the PLC device is the client, the HPC device is the server, and the PLC device sends the second data to the HPC device; when both the first input signal and the second input signal change, it means that in this communication, the HPC device and the PLC device both have data to send and both need to receive data. In this case, the HPC device first sends the first data to the PLC device, and then the PLC device sends the second data to the HPC device. This improves the orderliness of data transmission, avoids signal congestion or processing delay caused by the HPC device and the PLC device sending signals at the same time, and reduces the waiting time caused by signal conflicts.

[0045] In some embodiments, optionally, the IP address field includes the first two digits of the IP address of the first data and the last two digits of the IP address of the first data.

[0046] In this embodiment, the present application simplifies the data length, reduces the sending time, and improves the efficiency of data sending while ensuring the uniqueness of the IP address by setting the IP address field to include the first two IP addresses of the first data and the last two IP addresses of the first data.

[0047] In some embodiments, optionally, when the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs a second preprocessing on the second data to obtain second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data, including: Encrypting the second data based on the second digital certificate stored in the PLC device to obtain second converted data; decrypting the second converted data based on the first digital certificate stored in the HPC device; The HPC device analyzes the second converted data and issues a second instruction.

[0048] In this embodiment, when the HPC device is in a receiving state and the PLC device is in a sending state, the present application encrypts the second data to obtain second converted data, and sends the second converted data on this basis. The second data is then decrypted and analyzed by the first digital certificate stored in the HPC device, and a second instruction is issued based on the second converted data to prevent the second data from being tampered with, thereby improving security and reducing risks.

[0049] In some embodiments, optionally, the communication protocol of the HPC device and the communication protocol of the PLC device are both UDP communication protocols.

[0050] In this embodiment, the present application adopts the UDP communication protocol. Compared with other protocols, the UDP protocol has little additional overhead, which helps to reduce the occupancy of network bandwidth and does not require complex flow control. The transmission delay is low, which improves the real-time and flexibility of the interaction between HPC devices and PLC devices.

[0051] In some embodiments, optionally, a computer-readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the two-way communication method in any of the above-mentioned technical solutions is implemented, thereby having all the beneficial technical effects of the two-way communication method in any of the above-mentioned embodiments.

[0052] The computer readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0053] A computer-readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device, and may be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above devices, but is not limited thereto. A non-exhaustive list of more specific examples of computer-readable storage media includes: portable computer floppy disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, static random access memories, portable compact disk read-only memories, digital versatile disks, memory cards, floppy disks, encoding mechanical devices (such as punched cards or grooves with raised structures having instructions recorded therein), and any suitable combination of the above devices. The computer-readable storage medium used herein should not be understood as a transmission signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media, or electrical signals transmitted through wires, etc.

[0054] In the claims, specification and drawings of the present invention, the term "multiple" refers to two or more than two. Unless otherwise clearly defined, the orientation or positional relationship indicated by the terms "upper" and "lower" is based on the orientation or positional relationship shown in the drawings, which is only for the purpose of more conveniently describing the present invention and making the description process simpler, rather than indicating or implying that the device or element referred to must have the specific orientation described, be constructed and operated in a specific orientation, so these descriptions cannot be understood as limiting the present invention; the terms "connect", "install", "fix" and the like should be understood in a broad sense. For example, "connection" can be a fixed connection between multiple objects, or a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects, or an indirect connection between multiple objects through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood based on the specific circumstances of the above data.

[0055] In the claims, specification and drawings of the present invention, the description of the terms "one embodiment", "some embodiments", "specific embodiments" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In the claims, specification and drawings of the present invention, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A two-way communication method for HPC equipment and PLC equipment, characterized in that: include: The HPC device establishes a network connection with the PLC device; When the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on the first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data; When the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs second preprocessing on the second data to obtain second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data.

2. The two-way communication method according to claim 1, characterized in that: When the HPC device is in a sending state and the PLC device is in a receiving state, the HPC device performs a first preprocessing on the first data to obtain first conversion data, the HPC device sends the first conversion data to the PLC device, and the PLC device issues a first instruction based on the received first conversion data, including: The HPC device performs packaging processing on the first data based on a first message format; Encrypting the first packaged data based on the first digital certificate stored in the HPC device to obtain the first converted data; decrypting the first converted data based on a second digital certificate stored in the PLC device; The PLC device analyzes the first conversion data and issues the first instruction.

3. The two-way communication method according to claim 2, characterized in that: The first message format includes: a message header, the message header being used to verify the target receivability of the first converted data; A data transmission times field, wherein the data transmission times field is used to determine the communication status between the HPC device and the PLC device; An IP address field, wherein the IP address field is used to identify an address of the first conversion data; A task process number field, wherein the task process number field is used to verify the number of the first conversion data; Among them, the message header, the data sending times field, the IP address field and the task process number field are arranged in this way.

4. The two-way communication method according to claim 1, characterized in that: The HPC device establishes a network connection with the PLC device, including: The HPC device initiates a network connection request; The HPC device determines the connection status between the HPC device and the PLC device; If the HPC device successfully establishes a network connection with the PLC device, the HPC device and the PLC device mutually authenticate each other; If the HPC device fails to establish a network connection with the PLC device, the HPC device stops sending network connection requests; or The PLC device initiates a network connection request; The PLC device determines the connection status between the HPC device and the PLC device; If the network connection between the HPC device and the PLC device is established successfully, the HPC device and the PLC device mutually authenticate each other; If the HPC device fails to establish the network connection with the PLC device, the PLC device stops sending network connection requests.

5. The two-way communication method according to claim 4, characterized in that: The HPC device and the PLC device verify identity, including: The HPC device sends a first digital certificate to the PLC device; The HPC device requests the PLC device to verify the first digital certificate; The PLC device sends a second digital certificate to the HPC device; The PLC device requests the HPC device to verify the second digital certificate; If both the first digital certificate and the second digital certificate are verified, the HPC device detects a change in the first input signal, and the PLC device detects a change in the second input signal, Otherwise, the HPC device is disconnected from the PLC device through the network.

6. The two-way communication method according to claim 5, characterized in that: If both the first digital certificate and the second digital certificate are verified, the HPC device detects a change in the first input signal, and the PLC device detects a change in the second input signal, including: When the first input signal changes and the second input signal does not change, the HPC device sends the first conversion data to the PLC device; When the first input signal does not change and the second input signal changes, the PLC device sends the second conversion data to the HPC device; When both the first input signal and the second input signal change, the HPC device first sends the first conversion data to the PLC device, and then the PLC device sends the second conversion data to the HPC device.

7. The two-way communication method according to claim 3, characterized in that: The IP address field includes: The first two digits of the IP address of the first data and the last two digits of the IP address of the first data.

8. The two-way communication method according to claim 1, characterized in that: When the HPC device is in a receiving state and the PLC device is in a sending state, the PLC device performs a second preprocessing on the second data to obtain second conversion data, the PLC device sends the second conversion data to the HPC device, and the HPC device issues a second instruction based on the received second conversion data, including: Encrypting the second data based on the second digital certificate stored in the PLC device to obtain second converted data; decrypting the second converted data based on a first digital certificate stored in the HPC device; The HPC device analyzes the second conversion data and issues the second instruction.

9. The two-way communication method according to any one of claims 1 to 8, characterized in that: The communication protocol of the HPC device and the communication protocol of the PLC device are both UDP communication protocols.

10. A computer-readable storage medium storing a program or an instruction, characterized in that: When the computer program is executed by a processor, the bidirectional communication method according to any one of claims 1 to 9 is implemented.