Industrial bus separation method, device and electronic equipment

By parsing and configuring industrial bus data in the PLC system, generating a registered atomic operation interface, and instantiating the industrial bus to unify the interface design, the problems of long development cycle and large resource usage when adding industrial protocols to the PLC system are solved, and stability is improved.

CN118760632BActive Publication Date: 2025-09-23NINGBO HOLLYSHI INFORMATION SECURITY RES INST CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410812132.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-09-23
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

When adding industrial protocols to a PLC system, existing technologies require changing all functional modules, resulting in long development cycles, poor stability, and high resource usage.

Method used

By parsing the received configuration industrial bus data, generating a registration atomic operation interface request, instantiating the industrial bus and configuring the adapted atomic operation interface, communication between the controller and the input and output modules is realized, and a unified interface design is used to reduce the implementation difficulty.

Benefits of technology

It effectively shortens the development cycle, improves product stability, and reduces resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760632B_ABST
    Figure CN118760632B_ABST
Patent Text Reader

Abstract

The present invention discloses an industrial bus separation method, device and electronic device, which belongs to the technical field of industrial control. The method includes: obtaining a parsing result by parsing the received configuration industrial bus data; generating a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle according to the call parsing result; instantiating the industrial bus according to the call registration atomic operation interface request, registering and configuring the atomic operation interface adapted for the industrial bus; calling the atomic operation interface according to the call for obtaining the industrial bus protocol handle request to drive the industrial bus to work, so that the calling controller communicates with the calling input and output module by calling the industrial bus. The device includes: a data parsing module, a request generating module, an instantiation module and a bus driver module. The present invention can effectively reduce the difficulty of implementing a new industrial protocol in a PLC system, shorten the development cycle, improve product stability and reduce resource usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial control, and in particular relates to an industrial bus separation method, device and electronic equipment. Background Art

[0002] The industrial control field drives many different devices. Different types of control devices will inevitably vary greatly in terms of latency, determinism, bandwidth, etc. due to their different application scenarios. When designing and implementing PLC controller (programmable logic controller) products, different functions will be developed and implemented based on the characteristics of the industrial protocol to support the new protocol functions.

[0003] In the above traditional implementation methods, when adding a protocol, all functional modules in the PLC system from top to bottom need to be changed, and the scope of change is expanded to the entire system, which brings challenges to the product development cycle and product stability. On the other hand, since all functions are integrated into the system, the occupation of resources is also a waste. Summary of the Invention

[0004] In order to solve the above problems, the present invention proposes an industrial bus separation method, device and electronic equipment, which effectively reduce the implementation difficulty when adding new industrial protocols to the PLC system, shorten the development cycle, improve product stability and reduce resource usage.

[0005] In a first aspect, the present invention provides an industrial bus separation method, which is applied to a controller connected to an input / output module via an industrial bus. The method comprises:

[0006] Parse the received configuration industrial bus data to obtain a parsing result; generate a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle based on the parsing result; instantiate the industrial bus based on the registration atomic operation interface request, register and configure the atomic operation interface adapted for the industrial bus; call the atomic operation interface based on the request for obtaining an industrial bus protocol handle to drive the industrial bus to operate, thereby enabling the controller to communicate with the input and output module through the industrial bus.

[0007] In an optional implementation, the configuration industrial bus data is sent from a host computer, and the host computer is connected to the controller.

[0008] In an optional embodiment, generating a register atomic operation interface request and a request for obtaining an industrial bus protocol handle according to the parsing result includes:

[0009] Obtain the protocol data contained in the configured industrial bus data; and call the protocol initialization interface in the configured industrial bus data; initialize the protocol function according to the protocol data, and generate the registered atomic operation interface request; obtain the interface configuration data contained in the configured industrial bus data, and generate a request for obtaining an industrial bus protocol handle according to the interface configuration data.

[0010] In an optional embodiment, instantiating the industrial bus according to the registration atomic operation interface request, and registering and configuring the atomic operation interface adapted by the industrial bus includes:

[0011] In response to the request to register the atomic operation interface, the protocol instance is initialized to register and configure the atomic operation interface adapted by the industrial bus, and an industrial bus protocol handle and registration success information are generated. The registration success information is used to trigger the response to the request for obtaining the industrial bus protocol handle.

[0012] In an optional embodiment, calling the atomic operation interface according to the request for obtaining the industrial bus protocol handle to drive the industrial bus to operate, thereby enabling the controller to communicate with the input and output module through the industrial bus, includes:

[0013] In response to the request for obtaining the industrial bus protocol handle, the industrial bus protocol handle is obtained; based on the industrial bus protocol handle, the RTS real-time operating system interface in the controller is called; the operation of calling the RTS interface is converted into the operation of calling the general interface, and the operation of calling the general interface is converted into the operation of calling the atomic operation interface; the operation of calling the atomic operation interface is converted into the operation of calling the industrial bus operation to communicate with the input and output module through the industrial bus.

[0014] In a second aspect, the present invention provides a controller connected to an input / output module via an industrial bus, the controller comprising:

[0015] A data parsing module is used to parse the received configuration industrial bus data and obtain the parsing results; a request generation module is used to generate a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle based on the parsing results; an instantiation module is used to instantiate the industrial bus based on the registration atomic operation interface request, register and configure the atomic operation interface adapted by the industrial bus; a bus driver module is used to call the atomic operation interface based on the request for obtaining an industrial bus protocol handle to drive the industrial bus to operate, so that the controller communicates with the input and output module through the industrial bus.

[0016] In an optional implementation, the configuration industrial bus data is sent from a host computer, and the host computer is connected to the controller.

[0017] In an optional implementation, the request generation module includes:

[0018] A data acquisition unit is used to obtain the protocol data contained in the configured industrial bus data and call the protocol initialization interface in the configured industrial bus data; a first request generation unit is used to initialize the protocol function according to the protocol data and generate the registration atomic operation interface request; a second request generation unit is used to obtain the interface configuration data contained in the configured industrial bus data and generate a request for obtaining the industrial bus protocol handle according to the interface configuration data.

[0019] In an optional embodiment, the instantiation module is used to:

[0020] In response to the request to register the atomic operation interface, the protocol instance is initialized to register and configure the atomic operation interface adapted by the industrial bus, and an industrial bus protocol handle and registration success information are generated. The registration success information is used to trigger the response to the request for obtaining the industrial bus protocol handle.

[0021] In an optional embodiment, the bus driver module includes:

