Industrial bus separation method and device and electronic equipment

By parsing the configuration data to generate a registered atomic operation interface request and instantiating the industrial bus, it solves the problems of extended development cycle and resource waste when new protocols are added in the PLC system, achieving higher stability and resource efficiency.

CN118760632AActive Publication Date: 2024-10-11NINGBO HOLLYSHI INFORMATION SECURITY RES INST CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When adding new protocols to the PLC system, the functional modules of the entire system need to be changed, resulting in extended development cycles, reduced stability, and waste of resources.

Method used

By parsing the received configuration industrial bus data, it generates a registration atomic operation interface request, instantiates the industrial bus, registers and configures the adapted atomic operation interface to drive the industrial bus work and enable the controller to communicate with the input and output modules.

Benefits of technology

It effectively reduces the difficulty of implementing new protocols in the PLC system, shortens the development cycle, improves product stability, and reduces resource occupation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760632A_ABST
    Figure CN118760632A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial bus separation method and device and electronic equipment, and belongs to the technical field of industrial control, and the method comprises the steps: obtaining an analysis result through analyzing received configuration industrial bus data; according to the calling analysis result, generating a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle; instantiating the industrial bus according to the request for calling and registering the atomic operation interface, and registering and configuring the atomic operation interface adapted to the calling industrial bus; and calling the atomic operation interface to drive the industrial bus to work according to the request for acquiring the industrial bus protocol handle, so that the calling controller communicates with the calling input / output module by calling the industrial bus. The device comprises a data analysis module, a request generation module, an instantiation module and a bus driving module. According to the invention, the realization difficulty of newly adding the industrial protocol in the PLC system can be effectively reduced, the development period is shortened, the product stability is improved, and the resource occupation is reduced.
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 will drive many different devices. Different types of control devices will inevitably differ 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 new protocol functions.

[0003] In the above traditional implementation methods, when a protocol is added, all functional modules from top to bottom in the PLC system 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 difficulty of implementing new industrial protocols in the PLC system, shorten the development cycle, improve product stability and reduce resource occupation.

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

[0006] Parse the received industrial bus configuration data to obtain the parsing result; 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 request for registering an atomic operation interface, register and configure the atomic operation interface adapted by the industrial bus; call the atomic operation interface according to the request for obtaining an industrial bus protocol handle to drive the industrial bus to work, so that the controller communicates with the input-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 implementation, 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 implementation, instantiating the industrial bus according to the registration atomic operation interface request, 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, a 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.

