CN117850328A - PLC system, PLC data transmission method and device - Google Patents
PLC system, PLC data transmission method and device Download PDFInfo
- Publication number
- CN117850328A CN117850328A CN202310383251.1A CN202310383251A CN117850328A CN 117850328 A CN117850328 A CN 117850328A CN 202310383251 A CN202310383251 A CN 202310383251A CN 117850328 A CN117850328 A CN 117850328A
- Authority
- CN
- China
- Prior art keywords
- data
- access unit
- external access
- service module
- memory
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000005540 biological transmission Effects 0.000 title claims abstract description 52
- 230000000737 periodic effect Effects 0.000 claims description 71
- 230000003139 buffering effect Effects 0.000 claims description 6
- 230000003993 interaction Effects 0.000 abstract description 65
- 238000004590 computer program Methods 0.000 description 8
- 238000013500 data storage Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 7
- 230000004044 response Effects 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 241000252185 Cobitidae Species 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/11—Plc I-O input output
- G05B2219/1103—Special, intelligent I-O processor, also plc can only access via processor
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Computer Security & Cryptography (AREA)
- Programmable Controllers (AREA)
Abstract
The application discloses a PLC system, a PLC data transmission method and a device, and relates to the technical field of industrial control and the technical field of computers. In the PLC system, an IO scheduler is loaded with configuration information corresponding to an external access unit, wherein an IO memory area is used for caching data interacted by the IO scheduler and the external access unit; the IO scheduler is used for carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy based on configuration information corresponding to the external access unit, so that the data service module and the connected external access unit interact data; and the data service module is used for carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by the connected external access unit to interact data with the connected external access unit. By adopting the scheme, the convenience of expansion when the PLC system needs to support a new industrial protocol is improved.
Description
Technical Field
The application relates to the technical field of industrial control and the technical field of computers, in particular to a PLC system, a PLC data transmission method and a device.
Background
Programmable logic controllers (PLCs, programmable Logic Controller) are a digital operation electronic system designed specifically for use in an industrial environment. It adopts a programmable memory, in its interior is stored the instruction for executing logic operation, sequence control, timing, counting and arithmetic operation, etc. and utilizes digital or analog input and output to control various mechanical equipments or production processes.
In the running process of the PLC system, data is often required to be read in and written out with an external IO circuit module or device, and the operation period of one PLC usually comprises a plurality of steps of scanning IO input, reading IO input, executing program logic, outputting data and the like.
Currently, in practical application, a PLC system needs to be capable of connecting with several tens of devices with different industrial protocols to perform data IO (input/output) interaction. In the field of internet of things and industrial control, there are numerous industry protocol standards. Developing a PLC system that needs to support multiple external industrial bus protocols presents a significant complexity challenge in the design of the IO blocks of the PLC system.
In the current PLC system, a system programming interface mode can be adopted to support various industrial protocols. A system programming interface is provided in an operating system through a device driver, and a PLC application program realizes connection and access to external devices adopting a certain industrial protocol by calling the system programming interface.
However, by adopting the system programming interface mode, when a new industrial protocol needs to be supported, corresponding changes need to be made to the device driver, the protocol layer and the PLC application program, namely, larger changes need to be made to the software layer, complexity is larger, and the problem of inconvenient expansion exists.
Disclosure of Invention
The embodiment of the application provides a PLC system, a PLC data transmission method and a device, which are used for solving the problem that the PLC system is inconvenient to expand when a new industrial protocol needs to be supported in the prior art.
The embodiment of the application provides a PLC system, which comprises: the IO scheduler, IO memory area and data service module, the data service module is connected with external access unit, the IO scheduler is loaded with the configuration information corresponding to external access unit, wherein:
the IO memory area is used for caching the data interacted by the IO scheduler and the external access unit;
the IO scheduler is used for carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy based on configuration information corresponding to the external access unit, so that the data service module and the connected external access unit interact data;
The data service module is used for carrying out information interaction with the IO scheduler and adopting an industrial protocol supported by the connected external access unit to interact data with the connected external access unit.
Further, the configuration information corresponding to the external access unit includes: data caching information and access information;
the IO scheduler is configured to obtain output data to be sent to the external access unit from the IO memory area based on the data cache information, or cache input data from the external access unit to the IO memory area; and the data service module is specifically used for carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy and an access mode represented by the access information based on the access information, so that the data service module and the connected external access unit interact data.
Further, the data buffering information includes: the storage location and the data type of the IO memory area further include: data quantity and/or data key value pairs;
the access information is a URL.
Further, the IO memory area includes an IO memory input area and an IO memory output area, where the IO memory input area is used to buffer data from the external access unit, and the IO memory output area is used to buffer data to be sent to the external access unit.
Further, the data service module includes: a point-to-point data service module;
the IO scheduler is used for sending a data acquisition request message to the point-to-point data service module when the data is required to be acquired from an external access unit connected with the point-to-point data service module; when data is required to be sent to an external access unit connected with the point-to-point data service module, obtaining output data required to be sent from the IO memory area, and sending a data sending request message carrying the output data to the point-to-point data service module;
the point-to-point data service module is used for acquiring input data from the connected external access unit after receiving the data acquisition request message and forwarding the acquired input data to the IO scheduler; after receiving the data sending request message, acquiring the carried output data, and forwarding the acquired output data to a connected external access unit;
the IO scheduler is further configured to cache the input data into the IO memory area after receiving the input data sent by the point-to-point data service module;
the data service module comprises: a first periodic data service module, the system further comprising: sharing the memory;
The IO scheduler is used for periodically acquiring output data which needs to be sent to an external access unit connected with the first periodic data service module from the IO memory area and caching the output data into the shared memory;
the first periodic data service module is configured to periodically obtain the output data from the shared memory, and forward the obtained output data to a connected external access unit; periodically acquiring input data from the connected external access unit, and caching the input data into the shared memory;
the IO scheduler is further configured to periodically obtain the input data from the shared memory, and cache the input data in the IO memory area;
the data service module comprises: a second periodic data service module, the system further comprising: a database;
the IO scheduler is used for periodically acquiring output data which needs to be sent to an external access unit connected with the second periodic data service module from the IO memory area, and caching the output data into the database;
the second periodic data service module is used for periodically acquiring the output data from the database and forwarding the acquired output data to a connected external access unit; periodically acquiring input data from a connected external access unit, and caching the input data into the database;
The IO scheduler is further configured to periodically obtain the input data from the database, and cache the input data in the IO memory area.
Further, the IO scheduler is further configured to send a memory location query request to the first periodic data service module, and receive a storage location in the shared memory, returned by the first periodic data service module, of data interacted with the connected external access unit;
and the first period data service module is further used for returning the storage position of the data interacted with the connected external access unit in the shared memory to the IO scheduler after receiving the memory location query request.
Further, the IO scheduler is further configured to obtain, from the header area of the shared memory, a version number indicating a layout version of the shared memory before the memory location query request is sent to the first periodic data service module, and if the obtained version number is inconsistent with a version number returned by the first periodic data service module, execute the step of sending the memory location query request to the first periodic data service module;
the first period data service module is further configured to store, after updating the shared memory layout version, a version number of the updated shared memory layout version in a header area of the shared memory; and after receiving the memory location query request, returning an updated version number of the shared memory layout version to the IO scheduler.
The embodiment of the application also provides a PLC data transmission method, which is applied to an IO scheduler in a PLC system, wherein the PLC system further comprises an IO memory area and a data service module, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, and the method comprises the following steps:
acquiring configuration information corresponding to an external access unit;
based on the obtained configuration information, according to a preset scheduling strategy, the data service modules connected with the external access units perform message interaction, so that the data service modules adopt industrial protocols supported by the connected external access units to interact data with the connected external access units.
Further, the configuration information corresponding to the external access unit includes: data caching information and access information;
the method further comprises the steps of:
based on the data caching information, obtaining output data to be sent to the external access unit from the IO memory area, or caching input data from the external access unit into the IO memory area;
Based on the obtained configuration information, according to a preset scheduling policy, the message interaction is performed between the data service module connected with the external access unit, including:
and based on the access information, carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy and an access mode represented by the access information.
Further, the data buffering information includes: the storage location and the data type of the IO memory area further include: data quantity and/or data key value pairs;
the access information is a URL.
Further, the IO memory area includes an IO memory input area and an IO memory output area, where the IO memory input area is used to buffer data from the external access unit, and the IO memory output area is used to buffer data to be sent to the external access unit.
Further, the data service module at least comprises one of the following service modules:
the system comprises a point-to-point data service module, a first period data service module and a second period data service module;
when the system comprises a first period data service module, the system also comprises a shared memory;
When a second periodic data service module is included, the system further includes a database;
based on the obtained configuration information, according to a preset scheduling policy, the message interaction is performed between the data service module connected with the external access unit, including:
when data is required to be acquired from an external access unit connected with a point-to-point data service module, a data acquisition request message is sent to the point-to-point data service module, so that the point-to-point data service module acquires input data from the connected external access unit after receiving the data acquisition request message, and forwards the acquired input data to the IO scheduler;
when data is required to be sent to an external access unit connected with the point-to-point data service module, obtaining output data to be sent from the IO memory area, and sending a data sending request message carrying the output data to the point-to-point data service module, so that the point-to-point data service module obtains the carried output data after receiving the data sending request message, and forwards the obtained output data to the connected external access unit;
after receiving the input data sent by the point-to-point data service module, caching the input data into the IO memory area;
Periodically acquiring output data which is required to be sent to an external access unit connected with a first periodic data service module from the IO memory area, caching the output data into the shared memory, periodically acquiring the output data from the shared memory by the first periodic data service module, and forwarding the acquired output data to the connected external access unit;
periodically acquiring input data from the shared memory, and caching the input data in the IO memory area, wherein the input data in the shared memory is periodically acquired from a connected external access unit of the first period data service module and cached in the shared memory;
periodically acquiring output data which is required to be sent to an external access unit connected with a second periodic data service module from the IO memory area, caching the output data into the database, periodically acquiring the output data from the database by the second periodic data service module, and forwarding the acquired output data to the connected external access unit;
periodically acquiring input data from the database, caching the input data in the IO memory area, wherein the input data in the database is periodically acquired from a connected external access unit of the second periodic data service module and cached in the database.
The embodiment of the application also provides a PLC data transmission method, which is applied to a data service module in a PLC system, wherein the PLC system further comprises an IO scheduler and an IO memory area, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, and the method comprises the following steps:
performing message interaction with the IO scheduler;
and the industrial protocol supported by the connected external access unit is adopted to interact data with the connected external access unit.
Further, the data service module is a point-to-point data service module;
and carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by an external access unit connected with the IO scheduler to interact data with the external access unit connected with the IO scheduler, wherein the method comprises the following steps of:
receiving a data acquisition request message sent by the IO scheduler when data is required to be acquired from an external access unit connected with a point-to-point data service module;
after receiving the data acquisition request message, acquiring input data from a connected external access unit, and forwarding the acquired input data to the IO scheduler, so that the IO scheduler caches the input data in the IO memory area after receiving the input data;
Receiving a data transmission request message carrying output data, which is transmitted by the IO scheduler when the IO scheduler needs to transmit data to an external access unit connected with the point-to-point data service module, wherein the output data is the output data which is acquired by the IO scheduler from the IO memory area and needs to be transmitted;
and after receiving the data transmission request message, acquiring the carried output data, and forwarding the acquired output data to a connected external access unit.
Further, the data service module is a first period data service module, and the system further comprises a shared memory;
and carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by an external access unit connected with the IO scheduler to interact data with the external access unit connected with the IO scheduler, wherein the method comprises the following steps of:
periodically acquiring output data from the shared memory, and forwarding the acquired output data to a connected external access unit, wherein the output data is periodically acquired from the IO memory area by the IO scheduler, is required to be sent to the external access unit connected with the first periodic data service module, and is cached in the shared memory;
and periodically acquiring input data from the connected external access unit, and caching the input data into the shared memory, so that the IO scheduler periodically acquires the input data from the shared memory, and caches the input data into the IO memory area.
Further, the data service module is a second period data service module, and the system further comprises a database;
and carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by an external access unit connected with the IO scheduler to interact data with the external access unit connected with the IO scheduler, wherein the method comprises the following steps of:
periodically acquiring output data from the database, forwarding the acquired output data to a connected external access unit, wherein the output data is the output data which is periodically acquired by the IO scheduler from the IO memory area and is required to be sent to the external access unit connected with a second periodic data service module and is cached in the database;
and periodically acquiring input data from the connected external access unit, and caching the input data into the database, so that the IO scheduler periodically acquires the input data from the database and caches the input data into the IO memory area.
The embodiment of the application also provides a PLC data transmission device, which is applied to an IO scheduler in a PLC system, the PLC system further comprises an IO memory area and a data service module, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, and the device comprises:
The configuration information acquisition module is used for acquiring configuration information corresponding to the external access unit;
and the data interaction module is used for carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy based on the acquired configuration information, so that the data service module adopts an industrial protocol supported by the connected external access unit to interact data with the connected external access unit.
The embodiment of the application also provides a PLC data transmission device, which is applied to a data service module in a PLC system, the PLC system further comprises an IO scheduler and an IO memory area, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, and the device comprises:
the first data interaction module is used for carrying out message interaction with the IO scheduler;
and the second data interaction module is used for interacting data with the connected external access unit by adopting an industrial protocol supported by the connected external access unit.
An embodiment of the present application also provides an electronic device, including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the PLC data transmission method applied to the IO scheduler is realized, or the PLC data transmission method applied to the data service module is realized.
The embodiment of the application also provides a computer readable storage medium, which is characterized in that a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the PLC data transmission methods applied to the IO scheduler or the PLC data transmission method applied to the data service module when being executed by a processor.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the above-mentioned PLC data transmission methods applied to the IO scheduler or execute any one of the above-mentioned PLC data transmission methods applied to the data service module.
The beneficial effects of the application include:
in the scheme provided by the embodiment of the application, the PLC system comprises an IO scheduler, an IO memory area and a data service module, wherein the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, and the IO memory area is used for caching data interacted by the IO scheduler and the external access unit; the IO scheduler is used for carrying out message interaction between the data service modules connected with the external access units according to a preset scheduling strategy based on configuration information corresponding to the external access units, so that the data service modules interact data with the connected external access units; the data service module is used for carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by the connected external access unit to interact data with the connected external access unit. In the PLC system, when a new industrial protocol needs to be supported, the data service module can be expanded, so that the new industrial protocol can be adopted to interact data with an external access unit, corresponding configuration information is added, and the IO scheduler does not need to be changed.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate the application and together with the description serve to explain the embodiment of the application, and do not limit the application. In the drawings:
fig. 1 is a schematic structural diagram of a PLC system according to an embodiment of the present application;
fig. 2 is a flowchart of a PLC data transmission method applied to an IO scheduler according to an embodiment of the present application;
fig. 3 is a flowchart of a PLC data transmission method applied to a data service module according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a PLC system according to another embodiment of the present disclosure;
fig. 5 is a flowchart of a PLC data transmission method provided in an embodiment of the present application;
fig. 6 is a flowchart of a PLC data transmission method according to another embodiment of the present application;
fig. 7 is a flowchart of a PLC data transmission method according to another embodiment of the present application;
Fig. 8 is a schematic structural diagram of a PLC data transmission device applied to an IO scheduler according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a PLC data transmission device applied to a data service module according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to provide an implementation scheme for improving the convenience of expansion when a PLC system needs to support a new industrial protocol, the embodiments of the present application provide a PLC system, a PLC data transmission method and apparatus, and the following description will describe preferred embodiments of the present application with reference to the accompanying drawings, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application. And embodiments and features of embodiments in this application may be combined with each other without conflict.
An embodiment of the present application provides a PLC system, as shown in fig. 1, including: the IO dispatcher is loaded with configuration information corresponding to the external access unit, wherein the IO memory area and the data service module are connected with the external access unit:
the IO memory area is used for caching the data interacted by the IO scheduler and the external access unit;
The IO scheduler is used for carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy based on configuration information corresponding to the external access unit, so that the data service module and the connected external access unit interact data;
and the data service module is used for carrying out message interaction with the IO scheduler and adopting an industrial protocol supported by the connected external access unit to interact data with the connected external access unit.
By adopting the PLC system provided by the embodiment of the application, when a new industrial protocol needs to be supported, the data service module can be expanded, so that the new industrial protocol can be adopted to interact data with an external access unit, corresponding configuration information is added, and an IO scheduler does not need to be changed.
Further, the configuration information corresponding to the external access unit may include: data caching information and access information;
the IO scheduler can acquire output data to be sent to the external access unit from the IO memory area based on the data caching information, or cache input data from the external access unit to the IO memory area; and based on the access information, carrying out message interaction between the data service module connected with the external access unit according to a preset scheduling strategy and an access mode represented by the access information, so that the data service module interacts data with the connected external access unit.
Further, the data buffering information may include: storage locations and data types, may also include: data quantity and/or data key value pairs; the access information may be a URL (uniform resource locator system, uniform Resource Locator), and various information carried in the URL may represent a corresponding access manner.
In the above PLC system, the user logic module may be various PLC applications, and may acquire input data from the external access unit from the IO memory area based on application requirements, or may cache output data to be sent to the external access unit into the IO memory area.
In this embodiment, as shown in fig. 1, the IO memory area may include an IO memory input area and an IO memory output area, where the IO memory input area is used to cache data from an external access unit, and the IO memory output area is used to cache data to be sent to the external access unit.
In this embodiment of the present application, the external access unit belongs to one external IO device, and one external IO device may include a plurality of external access units.
Based on the above PLC system provided by the embodiment of the present application, correspondingly, the embodiment of the present application further provides a PLC data transmission method, which is applied to an IO scheduler in the PLC system, where the PLC system further includes an IO memory area and a data service module, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, and the IO memory area is used to buffer data interacted by the IO scheduler and the external access unit, as shown in fig. 2, and the method includes:
Step 21, obtaining configuration information corresponding to an external access unit;
and step 22, based on the obtained configuration information, carrying out message interaction with the data service module connected with the external access unit according to a preset scheduling strategy, so that the data service module adopts an industrial protocol supported by the connected external access unit to interact data with the connected external access unit.
Correspondingly, the embodiment of the application also provides a PLC data transmission method, which is applied to a data service module in a PLC system, wherein the PLC system further comprises an IO scheduler and an IO memory area, the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, and the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, as shown in fig. 3, the method comprises the following steps:
step 31, carrying out message interaction with the IO scheduler;
step 32, using an industrial protocol supported by the connected external access unit, interacting data with the connected external access unit.
The PLC system and the corresponding method provided in the present application are described in detail with specific embodiments with reference to the accompanying drawings.
In this embodiment, for each external access unit connected to the PLC system, an IO configuration file may be created, where the IO configuration file includes configuration information corresponding to each external access unit, where the configuration information may describe a correspondence between a storage location in an IO memory area and the external access unit, and specifically may describe a correspondence between a storage location in the IO memory area and an IO physical address of the external access unit, so as to implement data interaction with the external access unit, and storage of input data and output data of the interaction in the IO memory area.
Specifically, an access unit exists in the IO configuration file corresponding to each external access unit, where the access unit may be understood as a piece of information content, and includes corresponding configuration information.
The configuration information may specifically include: data caching information and access information;
the data cache information is used for acquiring output data and cache input data in the IO memory area, and the access information is used for interacting data with the external access unit.
Further, the data cache information may include a storage location, a data type, and a data amount; alternatively, the data cache information may include a storage location, a data type, and a data key value pair;
the access information may be a URL.
In other embodiments, configuration information corresponding to the external access unit may also be provided by the source code.
The following is an example description of configuration information corresponding to an external access unit:
configuration information example one:
in the configuration information example one described above, "input" represents a cache of input data from an external access unit;
the field "location" indicates a storage location, which may be a stored first address;
the field 'type' indicates a data type, and the data type may also indicate bytes occupied by data in the IO memory area;
The field "num" indicates the data amount, i.e. the data amount of one data interaction with the external access unit;
based on the configuration information of the three fields, it can be determined which address the storage head address of the data in the IO memory area starts to which address ends.
The field "access" indicates access information, i.e., a URL, which may contain components of a protocol, a host address, a port, a resource path, and a query parameter.
In the embodiment of the application, the type of the "protocol" in the URL may include two types of standard protocols and custom protocols.
Standard protocols may include, among others, "http", "https", "shape", and "shapes", etc. Standard protocols may be used to interact data with external access units through point-to-point data service modules.
The custom protocol may include three types of "static memory sharing", "dynamic memory sharing" and "database" for interacting data with external access units through the periodic data service module.
Configuration information example two:
in the second configuration information example, the "output" indicates a cache of output data that needs to be sent to the external access unit;
the field "key" indicates a data key pair, which may describe the structure of output data for encoding data using JSON protocol or CBOR protocol.
In this embodiment of the present application, the data service module in the PLC system may use different data interaction modes based on the characteristics of data interaction between the user logic module of the PLC application and the external access unit, which may be performing data interaction in a point-to-point manner or performing data interaction periodically.
As shown in fig. 4, the PLC system provided in the embodiment of the present application may at least include one of the following three data service modules:
the system comprises a point-to-point data service module, a first period data service module and a second period data service module;
when the first period data service module is included, the PLC system further comprises a shared memory;
when the second periodic data service module is included, the PLC system also includes a database.
The data interaction between the PLC system and the external access unit is described in detail below for each data service module.
For the point-to-point data service module, the embodiment of the application provides a PLC data transmission method, as shown in fig. 5, including:
step 501, the IO scheduler obtains configuration information corresponding to an external access unit in the loaded IO configuration file according to a preset scheduling policy, where the external access unit is connected to the point-to-point data service module.
In this step, the following configuration information example three is described as an example:
after loading the IO configuration file, the IO scheduler may sequentially obtain configuration information corresponding to the external access unit according to a preset scheduling policy, execute step 502 if the configuration information is of an output type, and execute step 507 if the configuration information is of an input type.
Step 502, if the configuration information is of an output type, indicating that output data needs to be sent to an external access unit based on the configuration information, the IO scheduler obtains the output data from a storage location indicated by the configuration information in the IO memory output area based on the configuration information.
According to the information of the fields "location", "type" and "num" in the configuration information three, the IO scheduler may obtain two pieces of output data from the location 1 and the location 2 of the IO memory output area according to the byte format.
Step 503, the IO scheduler encodes the obtained output data.
In this embodiment of the present application, output data may be encoded by adopting a corresponding encoding manner based on the needs of practical applications, for example, output data may be encoded by using a JSON array format, where the encoded format is as follows: [100,200]; plain text format encoding may also be used, and typically, plain text format encoding may be used when the number of data is 1.
If the configuration information contains data key value pairs, the output data may be encoded in the encoding format represented by the data key value pairs, e.g., using the JSON object format, resulting in { "key1":100, "key2":200}.
Step 504, the IO scheduler sends a data sending request message carrying output data to the point-to-point data service module connected to the external access unit.
In this step, a data transmission request message (PUT message) carrying output data may be specifically generated based on the URL of the field "access" in the third configuration information, and sent to the point-to-point data service module.
The URL is also carried in the data transmission request message.
Step 505, after receiving the data transmission request message, the point-to-point data service module obtains the carried output data from the data transmission request message.
In this embodiment of the present application, the peer-to-peer data service module may determine whether the URL carried in the data transmission request message meets the requirement, that is, whether the URL can be processed, if so, continue to execute the subsequent steps, and if not, may return an error code indicating that the URL does not meet the requirement to the IO scheduler, so that the IO scheduler performs corresponding processing.
Step 506, the peer-to-peer data service module forwards the obtained output data to the connected external access unit by adopting an industrial protocol supported by the connected external access unit.
Step 507, if the configuration information is an input type, which indicates that input data needs to be requested to an external access unit based on the configuration information, the IO scheduler sends a data acquisition request message to a point-to-point data service module connected to the external access unit based on the configuration information.
In this step, a data acquisition request message (GET message) may be specifically generated based on the URL of the field "access" in the third configuration information, and sent to the peer-to-peer data service module.
The data acquisition request message may carry a URL.
Step 508, the peer-to-peer data service module acquires the input data from the connected external access unit after receiving the data acquisition request message.
In this step, input data may be acquired from the connected external access unit using an industrial protocol supported by the connected external access unit based on the carried URL.
In this embodiment of the present application, the peer-to-peer data service module may determine whether the URL carried in the data acquisition request message meets the requirement, that is, whether the URL can be processed, if so, continue to execute the subsequent steps, and if not, may return an error code indicating that the URL does not meet the requirement to the IO scheduler, so that the IO scheduler performs corresponding processing.
Step 509, the point-to-point data service module forwards the acquired input data to the IO scheduler.
Specifically, a request response message carrying the input data may be sent to the IO scheduler.
Step 510, the IO scheduler obtains the carried input data from the request response message after receiving the request response message.
In this step, the IO scheduler may complete data decoding according to the format indicated by "type" in the configuration information three, for example, if the format is a plain text format, complete single data decoding, and if the format is a JSON array format, decode to obtain several pieces of data.
In this step, if the configuration information includes a data key pair, the configuration information may also be used to decode and acquire the input data using the structure represented by the data key pair in the configuration information.
In step 511, after determining that the acquired input data satisfies the data type and the data quantity in the configuration information, the IO scheduler caches the acquired input data in a storage location indicated by the configuration information in the IO memory input area.
For example, the first piece of data is stored in a position beginning at the first address, and the second piece of data is stored in a position of the first address plus the number of bytes occupied by the first piece of data.
The PLC data transmission method shown in fig. 5 and provided by the embodiment of the present application is based on a point-to-point data service module, so as to implement data interaction with an external access unit, and the PLC system may include a plurality of point-to-point data service modules, which are respectively used for supporting data interaction of multiple industrial protocols.
For the first period data service module, the embodiment of the application provides a PLC data transmission method, as shown in fig. 6, including:
in step 601, the IO scheduler obtains configuration information corresponding to an external access unit in the loaded IO configuration file, where the external access unit is connected to the first periodic data service module.
In this step, the following configuration information example four is described as an example:
based on the information in the above configuration information example four, the storage location in the IO memory area is 1, the data type is "INT", one piece of data occupies 2 bytes in the memory, the data amount is 1, and the protocol information "shm2" in the url may represent that the data is interacted with the first periodic data service module by adopting the manner of sharing the memory.
The memory sharing method may further include "static memory sharing" and "dynamic memory sharing", where:
for "static memory sharing," information about the location of data in shared memory may be contained in a URL, for example, the URL may be in the following format:
protocol flags// [ shared memory name ]/[ offset location ]
[ protocol flags ]:/[ shared memory name ]? [ offset position query ]
Examples: the sum:// shared-mem/100, or the sum:// shared-meffset=100;
For "dynamic memory sharing", the URL does not include the address of the data in the shared memory, and may provide necessary information for the IO scheduler to request the address query from the first periodic data service module, for example, the URL may include information: the format of the URL may be as follows, sharing the memory name, port, path, and query parameters:
: [ protocol flags ]/[ shared memory name ]: port/path? [ offset position query ]
Examples: shm2:// shared-mem: 5555/ethercatmaster=100 & slave=1 & reg=100;
the configuration information may be of an output type or an input type.
Step 602, the IO scheduler creates memory nodes AN (Access-nodes) for the configuration information, where each memory Node AN may include the following information:
URL: acquiring loaded configuration information;
LOC: the storage location of the input data or the output data in the shared memory.
In this embodiment of the present application, if the protocol in the URL indicates "static memory sharing", the initial value of the protocol may be obtained from the URL, and if the protocol indicates "dynamic memory sharing", the initial value of the protocol may be set to an invalid value (for example, -1), and then LOC is obtained through a LOC obtaining procedure.
In the LOC acquisition process, the IO scheduler can construct a memory location query request based on the URL and send the memory location query request to the first periodic data service module, and the first periodic data service module determines the storage position of data interacted with the connected external access unit in the shared memory based on the memory location query request, carries the storage position in a memory location query response and returns the storage position to the IO scheduler.
Furthermore, the version number V (representing the layout version of the shared memory) may be returned at the same time, and the version number V is added in the header of the shared memory, and accordingly, if the version number V is consistent with the version number V in the header of the shared memory, the LOC may also remain unchanged, otherwise, the LOC has changed, and the LOC acquisition process needs to be re-executed, that is, a memory location query request is sent to the first periodic data service module.
In step 603, the IO scheduler periodically executes AN input data acquisition task or AN output data storage task based on the information in the memory node AN.
The flow of executing the input data acquisition task is as follows:
the first step: checking whether a shared memory object contained in a URL in the current memory node AN is already opened, if not, attempting to open and map to the current process space, and if not, exiting the execution of the current task;
and a second step of: acquiring a synchronous lock in a shared memory head;
and a third step of: based on LOC in the memory node AN, acquiring input data from AN external access unit from a storage position represented by LOC in the shared memory, and releasing a synchronous lock;
The input data is acquired from a connected external access unit in a first period data service module period and is cached in a shared memory;
fourth step: and caching the acquired input data to the corresponding position of the input area of the IO memory according to the storage position indicated in the configuration information.
The flow of executing the output data storage task is as follows:
the first step: checking whether a shared memory object contained in a URL in the current memory node AN is already opened, if not, attempting to open and map to the current process space, and if not, exiting the execution of the current task;
and a second step of: based on the storage position indicated in the configuration information, obtaining output data which needs to be sent to an external access unit connected with the first periodic data service module from an IO memory output area;
and a third step of: acquiring a synchronous lock in a shared memory head;
fourth step: based on LOC in the memory node AN, the output data is cached to a storage location denoted by LOC in the shared memory, and the synchronization lock is released.
Step 604, after the first periodic data service module is started, loading a private configuration for interacting data with the external access unit using an industrial protocol supported by the connected external access unit.
Step 605, the first periodic data service module creates a shared memory.
The shared memory may include a header area and a data area, wherein the header area may include a length synchronization lock of the data area, and the data area is used for storing data interacted with the external access unit.
Based on the above description, when "dynamic memory sharing" is adopted, the header area may further include a version number V of the memory layout version.
Step 606, the first periodic data service module periodically executes an input data storage task or an output data acquisition task.
The execution of the input data storage task flow is as follows:
the first step: acquiring input data from an external access unit by adopting an industrial protocol supported by the connected external access unit;
and a second step of: acquiring a synchronous lock in a shared memory head;
and a third step of: and caching the acquired input data to the corresponding position in the shared memory, and releasing the synchronous lock.
The execution output data acquisition task flow is as follows:
the first step: acquiring a synchronous lock in a shared memory head;
and a second step of: acquiring output data to be sent to an external access unit from a corresponding position in the shared memory, wherein the output data is stored in the shared memory by the IO scheduler, and releasing a synchronous lock;
And a third step of: and forwarding the acquired output data to the connected external access unit by adopting an industrial protocol supported by the connected external access unit.
The steps 601-603 and 604-606 are executed according to logic between the steps in the execution sequence, not strictly according to the sequence described in the steps.
The method for transmitting PLC data shown in fig. 6 according to the embodiment of the present application is based on a first periodic data service module and a shared memory, so as to implement data interaction with an external access unit, and the PLC system may include a plurality of first periodic data service modules, which are respectively configured to support data interaction of multiple industrial protocols.
For the second periodic data service module, the embodiment of the application provides a PLC data transmission method, as shown in fig. 7, including:
in step 701, the IO scheduler obtains configuration information corresponding to an external access unit in the loaded IO configuration file, where the external access unit is connected to the second periodic data service module.
In this step, the following configuration information example five is described as an example:
based on the information in the configuration information five, the storage position in the IO memory area is 10, the data type is DINT, one piece of data occupies 4 bytes in the memory, the data quantity is 1, and the protocol information redis in the URL can represent that the data is interacted with the second period data service module in a database mode.
For the database, the URL may further include an IP address and a port number of the database, a key value of the data, and the like, for example, the format of the URL may be as follows:
protocol flags// [ database IP ]: port/[ data key values ]
Examples: redis://192.168.1.11:6666/1/1/1.
Step 702, the IO scheduler creates memory nodes AN (Access-nodes) for the configuration information, where each memory Node AN may include the following information:
URL: acquiring loaded configuration information;
the connection information of the memory data can also be obtained from the configuration information.
In step 703, the IO scheduler periodically executes AN input data acquisition task or AN output data storage task based on the information in the memory node AN.
The flow of executing the input data acquisition task is as follows:
the first step: checking whether a database pointed by a URL in the current memory node AN is connected or not, if not, trying to connect, and if not, exiting the execution of the current task;
and a second step of: acquiring input data from AN external access unit from a database by using a data key value in a URL in a memory node AN;
the input data is acquired from the connected external access unit periodically by the second periodic data service module and is cached in the database;
And a third step of: and caching the acquired input data to the corresponding position of the input area of the IO memory according to the storage position indicated in the configuration information.
The flow of executing the output data storage task is as follows:
the first step: checking whether a database pointed by a URL in the current memory node AN is connected or not, if not, trying to connect, and if not, exiting the execution of the current task;
and a second step of: based on the storage position indicated in the configuration information, obtaining output data which is required to be sent to an external access unit connected with the second periodic data service module from the IO memory output area;
and a third step of: and according to the data key value in the URL in the memory node AN, caching the output data to the corresponding position in the database.
Step 704, after the second periodic data service module is started, loading a private configuration for interacting data with the external access unit using an industrial protocol supported by the connected external access unit.
Step 705, the second periodic data service module establishes a network connection with the database.
Step 706, the second periodic data service module periodically executes an input data storage task or an output data acquisition task.
The execution of the input data storage task flow is as follows:
the first step: acquiring input data from an external access unit by adopting an industrial protocol supported by the connected external access unit;
and a second step of: and caching the acquired input data on corresponding data key values in a database.
The execution output data acquisition task flow is as follows:
the first step: acquiring output data which needs to be sent to an external access unit from a corresponding data key value in a database, wherein the output data is stored in the database by an IO scheduler;
and a second step of: and forwarding the acquired output data to the connected external access unit by adopting an industrial protocol supported by the connected external access unit.
The steps 701-703 and 704-706 are performed in the order of execution according to the logic between the steps, not exactly in the order described in the steps.
The method for transmitting PLC data shown in fig. 7 according to the embodiment of the present application is based on the second periodic data service module and the database, so as to implement data interaction with the external access unit, and the PLC system may include a plurality of second periodic data service modules, which are respectively configured to support data interaction of multiple industrial protocols.
Based on the same inventive concept, according to the PLC data transmission method applied to the IO scheduler provided in the foregoing embodiment of the present application, correspondingly, another embodiment of the present application further provides a PLC data transmission device applied to the IO scheduler in the PLC system, where the PLC system further includes an IO memory area and a data service module, the data service module is connected with the external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, and the IO memory area is used for caching data interacted by the IO scheduler and the external access unit, and a structural schematic diagram of the PLC data transmission device is shown in fig. 8, and specifically includes:
a configuration information obtaining module 81, configured to obtain configuration information corresponding to an external access unit;
and the data interaction module 82 is configured to perform message interaction with the data service module connected to the external access unit according to a preset scheduling policy based on the obtained configuration information, so that the data service module uses an industrial protocol supported by the connected external access unit to interact data with the connected external access unit.
Further, the configuration information corresponding to the external access unit includes: data caching information and access information;
The data interaction module 82 is further configured to obtain, based on the data cache information, output data to be sent to the external access unit from the IO memory area, or cache input data from the external access unit to the IO memory area;
and the data service module is specifically used for carrying out message interaction with the data service module connected with the external access unit according to the access information, the preset scheduling strategy and the access mode indicated by the access information.
Further, the data buffering information includes: the storage location and the data type of the IO memory area further include: data quantity and/or data key value pairs; the access information is a URL.
Further, the IO memory area includes an IO memory input area and an IO memory output area, where the IO memory input area is used to buffer data from the external access unit, and the IO memory output area is used to buffer data to be sent to the external access unit.
Further, the data service module at least comprises one of the following service modules:
the system comprises a point-to-point data service module, a first period data service module and a second period data service module;
When the system comprises a first period data service module, the system also comprises a shared memory;
when a second periodic data service module is included, the system further includes a database;
the data interaction module 82 is specifically configured to, when data needs to be acquired from an external access unit connected to the peer-to-peer data service module, send a data acquisition request message to the peer-to-peer data service module, so that the peer-to-peer data service module acquires input data from the connected external access unit after receiving the data acquisition request message, and forwards the acquired input data to the IO scheduler;
when data is required to be sent to an external access unit connected with the point-to-point data service module, obtaining output data to be sent from the IO memory area, and sending a data sending request message carrying the output data to the point-to-point data service module, so that the point-to-point data service module obtains the carried output data after receiving the data sending request message, and forwards the obtained output data to the connected external access unit;
after receiving the input data sent by the point-to-point data service module, caching the input data into the IO memory area;
Periodically acquiring output data which is required to be sent to an external access unit connected with a first periodic data service module from the IO memory area, caching the output data into the shared memory, periodically acquiring the output data from the shared memory by the first periodic data service module, and forwarding the acquired output data to the connected external access unit;
periodically acquiring input data from the shared memory, and caching the input data in the IO memory area, wherein the input data in the shared memory is periodically acquired from a connected external access unit of the first period data service module and cached in the shared memory;
periodically acquiring output data which is required to be sent to an external access unit connected with a second periodic data service module from the IO memory area, caching the output data into the database, periodically acquiring the output data from the database by the second periodic data service module, and forwarding the acquired output data to the connected external access unit;
periodically acquiring input data from the database, caching the input data in the IO memory area, wherein the input data in the database is periodically acquired from a connected external access unit of the second periodic data service module and cached in the database.
Further, the data interaction module 82 is further configured to send a memory location query request to the first periodic data service module; and receiving a storage position of the returned data interacted with the connected external access unit in the shared memory after the first period data service module receives the memory positioning query request.
Further, the data interaction module 82 is further configured to, before the sending the memory location query request to the first periodic data service module, obtain a version number indicating a layout version of the shared memory from the header area of the shared memory, and if the obtained version number is inconsistent with a version number returned by the first periodic data service module, execute the step of sending the memory location query request to the first periodic data service module;
and receiving an updated version number of the shared memory layout version returned by the first periodic data service module after receiving the memory location query request, wherein the updated version number is the updated version number of the shared memory layout version stored in the header area of the shared memory by the first periodic data service module after updating the shared memory layout version.
Based on the same inventive concept, according to the PLC data transmission method applied to the data service module provided in the foregoing embodiment of the present application, correspondingly, another embodiment of the present application further provides a PLC data transmission device applied to the data service module in the PLC system, where the PLC system further includes an IO scheduler and an IO memory area, the data service module is connected to the external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, and the IO memory area is used to buffer data interacted by the IO scheduler and the external access unit, and a structural schematic diagram of the PLC data transmission device is shown in fig. 9, and specifically includes:
a first data interaction module 91, configured to perform message interaction with the IO scheduler;
a second data interaction module 92 for interacting data with the connected external access unit using an industrial protocol supported by the connected external access unit.
Further, the data service module is a point-to-point data service module;
the first data interaction module 91 is specifically configured to receive a data acquisition request message sent by the IO scheduler when data needs to be acquired from an external access unit connected to the point-to-point data service module;
The second data interaction module 92 is specifically configured to acquire input data from the connected external access unit after receiving the data acquisition request message;
the first data interaction module 91 is further configured to forward the obtained input data to the IO scheduler, so that the IO scheduler caches the input data in the IO memory area after receiving the input data;
the first data interaction module 91 is specifically configured to receive a data transmission request message that is sent and carries output data when the IO scheduler needs to send data to an external access unit connected to the peer-to-peer data service module, where the output data is output data that is acquired by the IO scheduler from the IO memory area and needs to be sent;
the second data interaction module 92 is specifically configured to obtain the carried output data after receiving the data sending request message, and forward the obtained output data to a connected external access unit.
Further, the data service module is a first period data service module, and the system further comprises a shared memory;
the first data interaction module 91 is specifically configured to periodically obtain output data from the shared memory;
The second data interaction module 92 is specifically configured to forward the obtained output data to a connected external access unit, where the output data is obtained from the IO memory area in the IO scheduler cycle, and is to be sent to the external access unit connected to the first cycle data service module, and cached in the shared memory;
a second data interaction module 92 for periodically obtaining input data from the connected external access unit;
the first data interaction module 91 is further configured to cache the input data in the shared memory, so that the IO scheduler periodically obtains the input data from the shared memory, and caches the input data in the IO memory area.
Further, the first data interaction module 91 is further configured to receive a memory location query request sent by the IO scheduler; and returning the storage position of the data interacted with the connected external access unit in the shared memory to the IO scheduler.
Further, the memory location query request is sent by the IO scheduler when the version number, obtained from the header area of the shared memory, representing the layout version of the shared memory is inconsistent with the version number returned by the first periodic data service module;
The first data interaction module 91 is further configured to store, after updating the shared memory layout version, a version number of the updated shared memory layout version in a header area of the shared memory; and after receiving the memory location query request, returning an updated version number of the shared memory layout version to the IO scheduler.
Further, the data service module is a second period data service module, and the system further comprises a database;
the first data interaction module 91 is specifically configured to periodically acquire output data from the database;
the second data interaction module 92 is specifically configured to forward the obtained output data to a connected external access unit, where the output data is obtained from the IO memory area in the IO scheduler cycle, and is to be sent to the external access unit connected to the second cycle data service module, and cached in the database;
a second data interaction module 92, in particular for periodically obtaining input data from the connected external access unit;
the first data interaction module 91 is specifically configured to cache the input data in the database, so that the IO scheduler periodically obtains the input data from the database, and caches the input data in the IO memory area.
The functions of the above-described modules may correspond to the corresponding processing steps in the flow shown in fig. 1 to 7.
The PLC data transmission device provided by the embodiment of the present application may be implemented by a computer program. It should be understood by those skilled in the art that the above-mentioned module dividing manner is only one of many module dividing manners, and if the module dividing manner is divided into other modules or not, it is within the scope of the present application as long as the PLC data transmission device has the above-mentioned functions.
Embodiments of the present application also provide an electronic device, as shown in fig. 10, comprising a processor 101 and a machine-readable storage medium 102, the machine-readable storage medium 102 storing machine-executable instructions executable by the processor 101, the processor 101 being caused by the machine-executable instructions to: the PLC data transmission method applied to the IO scheduler is realized, or the PLC data transmission method applied to the data service module is realized.
The embodiment of the application also provides a computer readable storage medium, which is characterized in that a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the PLC data transmission methods applied to the IO scheduler or the PLC data transmission method applied to the data service module when being executed by a processor.
The embodiment of the application also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the above-mentioned PLC data transmission methods applied to the IO scheduler or execute any one of the above-mentioned PLC data transmission methods applied to the data service module.
The machine-readable storage medium in the electronic device may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, an electronic device, a computer readable storage medium, a computer program product embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, and reference is made to the section description of a method embodiment for relevant points.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.
Claims (10)
1. A PLC system, comprising: the system comprises an IO scheduler, an IO memory area and a data service module, wherein the data service module is connected with an external access unit, the IO scheduler is loaded with configuration information corresponding to the external access unit, the data service module comprises a first period data service module, and the system further comprises a shared memory, wherein:
the IO memory area is used for caching the data interacted by the IO scheduler and the external access unit;
the IO scheduler is configured to periodically obtain output data that needs to be sent to an external access unit connected to the first periodic data service module from the IO memory area based on configuration information corresponding to the external access unit, and cache the output data into the shared memory;
the first periodic data service module is configured to periodically obtain the output data from the shared memory, and forward the obtained output data to a connected external access unit by adopting an industrial protocol supported by the connected external access unit; periodically acquiring input data from the connected external access units by adopting an industrial protocol supported by the connected external access units, and caching the input data into the shared memory;
The IO scheduler is further configured to periodically obtain the input data from the shared memory, and cache the input data in the IO memory area.
2. The system of claim 1, wherein the configuration information corresponding to the external access unit comprises: data caching information and access information;
the IO scheduler is configured to obtain output data to be sent to the external access unit from the IO memory area based on the data cache information, or cache input data from the external access unit to the IO memory area; and the method is specifically used for periodically acquiring output data which needs to be sent to an external access unit connected with the first periodic data service module from the IO memory area according to the access mode indicated by the access information, caching the output data into the shared memory, periodically acquiring the input data from the shared memory, and caching the input data into the IO memory area.
3. The system of claim 2, wherein the data caching information comprises: the storage location and the data type of the IO memory area further include: data quantity and/or data key value pairs;
The access information is a URL.
4. The system of claim 1, wherein the IO memory region comprises an IO memory input region for buffering data from an external access unit and an IO memory output region for buffering data to be sent to an external access unit.
5. The system of claim 1, wherein the data service module further comprises a second periodic data service module;
the system further comprises: a database;
the IO scheduler is further used for periodically acquiring output data which needs to be sent to an external access unit connected with the second periodic data service module from the IO memory area, and caching the output data into the database;
the second periodic data service module is used for periodically acquiring the output data from the database and forwarding the acquired output data to a connected external access unit; periodically acquiring input data from a connected external access unit, and caching the input data into the database;
the IO scheduler is further configured to periodically obtain the input data from the database, and cache the input data in the IO memory area.
6. The system of claim 1, wherein the IO scheduler is further configured to send a memory location query request to the first periodic data service module, and receive a storage location in the shared memory of data returned by the first periodic data service module that interacts with a connected external access unit;
and the first period data service module is further used for returning the storage position of the data interacted with the connected external access unit in the shared memory to the IO scheduler after receiving the memory location query request.
7. The system of claim 6, wherein the IO scheduler is further configured to obtain a version number representing a shared memory layout version from a header area of the shared memory before the sending of the memory location query request to the first periodic data service module, and if the obtained version number is inconsistent with a version number returned by the first periodic data service module, execute the step of sending the memory location query request to the first periodic data service module;
the first period data service module is further configured to store, after updating the shared memory layout version, a version number of the updated shared memory layout version in a header area of the shared memory; and after receiving the memory location query request, returning an updated version number of the shared memory layout version to the IO scheduler.
8. The utility model provides a PLC data transmission method which is characterized in that is applied to the IO scheduler in the PLC system, the PLC system still includes IO memory district and data service module, data service module is connected with external access unit, data service module includes first period data service module, the system still includes shared memory, the IO scheduler is loaded with the configuration information that corresponds with external access unit, IO memory district is used for caching the data that IO scheduler and external access unit interacted, the method includes:
acquiring configuration information corresponding to an external access unit;
based on the obtained configuration information, periodically obtaining output data which is required to be sent to an external access unit connected with a first periodic data service module from the IO memory area, caching the output data into the shared memory, so that the first periodic data service module periodically obtains the output data from the shared memory, and forwarding the obtained output data to the connected external access unit by adopting an industrial protocol supported by the connected external access unit;
based on the obtained configuration information, periodically obtaining input data from the shared memory, caching the input data in the IO memory area, wherein the input data in the shared memory is an industrial protocol supported by the first periodic data service module by adopting a connected external access unit, and periodically obtained from the connected external access unit and cached in the shared memory.
9. The method of claim 8, wherein the configuration information corresponding to the external access unit comprises: data caching information and access information;
the method further comprises the steps of:
based on the data caching information, obtaining output data to be sent to the external access unit from the IO memory area, or caching input data from the external access unit into the IO memory area;
based on the obtained configuration information, periodically obtaining output data to be sent to an external access unit connected with the first periodic data service module from the IO memory area, and caching the output data into the shared memory, where the steps include:
according to the access mode represented by the access information, periodically acquiring output data which is required to be sent to an external access unit connected with a first periodic data service module from the IO memory area, and caching the output data into the shared memory;
the periodically obtaining input data from the shared memory based on the obtained configuration information, and caching the input data in the IO memory area includes:
and periodically acquiring input data from the shared memory according to the access mode indicated by the access information, and caching the input data into the IO memory area.
10. The method of claim 9, wherein the data caching information comprises: the storage location and the data type of the IO memory area further include: data quantity and/or data key value pairs;
the access information is a URL.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310383251.1A CN117850328A (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210535826.2A CN115047819B (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
CN202310383251.1A CN117850328A (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210535826.2A Division CN115047819B (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117850328A true CN117850328A (en) | 2024-04-09 |
Family
ID=83159259
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210535826.2A Active CN115047819B (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
CN202310383251.1A Pending CN117850328A (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
CN202310387013.8A Pending CN117850329A (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210535826.2A Active CN115047819B (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310387013.8A Pending CN117850329A (en) | 2022-05-17 | 2022-05-17 | PLC system, PLC data transmission method and device |
Country Status (1)
Country | Link |
---|---|
CN (3) | CN115047819B (en) |
Family Cites Families (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11288307A (en) * | 1998-04-01 | 1999-10-19 | Omron Corp | Fa system |
CN101042582A (en) * | 2007-04-25 | 2007-09-26 | 上海电器科学研究所(集团)有限公司 | Programmable and configurable remote I/O module with field bus interface |
CN101344773B (en) * | 2008-08-13 | 2010-11-10 | 陈华兴 | Programmable controller PLC and its expansion method |
CN201307867Y (en) * | 2008-11-13 | 2009-09-09 | 上海纳杰电气成套有限公司 | Communication system applicable to multiple communication protocols |
CN101958838B (en) * | 2010-10-14 | 2012-08-22 | 联动优势科技有限公司 | Data access method and device |
JP5803337B2 (en) * | 2011-06-28 | 2015-11-04 | オムロン株式会社 | Synchronization control device, synchronization control method, synchronization control program, and computer-readable recording medium recording the synchronization control program |
JP6166530B2 (en) * | 2012-12-14 | 2017-07-19 | オムロン株式会社 | Information processing apparatus and program |
CN104090519A (en) * | 2014-06-25 | 2014-10-08 | 深圳市汇川控制技术有限公司 | System for being in communication with PLC extended module and implementation method thereof |
JP6481267B2 (en) * | 2014-06-27 | 2019-03-13 | オムロン株式会社 | Programmable display |
CN104950855A (en) * | 2015-06-19 | 2015-09-30 | 湖南正泰水务有限公司 | Town sewage plant and pump station operation monitoring management system and town sewage plant and pump station operation monitoring management method |
CN105049310A (en) * | 2015-07-30 | 2015-11-11 | 深圳市科为源自动化技术有限公司 | Intelligent module for realizing GPRS (General Packet Radio Service) remote communication based on PLC (Programmable Logic Controller) backplane bus protocol |
CN206402259U (en) * | 2017-01-16 | 2017-08-11 | 天芯宜智能网络科技(天津)有限公司 | A kind of expansible multi-protocol adaptive control device |
CN107948009B (en) * | 2017-10-30 | 2020-12-25 | 中国电力科学研究院有限公司 | Method and model for constructing data interaction channel for PLC protocol test |
CN109413141B (en) * | 2018-09-07 | 2022-03-18 | 中国电力科学研究院有限公司 | Access method and system between main station and sub-station of power grid |
JP7423920B2 (en) * | 2019-07-03 | 2024-01-30 | オムロン株式会社 | Control systems, configuration devices and computer programs |
CN212134729U (en) * | 2020-06-30 | 2020-12-11 | 安徽万昇建设工程有限公司 | Portable water flow velocity measuring device for water conservancy detection |
CN111698268A (en) * | 2020-07-16 | 2020-09-22 | 江苏神彩科技股份有限公司 | Equipment communication protocol converter |
CN214042097U (en) * | 2020-12-25 | 2021-08-24 | 傲拓科技股份有限公司 | PLC serial port communication extension module capable of customizing protocol |
CN113721532A (en) * | 2021-09-07 | 2021-11-30 | 深圳市合信自动化技术有限公司 | PLC CPU extension module multi-bus protocol self-adaption method |
-
2022
- 2022-05-17 CN CN202210535826.2A patent/CN115047819B/en active Active
- 2022-05-17 CN CN202310383251.1A patent/CN117850328A/en active Pending
- 2022-05-17 CN CN202310387013.8A patent/CN117850329A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
CN117850329A (en) | 2024-04-09 |
CN115047819A (en) | 2022-09-13 |
CN115047819B (en) | 2023-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107835178B (en) | Multi-protocol service communication method and device and electronic equipment | |
US8572157B2 (en) | Configuration based approach to unify web services | |
US20100083281A1 (en) | System and method for processing messages using a common interface platform supporting multiple pluggable data formats in a service-oriented pipeline architecture | |
US20100058285A1 (en) | Compositional view of imperative object model | |
US20020161827A1 (en) | Communication system between a programmable logic controller server and a client machine | |
US20140181252A1 (en) | Request and response decoupling via pluggable transports in a service oriented pipeline architecture for a request response message exchange | |
Käbisch et al. | Efficient and flexible XML-based data-exchange in microcontroller-based sensor actor networks | |
CN102981911A (en) | Distributed message handling system and device and method thereof | |
JP4554723B2 (en) | Managing network response buffering behavior | |
CN113596017A (en) | Protocol analysis method, device, soft gateway and storage medium | |
CN115047819B (en) | PLC system, PLC data transmission method and device | |
Culler | TinyOS: operating system design for wireless sensor networks; Meet the OS designed to ease development of robust software applications for wireless sensor networks | |
CN113542390B (en) | Internet of things equipment management method and system adopting memory data model | |
Gabbrielli et al. | A language-based approach for interoperability of IoT platforms | |
CN116107999B (en) | Database service and storage system and method | |
JP2016004359A (en) | Opc ua server creation method | |
CN110049133B (en) | Method and device for issuing full amount of DNS zone files | |
US20140297736A1 (en) | Data interchange system | |
JP2019507917A (en) | Semantic verification method and apparatus | |
CN115421693A (en) | Method and device for realizing micro front-end architecture, computer equipment and storage medium | |
CN112256714A (en) | Data synchronization method and device, electronic equipment and computer readable medium | |
Bogomazov et al. | Implementation of Information and Measurement Systems at the Base of Specialized Internet Protocols | |
CN104980520A (en) | Notification message receiving method, device and system | |
JP4776602B2 (en) | Programming device for controller, controller and controller management system | |
Kanagasundaram et al. | Exposing resources as web services: A performance oriented approach |
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 |