[0022] A handle obtaining unit is used to obtain the industrial bus protocol handle in response to the request for obtaining the industrial bus protocol handle; an interface calling unit is used to call the RTS real-time operating system interface in the controller based on the industrial bus protocol handle; a first conversion unit is used to convert the operation of calling the RTS interface into the operation of calling the general interface, and convert the operation of calling the general interface into the operation of calling the atomic operation interface; a second conversion unit is used to convert the operation of calling the atomic operation interface into the operation of calling the industrial bus operation, so as to communicate with the input and output module through the industrial bus.

[0023] In a third aspect, the present invention provides an industrial bus separation method, which is applied to a controller, wherein the controller is installed with a main software module, a protocol core layer, and an industrial bus software module, and the controller is connected to an IO module via an industrial bus. The controller is also connected to a host computer, and the host computer is installed with programming configuration software. The method comprises:

[0024] The main software module receives the configuration industrial bus data sent by the programming configuration software and forwards it to the industrial bus software module;

[0025] The industrial bus software module parses the configured industrial bus data and sends a registration atomic operation interface request to the protocol core layer according to the parsing result;

[0026] The protocol core layer instantiates the industrial bus according to the registration atomic operation interface request, and registers the atomic operation interface adapted to the industrial bus;

[0027] The main software module parses the configured industrial bus data and sends an industrial bus protocol handle acquisition request to the protocol core layer according to the parsing result;

[0028] The protocol core layer is configured with an atomic operation interface adapted to the industrial bus protocol;

[0029] The main software module calls the atomic operation interface according to the industrial bus protocol handle sent by the protocol core layer to drive the industrial bus to work, so that the controller communicates with the IO module through the industrial bus.

[0030] In an optional embodiment, the industrial bus software module includes a configuration entity software module; the step of the main software module receiving the configuration industrial bus data sent by the programming configuration software and forwarding it to the industrial bus software module includes:

[0031] The main software module forwards the received configuration industrial bus data sent by the programming configuration software to the configuration entity software module.

[0032] In an optional embodiment, the industrial bus software module further includes a protocol entity software module; the step of the industrial bus software module parsing the configured industrial bus data and sending a registration atomic operation interface request to the protocol core layer according to the parsing result includes:

[0033] The configuration entity software module parses the configuration industrial bus data, sends the first protocol data contained in the configuration industrial bus data to the protocol entity software module; and calls the initialization interface in the configuration industrial bus data;

[0034] The protocol entity software module initializes the protocol function according to the first protocol data, and sends a request to register the industrial protocol and register the atomic operation interface to the protocol core layer.

[0035] In an optional embodiment, the step of the protocol core layer instantiating the industrial bus according to the registration atomic operation interface request includes:

[0036] The protocol core layer calls the protocol initialization interface in the configuration industrial bus data according to the registration industrial protocol and the registration atomic operation interface request, initializes the protocol instance, and sends a registration success message to the protocol entity software module; so that the protocol entity software module sends the second protocol data and initialization success information to the programming configuration software.

[0037] In an optional embodiment, the main software module includes an RTS interface software module; the RTS interface software module includes an input interface, an output interface, and a diagnostic interface; the main software module parses the configured industrial bus data, and sends an industrial bus protocol handle request to the protocol core layer based on the parsing result, including:

[0038] The RTS interface software module sends a request to obtain a protocol instance handle to the protocol core layer according to the interface configuration data, wherein the interface configuration data is the configuration data about the input interface, the output interface and the diagnostic interface sent by the programming configuration software to the RTS interface software module.

[0039] In an optional embodiment, the protocol core layer includes an atomic operation interface and a core layer general interface; the atomic operation interface is used to implement basic atomic operations on the industrial protocol; the core layer general interface includes periodic interface operations, aperiodic interface operations, synchronous interface operations and asynchronous interface operations;

[0040] The steps of configuring the atomic operation interface adapted to the industrial bus protocol at the protocol core layer include:

[0041] The protocol core layer sends a protocol instance handle to the RTS interface software module;

[0042] The RTS interface software module calls the input interface, the output interface and the diagnostic interface based on the protocol instance handle, and drives the core layer general interface to work;

[0043] The protocol core layer converts the periodic interface operations, non-periodic interface operations, synchronous interface operations and asynchronous interface operations of the core layer general interface into atomic operation interfaces, calls the atomic operation interfaces, and sends a request to the protocol entity software module to drive the protocol entity software module to work.

[0044] In an optional embodiment, the step of the main software module calling the atomic operation interface according to the industrial bus protocol handle sent by the protocol core layer to drive the industrial bus to operate includes:

[0045] The protocol core layer calls the atomic operation interface to drive the protocol entity software module to work;

[0046] The protocol entity software module encapsulates third protocol data and sends the encapsulated third protocol data to the protocol slave module; wherein the protocol slave module is a separately integrated hardware module or a software module installed in the IO module; the protocol slave module parses the third protocol data, drives the IO module to operate, and encapsulates fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module; wherein the fourth data is status information and diagnostic information fed back by the IO module to the protocol slave module;

[0047] The protocol entity software module parses the encapsulated fourth protocol data and forwards the fourth protocol data to the protocol core layer through the atomic operation interface;

[0048] The protocol core layer converts the fourth protocol data into interface data, sends the interface data to the data area, and sends a notification to the main software module to process the interface data.

[0049] In an optional embodiment, the industrial bus software module is not installed on the controller, the controller further includes a protocol agent module, and the method further includes:

[0050] The protocol agent module parses the industrial bus data, loads the high-speed bus driver, and sends the first protocol data to the protocol entity software module;

[0051] The protocol entity software module initializes the protocol function and sends an initialization success message to the protocol agent module;

[0052] The protocol agent module sends a registration industrial protocol request to the protocol core layer and connects the protocol interface;

[0053] The protocol core layer receives the registration request, initializes the protocol instance, and sends a registration success message to the protocol proxy layer;

[0054] The protocol proxy layer sends the second protocol data and initialization success information to the programming configuration software.

[0055] In a fourth aspect, the present invention provides a controller, wherein the controller is connected to an input / output module via an industrial bus; the device comprises:

[0056] A configuration data receiving module is used to receive the configuration industrial bus data sent by the programming configuration software through the main software module in the controller and forward it to the industrial bus software module in the controller;

[0057] A configuration data parsing module, configured to parse the configuration industrial bus data through the industrial bus software module, and send a registration atomic operation interface request to the protocol core layer in the controller according to the parsing result;

[0058] An instantiation module, configured to instantiate the industrial bus according to the registration atomic operation interface request through the protocol core layer, thereby adapting to the industrial bus;

[0059] A sending handle request module is used to parse the configured industrial bus data through the main software module, and send an industrial bus protocol handle acquisition request to the protocol core layer according to the parsing result;

[0060] A configuration interface module is used to configure an atomic operation interface adapted to the industrial bus protocol through the protocol core layer;

