CN117452873B - Communication method, device, equipment and storage medium - Google Patents

Communication method, device, equipment and storage medium Download PDF

Info

Publication number
CN117452873B
CN117452873B CN202311800118.8A CN202311800118A CN117452873B CN 117452873 B CN117452873 B CN 117452873B CN 202311800118 A CN202311800118 A CN 202311800118A CN 117452873 B CN117452873 B CN 117452873B
Authority
CN
China
Prior art keywords
data packet
variable information
variable
plc
storage pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311800118.8A
Other languages
Chinese (zh)
Other versions
CN117452873A (en
Inventor
尹俊杰
杨宝通
楚兵
刘鸿斐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Helishi Information Security Research Institute Co ltd
Original Assignee
Ningbo Helishi Information Security Research Institute Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Helishi Information Security Research Institute Co ltd filed Critical Ningbo Helishi Information Security Research Institute Co ltd
Priority to CN202311800118.8A priority Critical patent/CN117452873B/en
Publication of CN117452873A publication Critical patent/CN117452873A/en
Application granted granted Critical
Publication of CN117452873B publication Critical patent/CN117452873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a communication method, a device, equipment and a storage medium, belonging to the field of industrial control. The method comprises the following steps: acquiring a data packet sending instruction, wherein the data packet sending instruction comprises: behavior type and variable information; responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool; responding to the behavior type as a reading operation, and if the data packet corresponding to the variable information is stored in a data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool; and transmitting a data packet corresponding to the variable information so that the PLC receives the data packet. The device comprises: the device comprises an instruction acquisition module, a first response module, a second response module and a data packet sending module. By the scheme, the computing resource is saved, and the communication efficiency between the upper computer and the PLC is improved.

Description

Communication method, device, equipment and storage medium
Technical Field
The present invention relates to the field of industrial control technologies, and in particular, to a communication method, apparatus, device, and storage medium.
Background
Public service fields such as electric power, petrochemical nuclear energy, aviation, railway and the like relate to key infrastructure of national folk life and realize automatic operation by means of an industrial control system. Typical characteristics of industrial control systems are extremely high requirements on stability, and as information technology advances, requirements on safety are gradually increased. The PLC is a digital electronic device for industrial process control, is core equipment of an industrial control system, and has the functions of collecting data of various instruments and meters, transmitting the data to an upper computer, and receiving control instructions of the upper computer to respond.
In the prior art, the upper computer sends the data information to be acquired to the PLC, and then the PLC sends corresponding data to the upper computer. In the DCS system, the upper computer collects data more frequently, so that the data information needs to be packaged frequently and then sent to the PLC, and a larger load is brought to the upper computer. For large industrial sites, it can also be easy to cause slow communication.
Disclosure of Invention
In order to solve the problems in the prior art, an aspect of the present invention provides a communication method applied to an upper computer side, including:
acquiring a data packet sending instruction, wherein the data packet sending instruction comprises: the system comprises a behavior type and variable information, wherein the behavior type comprises a reading operation, and the variable information is used for representing a storage address of a PLC (programmable logic controller) aimed by the reading operation; responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool; responding to the behavior type as a reading operation, and if the data packet corresponding to the variable information is stored in the data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool; and sending a data packet corresponding to the variable information so as to enable the PLC to receive the variable information.
Another aspect provides a communication device comprising:
the instruction acquisition module is used for acquiring a data packet sending instruction, and the data packet sending instruction comprises: the system comprises a behavior type and variable information, wherein the behavior type comprises a reading operation, and the variable information is used for representing a storage address of a PLC (programmable logic controller) aimed by the reading operation; the first response module is used for responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool; the second response module is used for responding to the behavior type as a reading operation, and extracting the data packet corresponding to the variable information from the data packet storage pool if the data packet corresponding to the variable information is stored in the data packet storage pool; and the data packet sending module is used for sending the data packet corresponding to the variable information so as to enable the PLC to receive the variable information.
In yet another aspect, the present invention provides an electronic device, comprising: a processor and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the communication method described above.
In yet another aspect, the present invention provides a computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, which is loaded and executed by a processor to implement the above-described communication method.
The technical scheme provided by the embodiment of the invention has the beneficial effects that:
acquiring a data packet sending instruction, wherein the data packet sending instruction comprises: behavior type and variable information, the behavior type includes reading operation, the variable information is used for representing the memory address of PLC that reading operation aims at; responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool; responding to the behavior type as a reading operation, and if the data packet corresponding to the variable information is stored in a data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool; and sending a data packet corresponding to the variable information so as to enable the PLC to receive the variable information, thereby saving calculation resources and improving the communication efficiency between the upper computer and the PLC.
Drawings
FIG. 1 is a flow chart of a communication method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of variable information according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a packet storage pool according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a communication device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present invention provides a communication method applied to a host side, for communication between the host and a PLC (Programmable Logic Controller ), that is, a communication method between the host and the PLC, the method flow includes the following steps:
step 101, acquiring a data packet sending instruction.
The data packet sending instruction is used for indicating the upper computer to send the data packet, and comprises the following components: behavior type and variable information. The behavior type is a read operation. The variable information is used for representing a storage address of the PLC which is in communication connection with the upper computer, namely a storage address of the PLC for which the data packet sends an instruction, and data acquired by the PLC, such as temperature, pressure, flow, speed and the like, are stored in the storage address. Referring to fig. 2, the variable information may include: PLC numbers and memory addresses, for example: the PLC with the PLC number A stores 5 variables with addresses 40001, 40003, 40005, 40007 and 40009, the information can exist in the form of a variable list, a plurality of PLCs are usually connected with an upper computer in a communication way, and different PLCs can be distinguished through the PLC numbers; in other embodiments, the variable information may include: the variable number is used for representing the storage address of the PLC which is in communication connection with the upper computer, and has a corresponding relationship with the storage address of the PLC, that is, after the variable number is determined, the storage address of the PLC can be uniquely determined according to the variable number, for example: the 5 variables with memory addresses 40001, 40003, 40005, 40007, 40009 for PLC number a were numbered: 58. 59, 60, 61, 62. A variable list may be created in which: variable number, PLC number, memory address. When the behavior type is a read operation, the data packet sending instruction is used for indicating that the read operation is performed on the storage address. In other embodiments, the behavior types may include: read operations and write operations. When the behavior type is a reading operation, the data packet sending instruction is used for indicating the reading operation to the storage address; when the behavior type is a write operation, the packet send instruction is used to instruct to write to the memory address. In actual operation, since the read operation is frequent relative to the write operation, in this embodiment, when the behavior type includes the read operation and the write operation, it is necessary to determine which operation the behavior type is, if the behavior type is the read operation, the subsequent step is performed, otherwise, the subsequent step is not performed. The data packet sending instruction can be triggered by the operation of a worker, and can also be automatically triggered, for example: when the preset time arrives. The data packet sending instruction is the engineering requirement of the DCS (Distributed Control System ) and can be received by a data acquisition module of DCS software.
And step 102, in response to the behavior type being a read operation, if the data packet corresponding to the variable information is not stored in the pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the constructed data packet in the data packet storage pool.
When the behavior type is a reading operation, judging whether the data packet corresponding to the variable information is stored in a pre-created data packet storage pool, if the data packet does not exist in the data packet storage pool, constructing the data packet corresponding to the variable information, and then storing the constructed data packet in the data packet storage pool.
Before the step of constructing the data packet corresponding to the variable information, the method further comprises the following steps:
numbering the storage addresses related to the reading operation of the PLC which is in communication connection with the upper computer in sequence to obtain a variable number; dividing the variable numbers based on preset intervals to obtain variable number groups.
Typically in an industrial control network, there are multiple PLCs communicatively coupled to an upper computer. The memory address of the PLC will sometimes be differentiated for the type of behavior, for example: if some addresses only allow read operation and some addresses only allow write operation, the memory addresses related to the read operation of the PLC which are in communication connection with the upper computer can be numbered sequentially to obtain variable numbers; the serial numbers of the memory addresses of the PLC which are in communication connection with the upper computer can be sequentially carried out, so that the serial numbers of the memory addresses related to the reading operation are realized, and the variable numbers are obtained; in other embodiments, the memory addresses of the PLCs may not be differentiated according to the behavior types, and the memory addresses of the PLCs that are communicatively connected to the upper computer may be numbered sequentially, so as to number the memory addresses related to the read operation, and obtain the variable numbers.
The variable number is used as a unique number of the memory address for distinguishing between different memory addresses of different PLCs. The storage addresses have corresponding variable numbers, and each variable number may correspond to one storage address or may correspond to two storage addresses, as shown in fig. 2, which is not limited in this embodiment. And then dividing the variable numbers according to preset intervals to obtain variable number groups. The preset interval is defined according to actual use conditions, and may be 5, for example. When 10000 variable numbers correspond to all PLCs which are in communication connection with the upper computer, the PLCs are divided according to 5, and can be divided into 2000 variable number groups. The variable number group is used as a construction unit when constructing the data packet, namely, the data packet is constructed by taking the variable number group as a unit, and the constructed data packet contains a storage address corresponding to the variable number group.
Correspondingly, the step of constructing the data packet corresponding to the variable information comprises the following steps:
and judging which variable number groups the variable information belongs to, and constructing the data packet by taking the variable number groups as units according to the judging result to obtain the data packet corresponding to the variable information.
The variable information contains storage addresses, the variable number groups correspond to the storage addresses, and the storage addresses in the variable number groups corresponding to the storage addresses in the variable information can be judged through comparison of the variable information and the variable number groups. In other embodiments, the variable information further includes a variable number, the variable number group is composed of a plurality of variable numbers, and the variable number group to which the same variable number belongs is used as the determination result by comparing the variable number of the variable information with the variable numbers in the plurality of variable number groups. For example: the variable numbers included in the variable information are 58, 60, 62, and 80, respectively, and the variable numbers 58, 60, and 62 all belong to the same variable number group, and if the variable numbers are divided according to the preset interval 5 as an example, the variable numbers included in the one variable number group also include 59 and 61. The variable number 80 belongs to another variable number group, and if the variable number group is divided according to the preset interval 5 as an example, the other variable number group further includes variable numbers 78, 79, 81 and 82. The one variable number group and the other variable number group are the judgment results.
After the judgment result is obtained, if the judgment result comprises a variable number group, constructing the data packet by taking the variable number group as a unit, so that the constructed data packet comprises a storage address corresponding to the variable number group. If the judging result comprises a plurality of variable number groups, respectively constructing the data packets of the variable number groups by taking the variable number groups as units, wherein the constructed data packets comprise storage addresses corresponding to the variable number groups, so that the constructed data packets comprise the storage addresses corresponding to the variable information. Other information contained in the constructed data packet is different based on different communication protocols of the upper computer and the PLC, and the communication protocol of the upper computer and the PLC is not specifically limited in the embodiment. In order to realize the safety of communication, the data packet is also encrypted to obtain an encrypted data packet (or ciphertext), so that the constructed data packet is the encrypted data packet. The present embodiment is not limited to a specific encryption algorithm.
And creating a data packet storage pool in advance for storing the constructed data packets. The storing in the data packet storage pool comprises:
numbering the constructed data packet to obtain a data packet number; and storing the constructed data packet by taking the variable number as a key and the data packet number as a value.
The data packet numbers have a corresponding relation with the data packets, the corresponding data packets can be determined after the data packet numbers are determined, the sizes of the data packet numbers can be determined according to the sequence of data packet construction, and the sizes of the data packet numbers are not consistent with the sizes of the variable numbers at the moment. Referring to fig. 3, the data packet is stored in the form of a key-value pair, the key in the key-value pair is a variable number, and the value is a data packet number, so as to form a key-value mapping relationship, wherein the mapping relationship is a many-to-one mapping relationship, i.e. a plurality of variable numbers correspond to the same data packet, and different data packets correspond to different variable numbers. The data packets stored in the data packet storage pool may be referred to as static data packets, which are constructed (or generated) once for long-term use, rather than repeatedly calculated each time, and stored in the data packet storage pool after being generated, and preferentially extracted from the data packet storage pool when transmission is required, so as to avoid repeated calculation.
In practical application, the data packets in the data packet storage pool can be solidified to the disk, so that the time for restarting the upper computer after the upper computer software is crashed and reconnecting the upper computer with the broken line of the PLC equipment can be obviously shortened.
And step 103, responding to the action type as a reading operation, and if the data packet corresponding to the variable information is stored in the data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool.
When the behavior type is a read operation, determining whether the data packet corresponding to the variable information is stored in the pre-memory
And if the data packet exists in the data packet storage pool, extracting the data packet from the data packet storage pool.
For example: the variable numbers in the variable information are 58, 60, 62 and 80, and three data packets are respectively in the current data packet storage pool: packet 1, packet 2, packet 3, packet 1 corresponding to variable number: 58. 59, 60, 61, 62, packet 3 corresponds to the variable number: 78. 79, 80, 81, 82, the variable information of the variable numbers 58, 60, 62 corresponds to the data packet 1, the variable information of the variable number 80 corresponds to the data packet 3, and the data packet 1 and the data packet 3 are extracted from the data packet storage pool, thereby obtaining the data packet corresponding to the variable information.
If the variable numbers in the variable information are 58, 60, 62 and 85, three data packets are in the current data packet storage pool, wherein the three data packets are respectively: packet 1, packet 2, packet 3, packet 1 corresponding to variable number: 58. 59, 60, 61, 62, packet 2 corresponds to the variable number: 68. 69, 70, 71, 72, packet 3 corresponds to the variable number: 78. 79, 80, 81, 82, the variable information of the variable numbers 58, 60, 62 corresponds to the data packet 1, and the variable information of the variable number 85 does not correspond to the data packet, and the data packet is constructed, and the relevant description of the steps is referred to for the construction process of the data packet, and is not repeated here.
And 104, transmitting a data packet corresponding to the variable information so as to enable the PLC to receive the variable information.
After obtaining the data packet corresponding to the variable information, serializing the data packet, namely generating an ordered queue of the data packet corresponding to the variable information, and then sending the ordered queue of the data packet. Sometimes the variable information corresponds to one data packet, and sometimes the variable information corresponds to a plurality of data packets, and at this time, the data packets are orderly transmitted without omission by serializing the variable information.
After the step of transmitting the data packet corresponding to the variable information to enable the PLC to receive, the method further comprises:
the upper computer receives a data packet sent by the PLC, the data packet is constructed by responding to the data packet corresponding to the variable information sent by the upper computer, and then the received data packet sent by the PLC is analyzed to obtain data stored at a storage address corresponding to the variable information. Because the data obtained after analysis is possibly more than the data required by the actual DCS engineering, the data required by the DCS engineering can be extracted from the data, namely the data stored by the storage address corresponding to the variable information.
By acquiring a packet transmission instruction, the packet transmission instruction includes: behavior type and variable information, the behavior type includes reading operation, the variable information is used for representing the memory address of PLC that reading operation aims at; responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool; responding to the behavior type as a reading operation, and if the data packet corresponding to the variable information is stored in a data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool; and transmitting a data packet corresponding to the variable information so that the PLC receives the data packet. Because the data packet is built for the data sent by the upper computer and the PLC in the industrial control system, the data packet is stored in the data packet storage pool, repeated calculation of the data packet and calculation of the encrypted packet when the data packet is the encrypted data packet can be effectively avoided for the acquisition of the same variable number group, CPU resources of the computer are saved, and the acquisition speed is improved. The data packet to be sent is directly extracted from the data packet storage pool, so that the processes of calculating the message (or the data packet) and encrypting the message (or the data packet) are reduced, and the communication rate of the upper computer and the PLC equipment can be obviously improved.
Referring to fig. 4, an embodiment of the present invention provides a communication apparatus, including: an instruction acquisition module 401, a first response module 402, a second response module 403, and a packet transmission module 404.
The instruction obtaining module 401 is configured to obtain a packet sending instruction, where the packet sending instruction includes: the system comprises a behavior type and variable information, wherein the behavior type comprises a read operation, and the variable information is used for representing a storage address of the PLC for which the read operation is aimed. The first response module 402 is configured to construct a data packet corresponding to the variable information and store the data packet in the data packet storage pool if the data packet corresponding to the variable information is not stored in the pre-created data packet storage pool in response to the behavior type being the read operation. The second response module 403 is configured to extract, in response to the behavior type being a read operation, a data packet corresponding to the variable information from the data packet storage pool if the data packet corresponding to the variable information is stored in the data packet storage pool. The data packet transmitting module 404 is configured to transmit a data packet corresponding to the variable information, so that the PLC receives the data packet.
Optionally, before the first response module 402 constructs a data packet corresponding to the variable information, the apparatus is further configured to:
numbering the storage addresses related to the reading operation of the PLC which is in communication connection with the upper computer in sequence to obtain a plurality of variable numbers; dividing a plurality of variable numbers based on a preset interval to obtain a variable number group;
accordingly, the first response module constructs a data packet corresponding to the variable information: judging which variable number groups the variable information belongs to; and constructing the data packet by taking the variable number group as a unit according to the judging result to obtain the data packet corresponding to the variable information.
Optionally, the variable information includes: and (5) variable numbers.
Optionally, the first response module 402 is stored in a packet storage pool, specifically for:
numbering the constructed data packet to obtain a data packet number; and storing the constructed data packet by taking the variable number as a key and the data packet number as a value.
Optionally, the data packet sending module 404 is specifically configured to: serializing the data packets corresponding to the variable information to obtain a data packet ordered queue; and sending the data packet ordered queue.
Optionally, the apparatus further includes: and the data packet receiving module and the data packet analyzing module. The data packet receiving module is used for receiving a data packet sent by the PLC, and the data packet is constructed by the PLC responding to the data packet corresponding to the variable information sent by the upper computer. The data packet analysis module is used for analyzing the data packet to obtain data stored in the storage address corresponding to the variable information.
Optionally, the data packet corresponding to the variable information is an encrypted data packet corresponding to the variable information, that is, the encrypted data packet is obtained after the data packet is encrypted and calculated.
It should be noted that: in the communication device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the communication device and the communication method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the communication device and the communication method are detailed in the method embodiments and are not described herein again.
The embodiment of the invention provides equipment, which is electronic equipment and comprises: memory and a processor. The processor is coupled to the memory and configured to perform the communication method described above based on instructions stored in the memory. The number of processors may be one or more, and the processors may be single core or multi-core. The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip. The memory may be an example of a computer-readable medium described below.
Embodiments of the present invention provide a computer-readable storage medium having stored thereon at least one instruction, at least one program, code set, or instruction set that is loaded and executed by a processor to implement the above-described communication method. The computer-readable storage medium includes: persistent and non-persistent, removable and non-removable media may implement information storage by any method or technique. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to: phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by the computing device.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. It will be appreciated by those skilled in the art that the present invention can be carried out in other embodiments without departing from the spirit or essential characteristics thereof. Accordingly, the above disclosed embodiments are illustrative in all respects, and not exclusive. All changes that come within the scope of the invention or equivalents thereto are intended to be embraced therein.

Claims (7)

1. A communication method applied to an upper computer side, the method comprising:
acquiring a data packet sending instruction, wherein the data packet sending instruction comprises: the system comprises a behavior type and variable information, wherein the behavior type comprises a reading operation, and the variable information is used for representing a storage address of a PLC (programmable logic controller) aimed by the reading operation;
responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool;
responding to the behavior type as a reading operation, and if the data packet corresponding to the variable information is stored in the data packet storage pool, extracting the data packet corresponding to the variable information from the data packet storage pool;
transmitting a data packet corresponding to the variable information so that the PLC receives the data packet;
the variable information includes: the variable number is used as a unique number of the storage address and is used for distinguishing different storage addresses of different PLCs;
before the constructing the data packet corresponding to the variable information, the method further comprises:
numbering the storage addresses related to the reading operation of the PLC which is in communication connection with the upper computer in sequence to obtain a plurality of variable numbers;
dividing a plurality of variable numbers based on preset intervals to obtain a variable number group;
the constructing the data packet corresponding to the variable information comprises the following steps:
judging which variable number groups the variable information belongs to;
constructing a data packet by taking the variable number group as a unit according to a judging result to obtain a data packet corresponding to the variable information;
the storing in the data packet storage pool comprises:
numbering the constructed data packet to obtain a data packet number;
and storing the constructed data packet by taking the variable number as a key and the data packet number as a value.
2. The method of claim 1, wherein the transmitting the data packet corresponding to the variable information comprises:
serializing the data packets corresponding to the variable information to obtain a data packet ordered queue;
and sending the data packet ordered queue.
3. The method of claim 1, wherein the transmitting the data packet corresponding to the variable information such that after the PLC receives, further comprises:
receiving a data packet sent by the PLC, wherein the data packet is constructed by the PLC responding to the data packet corresponding to the variable information sent by the upper computer;
and analyzing the data packet sent by the PLC to obtain data stored in a storage address corresponding to the variable information.
4. The method of claim 1, wherein the data packet corresponding to the variable information is an encrypted data packet corresponding to the variable information.
5. A communication device, the device comprising:
the instruction acquisition module is used for acquiring a data packet sending instruction, and the data packet sending instruction comprises: the system comprises a behavior type and variable information, wherein the behavior type comprises a reading operation, and the variable information is used for representing a storage address of a PLC (programmable logic controller) aimed by the reading operation;
the first response module is used for responding to the behavior type as a reading operation, if the data packet corresponding to the variable information is not stored in a pre-created data packet storage pool, constructing the data packet corresponding to the variable information, and storing the data packet in the data packet storage pool;
the second response module is used for responding to the behavior type as a reading operation, and extracting the data packet corresponding to the variable information from the data packet storage pool if the data packet corresponding to the variable information is stored in the data packet storage pool;
the data packet sending module is used for sending a data packet corresponding to the variable information so as to enable the PLC to receive the variable information;
the variable information includes: the variable number is used as a unique number of the storage address and is used for distinguishing different storage addresses of different PLCs;
the first response module is further configured to, before the constructing the data packet corresponding to the variable information:
numbering the storage addresses related to the reading operation of the PLC which is in communication connection with the upper computer in sequence to obtain a plurality of variable numbers;
dividing a plurality of variable numbers based on preset intervals to obtain a variable number group;
the first response module is configured to construct a data packet corresponding to the variable information, and includes:
judging which variable number groups the variable information belongs to;
constructing a data packet by taking the variable number group as a unit according to a judging result to obtain a data packet corresponding to the variable information;
the first response module is configured to store in a data packet storage pool, and includes:
numbering the constructed data packet to obtain a data packet number;
and storing the constructed data packet by taking the variable number as a key and the data packet number as a value.
6. An electronic device, the electronic device comprising: a processor and a memory for storing executable instructions of the processor;
wherein the processor is configured to perform a communication method of any of claims 1-4.
7. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, at least one program, code set, or instruction set being loaded and executed by a processor to implement a method of communication according to any one of claims 1-4.
CN202311800118.8A 2023-12-26 2023-12-26 Communication method, device, equipment and storage medium Active CN117452873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311800118.8A CN117452873B (en) 2023-12-26 2023-12-26 Communication method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311800118.8A CN117452873B (en) 2023-12-26 2023-12-26 Communication method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117452873A CN117452873A (en) 2024-01-26
CN117452873B true CN117452873B (en) 2024-03-15

Family

ID=89593347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311800118.8A Active CN117452873B (en) 2023-12-26 2023-12-26 Communication method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117452873B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103178998A (en) * 2013-03-20 2013-06-26 中国人民解放军91404部队 Test and control data transmission method and device
CN104486185A (en) * 2014-12-12 2015-04-01 中广核工程有限公司 Control system communication method and system for nuclear power plant
CN110401558A (en) * 2019-04-28 2019-11-01 北京广利核系统工程有限公司 Safety level multi-point communication network equipment, system and safety level network communication method
CN110826075A (en) * 2019-12-20 2020-02-21 宁波和利时信息安全研究院有限公司 PLC dynamic measurement method, device, system, storage medium and electronic equipment
CN111897283A (en) * 2020-08-05 2020-11-06 深圳市海浦蒙特科技有限公司 Programmable logic controller software element monitoring method, system and storage medium
CN112073280A (en) * 2020-09-07 2020-12-11 合肥阳光新能源科技有限公司 Communication method and device based on Modbus protocol and communication equipment
EP3771182A1 (en) * 2019-07-23 2021-01-27 Schneider Electric Industries SAS Method for detecting and identifying devices communicating according to a modbus protocol and communication controller for implementing such a method
CN112948418A (en) * 2021-02-25 2021-06-11 平安普惠企业管理有限公司 Dynamic query method, device, equipment and storage medium
CN113287288A (en) * 2021-03-31 2021-08-20 华为技术有限公司 Data transmission method and device
CN113886316A (en) * 2021-09-27 2022-01-04 合肥讯飞数码科技有限公司 Data communication method and related device, equipment, system and storage medium
CN113986746A (en) * 2021-11-05 2022-01-28 中国工商银行股份有限公司 Performance test method and device and computer readable storage medium
CN114760151A (en) * 2022-06-13 2022-07-15 宁波和利时信息安全研究院有限公司 Method and device for acquiring authority of upper computer through PLC
CN115495406A (en) * 2022-09-02 2022-12-20 深圳市楠菲微电子有限公司 Message transmission method, device, equipment and storage medium based on PCIe
CN115495171A (en) * 2022-09-29 2022-12-20 新华三信息技术有限公司 Command management method, device, equipment and machine-readable storage medium
CN115913884A (en) * 2022-11-22 2023-04-04 广东安达智能装备股份有限公司 Communication method, etherCAT system, communication device and storage medium
CN115988050A (en) * 2022-11-08 2023-04-18 山东云海国创云计算装备产业创新中心有限公司 Session-based IPMI communication method, system, storage medium and equipment
CN116203922A (en) * 2023-01-03 2023-06-02 重庆长安汽车股份有限公司 Automobile controller fault diagnosis method, device, equipment and storage medium
CN116483737A (en) * 2023-04-18 2023-07-25 深圳市金玺智控技术有限公司 Data processing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210137702A (en) * 2020-05-11 2021-11-18 삼성전자주식회사 Electronic device and method for processing a data packet received in the electronic device

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103178998A (en) * 2013-03-20 2013-06-26 中国人民解放军91404部队 Test and control data transmission method and device
CN104486185A (en) * 2014-12-12 2015-04-01 中广核工程有限公司 Control system communication method and system for nuclear power plant
CN110401558A (en) * 2019-04-28 2019-11-01 北京广利核系统工程有限公司 Safety level multi-point communication network equipment, system and safety level network communication method
EP3771182A1 (en) * 2019-07-23 2021-01-27 Schneider Electric Industries SAS Method for detecting and identifying devices communicating according to a modbus protocol and communication controller for implementing such a method
CN110826075A (en) * 2019-12-20 2020-02-21 宁波和利时信息安全研究院有限公司 PLC dynamic measurement method, device, system, storage medium and electronic equipment
CN111897283A (en) * 2020-08-05 2020-11-06 深圳市海浦蒙特科技有限公司 Programmable logic controller software element monitoring method, system and storage medium
CN112073280A (en) * 2020-09-07 2020-12-11 合肥阳光新能源科技有限公司 Communication method and device based on Modbus protocol and communication equipment
CN112948418A (en) * 2021-02-25 2021-06-11 平安普惠企业管理有限公司 Dynamic query method, device, equipment and storage medium
CN113287288A (en) * 2021-03-31 2021-08-20 华为技术有限公司 Data transmission method and device
CN113886316A (en) * 2021-09-27 2022-01-04 合肥讯飞数码科技有限公司 Data communication method and related device, equipment, system and storage medium
CN113986746A (en) * 2021-11-05 2022-01-28 中国工商银行股份有限公司 Performance test method and device and computer readable storage medium
CN114760151A (en) * 2022-06-13 2022-07-15 宁波和利时信息安全研究院有限公司 Method and device for acquiring authority of upper computer through PLC
CN115495406A (en) * 2022-09-02 2022-12-20 深圳市楠菲微电子有限公司 Message transmission method, device, equipment and storage medium based on PCIe
CN115495171A (en) * 2022-09-29 2022-12-20 新华三信息技术有限公司 Command management method, device, equipment and machine-readable storage medium
CN115988050A (en) * 2022-11-08 2023-04-18 山东云海国创云计算装备产业创新中心有限公司 Session-based IPMI communication method, system, storage medium and equipment
CN115913884A (en) * 2022-11-22 2023-04-04 广东安达智能装备股份有限公司 Communication method, etherCAT system, communication device and storage medium
CN116203922A (en) * 2023-01-03 2023-06-02 重庆长安汽车股份有限公司 Automobile controller fault diagnosis method, device, equipment and storage medium
CN116483737A (en) * 2023-04-18 2023-07-25 深圳市金玺智控技术有限公司 Data processing method and device, electronic equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
农副产品智能挑选控制系统设计;徐峰;王蔚;王聪;孙卓;李子林;;机电工程;20130320(03);全文 *
基于MSP430的远程空调控制系统控制终端的设计;廉小亲;陈建涛;张晓力;王嵩;;测控技术;20130218(02);全文 *
基于组态软件的城市轨道交通综合监控系统与火灾报警子系统通信协议研究;陈瑞峰;;上海电气技术;20170630(02);全文 *
支持Modbus和PPI协议复用的实时串行通信主站;姚世选;王相蓉;仲崇权;;大连交通大学学报;20150915(S1);全文 *

Also Published As

Publication number Publication date
CN117452873A (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN110995513B (en) Data sending and receiving method in Internet of things system, internet of things equipment and platform
CN111966289B (en) Partition optimization method and system based on Kafka cluster
CN110022221B (en) System interface data monitoring method, device and system
CN103927305B (en) It is a kind of that the method and apparatus being controlled is overflowed to internal memory
CN111221700B (en) Cluster node state monitoring method, device, equipment and readable storage medium
CN110806960A (en) Information processing method and device and terminal equipment
CN112235262A (en) Message analysis method and device, electronic equipment and computer readable storage medium
CN113419597A (en) Working method, equipment and medium of arbitrary waveform generator
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
CN117452873B (en) Communication method, device, equipment and storage medium
CN111427696B (en) Service resource scheduling method and device
CN113377863B (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN110932393B (en) Substation information protection master station system and data initialization method thereof
CN110109751B (en) Distribution method and device of distributed graph cutting tasks and distributed graph cutting system
CN104065505A (en) Monitoring System, Monitoring Server And Monitoring Method
CN115933591A (en) Controller diagnosis method, device, equipment and storage medium
CN113630442B (en) Data transmission method, device and system
CN115118475A (en) Method, device, equipment and medium for dispatching cryptographic equipment cluster
CN116781717A (en) Method and system for synchronizing hybrid cloud data
CN113032307A (en) Integrated device access request processing method and related assembly
CN113051143A (en) Detection method, device, equipment and storage medium for service load balancing server
CN106557530A (en) Operation system, data recovery method and device
CN116186019B (en) Function integrated intelligent analysis method and device applied to civil aircraft avionics system
CN108449343B (en) SSH protocol text data acquisition method, acquisition device and computer equipment
CN116009465B (en) Distributed data acquisition method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant