Embodiment
In the present embodiment, Rapid IO agreement adopts the architecture of three layers of classification, and this structure is respectively as shown in Figure 2:logical layer 201,transport layer 202 andphysical layer 203.
Logical layer 201 has defined all accord of interface and the form of bag at top layer;Transport layer 202 is in the intermediate layer, and address space and data needed routing iinformation of transmission package between the end points device of definition Rapid IO agreement have been realized route, the transmission of Rapid IO packet;Physical layer 203 is positioned at the bottom of whole hierarchy, comprises the device level interface details.
The core of Rapid IO agreement is bag and control character, and bag is the basic communication unit between the end points device in the system, and control character is used for the transaction flow that interconnects between managing physical layer end points device, also is used to wrap affirmation, flow control and maintenance.
Below the bag commonly used in the Rapid IO agreement is introduced.
1, NWRITE bag: write request, data are mail to certain sector address of certain target endpoint device with the form of bag, do not need the target endpoint device from high-rise feedback response;
2, SWRITE bag: the stream write request, data are mail to certain sector address of certain target endpoint device with the form of bag, do not need the target endpoint device from high-rise feedback response, the data length in the bag must be the integral multiple of 64bit;
3, NRITE_R bag: the write request of band response, data are mail to certain sector address of certain target endpoint device with the form of bag, require the target endpoint device from high-rise feedback response;
4, DOORBELL bag: a kind of as message body, subsidiary any data can be used for triggering and interrupt.
Wherein, NWRITE bag and SWRITE bag do not need the target endpoint device to provide feedback response from high level, the high level that is the target endpoint device can't be known the situation that data arrive, if wanting notification target end points device data to send, finishes by the source endpoint device, then can be after entire packet be sent completely, send a DOORBELL bag to the target endpoint device, be used for the transmission of notification target end points device data and finish, and trigger of the processing of target endpoint device data.
Therefore RapidIO protocol specifies data bag once can transmit the data of 256 bytes at most, when the data length that needs transmission during greater than 256 bytes, data need be divided into a plurality of packets and be docile and obedient preface and send to the target endpoint device.With above-mentioned NWRITE bag and SWRITE bag is example, these two kinds of bags do not need the target endpoint device to provide feedback response from high level, the high level that is the target endpoint device can't be known the situation that data arrive, if wanting notification target end points device data to send, finishes by the source endpoint device, then need be after entire packet be sent completely, send a DOORBELL bag to the target endpoint device, be used for the transmission of notification target end points device data and finish, and trigger of the processing of target endpoint device data.
Consider the disposal ability of target endpoint device to data, under the big data quantity situation, need cooperate the source endpoint device to finish data processing jointly by a plurality of target endpoint devices, the data that are the source endpoint device need to send to a plurality of target endpoint devices simultaneously, handle by a plurality of target endpoint device parallels, to improve data-handling efficiency.
Source endpoint device and target endpoint device carry out transfer of data by interchanger (Rapid IO SWITCH), and packet and control character all have the IP address of source endpoint device and the IP address of target endpoint device, carry out route by interchanger.Interchanger has a plurality of different passages, is respectively applied for the different information of transmission.Because packet is different with the transmission means of DOORBELL bag, so take the different transmission channel of interchanger, for example packet transmits by data channel, and the DOORBELL bag transmits by control channel.
Under the big situation of transmitted data amount, the transfer of data back-pressure can appear in the target endpoint device, promptly need the overabundance of data that receives, data transfer delay appears on data channel, and this moment, need data quantity transmitted will reduce a lot relatively on the control channel, at this moment, data just might occur does not finish receiving as yet, but receive the situation of DOORBELL bag, the target endpoint device is after receiving the DOORBELL bag, the memory address of the data of can be immediately carrying according to the DOORBELL bag obtains data and handles, but in fact data all do not arrive as yet, and what store on specified memory address might be old data, mistake will occur when the target endpoint device carries out data processing.
Arrive fully in order to solve the pending data of knowing that target devices can't be correct, the problem that causes data processing to make a mistake, the embodiment of the invention provide a kind of data transmission method for uplink and a kind of data receive method.
The process of a kind of data transmission method for uplink transmission data that the use embodiment of the invention provides comprises as shown in Figure 3:
Step 301, send data by data channel, described data comprise more than one packet;
Step 302, after entire packet is sent completely, send the packet of indicating data transmission completeness by identical data channel.
The process of the data receive method reception data that the use embodiment of the invention provides comprises as shown in Figure 4:
Step 401, receive data by data channel, described data comprise at least one packet;
Step 402, receive the packet of indicating data transmission completeness, confirm that Data Receiving finishes by identical data channel.
A kind of data transmission method for uplink and data receive method that embodiments of the invention provide, at first send data, described data comprise at least one packet, after entire packet is sent completely, send the packet of indicating data transmission completeness again by identical data channel, determined the transmission sequence of the packet of packet and indicating data transmission completeness, guaranteed that the target endpoint device just receives the packet of indicating data transmission completeness after data all arrive, solve the problem that the data processing that exists in the prior art makes a mistake, improved reliability of data transmission under the Rapid IO standard.
Below in conjunction with accompanying drawing 5, another embodiment of the present invention is introduced.
Arrive fully in order to solve the pending data of knowing that target devices can't be correct, and then the problem that causes data processing to make a mistake, the embodiment of the invention provides a kind of data transmission method for uplink and a kind of data receive method.
The process of the data method of sending and receiving transmission data that the use embodiment of the invention provides comprises as shown in Figure 5:
Step 501, source endpoint device are divided into more than one packet with data;
In this step, owing to need the data length of transmission long, the packet of a Rapid IO can not transmit whole data, is divided into a plurality of packets so will be used for the data of a data processing.
Step 502, source endpoint device send described packet in order;
In this step, with the form of broadcasting described a plurality of packets are sent in order, the packet of transmission does not need the feedback of target endpoint device high level; Each packet all carries the memory address of target endpoint device, routes a data packet to corresponding target endpoint device by switching equipment, and writes in the internal memory of this target endpoint device.
Step 503, target endpoint device receive data;
In this step, the target endpoint device receives a plurality of packets of described composition data, because in the embodiment of the invention, the packet that sends is not need the high-rise feedback of target endpoint device, so target endpoint device and do not known to receive new data in fact, the target endpoint device just when receiving the indication of source endpoint device, is handled the data in the internal memory.
Carry target endpoint device memory address in the described packet, according to described memory address, the target endpoint device writes the data packet in the corresponding core position and goes.
Step 504, source endpoint device send the packet of indicating data transmission completeness;
In this step, the source endpoint device uses packet that is used for indicating data transmission completeness of identical data passage broadcast transmission after sending data with the forms of broadcasting, be sent completely with notification target end points device data, can begin data processing.
In the embodiment of the invention, be equipped with interrupt register on the target endpoint device, and be interrupt register distributing independent address, described interrupt register is an addressable register; The described packet that is used for indicating data transmission completeness is for triggering bag, and it is in the nature packet, and the destination address that triggers bag is the address of interrupt register, carries trigger message in this triggering bag; Interrupt register receives and triggers bag, extracts trigger message wherein; , operate accordingly according to trigger message, trigger the target endpoint device and carry out data processing.
Because triggering bag transmits in identical data channel with packet, and the source endpoint device just sends after sending packet and triggers bag, trigger bag so the target endpoint device also will just receive after receiving entire packet, guaranteed that data arrive the order of target endpoint device.
Step 505, target endpoint device receive the packet of described indicating data transmission completeness;
In this step, the target endpoint device receives the triggering bag by identical data channel afterstep 503 receives entire packet by data channel.
The address of the interrupt register that interchanger carries according to described triggering bag should be triggered bag and being routed to interrupt register.
The embodiment of the invention adopts addressable register as interrupt register, value according to addressable register determines whether the trigger data handling process, the bit position that described addressable register can be set is a trigger bit, and it is trigger bit that a plurality of bit position also can be set; When bit position of equipment is trigger bit, can stipulate trigger data handling process when the value of this trigger bit is 0, also can stipulate trigger data handling process when the value of this trigger bit is 1.
It is example that the embodiment of the invention has the trigger bit of a bit position with described interrupt register, when the triggering place value of described interrupt register is 1, triggers the processing of processor to data.
In the embodiment of the invention, carry trigger message in the triggering bag that interruption location register receives, the value that described trigger message is specially the trigger bit of the described interrupt module of indication is set to 1.
Step 506, target endpoint device deal with data;
In this step, the value of described interrupt register trigger bit is set to 1, and interrupt register triggers the flow chart of data processing of target endpoint device processor.
The total data that described triggering bag carries one group of data that described source endpoint device sends wraps in the memory address in the described target endpoint device internal memory, and processor wraps in the corresponding internal memory according to triggering and obtains data, and data are handled.
A kind of data transmission method for uplink and data receive method that embodiments of the invention provide, at first send data, described data comprise at least one packet, after entire packet is sent completely, send the packet of indicating data transmission completeness again by same data channel, determined the transmission sequence of the packet of packet and indicating data transmission completeness, guaranteed that the target endpoint device just receives the packet of indicating data transmission completeness after data all arrive, solve the problem of the loss of data that exists in the prior art, improved reliability of data transmission under the Rapid IO standard.
Below in conjunction with accompanying drawing, another embodiment of the present invention is introduced.
Arrive the problem of the loss of data that causes fully in order to solve the pending data of knowing that target devices can't be correct, the embodiment of the invention provides a kind of data transmission method for uplink and a kind of data receive method.
The process of using described data method of sending and receiving transmission data comprises as shown in Figure 6:
Step 601, source endpoint device are divided into more than one packet with data;
In this step, owing to need the data length of transmission long, the packet of a Rapid IO can not transmit whole data, is divided into a plurality of packets so will be used for one group of data of a data processing.
In the embodiment of the invention, described one group of data comprise two or more data types, and for example up frequency domain data and up time domain data are divided into packet respectively with these data types, be all corresponding at least one the packet of data of each data type, transmit these packets again.
Step 602, source endpoint device send described packet in order;
In this step, with broadcast mode described a plurality of packets are sent in order, the packet of transmission does not need the feedback of target endpoint device high level; Each packet all carries the memory address of target endpoint device, routes a data packet to corresponding target endpoint device by switch, and writes in the internal memory of this target endpoint device.
Step 603, target endpoint device receive data;
In this step, the target endpoint device receives a plurality of packets of described composition data, because in the embodiment of the invention, the packet that sends is not need the high-rise feedback of target endpoint device, so target endpoint device and do not known to receive new data in fact, the target endpoint device just when receiving the indication of source endpoint device, is handled the data in the internal memory.
Carry target endpoint device memory address in the described packet, according to described memory address, the target endpoint device writes the data packet in the corresponding core position and goes.
Step 604, source endpoint device send the packet of indicating data transmission completeness;
In this step, the source endpoint device uses packet that is used for indicating data transmission completeness of identical data channel broadcast transmission after sending data with the forms of broadcasting, be sent completely with notification target end points device data, can begin data processing.
In the embodiment of the invention, the described packet that is used for indicating data transmission completeness is for triggering bag, and it is in the nature packet, triggers bag and carries trigger message, and destination address is the address of interrupt register; Interrupt register receives and triggers bag, extracts trigger message wherein, operates accordingly, triggers the target endpoint device and carries out data processing.
Because triggering bag transmits in same data channel with packet, and the source endpoint device just sends after sending packet and triggers bag, trigger bag so the target endpoint device also will just receive after receiving entire packet, guaranteed that data arrive the order of target endpoint device.
In the embodiment of the invention, the data that comprise numerous types of data in one group of data that the source endpoint device sends, so described triggering bag carries extra interruption info information, described interruption info information comprises the memory location of data in internal memory of data type information and each data type.For example, comprise up frequency domain data and up time domain data in one group of data of transmission, up frequency domain data is divided into more than one packet, and the address of each packet of up frequency domain data added to interrupt in the info information; Up time domain data also is divided into more than one packet, and the address of each packet of up time domain data added to interrupts in the info information.
Step 605, target endpoint device receive the packet of described indicating data transmission completeness;
In this step, the target endpoint device receives the triggering bag by identical data channel afterstep 503 receives entire packet by data channel.
The processor of the target endpoint device in the embodiment of the invention is connected with interrupt register, and interrupt register has independently address, and in this step, the address of the interrupt register that interchanger carries according to described triggering bag should be triggered bag and being routed to interrupt register.
The embodiment of the invention adopts addressable register as interrupt register, value according to addressable register determines whether the trigger data handling process, can be trigger bit with a bit position of described addressable register, can be trigger bit also with a plurality of bit position, it is example that the embodiment of the invention has the trigger bit of a bit position with described addressable register, when the triggering place value of described addressable register is 1, trigger the processing of processor to data.
In the embodiment of the invention, carry trigger message in the triggering bag that the interrupt register of target endpoint device receives, the triggering place value that described trigger message is specially described interrupt register is changed to 1.
Carry interruption info information owing to trigger bag, interrupt register dumps to described interruption info information in the internal memory after identifying described interruption info information, and the memory location can be to be specified by the source endpoint device, carries by triggering bag; Also can be by a position in the target endpoint device beforehand specified memory, be used for storing the info information of interrupting specially.
Step 606, target endpoint device deal with data;
In this step, the value of described addressable register trigger bit is set to 1, and interrupt register triggers the flow chart of data processing of target endpoint device processor.
Because described triggering bag carries the info information of interrupting, and be stored in the internal memory of target endpoint device, when the processor of target endpoint device begins deal with data, at first by reading the info information of interrupting in the internal memory, obtain data of different types according to the data type information in the described interruption info information, data of different types is handled respectively successively.For example, comprise up frequency domain data and up time domain data in one group of data of reception, from interrupt info information, extract the address of each packet of up frequency domain data, obtain up frequency domain data according to described address; From interrupt info information, extract the address of each packet of up time domain data, obtain up time domain data according to described address.
Need to prove, in the embodiment of the invention, data type information also can be carried by packet, whenstep 606 target endpoint device carries out data processing, just can obtain the data type of described packet in the time of read data packet, then data of different types be handled respectively.
The data method of sending and receiving that the embodiment of the invention provides when one group of data handling when needs comprise the data of numerous types of data, is divided at least one packet respectively with the data of different types of data, sends described entire packet by data channel; After entire packet is sent completely, sends the packet of indicating data transmission completeness by identical data channel, and in this packet, carry the data type information of several data; After receiving a plurality of packets that constitute one group of data by data channel, receive the packet of indicating data transmission completeness by identical data channel, and when carrying out data processing, at first extract data type information, according to described data type information data of different types is handled respectively then.Guaranteed to comprise under the situation of a plurality of packets that the target endpoint device ability specified data after receiving total data that receives data finishes receiving, and has solved the problem of loss of data, has improved data-handling efficiency one group of data.
Embodiments of the invention also provide a kind of data transmission device, and the structure of this data transmission device comprises as shown in Figure 7:
Packet sending module 701 is used for sending data by data channel, and described data comprise more than one packet;
Send and finish indicatingmodule 702, be used for after describedpacket sending module 701 is finished the whole subdatas of transmission, sending the packet of indicating data transmission completeness by identical data channel.
Further, said chip also comprises as shown in Figure 8:
Packet receiver module 703 is used for receiving the data that describedpacket sending module 701 sends by described data channel, and described data comprise at least one packet;
Interrupt module 704 is used for receiving the packet that described transmission finishes the indicating data transmission completeness of indicatingmodule 702 transmissions by identical data channel, and the trigger data handling process.When specific implementation, interrupt module can be a for example addressable register of interrupt register.
Above-mentioned data transmission device, can combine with a kind of data method of sending and receiving that embodiments of the invention provide, when sending data, the data volume that sends as required bypacket sending module 701, data are divided at least one packet, and a plurality of packets are sent in order by data channel; After described data are sent completely, finish the packet of indicatingmodule 702 by described transmission at identical data channel transmission indicating data transmission completeness, notification target end points device data sends and finishes, can carry out data processing.
When receiving data, at first receive data by data channel bypacket receiver module 703, described data comprise at least one packet; Afterwards, interrupt module 704 is by the packet of identical data channel reception indicating data transmission completeness, and the trigger data handling process.
The data transmission device that the embodiment of the invention provides, can combine with a kind of data method of sending and receiving that embodiments of the invention provide, after sending the data that constitute by a plurality of packets, send the packet of indicating data transmission completeness by identical data channel by data channel; After receiving a plurality of packets of composition data, receive the packet of indicating data transmission completeness by identical data channel by data channel.Guaranteed to comprise under the situation of a plurality of packets that the target endpoint device ability specified data after receiving total data that receives data finishes receiving, and has solved the problem of loss of data in data.
Embodiments of the invention also provide a kind of data transmission system, and the structure of this system comprises firstdata transmission device 901 and seconddata transmission device 902 as shown in Figure 9; Be equipped with a data channel and at least one other passages, for example control channel between described firstdata transmission device 901 and seconddata transmission device 902.
Described firstdata transmission device 901 is used for sending data by data channel to described seconddata transmission device 902, and described data comprise more than one packet; After entire packet is sent completely, send the packet of indicating data transmission completeness to described seconddata transmission device 902 by identical data channel;
Described seconddata transmission device 902 is used for by data channel, receives the data that described firstdata transmission device 901 sends, and described data comprise at least one packet; After receiving entire packet, receive the packet of the indicating data transmission completeness that described firstdata transmission device 901 sends by identical data channel, and data are handled.
Further, described seconddata transmission device 902 also is used for the information according to the packet of described indicating data transmission completeness, from the corresponding core position of described second data transmission device, obtain the data of different types of data, the data of each data type are handled respectively.
A kind of data transmission system that the embodiment of the invention provides, can combine with a kind of data transmission method that embodiments of the invention provide, after sending the data that constitute by a plurality of packets, send the packet of indicating data transmission completeness by identical data channel by data channel; After receiving a plurality of packets, receive the packet of indicating data transmission completeness by identical data channel by data channel.Guaranteed to comprise under the situation of a plurality of packets that the target endpoint device ability specified data after receiving total data that receives data finishes receiving, and has solved the problem of loss of data in data.
One of ordinary skill in the art will appreciate that and realize that all or part of step that the foregoing description method is carried is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, this program comprises one of step or its combination of method embodiment when carrying out.
In addition, each functional unit in each embodiment of the present invention can be integrated in the module, also can be that the independent physics in each unit exists, and also can be integrated in the module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, also can adopt the form of software function module to realize.If described integrated module realizes with the form of software function module and during as independently production marketing or use, also can be stored in the computer read/write memory medium.
The above-mentioned storage medium of mentioning can be a read-only memory, disk or CD etc.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the described protection range of claim.