[0061] The calling interface module is used to call the atomic operation interface through the main software module according to the industrial bus protocol handle sent by the protocol core layer to drive the industrial bus to work, so that the controller communicates with the IO module through the industrial bus.

[0062] In an optional embodiment, the industrial bus software module includes a configuration entity software module; and the module for receiving configuration data includes:

[0063] The main software module forwards the received configuration industrial bus data sent by the programming configuration software to the configuration entity software module.

[0064] In an optional embodiment, the industrial bus software module further includes a protocol entity software module; and the configuration data parsing module includes:

[0065] A first sending module is configured to parse the configuration industrial bus data through the configuration entity software module, send the first protocol data included in the configuration industrial bus data to the protocol entity software module, and call the initialization interface in the configuration industrial bus data;

[0066] The second sending module is used to initialize the protocol function according to the first protocol data through the protocol entity software module, and send a registration industrial protocol and a registration atomic operation interface request to the protocol core layer.

[0067] In an optional embodiment, the instantiation module 30 includes:

[0068] The first instantiation module is used to call the protocol initialization interface in the configuration industrial bus data according to the registration industrial protocol and registration atomic operation interface request through the protocol core layer, initialize the protocol instance, and send a registration success message to the protocol entity software module;

[0069] The second instantiation module is used to send the second protocol data and initialization success information to the programming configuration software through the protocol entity software module.

[0070] In an optional embodiment, the main software module includes an RTS interface software module; the RTS interface software module includes an input interface, an output interface and a diagnostic interface; the sending handle request module is also used to send a protocol instance handle acquisition request to the protocol core layer through the RTS interface software module according to the interface configuration data, wherein the interface configuration data is the configuration data about the input interface, output interface and diagnostic interface sent by the programming configuration software to the RTS interface software module.

[0071] In an optional embodiment, the protocol core layer includes a core layer basic abstract interface and a core layer universal interface; the core layer basic abstract interface is used to implement basic atomic operations on the industrial protocol; the core layer universal interface includes periodic interface operations, aperiodic interface operations, synchronous interface operations, and asynchronous interface operations; the configuration interface module includes:

[0072] A first configuration module, configured to send a protocol instance handle to the RTS interface software module through the protocol core layer;

[0073] A second configuration module is used to call the input interface, output interface and diagnostic interface based on the protocol instance handle through the RTS interface software module, and drive the core layer general interface to work;

[0074] The third configuration module is used to convert the periodic interface operations, non-periodic interface operations, synchronous interface operations and non-synchronous interface operations of the core layer general interface into the core layer basic abstract interface through the protocol core layer, call the atomic operation interface, and send a request to the protocol entity software module to drive the protocol entity software module to work.

[0075] In an optional embodiment, the calling interface module includes:

[0076] The first calling module is used to call the atomic operation interface through the protocol core layer to drive the operation of the protocol entity software module;

[0077] The second calling module is configured to encapsulate the third protocol data through the protocol entity software module and send the encapsulated third protocol data to the protocol slave module; wherein the protocol slave module is a separately integrated hardware module or a software module installed in the IO module; the protocol slave module parses the third protocol data, drives the IO module to operate, and encapsulates the fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module; wherein the fourth data is status information and diagnostic information fed back by the IO module to the protocol slave module;

[0078] A third calling module is used to parse the encapsulated fourth protocol data through the protocol entity software module and forward the fourth protocol data to the protocol core layer through the atomic operation interface;

[0079] The fourth calling module is used to convert the fourth protocol data into interface data through the protocol core layer, send the interface data to the data area, and send a notification to the main software module to process the interface data.

[0080] In an optional embodiment, the industrial bus software module is not installed on the controller, and the controller further includes a protocol agent module, and correspondingly, further includes:

[0081] a first proxy module, configured to parse industrial bus data through the protocol proxy module, load a high-speed bus driver, and send first protocol data to the protocol entity software module;

[0082] A second agent module is used to initialize the protocol function through the protocol entity software module and send an initialization success message to the protocol agent module;

[0083] A third agent module is used to send an industrial protocol registration request to the protocol core layer through the protocol agent module and to connect a protocol interface;

[0084] A fourth proxy module, configured to receive a registration request through the protocol core layer, initialize a protocol instance, and send a registration success message to the protocol proxy layer;

[0085] The fifth agent module is used to send the second protocol data and initialization success information to the programming configuration software through the protocol agent layer.

[0086] In a fifth aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first aspects when executing the computer program.

[0087] In a sixth aspect, the present invention provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute any one of the methods described in the first aspect.

[0088] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0089] The received configuration industrial bus data is parsed to obtain the parsing result; based on the parsing result, a registration atomic operation interface request and a request for obtaining the industrial bus protocol handle are generated; based on the call registration atomic operation interface request, the industrial bus is instantiated, and the atomic operation interface adapted for the industrial bus is registered and configured; based on the call for obtaining the industrial bus protocol handle request, the atomic operation interface is called to drive the industrial bus to work, so that the calling controller communicates with the calling input and output module by calling the industrial bus, thereby configuring a unified interface for all industrial buses, effectively reducing the difficulty of implementing new industrial protocols in the PLC system, shortening the development cycle, improving product stability, and reducing resource usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 A schematic diagram of a process for separating an industrial bus provided by an embodiment of the present invention;

[0091] Figure 2 An interaction sequence diagram of various software modules in an industrial bus separation method provided by an embodiment of the present invention;

[0092] Figure 3 A schematic diagram of the industrial bus separation principle in an industrial bus separation method provided by an embodiment of the present invention;

[0093] Figure 4 A schematic diagram of the industrial protocol activation principle in an industrial bus separation method provided by an embodiment of the present invention;

[0094] Figure 5 A schematic diagram of the industrial bus layering design principle in an industrial bus separation method provided by an embodiment of the present invention;

[0095] Figure 6 Another interaction sequence diagram of various software modules of an industrial bus separation method provided by an embodiment of the present invention;

[0096] Figure 7 A schematic diagram of the data transmission principle of each layer interface of a PLC controller in an industrial bus separation method provided by an embodiment of the present invention;

[0097] Figure 8 A schematic diagram of the system principle of an industrial bus separation device provided by an embodiment of the present invention;

[0098] Figure 9 A schematic diagram of a process for separating an industrial bus provided by an embodiment of the present invention;

[0099] Figure 10 A schematic diagram of the structure of a controller provided by an embodiment of the present invention;

