CN111209229B - Fieldbus method based on virtual equipment - Google Patents

Fieldbus method based on virtual equipment Download PDF

Info

Publication number
CN111209229B
CN111209229B CN201911393488.8A CN201911393488A CN111209229B CN 111209229 B CN111209229 B CN 111209229B CN 201911393488 A CN201911393488 A CN 201911393488A CN 111209229 B CN111209229 B CN 111209229B
Authority
CN
China
Prior art keywords
virtual
equipment
data
module
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911393488.8A
Other languages
Chinese (zh)
Other versions
CN111209229A (en
Inventor
石文辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Elite Robot Co Ltd
Original Assignee
Suzhou Elite Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Elite Robot Co Ltd filed Critical Suzhou Elite Robot Co Ltd
Priority to CN201911393488.8A priority Critical patent/CN111209229B/en
Publication of CN111209229A publication Critical patent/CN111209229A/en
Application granted granted Critical
Publication of CN111209229B publication Critical patent/CN111209229B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/105Program control for peripheral devices where the programme performs an input/output emulation function
    • G06F13/107Terminal emulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40013Details regarding a bus controller

Abstract

The invention relates to a field bus method based on virtual device, which maps physical device address to virtual device layer as slave device through device adapting module of main device, the specific equipment processing method is realized in a bus equipment adaptation module which is a bridge of physical equipment and virtual equipment, the data read and written from the physical equipment is stored in the input buffer of the virtual equipment through the bus equipment adaptation module, the data output from the buffer of the virtual equipment is pushed to the physical equipment, the data synchronization of the physical equipment and the virtual equipment is realized, the master equipment reads and writes the virtual slave equipment to complete the communication with the actual physical equipment, thereby shielding the difference of different bus devices, being simple and efficient, having low cost, dividing service processing thread and client processing thread, improving the operation efficiency, the method is particularly suitable for data communication between multi-axis motion control systems such as numerical control systems, robots/mechanical arms and the like and bus equipment. The control requirements of multiple devices and high efficiency can be met.

Description

Fieldbus method based on virtual equipment
Technical Field
The invention relates to the technical field of field buses, in particular to a field bus method based on virtual equipment.
Background
The Field bus (Field bus) is an industrial data bus which is rapidly developed in recent years, and mainly solves the problems of digital communication among Field devices such as intelligent instruments, controllers and actuators in an industrial Field and information transmission between the Field control devices and a high-level control system. Due to a series of outstanding advantages of simplicity, reliability, economy, practicability and the like, the field bus is widely applied to the aspects of industrial automation, ships, medical equipment, industrial equipment and the like.
However, the existing virtual bus technology mostly adopts a controller or an arbiter for virtualization processing based on a plurality of physical buses inside the device, and the virtual bus technology is limited by the existing physical bus implementation, if a plurality of physical buses are adopted in an industrial field, maintenance cost of the field is obviously increased, and the like, and a single device and the controller or the arbiter are required for different physical buses, so that the technology is not universal.
In order to solve the problems that bus equipment in the prior art has no universality and is high in maintenance cost, the invention provides a field bus method based on virtual equipment, which not only realizes communication among the bus equipment, but also ensures that services among the equipment are not interfered with each other, and has strong universality.
Disclosure of Invention
The invention aims to overcome the problems in the prior art and provides a field bus method based on a virtual device.
In order to achieve the technical purpose and achieve the technical effect, the invention is realized by the following technical scheme:
a field bus structure based on virtual equipment, the bus structure includes at least one main equipment and at least one slave equipment, the main equipment is connected with the slave equipment through a physical bus, the slave equipment maps the physical equipment address to the main equipment through the physical bus.
Furthermore, the master device includes a device adaptation module, a virtual device module, a communication module, and a service processing module, and the slave device maps a physical device address of the slave device to the virtual device module through the device adaptation module, and is configured to store read and write data from the slave device into an input buffer of the virtual device module, and push data output from the virtual device to the slave device, thereby implementing data synchronization between the physical device and the virtual device.
Furthermore, the master device can be used as a slave device which is connected to another master device through the bus to be used as a slave device and passively receives data.
Furthermore, the main device is divided into a service thread and a client thread, the communication processing and address mapping processing module of the main device is classified into the service processing thread according to the time key characteristic by analyzing the data stream, and the user-defined processing, the system signal processing and the communication processing of the slave device with the cycle processing characteristic are classified into the client processing thread.
A virtual device based fieldbus method, comprising the steps of:
step 1) loading the slave equipment, wherein an equipment adaptation module in the master equipment provides a uniform interface to connect the slave equipment so as to perform the operations of opening the equipment, reading in data, writing out the data and closing the equipment;
step 2) creating a virtual equipment set, firstly constructing a data structure of a virtual equipment module, loading corresponding parameters of the virtual equipment module, and inserting the virtual equipment module into a corresponding position of a virtual equipment linked list according to an ascending order of equipment addresses;
step 3) creating data cache mapping for the virtual equipment modules in sequence according to the sequence of the equipment in the linked list;
and 4) the master device reads data from the slave device through the device adapter, stores the data into the input cache of the virtual device module, pushes the data of the output cache of the virtual device module to the physical device, realizes data synchronization of the slave device and the virtual device, and completes communication with the actual physical device by reading and writing the virtual slave device through the master device.
Further, in step 4), after the service processing module of the master device completes data synchronization of the local slave device, the master device is used as a slave device, and passively processes data read-write requests of other master devices.
Furthermore, in an application scenario when the master device is used as a slave device, the master device is visible as a unified addressing virtual address, the master device communication processing and address mapping processing module is classified as a service processing thread according to a time key characteristic, and user-defined processing, system signal processing and slave device communication processing with a periodic processing characteristic are classified as a client processing thread.
The invention has the beneficial effects that:
1. the invention can access different actual physical field bus devices into the master device by adopting a method of virtually mapping the physical devices, and the master device reads and writes the virtually mapped slave devices so as to realize one-to-many data transmission.
2. In the communication process, the communication processing and address mapping processing module of the main equipment is classified into the service processing thread according to the time key characteristic, and the user-defined processing, the system signal processing and the communication processing of the slave equipment with the periodic processing characteristic are classified into the client processing thread, so that the operation efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of a virtual device based field bus method according to the present invention;
FIG. 2 is a flowchart illustrating virtual device loading according to the present invention;
FIG. 3 is a diagram of a virtual device data structure according to the present invention;
FIG. 4 is a server thread flow diagram in accordance with the present invention;
FIG. 5 is a block diagram of a server thread flow in accordance with the present invention;
FIG. 6 is a block diagram of a client thread flow in accordance with the present invention;
FIG. 7 is a flow chart of the virtual device process of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
As shown in fig. 1, a fieldbus structure based on virtual devices includes at least one master device and at least one slave device, the master device is connected to the slave device through a physical bus, and the slave device maps the physical device address to the master device through the physical bus. In this embodiment, as shown in fig. 1, the system includes a master device and at least one slave device, where the master device and the slave device are respectively connected through a physical bus, the master device includes a virtual device layer and a device adaptation layer, the virtual device layer includes at least one virtual device, the number of the virtual devices corresponds to the number of the actual physical slave devices, the virtual device is created by the master device, and the device adaptation layer adapts various bus devices according to the type of the actual physical device.
Further, the master device includes a device adaptation module, a virtual device module, a communication module and a service processing module, where the communication module is responsible for communication between each slave device and the master device, the service processing module processes data between each devices, the slave device maps a physical device address of the slave device into the virtual device module through the device adaptation module, and is used to store read and write data from the slave device into an input buffer of the virtual device module, and push data cached by an output of the virtual device to the slave device, so as to implement data synchronization between the physical device and the virtual device, the device adaptation module of the master device maps an actual physical slave device to the virtual device module to become a virtual device, the actual physical slave device corresponds to the virtual device, the virtual device is a mirror image of the slave device connected to the master device, and the virtual device module is a bridge between the physical slave device and the virtual device, in this embodiment, the master device can be adapted to various slave devices, including MODBUS TCP, MODBUS RTU, ETHERNET, PROFINET devices.
The master device can be used as a slave device, is connected to another master device through a bus to be used as a slave device, and passively receives data, and the situation is the same as that of an ordinary slave device.
The main device is divided into a service thread and a client thread, a main device communication processing and address mapping processing module is classified into the service processing thread according to time key characteristics through data flow analysis, and user-defined processing, system signal processing and slave device communication processing with cycle processing characteristics are classified into the client processing thread.
With continued reference to fig. 1, a virtual device based fieldbus method, comprising the steps of:
step 1) loading the slave equipment, wherein an equipment adaptation module in the master equipment provides a uniform interface to connect the slave equipment so as to perform the operations of opening the equipment, reading in data, writing out the data and closing the equipment;
step 2) creating a virtual equipment set, as shown in fig. 2, firstly constructing a data structure of a virtual equipment module, loading corresponding parameters of the virtual equipment module, as shown in fig. 3, and inserting the virtual equipment module into a corresponding position of a virtual equipment linked list according to an ascending order of equipment addresses;
step 3) as shown in fig. 4, creating data cache mapping for the virtual device modules in sequence according to the sequence of the devices in the linked list;
and 4) the master device reads data from the slave device through the device adapter, stores the data into the input cache of the virtual device module, pushes the data of the output cache of the virtual device module to the physical device, realizes data synchronization of the slave device and the virtual device, and completes communication with the actual physical device by reading and writing the virtual slave device through the master device.
In the step 4), when the master device is used as a slave device after the service processing module of the master device completes data synchronization of the local slave device, the data read-write requests of other master devices are passively processed.
In an application scene when the master device is used as the slave device, the master device can see the unified addressing virtual address externally, the communication processing and address mapping processing modules of the master device are classified into service processing threads according to the time key characteristic, and user-defined processing, system signal processing and slave device communication processing with the cycle processing characteristic are classified into client processing threads, so that the operation efficiency is improved.
In this embodiment, a read command obtains input device data from an input buffer, a write command writes data to an output buffer, and when the bus slave device processes the data, the output buffer data is pushed to an output device, and because the input buffer and the output buffer are separated and independently addressed, the data needs to be written to the input buffer when an internal virtual bus operation is used, at this time, the output buffer is specified by the address code with the highest bit of 1, the input buffer corresponds to an address range of 0x000-0xFFF, and the output buffer corresponds to an address range of 0x1000-0x1 FFF.
The bus slave device processes data of input devices of the access system periodically and sequentially read into a register of the system, processes system signals and user-defined IO signals, and finally sequentially writes out the data in the register of the system to the output devices of the access system.
Principle of the invention
To facilitate understanding of the invention, the present invention relates to technical terms in which:
1. the main device is an industrial field bus communication master station, also called a management node, and is internally provided with a device adapter module, the module comprises multiple types of device adapters, a specific device processing method is realized in the device adapters, the device adapters are bridges of physical devices and virtual devices, data are actually read from the physical devices through the device adapters and stored in output caches of the virtual devices, the data of the virtual devices which are output and cached are pushed to the physical devices, data synchronization of the physical devices and the virtual devices is realized, an implementation interface of the device adapters has great flexibility, expansion device adapters can be continuously added according to requirements, and more physical devices are supported.
2. The slave device is an industrial field bus communication device and can also be called a controlled node.
3. Virtual devices, which do not actually exist, can be understood as: the mapping of the fieldbus devices on the master device, the virtual device acts as a mirror of the physical device, so that the master device can indirectly communicate with the actual physical device by communicating with the virtual device.
4. The bus equipment adaptation layer comprises multiple types of equipment adapters, a specific equipment processing method is realized in the equipment adapters, the equipment adapters are bridges of physical equipment and virtual equipment, data read from the physical equipment and stored in an output cache of the virtual equipment are realized through the equipment adapters, the data output cache of the virtual equipment is pushed to the physical equipment, and data synchronization of the physical equipment and the virtual equipment is realized. The realization interface of the adapter has great flexibility, and the adapter of the expansion device can be continuously added according to the requirement to support more physical devices.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A fieldbus structure based on virtual devices, the bus structure comprising at least one master device and at least one slave device, wherein the master device is connected to the slave device via a physical bus, and the slave device maps physical device addresses into the master device via the physical bus;
the master device comprises a device adaptation module, a virtual device module, a communication module and a service processing module, the slave device maps the physical device address of the slave device to the virtual device module through the device adaptation module, and is used for reading and writing data from the slave device and storing the data into an input cache of the virtual device module, and pushing the data output cache of the virtual device to the slave device, so that data synchronization between the physical device and the virtual device is realized.
2. The virtual device based fieldbus structure of claim 1, wherein the master device is adapted to be a slave device coupled to another master device via a bus and to passively receive data.
3. The virtual device based fieldbus structure of claim 2, wherein the master device is divided into a service thread and a client thread, and the master device communication processing and address mapping processing module is classified as the service processing thread and the user-defined processing, system signal processing, and slave device communication processing having a cycle processing characteristic are classified as the client processing thread according to a time-critical characteristic by analyzing a data stream.
4. A virtual device based fieldbus method, comprising the steps of:
step 1) loading the slave equipment, wherein an equipment adaptation module in the master equipment provides a uniform interface to connect the slave equipment so as to perform the operations of opening the equipment, reading in data, writing out the data and closing the equipment;
step 2) creating a virtual equipment set, firstly constructing a data structure of a virtual equipment module, loading corresponding parameters of the virtual equipment module, and inserting the virtual equipment module into a corresponding position of a virtual equipment linked list according to an ascending order of equipment addresses;
step 3) creating data cache mapping for the virtual equipment modules in sequence according to the sequence of the equipment in the linked list;
and 4) the master device reads data from the slave device through the device adapter, stores the data into the input cache of the virtual device module, pushes the data of the output cache of the virtual device module to the physical device, realizes data synchronization of the slave device and the virtual device, and completes communication with the actual physical device by reading and writing the virtual slave device through the master device.
5. The virtual device based fieldbus method of claim 4, wherein in step 4), when the service processing module of the master device completes data synchronization of the local slave device and the master device is used as a slave device, the data read-write request of other master devices is passively processed.
6. The virtual device-based fieldbus method of claim 5, wherein in an application scenario when the master device is acting as a slave device, the master device sees externally a uniformly addressed virtual address, and according to time-critical characteristics, the master device communication processing and address mapping processing module is classified as a service processing thread, and the user-defined processing, system signal processing, and slave device communication processing with periodic processing characteristics are classified as a client processing thread.
CN201911393488.8A 2019-12-30 2019-12-30 Fieldbus method based on virtual equipment Active CN111209229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911393488.8A CN111209229B (en) 2019-12-30 2019-12-30 Fieldbus method based on virtual equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911393488.8A CN111209229B (en) 2019-12-30 2019-12-30 Fieldbus method based on virtual equipment

