Summary of the invention
What the present invention solved is cannot realize the interconnected problem with communicating between various types of equipment in prior art.
For solving the problem, the invention provides a kind of control device, described control device comprises controller and equipment that at least one is connected with described controller, and described controller comprises:
Setting unit, is suitable for arranging and preserves equipment, comprises the corresponding relation of device numbering, protocol type and device numbering and protocol type, preserves the set of described device numbering;
Source data processing unit, is suitable for the source data that receiving equipment sends, and the protocol type corresponding according to the equipment sending described source data obtains the device numbering of data message and target device in described source data;
First transmitting element, is suitable for when the set of described device numbering comprises the device numbering of the target device in described source data, and the protocol type corresponding according to described target device sends the data message extremely described target device in described source data.
Alternatively, described setting unit, the interface type being suitable for being connected with described controller according to described equipment arranges described equipment.
Alternatively, described protocol type comprises messaging parameter, and described first transmitting element is suitable for sending data message in described source data to described target device according to the messaging parameter in protocol type corresponding to described target device.
Alternatively, described protocol type comprises data message position and target address location, data message in described source data is determined in the data message position that described source data processing unit is suitable for according to sending in protocol type corresponding to the equipment of described source data, and determines the device numbering of described target device according to the target address location in protocol type corresponding to the equipment sending described source data.
Alternatively, described control device is suitable for connecting bus, and described controller also comprises:
Data packetization unit, is suitable for when the set of described device numbering does not comprise the device numbering of described target device, at least obtains according to the device numbering of the data message in described source data and target device the packet being suitable for transmitting on the bus.
Alternatively, described controller also comprises:
Packet resolution unit, is suitable for carrying out dissection process to obtain the device numbering of data message in described packet and target device to packet;
Second transmitting element, is suitable for when the set of described device numbering comprises the device numbering of the target device in described packet, and the protocol type corresponding according to described target device sends the data message extremely described target device in described packet.
Correspondingly, the present invention also provides a kind of bus system, comprising: bus and at least one control device, and described control device is distributed in described bus, described control device comprises controller and equipment that at least one is connected with described controller, and described controller comprises:
Setting unit, is suitable for arranging and preserves equipment, comprises the corresponding relation of device numbering, protocol type and device numbering and protocol type, preserves the set of described device numbering;
Source data processing unit, is suitable for the source data that receiving equipment sends, and the protocol type corresponding according to the equipment sending described source data determines the device numbering of data message and target device in described source data;
First transmitting element, is suitable for when the set of described device numbering comprises the device numbering of the target device in described source data, and the protocol type corresponding according to described target device sends the data message extremely described target device in described source data.
Alternatively, described controller also comprises:
Data packetization unit, is suitable for when the set of described device numbering does not comprise the device numbering of described target device, at least obtains according to the device numbering of the data message in described source data and target device the packet being suitable for transmitting on the bus.
Alternatively, described controller also comprises:
Packet resolution unit, is suitable for carrying out dissection process to obtain the device numbering of data message in described packet and target device to packet;
Second transmitting element, is suitable for when the set of described device numbering comprises the device numbering of the target device in described packet, and the protocol type corresponding according to described target device sends the data message extremely described target device in described packet.
Alternatively, described controller also comprises:
Processing data packets unit, be suitable for when the set of described device numbering does not comprise the device numbering of described target device and the length of the data message in described source data is greater than data length threshold value, process data message in described source data to obtain multiple subdata information, and the device numbering of described multiple subdata information and target device is sent to described data packetization unit;
Described data packetization unit, also be suitable at least obtaining according to the device numbering of described subdata information and described target device the multiple packets being suitable for transmitting on the bus, each packet includes the device numbering of a sub-data message and described target device.
Alternatively, described controller also comprises:
Time synchronizing unit, is suitable for the time synchronized adjusting described controller and synchronisation source;
Temporal information obtains unit, is suitable for the time acquisition temporal information corresponding according to equipment transmission source data;
Described source data processing unit, is also suitable for receiving described temporal information;
Described first transmitting element, is also suitable for sending described temporal information when the set of described device numbering comprises the device numbering of the target device in described source data to described target device.
Alternatively, described controller also comprises:
Time synchronizing unit, is suitable for the time synchronized adjusting described controller and synchronisation source;
Temporal information obtains unit, is suitable for the time acquisition temporal information corresponding according to equipment transmission source data;
Described source data processing unit, is also suitable for receiving described temporal information;
Described data packetization unit, also be suitable for when the set of described device numbering does not comprise the device numbering of described target device, the device numbering according to the data message in described temporal information, source data and target device obtains the packet being suitable for transmitting on the bus.
Alternatively, described controller also comprises:
Device package resolution unit, is suitable for carrying out dissection process to obtain the device numbering of temporal information, data message and target device in described packet to packet;
Second transmitting element, is suitable for when the set of described device numbering comprises the device numbering of the target device in described packet, and the protocol type corresponding according to described target device sends data message in described packet and temporal information to described target device.
Alternatively, the packet being suitable for transmitting in bus that described data packetization unit obtains is the packet of short data frame transformat, and described packet comprises: the device numbering of data packet head mark, target device, temporal information, data message, check information and packet end mark.
Alternatively, the packet being suitable for transmitting in bus that described data packetization unit obtains is the packet of long data frame transformat, and described packet comprises: the device numbering of data packet head mark, target device, temporal information, data length information, data message, check information and packet end mark.
Alternatively, described bus system also comprises: at least one control module, and each control module correspondence connects a controller, is suitable for obtaining the performance parameter of described controller and carries out analyzing and processing.
Alternatively, described equipment has pre-set priority, and described controller is also suitable for the source data that the equipment high according to the pre-set priority priority processing pre-set priority of equipment sends.
Alternatively, the controller in described bus system is divided into master controller and from controller, in described bus system, the device numbering of each equipment is distributed by described master controller.
Compared with prior art, technical scheme of the present invention has the following advantages:
In bus system of the present invention, the protocol type of each equipment be connected with this controller can be set flexibly by controller, and be sent to target device after source data being processed accordingly by the first transmitting element or data packetization unit.In bus system of the present invention, each equipment can access bus as required freely, achieve between various types of equipment interconnected with communicate.In addition, the communication between controller of the present invention and each equipment does not need to be arranged to unified transfer rate, thus reduces the cost of equipment access bus.
Further, controller of the present invention can when in source data, the length of data message be greater than data message threshold value, described processing data information is become multiple subdata information, and obtains with the device numbering of corresponding target device the packet being suitable for transmitting in bus according to described subdata information.Thus improve the transfer efficiency of data in bus system of the present invention.
Further, synchronisation source can also be comprised in bus system of the present invention, each controller carries out time synchronized based on described synchronisation source, and temporal information corresponding for equipment transmission source data is sent to target device, such target device can obtain the delay of this target device according to the difference received between temporal information corresponding to these data temporal information corresponding with equipment transmission source data when receiving corresponding data, thus improve the degree of accuracy of the data processing of bus system.
Embodiment
As described in the background art, existing various fieldbus has oneself living space separately, and multiple bussing technique standard coexists.The interface type of the field apparatus in various fieldbus varies, cannot realize between various fieldbus freely interconnected with communicate.
The invention provides a kind of can the adaptive control device of expanded application and bus system.Based on the present invention, various types of terminal device can be linked in bus system easily, the equipment of various distinct interface and traffic rate directly can adopt self existing communication interface or the communication interface according to self-demand design, and does not need to adopt for the necessary controller of a certain bus system.Further, each terminal device can adopt the speed rates required for equipment of itself, and does not need to adopt uniform rate.By the present invention, various types of terminal device achieves interconnected and communication freely.
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail specific embodiments of the invention below in conjunction with accompanying drawing.
Embodiment one
Fig. 1 shows the structural representation of the embodiment one of bus system of the present invention.With reference to figure 1, described bus system comprises: bus (not shown) and control device, and described control device comprises: controller 10 and the equipment that at least one is connected with described controller 10.In the present embodiment, the equipment be connected with described controller 10 comprises the first equipment 20 and the second equipment 30.Certainly, in other embodiments, the equipment of described bus system other quantity all right, the present invention does not limit this.
Continue with reference to figure 1, described controller 10 comprises: setting unit 11, source data processing unit 12 and the first transmitting element 13.
Described setting unit 11 is suitable for arranging and preserves the corresponding relation of equipment, device numbering and protocol type, preserves the set of described device numbering.
For example, described setting unit 11 can access the device type of described controller 10 as required to arrange protocol type corresponding to each equipment and device numbering under embody rule scene, such as, described first equipment 20 can be set to meet the equipment of CAN protocol type, the device numbering of described first equipment 20 is set to 1.1; Be set to described second equipment 30 to meet the equipment of UART protocol type, the device numbering of described second equipment 30 is set to 1.2.Like this, the set of the device numbering of described setting unit 11 preservation is (1.1,1.2).
Described source data processing unit 12 connects described first equipment 20 and the second equipment 30, be suitable for the source data that receiving equipment sends, the protocol type corresponding according to the equipment sending described source data determines the device numbering of data message and target device in described source data.
In the present embodiment, the protocol type preserved in described setting unit 11 can comprise data message position and target address location, data message in described source data is determined in the data message position that described source data processing unit 12 is suitable for according to sending in protocol type corresponding to the equipment of described source data, and determines the device numbering of described target device according to the target address location in protocol type corresponding to the equipment of described transmission source data.
Particularly, when described first equipment 20 sends data to described second equipment 30, described first equipment 20 is the equipment of transmission source data; Described second equipment 30 is target device.So, described source data processing unit 12 receives the source data that described first equipment 20 sends, and determines the device numbering of data message and described second equipment 30 in described source data according to the corresponding protocol type of described first equipment 20.
The device numbering still supposing described first equipment 20 is 1.1, meets CAN protocol type; The device numbering of described second equipment 30 is 1.2, meets UART protocol type.So, the source data that described first equipment 20 sends is the message meeting CAN protocol type; Such as, described first equipment 20 send source data be CAN standard format message, namely described source data initial by frame, arbitration field, controlling filed, data fields, verification field, response field and frame end etc. seven part form.Described source data processing unit 12 obtains data message according to the CAN protocol type of described first equipment 20 correspondence from the data fields of CAN standard format message, obtains the device numbering 1.2 of the second equipment 30 from arbitration field.
Otherwise when described second equipment 30 sends data to described first equipment 20, described second equipment 30 is the equipment of transmission source data, and described first equipment 20 is target device.So, described source data processing unit 12 receives the source data that described second equipment 30 sends, and determines the device numbering of data message and described first equipment 20 in described source data according to the corresponding protocol type of described second equipment 30.It is similar that described source data processing unit 12 to obtain in the source data that described second equipment 30 sends the process of data message and the process of device numbering of first equipment 20 of acquisition and aforementioned acquisition process, do not repeat them here.
Continue with reference to figure 1, described first transmitting element 13 connects described first equipment 20 and the second equipment 30, when the set of device numbering being suitable for preserving in described setting unit 11 comprises the device numbering of the target device in described source data, the protocol type corresponding according to described target device sends data message in described source data to described device target equipment.
Be described further in conjunction with the course of work of instantiation to the bus system of the present embodiment more below.For convenience of description, first suppose that described first equipment 20 is the equipment of transmission source data, described second equipment 30 is target device.And still suppose that described first equipment 20 meets CAN protocol type, corresponding device numbering is 1.1; Described second equipment 30 meets UART protocol type, and corresponding device numbering is 1.2; The set of the device numbering preserved in described setting unit 11 is (1.1,1.2).
Described first equipment 20 is to the source data processing unit 12 transmission source data of described controller 10, described source data processing unit 12 receives described source data, and the data message obtained from the data fields of CAN form message according to the CAN protocol type of described first equipment 20 correspondence in described source data, from the arbitration field of CAN form message, obtain the device numbering 1.2 of the second equipment 30.
Described first transmitting element 13 judges whether the device numbering 1.2 of the second equipment 30 that described source data processing unit 12 obtains is contained in the set of the device numbering preserved in described setting unit 11.Because the set of the device numbering preserved in described setting unit 11 is (1.1,1.2), the set of described device numbering comprises the device numbering 1.2 of described second equipment 30, and therefore described first transmitting element 13 sends data message extremely described second equipment 30 in the source data of described first equipment 20 transmission according to the UART protocol type of the second equipment 30 correspondence.
Particularly, described protocol type can comprise messaging parameter, and described messaging parameter is relevant to the transfer rate of target device.Described first transmitting element 13 be suitable for according to the messaging parameter (if transfer rate is 115200bps) in the UART protocol type of described second equipment 30 correspondence by as described in data message in source data to be sent to according to the form of serial data as described in the second equipment 30.
In above instantiation, described controller 10 does not need the CAN form message sent by the first equipment 20 to convert UART form message needed for described second equipment 30 to, but from CAN form literary composition, obtains uncorrected data information by described controller 10 and namely second equipment 30 that described uncorrected data information is sent to complete the first equipment 20 sends process from data to described second equipment 30.
It should be noted that, described controller 10 can also be connected with the equipment of other types, in other words, the connecting interface of the equipment of described controller 10 and other types can also be: I2C interface, SPI interface, 1-wire interface, USB interface, LIN interface, I2S interface, Interbus interface or EtherNet interface etc., the present invention does not limit this.
In addition, described controller 10 both can be the connecting interface solidified with the connecting interface of equipment (as the first equipment 20 or the second equipment 30), also can by FPGA(Field Programmable Gate Array, field programmable gate array) design according to demand and load corresponding module interface, thus realize the modular design of the connecting interface of described controller and equipment.
In the present embodiment, described controller can arrange the type of each equipment connected according to demand more flexibly, thus realizes the interconnected of polytype equipment and communication.And, communication between the controller of the present embodiment and each equipment does not need to be arranged to unified transfer rate again, the data layout format conversion of source data become needed for target device is not needed yet, but from source data, obtain corresponding uncorrected data according to the protocol type of equipment itself, the described uncorrected data got is sent to target device, thus reduces the cost of equipment access bus.
Embodiment two
Fig. 2 shows the structural representation of the embodiment two of bus system of the present invention.With reference to figure 2, described bus system comprises: bus 40, first control device and second control device, described first control device and described second control device are distributed in described bus 40, and namely described first control device and described second control device are all connected described bus 40.Wherein, described bus 40 can be LVDS optical cable, differential bus or optical fiber, and the present invention does not limit this.
Particularly, described first control device comprises: the first controller 10 and the first equipment 20 and the second equipment 30 be connected with described first controller 10; Described second control device comprises: second controller 70 and the 3rd equipment 80 be connected with described second controller 70 and the 4th equipment 90.
With reference to figure 2, the setting unit of the setting unit 71 in the setting unit 11 in described first controller 10, source data processing unit 12, first transmitting element 13 and described second controller 70, source data processing unit 72, first transmitting element 73 and embodiment one middle controller, source data processing unit, the first transmitting element are similar, do not repeat them here.
Below only stress with regard to the difference part of the present embodiment and embodiment one, and because the structure of described first controller 10 and second controller 70 is similar, below be only described in detail with regard to the concrete structure of the first controller 10, corresponding units in described second controller 70 with reference to the corresponding unit in described first controller 10, below can repeat no more.
It should be noted that, the set of the device numbering preserved in described setting unit 11 is the device numbering of described first equipment 20 and described second equipment 30 be connected with described first controller 10; The set of the device numbering preserved in described setting unit 71 is the device numbering of described 3rd equipment 80 and described 4th equipment 90 be connected with described second controller 70.
With reference to figure 2, described first controller 10 also comprises data packetization unit 14.Described data packetization unit 14 connects described setting unit 11, source data processing unit 12 and bus 40, described data packetization unit 14 is suitable for, when the set of the device numbering of described setting unit 11 preservation does not comprise the device numbering of the target device that described source data processing unit 12 obtains, at least obtaining according to the device numbering of the data message in described source data and target device the packet being suitable for transmission in described bus 40.
For example, suppose that described first equipment 20 is the equipment of transmission source data, described 3rd equipment 80 is target device: so, described source data processing unit 12 obtains the device numbering (course of work of described source data processing unit 12 can description to source data processing unit in reference example one, do not repeat them here) of data message in described source data and target device.Set due to the device numbering preserved in described setting unit 11 does not comprise the device numbering of described 3rd equipment 80, therefore, described data packetization unit 14 at least obtains according to the device numbering of the data message in described source data and described 3rd equipment 80 packet being suitable for transmission in described bus 40.
The packet being suitable for transmission in bus 40 of described data packetization unit 14 acquisition can be the packet of short data frame transformat, as shown in Figure 3, the packet of described short data frame transformat comprises: the device numbering of data packet head mark, target device, temporal information, data message, check information and packet end mark.
Wherein, namely the device numbering of described target device and data-signal are acquired by described source data processing unit 12; The acquisition of described temporal information is described in detail in following meeting, does not first repeat at this.Other parts of the packet of form shown in Fig. 3, as data packet header will, check information and packet end mark by as described in data packetization unit 14 obtain, the present invention does not limit this.
In addition, the packet being suitable for transmission in bus 40 of described data packetization unit 14 acquisition can also be the packet of long data frame transformat, as shown in Figure 4, the packet of described long data frame transformat can comprise: the device numbering of data packet head mark, target device, temporal information, data length information, data message, check information and packet end mark.
In the packet of the long data frame transformat shown in Fig. 4, the device numbering of described target device and data message are all obtained by described source data processing unit 12; Described data packet head mark, checking information and packet end mark are obtained by described data packetization unit 14, and the acquisition of described temporal information and described data length information is described in detail in following content, first do not repeat at this.
Continue with reference to figure 2, described first controller 10 can also comprise: packet resolution unit 15 and the second transmitting element 16.Described packet resolution unit 15, is suitable for receiving packet from bus 40 and carrying out dissection process to obtain the device numbering of data message in described packet and target device.Second transmitting element 16, when the set of device numbering being suitable for preserving in described setting unit 11 comprises the device numbering of the target device in described packet, the protocol type corresponding according to described target device sends data message in described packet to described target device.
For example, suppose that described 4th equipment 90 is the equipment of transmission source data, described second equipment 30 is target device: so, and the data packetization unit 74 in described second controller 70 processes the source data that described 4th equipment 90 sends and is packaged into the packet being suitable for transmission in described bus 40.
Packet resolution unit 15 in described first controller 10 receives described packet from bus 40 and carries out dissection process, thus the device numbering of the data message obtained in packet and the second equipment 30 as target device.
Device numbering due to described second equipment 30 is contained in the set of the device numbering preserved in described setting unit 11, therefore, described second transmitting element 16 sends data message extremely described second equipment 30 in described packet according to the protocol type of described second equipment 30 correspondence.This completes described 4th equipment 90 sends process from data to described second equipment 30.
In the present embodiment, in described bus 40, the packet of transmission has identical protocol format, there is versatility, each equipment be connected with described first controller 10 and each equipment of being connected with described second controller 70 only need send to described controller 10 or second controller 70 access that data can realize other equipment in bus system according to each own protocol type, thus achieve the intercommunication mutually between polytype equipment.That is, which kind of form is the source data that the equipment be connected with each controller sends be, described source data packing all can be processed into the packet of consolidation form to transmit in bus by each controller.Free communication between the equipment so just achieving number of different types and interconnected.
In addition, in the bus system of the present embodiment, communication between the equipment that each controller is coupled can be carried out according to the protocol type of each equipment itself, and do not need to arrange according to unified messaging parameter as of the prior art, the mode of each equipment access controller is very flexible, improves the practicality of controller.
Embodiment three
Fig. 5 shows the structural representation of the embodiment three of bus system of the present invention.With reference to figure 5, the bus system of the present embodiment comprises: bus 40 and control device, and described control device comprises: controller 10 and the first equipment 20 and the second equipment 30 be connected with described controller 10.
Setting unit 11 in described controller 10, source data processing unit 12 and the first transmitting element 13 can be corresponding in reference example one and embodiment two the explanation of unit, do not repeat them here.
In the present embodiment, described controller 10 also comprises processing data packets unit 17.Described processing data packets unit 17 connects described setting unit 11, described source data processing unit 12 and described data packetization unit 14.Particularly, described processing data packets unit 17, the set of device numbering being suitable for preserving in described setting unit 11 do not comprise the device numbering of target device that described source data processing unit 12 obtains and the length of the data message in described source data is greater than data length threshold value time, process data message in described source data to obtain multiple subdata information, and the device numbering of described multiple subdata information and target device is sent to described data packetization unit 14.
Described data packetization unit 14 is suitable at least obtaining according to the device numbering of described subdata information and described target device the multiple packets being suitable for transmitting in described bus 40, and each packet includes the device numbering of a sub-data message and described target device.
In the present embodiment, described data length threshold value is relevant to the data throughout of bus 40, if the data throughout of described bus 40 is larger, described data length threshold value is larger, otherwise the data throughout of described bus 40 is less, and described data length threshold value is less.Described data throughout refers to when not having LOF, and equipment can accept and the maximum data rate forwarded, and unit is bps or byte per second.
Cite a plain example, suppose that described data length threshold value is 2Mbit, that is, when the length of the data message in source data is greater than 2Mbit, and when the target device for receiving source data connects same controller with the equipment sending described source data is not corresponding, processing data information in the source data received is become multiple subdata information by described processing data packets unit 17, and wherein the length of each subdata information is all less than described data length threshold value and is namely less than 2Mbit.The device numbering of each subdata information and target device is packaged into a packet and is sent to bus 40 by described data packetization unit 14.
It should be noted that, described processing data packets unit 17 can obtain the length information of data message in described source data, and the length information that described data packetization unit 14 obtains according to described processing data packets unit 17 forms the data length information shown in Fig. 4.
In the present embodiment, when there is mass data and needing by bus transfer, described controller can according to the length of the adaptive control data transmission of bus data handling capacity to improve the transfer rate of data.
Embodiment four
Fig. 6 shows the structural representation of the embodiment four of bus system of the present invention.With reference to figure 6, in the present embodiment, described bus system comprises: the first control device be made up of the first controller 10, first equipment 20 and the second equipment 30, bus 40, synchronisation source 50 and the second control device be made up of second controller 70, the 3rd equipment 80 and the 4th equipment 90.
Described first controller 10 comprises: setting unit 11, source data processing unit 12, first transmitting element 13, data packetization unit 14, packet resolution unit 15, second transmitting element 16, time synchronized unit 18 and temporal information obtain unit 19.Described second controller 70 comprises: setting unit 71, source data processing unit 72, first transmitting element 73, data packetization unit 74, packet resolution unit 75, second transmitting element 76, time synchronized unit 78 and temporal information obtain unit 79.
Wherein, described first controller 10 is identical with the structure of described second controller 70, and concrete structure and the principle of work of the setting unit 11 in described first controller 10 and the setting unit 71 in second controller 70 all with reference to the corresponding units in previous embodiment, can not repeat them here.Be described in further details the bus system of the present embodiment by reference to the accompanying drawings more below, in described second controller 70, the specific works principle of unit with reference to the following explanation to described first controller 10, can repeat no more this.
With reference to figure 6, described synchronisation source 50 is suitable for carrying out timing according to certain clock frequency, such as in the present embodiment, can set the timing in units of 10ns of described synchronisation source 50, and the clocking information of described synchronisation source 50 is as information lock in time of described bus system.
Described time synchronizing unit 18 connects described synchronisation source 50, is suitable for the time synchronized adjusting described first controller 10 and synchronisation source 50, and the time after synchronous is sent to each equipment be connected with described first controller 10.
Described temporal information obtains unit 19 and connects described time synchronizing unit 18 and source data processing unit 12.Described temporal information obtains unit 19 and is suitable for the time acquisition temporal information corresponding according to equipment transmission source data.
Described source data processing unit 12 is suitable for the source data that receiving equipment sends, according to the device numbering sending protocol type corresponding to the equipment of described source data and determine data message in described source data and target device, and described source data processing unit 12 is also suitable for receiving described temporal information obtains the temporal information that unit 19 obtains.
When the set of device numbering that described first transmitting element 13 is suitable for preserving in described setting unit 11 comprises the device numbering of the target device in described source data, the protocol type corresponding according to described target device sends the data message extremely described target device in described source data, in addition, the temporal information that described first transmitting element 13 is also suitable for described source data processing unit 12 sends is sent to described target device.
For example, suppose that the first equipment 20 is the equipment of transmission source data, described second equipment 30 is target device.So, when described first equipment 20 is to described source data processing unit 12 transmission source data, the time that described temporal information obtains unit 19 corresponding according to described first equipment 20 transmission source data obtains temporal information, for additional symbols, temporal information corresponding for described first equipment 20 transmission source data is designated very first time information.
Described source data processing unit 12 is suitable for the source data receiving described first equipment 20 transmission, determine the device numbering of data message and the second equipment 30 in described source data according to the protocol type of described first equipment 20 correspondence, and described source data processing unit 12 is also suitable for receiving the very first time information corresponding to described first equipment 20 transmission source data.
Described first transmitting element 13 is through judging to show that the set of the device numbering that described setting unit 11 is preserved comprises the device numbering of the second equipment 30 in described source data, therefore, described first transmitting element 13 sends the second equipment 30 described in described very first time information to equipment that data message in described source data and described source data processing unit 12 receive according to the protocol type of described second equipment 30 correspondence.
Described second equipment 30 can obtain the second temporal information when receiving described very first time information according to described time synchronizing unit 18, and determines the delay between this equipment and described first controller 10 according to the difference of described second temporal information and very first time information.Similarly, when other equipment are as target device, also can obtain temporal information when receiving corresponding data according to described time synchronizing unit 18 and to draw the delay of this equipment and described first controller 10 compared with the temporal information of transmission source data.
Unit 19 is obtained by described time synchronizing unit 18 and temporal information, each equipment be connected with described first controller 10 can obtain the temporal information of transmission source data accurately and receive the temporal information of corresponding data, thus response can be made more accurately, improve real-time and the reliability of bus system.
Continue with reference to figure 6, in the present embodiment, when the set that described data packetization unit 14 is suitable for the device numbering preserved at described setting unit 11 does not comprise the device numbering of described target device, the data message in the temporal information sent according to described source data processing unit 12, source data and the device numbering of target device obtain the packet being suitable for transmission in described bus 40.
Combine with reference to figure 3, what the temporal information in the packet of described short data frame transformat referred to is exactly the very first time information that described temporal information obtains unit 19 acquisition again, i.e. the time of equipment transmission source data.Particularly, described temporal information obtains unit 19 using rear 16 bit time information corresponding during equipment transmission source data as the temporal information in described packet, and can be packaged into the packet of form shown in Fig. 3 together with the device numbering of the data message in source data, target device by rear 16 bit time information corresponding for equipment transmission source data by described data packetization unit 14.
Accordingly, the described packet resolution unit 15 in the present embodiment, is also suitable for obtaining packet from bus 40, and carries out dissection process to obtain the device numbering of temporal information, data message and target device in described packet to packet.Should be understood that, the packet that described packet resolution unit 15 obtains be by described first controller 10 beyond controller send.
Second transmitting element 16, when the set of device numbering being also suitable for preserving in described setting unit 11 comprises the device numbering of the target device in described packet, the protocol type corresponding according to described target device sends data message in described packet and temporal information to target device.
For example, suppose that the 4th equipment 90 be connected with second controller 70 is the equipment of transmission source data, described the second equipment 30 be connected with the first controller 10 is target device.
When the source data that described 4th equipment 90 sends is to described source data processing unit 72, described temporal information acquisition unit 79 obtains temporal information during described 4th equipment 90 transmission source data; Described source data processing unit 72 processes the device numbering of data message in rear acquisition source data and the second equipment 30 to the source data that described 4th equipment 90 sends; The device numbering of the data message in the temporal information that described data packetization unit 74 sends based on described source data processing unit 72, source data and the second equipment 30 carries out packing to obtain the packet being suitable for transmission in bus 40.
Described packet transfers to described first controller 10 via described bus 40; Packet resolution unit 15 in described first controller 10 obtains this packet and resolves the device numbering of temporal information, data message and the second equipment 30 obtained in described packet;
Set due to the device numbering preserved in described setting unit 11 comprises the device numbering of described second equipment 30, therefore, described second transmitting element 16 sends data message in described packet and temporal information to described second equipment 30 according to the protocol type of the second equipment 30 correspondence.Thus complete described 4th equipment 90 sends process from data to described second equipment 30.
Described second equipment 30 obtains the second temporal information of data message and the temporal information received to described packet according to described time synchronizing unit 18, and can be drawn the delay of described second equipment 30 by the temporal information in more described second temporal information and described packet.
In other embodiments, described bus system can also comprise: at least one control module, and each control module correspondence connects a controller, and described control module is suitable for the performance parameter of the controller that acquisition is connected with this control module and analyzes.
Can PCI-e(PCI-Express be passed through between described control module with described controller) interface or USB interface etc. be connected, and the present invention does not limit this.Described control module can obtain the parameter such as the duty of each interface of described controller, the transfer rate of each interface, and analyzes the parameter got.Described control module can adopt existing PC main frame to come Realization analysis and processing capacity, and can certainly adopt other processors to realize, the present invention does not limit this.
In addition, in other embodiments, can also preset the pre-set priority of each equipment in bus system, described controller is also suitable for the source data that the equipment high according to the pre-set priority priority processing pre-set priority of equipment sends.
For example, suppose a controller connection device 1 in bus system and equipment 2, and the pre-set priority of described equipment 1 is higher than the pre-set priority of described equipment 2.
So, when described equipment 1 and equipment 2 may occur following several situation to during described controller transmission source data simultaneously:
The total length of the source data that described equipment 1 and described equipment 2 send is less than or equal to the handling capacity of bus, and so, the source data that described equipment 1 and equipment 2 send is by packaged respectively and sent by bus simultaneously.
The length of the source data of described equipment 1 and the single transmission of described equipment 2 is all less than the handling capacity of bus, but total length is greater than the handling capacity of bus, so, the preferential source data by equipment 1 higher for pre-set priority is carried out packing process by described controller, after the source data of described equipment 1 transmission is disposed, the source data that the equipment 2 that reprocessing pre-set priority is lower sends.
Certainly, in described bus system, the pre-set priority of each equipment is not changeless, in actual applications, can adjust according to actual conditions.
In addition, it should be noted that, the controller in bus system of the present invention can also be divided into master controller and from controller, in described bus system, the device numbering of each equipment is distributed by described master controller; Certainly, the device numbering of each equipment in described bus system can also fixedly be designed in advance.
Although the present invention discloses as above, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.