[0100] Figure 11A schematic diagram of the system principle of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0101] Currently, industrial buses connect PLC controllers with other devices over networks. These networks include hardware interfaces such as TCP / IP, PCIE, and RS485. These industrial buses are independent of each other. Adding an industrial protocol to a PLC system requires modifications and adaptations at both the computation and data transfer layers. This embodiment designs a new form of industrial bus that provides abstract, unified interfaces for all industrial buses. All industrial buses adapt to these interfaces to achieve industrial bus support.

[0102] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0103] Reference Figure 1 and Figure 2 This embodiment provides an industrial bus separation method, which includes the following steps:

[0104] Step S110 : The main software module receives the industrial bus configuration data sent by the programming configuration software and forwards it to the industrial bus software module.

[0105] The method of this embodiment is applied to a controller, which refers to a PLC controller used in an industrial environment. The PLC controller in this embodiment is equipped with a main software module, a protocol core layer, and an industrial bus software module. The PLC controller (or main control module or CPU module) is connected to the input and output (IO) module via the industrial bus. The PLC controller is also connected to a host computer (or host computer), which is equipped with programming configuration software. In addition to being deployed on the PLC controller, the industrial bus software module can also be deployed on an independent hardware module (in this case, an agent module needs to be deployed on the PLC controller). This embodiment is first described by taking the industrial bus software module deployed on the PLC controller as an example.

[0106] like Figure 3 As shown, the distributed PLC system includes a PLC controller, a communication module (or industrial bus), and an IO module. This embodiment performs a separation design based on this, separating the input, calculation, output, and data transmission to the IO module processes in the system into: a main software module (i.e., the PLC controller processing part), an abstract protocol core layer, an industrial bus software module, and an IO module.

[0107] The main software module implements the functions required by the existing PLC controller software program, such as performing calculations on data collected from sensors. The protocol core layer is a software module deployed within the PLC controller that summarizes, abstracts, and refines various industrial bus protocol interfaces, defining atomic interfaces and their combinations from the bottom up. The industrial bus software module, installed within the controller, is a program related to the industrial protocol and is responsible for parsing and configuring industrial bus data, determining data validity, and sending industrial bus registration requests. The I / O module primarily outputs current / voltage data to lower-level devices (such as sensors). The industrial bus protocol transmits the data calculated by the main software module to the I / O module, which then outputs the corresponding current / voltage based on this data. Programming and configuration software (also known as host computer software) is software within industrial automation control systems that helps users configure and manage various control devices and monitor and control various parameters and indicators during the production process.

[0108] In this embodiment, the programming configuration software sends industrial bus configuration data and hardware module configuration to the main software module. The main software module parses this data and forwards the industrial bus configuration data to the industrial bus software module. The industrial bus configuration data includes, but is not limited to, which industrial bus modules and I / O modules are involved in a PLC system, which industrial buses the I / O modules are connected to, and the address mapping between the industrial bus modules and I / O modules.

[0109] Step S120 : The industrial bus software module parses and configures the industrial bus data, and sends a registration atomic operation interface request to the protocol core layer according to the parsing result.

[0110] Here, the industrial bus software module parses the configured industrial bus data and then sends a request to register the atomic operation interface to the protocol core layer. In actual applications, after parsing, the validity of the configured industrial bus data can also be determined. If valid, a request to register the atomic operation interface is sent to the protocol core layer.

[0111] Step S130 : The protocol core layer instantiates the industrial bus according to the atomic operation interface registration request, and registers the atomic operation interface adapted to the industrial bus.

[0112] Specifically, instantiating an industrial bus refers to setting an abstract, unified interface for the industrial bus. All buses adapt to this interface to achieve the purpose of supporting the industrial bus. The protocol core layer of this embodiment sets two sets of interfaces: the core layer basic abstract interface (also called the atomic operation interface or the core layer atomic operation interface) and the core layer general interface. Through these two sets of interfaces, protocol data is converted into corresponding operations (hereinafter referred to as periodic interface operations, non-periodic interface operations, synchronous interface operations, and asynchronous interface operations), and then replaced with the actual core layer read interface and core layer write interface, thereby achieving adaptation to the industrial bus. It should be noted that the core layer general interface is based on the atomic operation interface and adds time characteristics to achieve periodic and non-periodic transmission, plus whether to wait for the response of the other end before sending the next data beat synchronous transmission and asynchronous transmission without waiting for the response. In actual applications, a PLC system will have input, output, and non-periodic (triggered) data. The input interface calls the protocol core layer general interface, the protocol layer general interface calls the atomic operation interface, and the atomic operation interface calls a specific industrial bus transmission data interface to realize data transmission, and the reception is reversed, thereby realizing data transmission and reception.

[0113] Step S140 : The main software module parses the configured industrial bus data and sends a request for obtaining the industrial bus protocol handle to the protocol core layer according to the parsing result.

[0114] The main software module parses the protocol type in the industrial bus configuration data and, based on the protocol type, retrieves a protocol handle from the protocol core layer. The protocol handle acts like an index. Using this index, all interfaces related to this industrial protocol can be found. Subsequent calls to the protocol core layer interfaces are based on the protocol handle, driving the industrial bus operation.

[0115] Step S150: The protocol core layer configures an atomic operation interface adapted to the industrial bus protocol.

[0116] Atomic operation interfaces refer to the smallest and most basic interfaces. These atomic operation interfaces are assembled and spliced ​​to form an interface or function. It should be noted that atomic operation interfaces are inseparable interfaces. For example, the protocol core layer will define interfaces such as read interfaces, write interfaces, control interfaces, and shutdown interfaces. If the industrial bus protocol is carried on PCIE, the specific industrial bus protocol will implement PCIE-based read interfaces, write interfaces, control read and write interfaces, and PCIE channel shutdown interfaces, and register these interfaces with the protocol core layer.

[0117] In step S160 , the main software module calls the atomic operation interface according to the industrial bus protocol handle sent by the protocol core layer to drive the industrial bus to work, thereby enabling the PLC controller to communicate with the IO module through the industrial bus.

[0118] The principle of this embodiment is to first use the programming configuration software to generate the configuration data of the industrial bus, and send it to the main software module, which is then forwarded to the industrial bus software module through the main software module; the industrial bus software module parses the configuration data of the industrial bus, determines the validity of the configuration data, and sends a request to register the atomic interface to the protocol core layer of the controller based on the judgment result; the protocol core layer instantiates the industrial bus based on the request to register the atomic interface, abstracts and unifies the interface, so that the industrial bus can adapt to this interface; the main software module parses the configuration data of the industrial bus, determines the protocol category, and then obtains the protocol handle from the protocol core layer based on the protocol category; the protocol core layer configures the atomic operation interface that is adapted to the industrial bus protocol; the main software module calls the atomic operation interface and drives the industrial bus to work.

[0119] For the calculation part of the PLC controller, the programming configuration software first issues programming instructions to allocate a data area (DataArea) in the PLC controller. Before the calculation, the PLC controller first reads the input data of the IO module based on the industrial bus. The input data is saved in the input area of ​​the data area (DataArea) allocated by the programming configuration software. After the main software module of the PLC controller calculates the data, the calculation result is sent to the output area of ​​the data area (DataArea). When reading the input and refreshing the output, the industrial bus exchanges data with the data area (DataArea).

[0120] This embodiment provides the hardware configuration function in the programming configuration software to configure the PLC controller and the industrial bus. A certain protocol and the corresponding communication module are sent to the PLC controller through the programming configuration software. The PLC controller module will parse the configuration data and load the general interface and instantiate the protocol to activate the controller and the protocol. Figure 4 shown.

[0121] The overall hierarchical design of the industrial bus is as follows Figure 5 As shown, the PLC controller includes an RTS (Run Time System) interface software module and a protocol core layer. The hardware configuration in the programming configuration software is connected to the RTS interface to send interface configuration data (or configuration parameters). This parameter can be a parameter related to the industrial bus protocol. In the application, the protocol category can be determined based on it, and thus the industrial bus protocol handle corresponding to the configured industrial bus data can be determined. The hardware configuration configures the hardware configuration of protocol one and the hardware configuration of protocol two. The protocol side includes two parts: the protocol core layer registration interface implementation and the protocol function implementation. The protocol core layer registration interface implementation includes general functions such as protocol registration, protocol configuration, protocol read and write interface, and protocol shutdown. Specific data related to the protocol is processed by the protocol-specific data. In the figure, the protocol function implementation includes the protocol one function implementation and the protocol two function implementation.

[0122] In addition to configuring the protocol side and the PLC controller, the hardware configuration also configures the industrial bus module, which parses data and registers the general interface with the protocol core layer. The hardware configuration also configures the RTS interface, activates the protocol, and binds the protocol core layer instance. The complete process is as follows: Figure 6 As shown, the aforementioned steps S110 to S160 may include the following steps:

[0123] Step S201: The main software module detects that the PLC controller is started;

[0124] Step S202: The main software module sends an initialization command to the protocol core layer.

[0125] Step S203: Initialize the protocol core layer.

[0126] Step S204 : the main software module forwards the received configuration industrial bus data sent by the programming configuration software to the configuration entity software module.

[0127] Here, the industrial bus software module includes a configuration entity software module and a protocol entity software module. These two software modules implement the protocol core layer registration interface mentioned above. The configuration entity is a software module for all industrial protocols running on the PLC controller, used for configuration logic, etc. The protocol entity software module is used to register protocols, shut down protocols, and configure protocol read and write interfaces. The protocol entity software module corresponds to the protocol core layer and is used to assist in implementing the registration atomic interface. The protocol entity software module in this embodiment is also deployed on the PLC controller.

[0128] Step S205 , the configuration entity software module parses the configuration industrial bus data, sends the first protocol data included in the configuration industrial bus data to the protocol entity software module; and calls the initialization interface in the configuration industrial bus data.

[0129] The first protocol data is data related to the industrial protocol; the initialization interface refers to initializing some management data structures, memories, etc. in configuring the industrial bus data, that is, some initialization functions.

[0130] Step S206 : The protocol entity software module initializes the protocol function according to the first protocol data, and sends a request to register the industrial protocol and register the atomic operation interface to the protocol core layer.

[0131] The protocol entity software module receives the first protocol data sent by the configuration entity software module, initializes the protocol function, and registers the industrial protocol and the atomic operation interface with the protocol core layer.

[0132] The configuration entity software module parses the configuration industrial bus data, sends the first protocol data in the parsed configuration industrial bus data to the protocol entity software module, and calls the initialization interface in the configuration industrial bus data.

[0133] Step S207: The protocol core layer calls the protocol initialization interface in the configuration industrial bus data according to the industrial protocol registration and atomic operation interface registration requests, initializes the protocol instance, and sends a registration success message to the protocol entity software module.

[0134] Step S208: The protocol entity software module sends the second protocol data and initialization success information to the programming configuration software.

[0135] The protocol entity software module returns the second protocol data and initialization success information to the hardware configuration of the programming configuration software. The second protocol data is data related to the protocol configuration. Specifically, industrial protocols require configuration parameters such as source address, destination address, protocol communication rate, bandwidth, and backup link. The protocol stack must receive these parameters before communication can proceed. For Modbus TCP, configuration may be required for latency, client and server addresses, and the number of access retries. For DP, configuration may also be required for baud rate and channel-related parameters.

[0136] Step S209: The RTS interface software module sends a request for obtaining a protocol instance handle to the protocol core layer according to the interface configuration data.

[0137] The RTS interface software module is a submodule within the main software module and includes input, output, and diagnostic interfaces. Interface configuration data (or configuration parameters) can be configuration data related to the RTS interface. This data is sent to the RTS interface software module by the programming configuration software. RTS stands for Runtime System, and the RTS interface software module is a virtual software interface.

[0138] The main functions of the RTS interface software module are to realize reading input, calculation, and writing output. To realize these functions, it is necessary to obtain the protocol instance handle based on the interface configuration data, and call the core layer interface based on the protocol handle to realize the operations of reading input and flushing output, as well as the operation of reading diagnosis. Usually, the RTS interface software module will periodically call the read input, flush output, read diagnosis and other interfaces based on the protocol instance handle as a parameter. Among them, the interface configuration data can refer to the configuration data that specifically maps the data of the back-end IO module to a certain location in the memory. During specific implementation, these mapping relationships need to be configured in advance on the programming configuration software, and then sent to the RTS interface software module through the programming configuration software. After instantiation, the protocol handle is also called the protocol instance handle.

[0139] Step S210: The protocol core layer sends a protocol instance handle to the RTS interface software module.

[0140] In step S211 , the RTS interface software module calls the input interface, output interface, and diagnostic interface based on the protocol instance handle, and drives the core layer general interface to operate.

[0141] In step S212, the protocol core layer converts the periodic interface operations, non-periodic interface operations, synchronous interface operations and asynchronous interface operations of the core layer general interface into the core layer basic abstract interface, calls the atomic operation interface, and sends a request to the protocol entity software module to drive the protocol entity software module to work.

[0142] The protocol core layer includes the core layer basic abstract interface and the core layer general interface; the core layer basic abstract interface is used to implement the basic atomic operations of the industrial protocol; the core layer general interface includes periodic interface operations, non-periodic interface operations, synchronous interface operations and non-synchronous interface operations. Figure 5 shown.

[0143] In this embodiment, the protocol core layer instantiates the industrial bus and abstracts two interfaces: the core layer basic abstract interface and the core layer general interface. During data transmission, these two interfaces remain unchanged, and the use of the upper-layer application will not change. It only needs to adapt to the underlying interface.

[0144] The protocol core layer converts the calls given to the upper layer (RTS interface software module) into actual core layer read interfaces and core layer write interfaces.

[0145] Step S213: The protocol core layer calls the atomic operation interface to drive the protocol entity software module to work.

[0146] Step S214: the protocol entity software module encapsulates the third protocol data and sends the encapsulated third protocol data to the protocol slave module; wherein the protocol slave module is a separately integrated hardware module or a software module installed in the IO module.

[0147] Industrial bus protocols have both master and slave protocols. The slave protocol is typically deployed with an I / O module, but can also be integrated into a separate hardware module. For example, a protocol slave might be deployed on a PLC I / O module. For example, when using the DP protocol, if it's a PowerLink protocol, it might be deployed on a PowerLink slave interface module. The protocol master corresponds to the DP master module and the PowerLink master module. The third protocol data is obtained by encapsulating the second protocol data.

[0148] Step S215: The protocol slave module parses the third protocol data and drives the IO module to operate.

[0149] Step S216: The IO module feeds back fourth protocol data to the protocol slave module, where the fourth protocol data includes status information and diagnostic information.

[0150] Step S217: the protocol slave module encapsulates the fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module.

[0151] Step S218: The protocol entity software module parses the encapsulated fourth protocol data and forwards the fourth protocol data to the protocol core layer through the atomic operation interface.

[0152] Step S219 , the protocol core layer converts the fourth protocol data into interface data, sends the interface data to the data area, and sends a notification to the main software module to process the interface data.

[0153] The protocol entity software module forwards the corresponding protocol data, namely the third protocol data, to the protocol slave module. The protocol slave module parses the third protocol data and drives the IO module to work.

[0154] Preferably, when the industrial bus software module is not installed on the PLC controller but is deployed separately on a hardware module, the PLC controller further includes a protocol proxy module. The aforementioned steps S205 to S208 may also be implemented by the following method:

[0155] The protocol proxy module parses the industrial bus data, loads the physical bearer link bus driver, and sends the first protocol data to the protocol entity software module. The bus involved in the physical bearer link bus driver can be a high-speed bus that supports high-speed data transmission, such as PCIE, Gigabit or 10 Gigabit Ethernet, or a low-speed bus, such as a serial port, I 2 C.

[0156] The protocol entity software module initializes the protocol function and sends an initialization success message to the protocol agent module.

[0157] The protocol agent module sends a registration industrial protocol request to the protocol core layer and connects the protocol interface.

[0158] The protocol core layer receives the registration request, initializes the protocol instance, and sends a registration success message to the protocol proxy layer.

[0159] The protocol proxy layer sends the second protocol data and initialization success information to the programming configuration software.

[0160] This embodiment adopts the concept of protocol separation, clarifies the division of labor between the PLC controller side and the industrial protocol side, consolidates the fixed part, and opens up the variable part; based on separation and functional implementation, it is layered step by step and decomposed into atomic functions, reducing the difficulty of implementation and interface flexibility; the protocol entity is activated based on hardware configuration, which is flexible to use and reduces resource usage.

[0161] Reference Figure 8 This embodiment proposes an industrial bus separation device, which is a controller connected to the input and output modules via an industrial bus. The controller includes:

[0162] The configuration data receiving module 10 is used to receive the configuration industrial bus data sent by the programming configuration software through the main software module and forward it to the industrial bus software module;

[0163] The configuration data parsing module 20 is used to parse the configuration industrial bus data through the industrial bus software module and send a registration atomic operation interface request to the protocol core layer according to the parsing result;

[0164] An instantiation module 30 is configured to instantiate the industrial bus according to a registration atomic operation interface request through a protocol core layer;

[0165] The handle request sending module 40 is used to parse the configuration industrial bus data through the main software module, and send an industrial bus protocol handle acquisition request to the protocol core layer according to the parsing result;

[0166] Configuration interface module 50, used to configure an atomic operation interface adapted to the industrial bus protocol through the protocol core layer;

[0167] The calling interface module 60 is used to call the atomic operation interface according to the industrial bus protocol handle sent by the protocol core layer through the main software module to drive the industrial bus to work, so that the PLC controller communicates with the IO module through the industrial bus.

[0168] In an optional embodiment, the industrial bus software module includes a configuration entity software module; the configuration data receiving module 10 includes:

[0169] The main software module forwards the configuration industrial bus data received from the programming configuration software to the configuration entity software module.

[0170] In an optional embodiment, the industrial bus software module further includes a protocol entity software module; and the configuration data parsing module 20 includes:

[0171] A first sending module is configured to parse the configuration industrial bus data through the configuration entity software module, send the first protocol data contained in the configuration industrial bus data to the protocol entity software module; and call the initialization interface in the configuration industrial bus data;

[0172] The second sending module is used to initialize the protocol function according to the first protocol data through the protocol entity software module, and send a registration industrial protocol and a registration atomic operation interface request to the protocol core layer.

[0173] In an optional embodiment, the instantiation module 30 includes:

[0174] The first instantiation module is used to call the protocol initialization interface in the configuration industrial bus data according to the registration industrial protocol and registration atomic operation interface request through the protocol core layer, initialize the protocol instance, and send a registration success message to the protocol entity software module;

[0175] The second instantiation module is used to send the second protocol data and initialization success information to the programming configuration software through the protocol entity software module.

[0176] In an optional embodiment, the main software module includes an RTS interface software module; the RTS interface software module includes an input interface, an output interface and a diagnostic interface; the handle request sending module 40 is also used to send a protocol instance handle acquisition request to the protocol core layer through the RTS interface software module according to the interface configuration data, wherein the interface configuration data is the configuration data about the input interface, output interface and diagnostic interface sent by the programming configuration software to the RTS interface software module.

[0177] In an optional embodiment, the protocol core layer includes a core layer basic abstract interface and a core layer general interface; the core layer basic abstract interface is used to implement basic atomic operations on the industrial protocol; the core layer general interface includes periodic interface operations, aperiodic interface operations, synchronous interface operations, and asynchronous interface operations;

[0178] The configuration interface module 50 includes:

[0179] A first configuration module is configured to send a protocol instance handle to the RTS interface software module through the protocol core layer;

[0180] The second configuration module is used to call the input interface, output interface and diagnostic interface based on the protocol instance handle through the RTS interface software module, and drive the core layer general interface to work;

[0181] The third configuration module is used to convert the periodic interface operations, non-periodic interface operations, synchronous interface operations and non-synchronous interface operations of the core layer general interface into the core layer basic abstract interface through the protocol core layer, call the atomic operation interface, and send a request to the protocol entity software module to drive the protocol entity software module to work.