Publications (2)

Publication Number Publication Date
CN111209229A CN111209229A (en) 2020-05-29
CN111209229B true CN111209229B (en) 2021-12-21

Family

ID=70789392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911393488.8A Active CN111209229B (en) 2019-12-30 2019-12-30 Fieldbus method based on virtual equipment

Country Status (1)

Country Link
CN (1) CN111209229B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109254931B (en) * 2018-08-31 2022-07-26 联想(北京)有限公司 Control method, control device, virtual drive and electronic system
CN112653725A (en) * 2020-11-30 2021-04-13 石家庄通合电子科技股份有限公司 Virtual scheduling algorithm of communication interface
CN115037568A (en) * 2022-05-16 2022-09-09 中国人民解放军海军工程大学 Industrial bus transmission method based on IO mapping
CN115664885A (en) * 2022-09-30 2023-01-31 蔚来软件科技(上海)有限公司 Cross-terminal communication method, system and device based on bus and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1708742A (en) * 2002-01-23 2005-12-14 思科技术公司 Methods and apparatus for implementing virtualization of storage within a storage area network
CN101809559A (en) * 2007-09-05 2010-08-18 伊姆西公司 De-duplication in virtualized server and virtualized storage environments
CN102165431A (en) * 2008-09-30 2011-08-24 微软公司 On-the-fly replacement of physical hardware with emulation
CN102932419A (en) * 2012-09-25 2013-02-13 浙江图讯科技有限公司 Data storage system for industrial and mining enterprise oriented safety production cloud service platform
CN103744790A (en) * 2005-08-25 2014-04-23 晶像股份有限公司 Smart scalable storage switch architecture
CN104253729A (en) * 2013-06-28 2014-12-31 施耐德电器工业公司 Method for transferring data between master unit and slave units through register interfaces
CN105786447A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and apparatus for processing data by server and server
CN109308288A (en) * 2018-09-26 2019-02-05 新华三云计算技术有限公司 Data processing method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060195623A1 (en) * 2005-02-25 2006-08-31 International Business Machines Corporation Native virtualization on a partially trusted adapter using PCI host memory mapped input/output memory address for identification
US7944946B2 (en) * 2008-06-09 2011-05-17 Fortinet, Inc. Virtual memory protocol segmentation offloading
US8478908B2 (en) * 2010-10-25 2013-07-02 Moxa Inc. Fieldbus gateway using virtual serial filedbus port and data transmission method thereof
CN103617175A (en) * 2013-11-04 2014-03-05 广东电子工业研究院有限公司 Method for virtualization of large-scale distributed heterogeneous data
US9798684B2 (en) * 2015-04-21 2017-10-24 Blackberry Limited Bus communications with multi-device messaging
CN105700826A (en) * 2015-12-31 2016-06-22 华为技术有限公司 Virtualization method and device
CN110597451B (en) * 2018-06-12 2021-02-23 华为技术有限公司 Method for realizing virtualized cache and physical machine

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1708742A (en) * 2002-01-23 2005-12-14 思科技术公司 Methods and apparatus for implementing virtualization of storage within a storage area network
CN103744790A (en) * 2005-08-25 2014-04-23 晶像股份有限公司 Smart scalable storage switch architecture
CN101809559A (en) * 2007-09-05 2010-08-18 伊姆西公司 De-duplication in virtualized server and virtualized storage environments
CN102165431A (en) * 2008-09-30 2011-08-24 微软公司 On-the-fly replacement of physical hardware with emulation
CN102932419A (en) * 2012-09-25 2013-02-13 浙江图讯科技有限公司 Data storage system for industrial and mining enterprise oriented safety production cloud service platform
CN104253729A (en) * 2013-06-28 2014-12-31 施耐德电器工业公司 Method for transferring data between master unit and slave units through register interfaces
CN105786447A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and apparatus for processing data by server and server
CN109308288A (en) * 2018-09-26 2019-02-05 新华三云计算技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN111209229A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
CN111209229B (en) Fieldbus method based on virtual equipment
CN100342352C (en) Expandable high speed storage network buffer system
RU2401452C2 (en) Method for data transmission in communication system link messages as well as communication module, communication system subscriber unit and communication system for this method implementation
US20130103904A1 (en) System and method to reduce memory access latencies using selective replication across multiple memory ports
US20090138597A1 (en) system and method for accessing memory
CN101639811B (en) Data writing method, controller and multi-controller system
CA2596720A1 (en) Method and apparatus for a redundancy approach in a processor based controller design
JPH02103649A (en) Controller and information processing system
JP2021500648A (en) Memory-mapped interface systems, methods and computer programs for message passing computing systems
JPH0217818B2 (en)
Knezic et al. Increasing EtherCAT performance using frame size optimization algorithm
CN109947390B (en) Buffer system and method of operation thereof
CN106980556B (en) Data backup method and device
CN109446130A (en) A kind of acquisition methods and system of I/O device status information
CN112367236A (en) Data scheduling method and system of LIN bus
JP4013250B2 (en) OPC communication station
CN103778069A (en) High-speed cache block length adjusting method and device of high-speed cache memory
JP6419400B1 (en) PLC, network unit, CPU unit, and data transfer method
CN1967483A (en) Method and storage medium for virtualization of device self-description information using in-transit modification
JP2007004710A (en) Storage access system, data transfer device, storage accessing method and program
US20040064644A1 (en) Structure and method of cache memory data update
US8316169B2 (en) Physical to hierarchical bus translation
CN212486527U (en) Slave station conversion device based on MODBUS protocol
US20110252170A1 (en) Hierarchical to physical bus translation
CN109298683B (en) Numerical control system supporting multiple bus driver communication protocols

Legal Events

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