[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 work, so that the controller communicates 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, so as to communicate with the input and output module through the industrial bus.

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

[0015] A data parsing module is used to parse the received configuration industrial bus data and obtain the parsing result; a request generating module is used to generate a registration atomic operation interface request and an industrial bus protocol handle acquisition request according to the parsing result; an instantiation module is used to instantiate the industrial bus according to the registration atomic operation interface request, register and configure the atomic operation interface adapted by the industrial bus; a bus driving module is used to call the atomic operation interface according to the industrial bus protocol handle acquisition request to drive the industrial bus to work, 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, a 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.

[0021] In an optional implementation, 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, the controller is connected to an IO module via an industrial bus, and the controller is also connected to a host, wherein programming configuration software is installed in the host; 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 implementation, 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 message 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 according to the parsing result, comprising:

[0038] The RTS interface software module sends a request to obtain a protocol instance handle to the protocol core layer according to interface configuration data, wherein the interface configuration data is 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 industrial protocols; the core layer general interface includes periodic interface operations, non-periodic interface operations, synchronous interface operations and non-synchronous 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 implementation, 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 work 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 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; the protocol slave module parses the third protocol data, drives the IO module to work, 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;

[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 implementation, 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 proxy 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 initialization success information to the protocol proxy module;

[0052] The protocol proxy module sends a request to register the industrial protocol 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, used for parsing the configuration industrial bus data through the industrial bus software module, and sending a registration atomic operation interface request to the protocol core layer in the controller according to the parsing result;

[0058] An instantiation module, used to instantiate the industrial bus according to the registered atomic operation interface request through the protocol core layer, so as to adapt to the industrial bus;

[0059] A sending handle request module, used for parsing the configured industrial bus data through the main software module, and sending 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; 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, used for parsing the configuration industrial bus data through the configuration entity software module, sending the first protocol data contained in the configuration industrial bus data to the protocol entity software module; and calling 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 request to register the industrial protocol and register the atomic operation interface 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 the 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 send handle request module is also used to send a request to obtain a protocol instance handle to the protocol core layer through the RTS interface software module according to interface configuration data, wherein the interface configuration data is 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 implementation, 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 industrial protocols; the core layer general interface includes periodic interface operations, non-periodic interface operations, synchronous interface operations and non-synchronous 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, the output interface and the 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 asynchronous 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 implementation, 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 protocol entity software module to work;

[0077] The second calling module is used 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 work, and encapsulates the fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module; wherein the fourth data is the 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, used 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 proxy module, used for initializing the protocol function through the protocol entity software module and sending initialization success information to the protocol proxy module;

[0083] A third proxy module, used for sending a registration industrial protocol request to the protocol core layer through the protocol proxy module, and attaching 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 proxy module is used to send the second protocol data and initialization success information to the programming configuration software through the protocol proxy 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 method 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 industrial bus configuration data is parsed to obtain the parsing result; based on the parsing result, a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle are generated; based on the request for calling the registering atomic operation interface, the industrial bus is instantiated, and the atomic operation interface adapted for calling the industrial bus is registered and configured; based on the request for obtaining an industrial bus protocol handle, 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 flow of an industrial bus separation method 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] Fig. 9 A schematic diagram of a process flow of an industrial bus separation method provided by an embodiment of the present invention;

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

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

[0101] At present, the function of industrial bus is to connect PLC controller with other devices based on the network. These networks include hardware interfaces such as TCP / IP, PCIE, RS485, etc. These industrial buses are independent of each other. Adding an industrial protocol to the PLC system requires modification and adaptation at both the operation layer and the data transmission layer. This embodiment designs a new form of industrial bus, sets abstract and unified interfaces for all industrial buses, and all industrial buses adapt to these interfaces to achieve the purpose of supporting industrial buses.

[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, the method comprising 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, and the controller refers to a PLC controller applied in an industrial environment. The PLC controller in this embodiment is installed 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 through the industrial bus, and the PLC controller is also connected to the host (or host computer), and the host is installed with programming configuration software. Among them, the industrial bus software module can be deployed on an independent hardware module in addition to being deployed on the PLC controller (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 on this basis, and separates the processes of input, calculation, output, and data transmission to the IO module in the system into: a main software module (i.e., a 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 that the software program in the original PLC controller needs to execute, such as calculating the data collected from the sensor. The protocol core layer is a software module deployed in the PLC controller, which is used to summarize, abstract, and refine various industrial bus protocol interfaces, and define atomic interfaces and combinations of atomic interfaces from the bottom up. The industrial bus software module is installed in the controller and is a program related to the industrial protocol. It is used to parse and configure industrial bus data, judge the validity of data, send requests to register the industrial bus, etc. The IO module is mainly used to output current / voltage data to the next level device (such as a sensor), that is, the industrial bus protocol passes the data calculated by the main software module to the IO module, and the IO module outputs the corresponding current / voltage according to the data. The programming configuration software (or host computer software) is software in the industrial automation control system that helps users configure and manage various control devices and monitor and control various parameters and indicators in the production process.

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

[0109] Step S120: 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.

[0110] Here, the industrial bus software module parses the configuration industrial bus data and then sends a request to register the atomic operation interface to the protocol core layer. In actual applications, the validity of the configuration industrial bus data can also be determined after parsing, and 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 the industrial bus means setting an abstract and unified interface for the industrial bus, and all buses adapt to this interface to achieve the purpose of supporting the industrial bus. The protocol core layer of this embodiment sets two groups of interfaces, the core layer basic abstract interface (or atomic operation interface or core layer atomic operation interface) and the core layer general interface. Through these two groups of interfaces, the protocol data is converted into corresponding operations (periodic interface operation, non-periodic interface operation, synchronous interface operation, and asynchronous interface operation in the following text), and then replaced with the actual core layer read interface and core layer write interface, so as to achieve adaptation with the industrial bus. It should be noted that the core layer general interface is based on the atomic operation interface plus the time characteristics to realize the periodic and non-periodic, plus whether the data is sent to wait for the response of the other end before sending the next beat of data synchronously and asynchronously without waiting for the response. In actual applications, a PLC system will have input, output, and non-periodic (trigger) 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 data transmission interface of an industrial bus to realize the transmission of data, and the reception is reversed, thereby realizing the transmission and reception of data.

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

[0114] The main software module parses the protocol category in the configuration industrial bus data, and obtains the protocol handle from the protocol core layer according to the protocol category. The protocol handle is similar to an index, that is, the protocol handle plays the role of an index. Using this index, you can find all interfaces related to this industrial protocol. That is, the protocol core layer interface is called based on the protocol handle to drive the industrial bus to work.

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

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

[0117] 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, so that the PLC controller communicates 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 according to the judgment result; the protocol core layer instantiates the industrial bus according to the request to register the atomic interface sent, 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 according to the protocol category; the protocol core layer configures the atomic operation interface 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 the data area (DataArea) in the PLC controller. Before the operation, 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). The parameters can be parameters related to the industrial bus protocol. In the application, the protocol category can be determined based on the parameters, so that 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 closing. The 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 configures the industrial bus module, which parses the data and registers the general interface to the protocol core layer; the hardware configuration 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: initializing 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, which 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, which is used to configure logic, etc. The protocol entity software module is used to register the protocol, close the protocol, and configure the protocol read and write interface. The protocol entity software module corresponds to the protocol core layer and is used to assist in the implementation of 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 initialization of some management data structures, memory, etc. in the configuration of 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 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;

[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 configuration of the programming configuration software, where the second protocol data is data related to the protocol configuration, that is, the industrial protocol needs to configure parameters such as source address, destination address, protocol communication rate, bandwidth, backup link, etc. The protocol stack can communicate only after receiving these parameters. If it is modbus tcp, you may need to configure the delay, the address of the client server, the number of times to re-initiate access, etc.; if it is DP, you may need to configure the baud rate, channel-related parameters, etc.

[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] Among them, the RTS interface software module is a submodule in the main software module, including an input interface, an output interface and a diagnostic interface. The interface configuration data (or configuration parameters) can be configuration data related to the RTS interface, which 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. RTS refers to the Runtime System real-time operating 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, where 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. When it is implemented, 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] 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 work.

[0141] 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, namely the core layer basic abstract interface and the core layer general interface. During data transmission, these two interfaces are kept unchanged, and the use of the upper-layer application will not change, and only the underlying interface needs to be adapted.

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

[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 master-slave protocols. Generally, the slave protocol is deployed together with the IO module, or it can be integrated into a hardware module separately. For example, the protocol slave may be deployed on the IO module of the PLC. When using the DP protocol, if it is the powerlink protocol, it may be deployed on the 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 work.

[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, and 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 proxy module.

[0157] The protocol proxy module sends a request to register the industrial protocol 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 idea of ​​protocol separation, clarifies the division of labor between the PLC controller side and the industrial protocol side, precipitates the fixed part, and opens the variable part; based on separation and function implementation, it is layered step by step and decomposed into atomic functions to reduce the difficulty of implementation and interface flexibility; the protocol entity is activated based on the hardware configuration configuration, which is flexible to use and reduces resource usage.

[0161] Reference Figure 8 , an industrial bus separation device proposed in this embodiment, the industrial bus separation device is a controller, the controller is connected to the input and output module through the industrial bus, and the controller includes:

[0162] A 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, configured to instantiate the industrial bus according to a registered 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] A configuration interface module 50 is used to configure an atomic operation interface adapted to the industrial bus protocol through a protocol core layer;

[0167] The calling interface module 60 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 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 receiving configuration data module 10 includes:

[0169] The main software module forwards the received configuration industrial bus data sent by 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; the configuration data parsing module 20 includes:

[0171] A first sending module is used 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;

[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 request to register the industrial protocol and register the atomic operation interface 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 the 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 sending handle request module 40 is also used to send a request for obtaining a protocol instance handle 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 implementation, 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, non-periodic interface operations, synchronous interface operations, and non-synchronous interface operations;

[0178] The configuration interface module 50 includes:

[0179] A first configuration module, used for sending a protocol instance handle to an RTS interface software module through a protocol core layer;

[0180] The second configuration module is used to call the input interface, the output interface and the 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 asynchronous 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 implementation, 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 protocol entity software module to work;

[0184] The second calling module is used 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 work, and encapsulates the fourth protocol data and sends the encapsulated fourth protocol data to the protocol entity software module; wherein the fourth data is the 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 device further includes:

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

[0189] The second proxy module is used to initialize the protocol function through the protocol entity software module and send initialization success information to the protocol proxy 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 to connect the protocol interface;

[0191] The fourth proxy 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 proxy layer;

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

[0193] The device provided in the embodiment of the present application is adopted. Since the device 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, which will not be repeated here.

[0194] See also Fig. 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, and 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, so that the controller communicates with the input and output module through the industrial bus.

[0199] Optionally, the configuration industrial bus data in step S10 is sent from a host computer, and the host computer 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; 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 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, so as to communicate with the input and output modules through the industrial bus, and protocol data can be sent to the input and output modules through 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 the implementation method of each step of this embodiment can refer to the relevant content in the aforementioned embodiment, and will not be repeated here.

[0207] The received industrial bus configuration data is parsed to obtain the parsing result; based on the parsing result, a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle are generated; based on the request for registering an atomic operation interface, the industrial bus is instantiated, and an atomic operation interface adapted to the industrial bus is registered and configured; based on the request for obtaining an 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 modules through the industrial bus, thereby configuring a unified interface for all industrial buses, effectively reducing the difficulty of implementing new industrial protocols in PLC systems, shortening development cycles, improving product stability, and reducing resource usage.

[0208] See also Fig.10 The embodiment of the present invention further provides a controller, which is connected to the input and output modules through 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 result. The request generation module 200 is used to generate a registration atomic operation interface request and a request for obtaining an industrial bus protocol handle according to the parsing result. The instantiation module 300 is used to 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 bus driver module 400 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.

[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 generation module 200 includes: a data obtaining unit, a first request generation unit and a second request generation unit.

[0212] The data acquisition unit is used to obtain the protocol data contained in the industrial bus configuration data and call the protocol initialization interface in the industrial bus configuration data. The first request generation unit is used to initialize the protocol function according to the protocol data and generate a registration atomic operation interface request. The second request generation unit is used 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.

[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 to obtain 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 the request for obtaining the industrial bus protocol handle. The interface calling unit is used to call the RTS real-time operation 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, so as to communicate with the input-output module through the industrial bus, and send protocol data to the input-output module through the industrial bus.

[0216] It should be noted that: when the controller provided in the above embodiment is running, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the controller provided in the above embodiment and the industrial bus separation method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0217] Reference Fig.11The 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 , wherein the program code enables the processor 502 to execute the industrial bus separation method in the above embodiment.

[0219] It is known from common technical knowledge that the present invention can be implemented by other embodiments that do not deviate from its spirit or essential features. Therefore, the above disclosed embodiments are only illustrative in all respects and are not exclusive. All changes within the scope of the present invention or within the scope equivalent to the present invention are included in the present invention.

Claims

1. An industrial bus separation method, characterized in that: Applied to a controller, the controller is connected to an input / output module via an industrial bus, the method comprising: Parse the received configuration industrial bus data and obtain the parsing result; Generate a request for registering an atomic operation interface and a request for obtaining an industrial bus protocol handle according to the analysis 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 register atomic operation interface request and a request for obtaining an industrial bus protocol handle according to the parsing result includes: Obtaining the protocol data contained in the configured industrial bus data; and calling the protocol initialization interface in the configured industrial bus data; Initialize the protocol function according to the protocol data, and generate the register 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 instantiation of the industrial bus according to the registration atomic operation interface request, and the registration and configuration of the atomic operation interface adapted by the industrial bus include: In response to the request to register the atomic operation interface, a 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.

5. The industrial bus separation method according to claim 4, characterized in that: The calling of 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, 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; Convert the operation of calling the RTS interface into an operation of calling the general interface, and convert the operation of calling the general interface into an operation of calling the atomic operation interface; The operation of calling the atomic operation interface is converted into calling the industrial bus operation to communicate with the input-output module through the industrial bus.

6. An industrial bus separation device, the industrial bus separation device is a controller, the controller is connected to the input and output module through the industrial bus, characterized in that: The controller comprises: A data analysis module is used to analyze the received configuration industrial bus data and obtain the analysis result; A request generation module, used 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, used 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 comprises: A data acquisition unit, 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 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 used 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, a 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.

9. The industrial bus separation device according to claim 8, characterized in that: The bus driver module comprises: 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, used for calling the RTS real-time operation system interface in the controller based on the industrial bus protocol handle; A first conversion unit, used to convert the operation of calling the RTS interface into an operation of calling the 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 used to convert the call of the atomic operation interface operation into the call of the industrial bus operation, 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 described in 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

  • Registering custom atomic operations with operating system

    CN116583831A

  • Global access bus architecture

    US20020120798A1

  • Bus agent capable of supporting extended atomic operations and method therefor

    US20130346655A1