[0182] In an optional embodiment, the calling interface module 60 includes:

[0183] The first calling module is used to call the atomic operation interface through the protocol core layer to drive the operation of the protocol entity software module;

[0184] The second calling module is configured to encapsulate the third protocol data through the protocol entity software module and send the encapsulated third protocol data to the protocol slave module; wherein the protocol slave module is a separately integrated hardware module or a software module installed in the IO module; the protocol slave module parses the third protocol data, drives the IO module to operate, and encapsulates the fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module; wherein the fourth data is status information and diagnostic information fed back by the IO module to the protocol slave module;

[0185] A third calling module is used to parse the encapsulated fourth protocol data through the protocol entity software module and forward the fourth protocol data to the protocol core layer through the atomic operation interface;

[0186] The fourth calling module is used to convert the fourth protocol data into interface data through the protocol core layer, send the interface data to the data area, and send a notification to the main software module to process the interface data.

[0187] In an optional embodiment, the industrial bus software module is not installed on the controller, the controller further includes a protocol agent module, and the apparatus further includes:

[0188] a first proxy module, configured to parse industrial bus data through the protocol proxy module, load a high-speed bus driver, and send first protocol data to the protocol entity software module;

[0189] The second agent module is used to initialize the protocol function through the protocol entity software module and send an initialization success message to the protocol agent module;

[0190] The third agent module is used to send a registration industrial protocol request to the protocol core layer through the protocol agent module and connect the protocol interface;

[0191] The fourth agent module is used to receive the registration request through the protocol core layer, initialize the protocol instance, and send a registration success message to the protocol agent layer;

[0192] The fifth agent module is used to send the second protocol data and initialization success information to the programming configuration software through the protocol agent layer.

[0193] The device provided in the embodiment of the present application adopts the same inventive concept as the above-mentioned method provided in the embodiment of the present application. On the premise that the method can solve the technical problem, the device can also solve the technical problem, and no further details will be given here.

[0194] See also Figure 9 The embodiment of the present invention further provides an industrial bus separation method, which is applied to a controller connected to an input / output module via an industrial bus. The method comprises the following steps:

[0195] Step S10: parsing the received configuration industrial bus data to obtain parsing results.

[0196] Step S20: Generate a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle according to the analysis result.

[0197] Step S30: instantiate the industrial bus according to the atomic operation interface registration request, and register and configure the atomic operation interface adapted by the industrial bus.

[0198] Step S40 : calling the atomic operation interface according to the request for obtaining the industrial bus protocol handle to drive the industrial bus to work, thereby enabling the controller to communicate with the input and output modules through the industrial bus.

[0199] Optionally, the configured industrial bus data in step S10 is sent from a host computer, which is connected to the controller.

[0200] Step S20 includes but is not limited to the following steps:

[0201] Obtain the protocol data contained in the configured industrial bus data; and call the protocol initialization interface in the configured industrial bus data; initialize the protocol function according to the protocol data, and generate a registration atomic operation interface request; obtain the interface configuration data contained in the configured industrial bus data, and generate a request for obtaining the industrial bus protocol handle according to the interface configuration data.

[0202] Step S30 includes but is not limited to the following steps:

[0203] In response to the request to register the atomic operation interface, the protocol instance is initialized to register and configure the atomic operation interface adapted by the industrial bus, and an industrial bus protocol handle and registration success information are generated. The registration success information is used to trigger a response to the request to obtain the industrial bus protocol handle.

[0204] Step S40 includes but is not limited to the following steps:

[0205] In response to a request for obtaining an industrial bus protocol handle, an industrial bus protocol handle is obtained; based on the industrial bus protocol handle, an RTS real-time operating system interface in the controller is called; the operation of calling the RTS interface is converted into an operation of calling a general interface, and the operation of calling the general interface is converted into an operation of calling an atomic operation interface; the operation of calling the atomic operation interface is converted into an operation of calling an industrial bus operation, so as to communicate with the input and output modules via the industrial bus, and protocol data can be sent to the input and output modules via the industrial bus. The RTS interface includes: an input interface, an output interface, and a diagnostic interface. The general interface includes periodic interface operations, non-periodic interface operations, synchronous interface operations, and asynchronous interface operations.

[0206] It should be noted that, for the implementation of each step of this embodiment, reference can be made to the relevant content in the aforementioned embodiments, and no further details will be given here.

[0207] The received industrial bus configuration data is parsed to obtain the parsing result; based on the parsing result, a registration atomic operation interface request and a request for obtaining the industrial bus protocol handle are generated; based on the registration atomic operation interface request, the industrial bus is instantiated, and the atomic operation interface adapted to the industrial bus is registered and configured; based on the request for obtaining the industrial bus protocol handle, the atomic operation interface is called to drive the industrial bus to work, so that the controller communicates with the input and output module through the industrial bus, thereby configuring a unified interface for all industrial buses, effectively reducing the difficulty of implementing new industrial protocols in the PLC system, shortening the development cycle, improving product stability, and reducing resource usage.

[0208] See also Figure 10 An embodiment of the present invention further provides a controller connected to an input / output module via an industrial bus. The controller includes: a data parsing module 100 , a request generating module 200 , an instantiation module 300 and a bus driving module 400 .

[0209] Among them, the data parsing module 100 is used to parse the received configuration industrial bus data and obtain the parsing results. The request generation module 200 is used to generate a registration atomic operation interface request and a request for obtaining the industrial bus protocol handle based on the parsing results. The instantiation module 300 is used to instantiate the industrial bus based on the registration atomic operation interface request, register and configure the atomic operation interface adapted by the industrial bus. The bus driver module 400 is used to call the atomic operation interface based on the request for obtaining the industrial bus protocol handle to drive the industrial bus to operate, thereby enabling the controller to communicate with the input and output modules via the industrial bus.

[0210] Optionally, the configuration industrial bus data received by the data analysis module 100 is sent from a host computer, and the host computer is connected to the controller.

[0211] Optionally, the request generating module 200 includes: a data obtaining unit, a first request generating unit and a second request generating unit.

[0212] The data acquisition unit is configured to obtain protocol data contained in the industrial bus configuration data and invoke the protocol initialization interface in the industrial bus configuration data. The first request generation unit is configured to initialize the protocol function based on the protocol data and generate a register atomic operation interface request. The second request generation unit is configured to obtain interface configuration data contained in the industrial bus configuration data and generate a request for obtaining the industrial bus protocol handle based on the interface configuration data.

