Detailed Description
As shown in fig. 1, the UM-BUS adopts a multi-channel intelligent dynamic redundancy BUS type topology based on M-LVDS (TIA/EIA-899), and at most 30 communication nodes are directly interconnected without routing or relaying equipment; the data are transmitted by using 2-32 channels, and the maximum communication rate can reach 6.4 Gbps; if the channel fails, the failed channel can be automatically shielded through the channel dynamic redundancy and fault reconstruction technology, and communication is continued on the remaining healthy channels; the communication mode of master-slave command response is adopted, so that remote storage access and non-intelligent expansion capability can be provided for the system.
The nodes on the UM-BUS BUS can be divided into a main node, a slave node and a monitoring node according to different functions, a communication process can only be initiated by the main node and responded by the slave node or other main nodes, and the monitoring node is used for monitoring the communication process on the BUS. The nodes exchange information in the form of data packets. The UM-BUS BUS main node can read and write access to internal functional units of other nodes according to addresses, and can support three address spaces of an IO space, a storage space and an attribute space, wherein the IO space and the attribute space can only carry out read and write access according to words and cannot be buffered, and the storage space can only carry out read and write access according to pages and needs to be buffered locally.
The communication protocol hierarchical model of the UM-BUS is shown in fig. 2, and comprises a processing layer, a data link layer and a physical layer from top to bottom, wherein the processing layer is responsible for management of the whole BUS, protocol encapsulation and conversion of an upper application interface. The data link layer is divided into a transmission sublayer and an MAC sublayer, and the transmission sublayer carries out grouping and dynamic reconstruction on data according to the existing effective line; the MAC sublayer is responsible for communication line detection, provides channel health conditions for the transmission sublayer, completes secondary packaging and unpacking of channel transmission information, and achieves time synchronization of bus nodes. The physical layer is the bottom layer of the protocol, provides transmission media and interconnection equipment for data communication, realizes the physical connection of the network, completes the functions of serial-parallel conversion, 8b/10b coding and decoding, clock synchronization and the like, and provides a reliable communication basis for the bus.
The bus nodes transmit data between different protocol layers in the form of data packets during communication, and the data transmission process is shown in fig. 3. When data communication is carried out, at a sending end, a processing layer obtains data from an upper layer interface and stores the data into a data buffer area, a transmission sublayer dynamically and uniformly distributes data packets to effective channels according to effective line information provided by an MAC sublayer, and a physical layer packages the grouped data and encodes the packed data into bit streams through 8b/10b to send the bit streams to a link. At the receiving end, the physical layer carries out clock synchronization, 8b/10b decoding and serial-parallel conversion on the received data, then unpacks the channel data, dynamically organizes the data according to the effective line information provided by the MAC sublayer at the transmission sublayer and stores the data in a data buffer area, and finally the processing layer delivers the data to the application layer for processing.
In the multi-master communication mode, the master node must obtain the bus use right before sending data from the physical layer to the bus, and a bus communication process is started. The UM-BUS has a time synchronization function, and all nodes on the UM-BUS are in a time synchronization state during work.
The UM-BUS BUS has a dedicated shared interrupt signal line between all nodes. As shown in fig. 4, all nodes of the bus may send an interrupt request signal to the shared interrupt signal line by using an OC (open collector) or an equivalent manner and using a serial encoding manner, and raise an interrupt request to the bus master node; meanwhile, all nodes can also receive signals from the shared interrupt line to acquire information transmitted on the interrupt line.
Based on the UM-BUS working principle, a specific implementation manner of the CPS master node dynamic identification method of the present invention is as follows:
for convenience in description, it is assumed that the UM-BUS is adopted by the CPS system as a communication BUS, the BUS has 6 master nodes and 10 slave nodes, which are respectively equal to a CPS master node and a CPS slave node in the CPS system, the node number of each CPS master node is defined as 1-6, and the node number of each CPS slave node is defined as 11-20.
TABLE 1 Attribute space definition
In order to realize the standardized operation of UM-BUS node equipment in a CPS system and meet the requirements of heterogeneous fusion and dynamic access, the attribute space of the UM-BUS is utilized to realize software-defined virtualization equipment, and the consistent operation of heterogeneous equipment is realized through a standardized interface and a standardized method defined by the attribute space.
UM-BUS BUS node attribute space setting
The 1KB attribute space of each node on the UM-BUS is divided into three parts, a node description area (32 words, 128B), a reserved area (32 words, 128 bytes) and a function attribute definition area (maximum 192 words, 768 bytes), as shown in table 1. The node description area is used for describing and defining the basic characteristics of the UM-BUS BUS node, the reserved area is used for future expansion, the number of the function attribute definition areas can be 0-4 according to needs, and at most, 4 specific functions can be specifically defined. One UM-BUS BUS node can support four function combinations at most, and a function attribute definition area can be set for each function through an attribute space to perform software definition on the functions.
1. Node description area
The node description area has 32 words (128 bytes) in total, occupies attribute space addresses 0-124, and defines node numbers, interrupt control, space requirements, function classification, global methods, node names and the like.
(1) Node number and basic attribute
The 0 th word is a node number and basic attributes and is divided into 4 bytes, the lowest byte is a node number, bits 4-0 are UM-BUS BUS node numbers, and the effective value is 1-30; the next lower byte is a node type attribute, a bit 7 (the highest bit) is 1 to indicate that the node has the master node capability, a bit 6 is 1 to indicate that the node has the slave node capability, a bit 5 is 1 to indicate that the node has the time master node capability, a bit 4 is 1 to indicate that the node has the interrupt request capability, and a bit 3 is 1 to indicate that the node has the interrupt processing capability; the next high byte is a node function attribute, the bits 2-0 are 0 to represent that the node has no specific function area, the bits 1-4 represent that the node has 1-4 combined functions, and 1-4 function attribute areas are used for defining the specific attribute and method of each function; the highest byte is reserved for future expansion.
(2) Interrupt control
The interrupt control is 5 words in total, address 4 is a forced reset register, and writing 0x1005 into the register resets the node device; the address 8 is an interrupt mask register, the bit 15-0 corresponds to the interrupt request 15-0, the corresponding interrupt request is masked when the bit is 1, and only the interrupt of number 0 is allowed after resetting; address 12 is an interrupt identification register, bits 15-0 correspond to interrupt requests 15-0, respectively, a 1 indicates that the corresponding interrupt request is active at a high level, otherwise, the rising edge is active; address 16 is an interrupt force register, bits 15-0 correspond to interrupt requests 15-0, respectively, and writing 1 indicates forcing the corresponding interrupt request; address 20 is reserved for future extensions.
(3) Space mapping requirements
The address 24 is an IO space address requirement register, the bits 15-0 are the size of IO space required by the slave node when the slave node performs unified address mapping in the master node, the unit is byte, and one slave node can only map 64KB of IO space at most. Address 28 is a memory space address requirement register and bits 15-0 indicate the number of blocks of memory space required for the slave node to perform the unified address mapping in the master node, each block being 64 KB. Therefore, a slave node can only map 4GB of memory at most. When the memory space is accessed, if the range of more than 4GB is needed, a block mapping mode can be adopted, and the upper 16-bit address is independently designated through the bits 31-16.
(4) Definition of functions
The address 32 is a function encoding register, which is divided into 4 bytes, the lowest byte is a function classification, the next lowest byte is a function subclass encoding, and the highest byte and the next highest byte are reserved for future expansion.
The addresses 36, 40 are two words reserved for future expansion.
The addresses 44, 48 are node global method area indices, including the starting address and size of the method area. The initial address is 48 bits, and the initial address of the global method in the storage space of the node is specified. Address 44 is the lower 32 bits of the start address and the lower 16 bits of address 48 are the upper 16 bits of the start address. The upper 16 bits of address 48 are the size of the global method area, which is expressed in 256 byte blocks, i.e., the maximum of 16 MB.
The address 52 is a functional attribute area definition register, and is divided into 4 bytes, which represent the number of functional attribute definition area words of four functions 1, 2, 3, and 4 in the order of the lowest byte (bits 7-0), the next lowest byte (bits 15-8), the next highest byte (bits 23-16), and the highest byte (bits 31-24). A function attribute definition area is 10 words at the minimum and 140 words at the maximum, so that the value range of each byte is 10-140. If the function attribute definition area does not exist, i.e., there is no corresponding function, the corresponding byte should be 0.
The addresses 56, 60 are two words reserved for future expansion.
(5) Name definition
The address 64-76 is four words, 16 bytes in total, is used for setting the name of the node, adopts Unicode encoding, and can represent 8 characters in total by representing one character every two bytes. The address 80-92 is four words and has 16 bytes, is used for setting the name of the node manufacturer, adopts Unicode coding, and can represent one character every two bytes and can represent 8 characters in total. The addresses 96-124 are reserved for a total of 8 words for future expansion.
2. Function attribute definition region
The UM-BUS BUS node supports at most four function combinations, a function attribute definition area is set for each function, and abstract definition is carried out on attribute configuration, IO operation and processing methods of the function attribute definition area so as to support standardized operation of heterogeneous equipment. A UM-BUS node includes at least one functional attribute definition area, and may include up to four functional attribute definition areas. The function attribute definition area defines a processing method and an operation address related to one function module by adopting a normative structure, so that the heterogeneous versions can be subjected to unified normative operation on software.
The function attribute definition area comprises a basic attribute definition and an operable attribute definition. The basic attribute definition is fixed to 10 words, and must have a basic attribute definition if a functional attribute definition area exists. And the operation attribute is selected and realized according to the function requirement.
(1) Fundamental attribute definition
The basic attribute definition includes a function code, name and operation attribute configuration, for a total of 10 words and 40 bytes.
The function code occupies the first word and is divided into 4 bytes, the lowest byte is the function classification, the next lowest byte is the function subclass coding, and the highest byte and the next highest byte are reserved for future expansion.
The 2 nd to 5 th words are function names and have 16 bytes, are coded by Unicode, and each two bytes represent one character and can represent 8 characters in total.
Word 6 is an operation attribute configuration word, divided into 4 bytes. Reserving the highest byte; a next-highest byte bit of 0 of 1 indicates that a functional method storage area exists, otherwise, no functional method storage area exists; the next lower byte is the size of the direct access attribute area, the value is 0-64, 0 represents that the attribute area is not directly accessed, and 1-64 represents the number of words directly accessed to the attribute area; the minimum byte is the size of the IO space mapping attribute area (indirect access attribute area), the value is 0-64, 0 represents that no IO space mapping attribute area exists, and 1-64 represents the number of words in the IO space mapping attribute area. In this embodiment, the operation attribute configuration words in the four function attribute definition areas are 0x00011020, 0x00010C00, 0x00000800, and 0x00010040, respectively, and indicate that: function 1, 2, 4 has a function method storage area, function 3 has no function method storage area; the direct access attribute area numbers of functions 1, 2 and 3 are respectively 16, 12 and 8, and function 4 has no direct access attribute area; the numbers of IO space mapping attribute areas of functions 1 and 4 are 32 and 64, respectively, and functions 2 and 3 have no IO space mapping attribute area.
Words 7-10 are reserved for future expansion.
(2) Operation attribute definition
The operating attributes of the UM-BUS node functions are divided into four categories:
1) and the function method attribute uses 2 words and 8 bytes to provide the storage starting address and size of the function method code in the node storage space in the operation attribute definition area. The starting address is 48 bits, the first word is the lower 32 bits of the starting address and the lower 16 bits of the second word are the upper 16 bits of the starting address. The upper 16 bits of the second word are the size of the functional method area, which is expressed in terms of the number of 256-byte blocks, and thus the maximum of the functional method area is 16 MB.
2) The direct access data can define 64 direct access addresses at most in the operation attribute area, and the read-write access to the functional data can be directly completed by reading and writing the addresses of the direct access data.
3) And indirectly accessing data, defining 64 IO space mapping addresses at most in an operation attribute area, respectively storing a node IO space address, and completing read-write access on the functional data through the read-write access of the IO space addresses.
4) The proprietary data, which is related to the specific implementation of the node, may be in the IO space or in the storage space.
The operation attribute definition region supports the standardized definition of the function method attribute, the direct access data attribute and the indirect access data attribute, and the system software can adopt the same software to carry out unified processing on the heterogeneous realization of the same function as long as the same attribute definition is used.
Table 1 gives an example of a function attribute definition area of a bus node including four combinations of functions.
Second, method area storage format
The UM-BUS node may include a global approach to support system initialization, common operation, and interrupt handling functions of the node device and a functional attribute approach to specifically handle data processing, attribute setting, and drive control of specific functions. The global method and the function attribute method both adopt the same storage structure to be solidified in the storage space of the node, and after the system is reset, the main node is dynamically loaded into the local memory of the processor to run according to the requirement. And respectively providing storage starting addresses and ranges of the global method and the function attribute method in the node storage space in the node description area and the function attribute definition area. The method area occupies 16MB at most, 256B memory blocks are taken as basic growth units, the memory start address must be 256B boundary alignment, and the memory format is as shown in FIG. 5, which comprises three parts, namely a method description area, a method mapping area and a method entity area. Fig. 6 shows the overall layout and storage organization of the CPS node method area.
1. Method description area
The method description area has 16 words and 64 bytes, the lowest byte of the 1 st word is used for indicating the total number of methods of the method area, the value range is 0-128, and the other three bytes are reserved. Thus, each method region contains a minimum of 0 methods and a maximum of 128 methods. When the total number of methods of the method area is 0, there is no method mapping area and method entity area. The remaining 15 words of the method description area are 60 bytes, and the method is simply explained by using ASCII codes and can comprise information such as copyright, name, version and the like.
2. Method mapping zone
The method mapping area is used for providing indexes for each specific method and establishing an index item for each method. An index entry occupies 8 words (32 bytes) and includes a method name, a method offset, a method parameter, and a reserved field. The method name occupies 16 bytes, and the ASCII code is adopted to represent the method. The method offset occupies 4 bytes, and the offset of the method code entry in the initial address of the method area is given; the method parameter has 4 bytes in total, 4 parameter definitions are supported, 0 represents that the parameter does not exist, 1 represents a numerical parameter, and 2 represents a pointer parameter. The reserved field is 8 bytes in total for future expansion.
3. Method entity area
The method entity area is used for storing entity codes and data supporting the operation of the method, and comprises not only execution codes of the method, but also supporting codes and data required by the execution of the method codes, and other data and codes defined by a user.
Third, access method of function parameter
Based on the UM-BUS attribute space definition, in the CPS system, the specific access method for the node function parameters is as follows:
(1) for attribute definition data of the attribute space, directly performing read-write access in an attribute space data access mode of the UM-BUS;
(2) for the special data of the nodes, read-write access is carried out through an attribute method, and also can be carried out according to an appointed IO address or a storage address;
(3) for direct access data and indirect access data defined in the attribute space, performing read-write access according to the following method and steps:
1) as shown in fig. 7, in the CPS master node, an address mapping table consisting of three parts, namely a node number, a space identifier and a storage address, is established for each data of the CPS slave node, and the address mapping table of all data of each function constitutes an independent attribute data address mapping table. Wherein the node number is the node number of the CPS slave node; the space identification indicates whether the data is in an IO space or an attribute space, and can also comprise other attributes such as reading, writing, size and the like of the data; the storage address is the storage location of the data in the space corresponding to the CPS slave node.
2) When the CPS slave node is initialized, the CPS master node acquires the storage addresses of the direct access data and the indirect access data one by one from each function attribute definition area, takes the acquired storage addresses as the storage addresses of the data address mapping, and sets a space identifier and a node number for the data address mapping.
3) And when the CPS master node performs read-write access on the functional data, acquiring corresponding address mapping from an attribute data address mapping table corresponding to the function, and performing read-write operation on corresponding addresses of corresponding spaces of the CPS slave nodes through the UM-BUS BUS according to the node numbers, the space identifications and the storage addresses of the address mapping.
Dynamic loading method of function processing method
In the CPS system, a CPS main node needs to load function methods of other nodes, and in the dynamic loading process, for any CPS main node, the other CPS nodes are used as CPS slave nodes, and the function methods are loaded into the main node.
The global method and the function processing method are dynamically loaded and called when the node is initialized and the system is applied. When a CPS slave node is initialized, the following steps and methods are adopted for dynamic loading and calling:
(1) the CPS master node firstly reads the attribute space of the CPS slave node and acquires the configuration information of the global method area and the function processing method area of the CPS slave node;
(2) the CPS main node establishes a method loading area for the CPS slave node in a CPS main node memory according to the storage space requirements of a global method area and a function processing method area of the CPS slave node, wherein the method loading area comprises an interrupt processing method area, a global method area and a function method area;
(3) copying all method codes of the CPS slave nodes to corresponding areas of a CPS main node method loading area through an UM-BUS BUS;
(4) establishing a method mapping table in the CPS master node, indicating the initial address and the size of the occupied memory for each method of the CPS slave node, and arranging the methods in the mapping table according to the ASCII code sequence of names so as to facilitate retrieval;
(5) when the application program in the CPS main node calls the function method of the CPS slave node, firstly, the method name and the parameters are searched and matched in a method mapping table, then, the corresponding mapping address is transferred, and a specific method code is called for processing.
Fifth, dynamic identification method of function module
1. Dynamic identification method of slave node
Based on the UM-BUS, the CPS master node dynamically identifies CPS slave nodes using the following methods and steps, as shown in fig. 8. For convenience of description, without loss of generality, it is assumed that the CPS slave node S0 is a slave node to be identified, and is identified by any CPS master node Mx in the CPS system.
(1) After a CPS slave node S0 is added into the system or reset, firstly, time synchronization is completed according to UM-BUS specifications, then a global interrupt request requesting identification is sent to the UM-BUS, and all CPS master nodes connected to the UM-BUS are requested to identify the CPS slave node S0;
(2) after receiving the global interrupt request identified by the request of the CPS slave node S0, one CPS master node Mx on the UM-BUS is processed according to the following steps:
reading the attribute space of a CPS slave node S0 to obtain basic attribute information of a CPS slave node S0; judging according to the basic attribute information of the CPS slave node S0, and if the CPS slave node S0 is identified, then turning to the step (four); otherwise, go to step two to continue to carry out;
establishing a method loading area for the CPS slave node S0 in a memory, reading configuration information of a global method area and a function attribute method area of an attribute space of the CPS slave node S0, establishing a method mapping table for all interrupt processing methods, global methods and function methods of the CPS slave node S0, moving method codes on the CPS slave node S0 to a memory of a CPS master node Mx, and transferring to the step III;
reading the direct data attribute and indirect data attribute definition area information of the CPS slave node S0, establishing a functional parameter read-write access mapping table for the CPS slave node S0 in a memory, establishing an address mapping containing three parts of information of a node number, a space identifier and a storage address for each data, and turning to the step IV; when a CPS master node Mx establishes a functional parameter read-write access mapping table for a CPS slave node S0, mapping the addresses of all attribute data of each function of the CPS slave node S0 to form an independent functional parameter read-write access mapping table;
fourthly, when the CPS master node Mx accesses the data of the CPS slave node S0, the data of the CPS slave node S0 are accessed by reading and writing an access mapping table through the functional parameters; when the method of the CPS slave node S0 is called, the corresponding method code is executed through a method mapping table in the memory of the CPS master node Mx.
(3) In the process of dynamically identifying the slave nodes, after each CPS master node on the UM-BUS receives a global interrupt request identified by a request sent by the CPS slave node S0, required BUS access is sequentially carried out on the CPS slave node S0 according to a multi-master arbitration method of the BUS.
2. Dynamic identification method of main node
Based on the UM-BUS, the CPS master node dynamically identifies the CPS slave nodes on the BUS by the following method and steps, and is dynamically identified by other master nodes on the BUS, as shown in FIG. 9, and the layout of the internal structures of the UM-BUS address space and the host memory space is the same as that of FIG. 8. For convenience of description, without loss of generality, the CPS master node M0 is assumed to be the master node to be identified.
(1) After a CPS main node M0 is added into the system or reset, firstly, time synchronization is completed according to UM-BUS specifications, then a global interrupt request for identification is sent to the UM-BUS, and other CPS main nodes connected to the UM-BUS are requested to identify the CPS main node and request to identify other CPS nodes;
(2) after receiving a global interrupt request which is sent by a CPS master node M0 and is requested to identify, all CPS slave nodes connected to the UM-BUS BUS send an interrupt request which is requested to identify to a CPS master node M0 through the UM-BUS BUS, and the CPS master node M0 is requested to identify and load the CPS slave nodes;
(3) after receiving a global interrupt request which is sent by a CPS main node M0 and is requested to identify, other CPS main nodes connected on an UM-BUS firstly read configuration information of an attribute space of the CPS main node M0 through the UM-BUS, establish a function parameter read-write access mapping table and a method mapping table for the CPS main node M0 in a memory, and complete dynamic identification of the CPS main node M0; then, an interrupt request requesting for identification is sent to the CPS master node M0, and the CPS master node M0 is requested to identify and load the CPS master node; each CPS master node on the UM-BUS sequentially accesses the CPS master node M0 according to a multi-master arbitration method of the UM-BUS.
(4) After receiving an interrupt request of a request identification sent by other CPS nodes, the CPS master node M0 reads an attribute space of the CPS node of which the sending request identification is interrupted, establishes a functional parameter read-write access mapping table and a method mapping table for the CPS node of which the sending request identification is interrupted in a memory of the CPS master node M0 according to configuration information of the attribute space, loads a method code of the CPS node of which the sending request identification is interrupted into the memory of the CPS master node M0, and completes dynamic identification of the CPS node of which the sending request identification is interrupted.
The CPS main node dynamic identification method is based on UM-BUS BUS, provides a method for CPS main node to dynamically identify and manage other CPS nodes on the BUS and dynamically identify and manage other CPS main nodes on the BUS, can avoid the requirement of pre-deployment of CPS slave node driving program on CPS main node, realizes driving-free application, can improve the fusion capability of heterogeneous CPS nodes, and is beneficial to the standardized upgrading and maintenance of CPS system.
The present invention may have various modifications within the scope not departing from the spirit of the invention, such as: other forms of buses, networks, etc. may be used, and may vary from implementation to implementation. Such variations are also intended to be included within the scope of the invention as claimed.