[0213] Optionally, the instantiation module 300 is specifically used to: respond to a request to register an atomic operation interface, initialize a protocol instance to register and configure the atomic operation interface adapted for the industrial bus, and generate an industrial bus protocol handle and registration success information, the registration success information being used to trigger a response to a request for obtaining an industrial bus protocol handle.

[0214] Optionally, the bus driver module 400 includes: a handle obtaining unit, an interface calling unit, a first conversion unit, and a second conversion unit.

[0215] The handle acquisition unit is used to obtain the industrial bus protocol handle in response to a request for obtaining the industrial bus protocol handle. The interface calling unit is used to call the RTS real-time operating system interface in the controller based on the industrial bus protocol handle. The first conversion unit is used to convert the operation of calling the RTS interface into the operation of calling the general interface, and convert the operation of calling the general interface into the operation of calling the atomic operation interface. The second conversion unit is used to convert the operation of calling the atomic operation interface into the operation of calling the industrial bus operation, so as to communicate with the input and output module through the industrial bus, and send protocol data to the input and output module through the industrial bus.

[0216] It should be noted that the controller provided in the above embodiment is merely illustrated by the division of the aforementioned functional modules during operation. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the controller provided in the above embodiment and the industrial bus separation method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0217] Reference Figure 11An embodiment of the present invention further provides an electronic device 500, including a communication interface 501, a processor 502, a memory 503 and a bus 505, wherein the processor 502, the communication interface 501 and the memory 503 are connected via a bus 504; the memory 503 is used to store a computer program that supports the processor 502 to execute the industrial bus separation method, and the processor 502 is configured to execute the program stored in the memory 503.

[0218] Optionally, an embodiment of the present invention further provides a computer-readable medium having a non-volatile program code executable by the processor 502 , where the program code enables the processor 502 to execute the industrial bus separation method in the above embodiment.

[0219] It is understood from common technical knowledge that the present invention may be implemented by other embodiments that do not depart from its spirit or essential features. Therefore, the embodiments disclosed above are, in all respects, merely illustrative and not exclusive. All modifications within the scope of the present invention or equivalent to the scope of the present invention are intended to be encompassed by the present invention.

Claims

1. An industrial bus separation method, characterized in that: Applied to a controller connected to an input / output module via an industrial bus, the method comprises: Parse the received configuration industrial bus data and obtain the parsing results; Generate a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle according to the parsing result; Instantiate the industrial bus according to the registration atomic operation interface request, register and configure the atomic operation interface adapted by the industrial bus; The atomic operation interface is called according to the request for obtaining the industrial bus protocol handle to drive the industrial bus to work, so that the controller communicates with the input and output module through the industrial bus.

2. The industrial bus separation method according to claim 1, characterized in that: The configuration industrial bus data is sent from a host computer, and the host computer is connected to the controller.

3. The industrial bus separation method according to claim 1, characterized in that: The step of generating a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle according to the parsing result includes: Obtaining protocol data contained in the configured industrial bus data; and calling a protocol initialization interface in the configured industrial bus data; Initializing the protocol function according to the protocol data and generating the registration atomic operation interface request; The interface configuration data included in the industrial bus configuration data is obtained, and a request for obtaining an industrial bus protocol handle is generated according to the interface configuration data.

4. The industrial bus separation method according to claim 1, characterized in that: The instantiating of the industrial bus according to the registration atomic operation interface request, and registering and configuring the atomic operation interface adapted by the industrial bus, includes: In response to the request to register the atomic operation interface, the protocol instance is initialized to register and configure the atomic operation interface adapted by the industrial bus, and an industrial bus protocol handle and registration success information are generated. The registration success information is used to trigger the response to the request for obtaining the industrial bus protocol handle.

5. The industrial bus separation method according to claim 4, characterized in that: The step of calling the atomic operation interface according to the request for obtaining the industrial bus protocol handle to drive the industrial bus to operate, thereby enabling the controller to communicate with the input / output module through the industrial bus, includes: In response to the request for obtaining the industrial bus protocol handle, obtaining the industrial bus protocol handle; Calling the RTS real-time operating system interface in the controller based on the industrial bus protocol handle; Converting the operation of calling the RTS real-time operating system interface into the operation of calling the general interface, and converting the operation of calling the general interface into the operation of calling the atomic operation interface; The operation of calling the atomic operation interface is converted into calling the industrial bus operation, so as to communicate with the input and output module through the industrial bus.

6. An industrial bus separation device, wherein the industrial bus separation device is a controller, and the controller is connected to the input and output modules via the industrial bus, characterized in that: The controller includes: The data parsing module is used to parse the received configuration industrial bus data and obtain the parsing results; A request generation module, configured to generate a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle according to the parsing result; An instantiation module, configured to instantiate the industrial bus according to the registration atomic operation interface request, and register and configure the atomic operation interface adapted by the industrial bus; The bus driver module is used to call the atomic operation interface according to the request for obtaining the industrial bus protocol handle to drive the industrial bus to work, so that the controller communicates with the input and output module through the industrial bus.

7. The industrial bus separation device according to claim 6, characterized in that: The request generation module includes: A data acquisition unit, configured to obtain the protocol data contained in the industrial bus configuration data and call the protocol initialization interface in the industrial bus configuration data; A first request generating unit, configured to initialize the protocol function according to the protocol data and generate the register atomic operation interface request; The second request generating unit is configured to obtain the interface configuration data contained in the industrial bus configuration data, and generate a request for obtaining the industrial bus protocol handle according to the interface configuration data.

8. The industrial bus separation device according to claim 6, characterized in that: The instantiation module is used to: In response to the request to register the atomic operation interface, the protocol instance is initialized to register and configure the atomic operation interface adapted by the industrial bus, and an industrial bus protocol handle and registration success information are generated. The registration success information is used to trigger the response to the request for obtaining the industrial bus protocol handle.

9. The industrial bus separation device according to claim 8, characterized in that: The bus driver module includes: A handle obtaining unit, configured to obtain the industrial bus protocol handle in response to the request for obtaining the industrial bus protocol handle; An interface calling unit, configured to call an RTS real-time operating system interface in the controller based on the industrial bus protocol handle; A first conversion unit is configured to convert an operation of calling an RTS real-time operating system interface into an operation of calling a general interface, and convert the operation of calling the general interface into an operation of calling the atomic operation interface; The second conversion unit is configured to convert the operation of calling the atomic operation interface into the operation of calling the industrial bus, so as to communicate with the input and output module through the industrial bus.

10. An electronic device, characterized in that: The electronic device comprises: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 5 when executing the computer program.

Citation Information

Patent Citations

  • Analog software communication layer and service application layer decoupling system and implementation method

    CN112131087A

  • Industrial bus data analysis and escape method, device and system

    CN115665271A