Example one
Fig. 1 shows a flowchart of an implementation of a data transmission method according to an embodiment of the present invention, which is detailed as follows:
s10: raw data is received.
The raw data accessed includes one of three data types, 10G LAN, 10G WAN or 10G POS. The three interfaces correspond to three data types, and corresponding data types are accessed when different interfaces are accessed. When the interface connected with the FPGA physical interface on the hardware single board is a 10G LAN interface, the accessed original data is the 10G LAN, namely the data received by the FPGA physical interface is the 10G LAN; when the interface connected with the FPGA physical interface on the hardware single board is a 10G WAN interface, the accessed original data is 10G WAN, and the received data is 10G WAN; when the interface connected with the FPGA physical interface on the hardware single board is a 10G POS interface, the accessed original data is a 10G POS, and the received data is the 10G POS.
The 10G LAN is a 10G Ethernet local area network, the data rate is 10.3125Gbps, and the clock frequency is 10.3125 GHZ; 10G WAN, 10G Ethernet wide area network, data rate 9.953Gbps, clock frequency 9.953 GHZ; the POS system is 10G POS, wherein the POS system is called PPP over SONET/SDH (SONET is called Synchronous Optical Network) and is composed of a whole set of hierarchical standard Digital transmission structure and suitable for transmission on various adaptive net load physical media, and the SDH is called Synchronous Digital Hierarchy and is a comprehensive information transmission Network which integrates the functions of multiplexing, line transmission and switching and is operated by a unified Network management system). The 10G POS interface is IP encapsulated to SDHSTM-64 through PPP: is a standard SDH with a data rate of 9.953Gbps and a clock frequency of 9.953 GHZ.
S20: determining a data type of the raw data, the data type comprising 10G LAN, 10G WAN or 10 GPOS.
The received original data is one of three data types, namely 10G LAN, 10G WAN or 10G POS, and is accessed to a corresponding interface, namely one original data is received. Firstly, distinguishing whether an interface is a 10G LAN or other interfaces by analyzing the rate of received original data, and when the interface rate is detected to be 10.3125G, determining that the interface is a 10GE LAN interface, namely the type of the accessed original data is 10GE LAN; when the interface rate is detected to be 9.953G, judging whether the original data type is 10G WAN or 10G POS by analyzing C2 overhead in SDH, and the steps are as follows:
when the value of C2 is 1A in 16-system, the interface is a 10G WAN interface, namely the data type is 10G WAN;
when the value of C2 is 16 or CF with 16 system, the interface is 10G POS interface, i.e. the data type is 10 GPOS.
S30: and selecting a corresponding configuration file according to the data type.
Three data types, namely 10G LAN, 10G WAN or 10G POS, are provided, and one data type corresponds to one configuration file. And after the data type of the received original data is determined, selecting a corresponding configuration file. If the received original data is determined to be 10GLAN, selecting a 10G LAN configuration file; if the received original data is determined to be 10G WAN, selecting a 10G WAN configuration file; if the received original data is determined to be 10G POS, a 10G POS configuration file is selected.
S40: and generating a corresponding data transmission channel and a clock frequency based on the configuration file.
Generating a corresponding data transmission channel according to the configuration file; and simultaneously, generating the clock frequency according to the clock frequency which is configured in the configuration file according to the data type. For example, a data transmission channel and clock frequency of 10G LAN 10.3125GHZ is generated from the 10G LAN profile.
S50: and performing data transmission processing based on the corresponding data transmission channel and clock frequency to output target data, wherein the clock frequency is the clock frequency corresponding to the data type of the received original data.
And performing data transmission processing based on the corresponding data transmission channel and the clock frequency to output target data, wherein the clock frequency of the target data is the clock frequency corresponding to the type of the received data. For example, data 10G LAN is transmitted based on a data transmission channel of 10G LAN and a clock frequency of 10.3125GHZ, and the clock frequency of 10.3125GHZ is a clock frequency corresponding to a type of received data, i.e., 10G LAN.
In the data transmission method provided by this embodiment, original data is received; determining a data type of the raw data, wherein the data type comprises a 10G LAN, a 10G WAN or a 10G POS; selecting a corresponding configuration file according to the data type; generating a corresponding data transmission channel and a clock frequency based on the configuration file; and performing data transmission processing based on the corresponding data transmission channel and clock frequency to output target data, wherein the clock frequency is the clock frequency corresponding to the data type of the received original data. The method can realize the access of the data in three formats of the 10G interface network on the same physical interface, thereby effectively solving the problems that equipment with three different types of physical interfaces is required to be configured to receive the data, the utilization rate of the equipment is reduced and the cost of the equipment is increased because the physical interfaces are incompatible.
Fig. 2 shows a flowchart of implementing step S40 in the data transmission method shown in fig. 1, which is detailed as follows:
s401: and generating a corresponding data transmission channel according to the configuration file.
If the configuration file is a 10G LAN configuration file, a 10G LAN data transmission channel is generated; if the configuration file is a 10G WAN configuration file, a 10G WAN data transmission channel is generated; and if the configuration file is a 10G POS configuration file, generating a 10G POS data transmission channel.
S402: and carrying out frequency multiplication on the initial clock frequency according to the configured clock frequency in the configuration file, and determining the clock frequency.
And receiving an initial clock frequency input by the programmable clock module, wherein the initial clock frequency comprises two frequency points of 156.25MHz and 155.52 MHz. When the initial clock frequency input by the receiving programmable clock module is 156.25MHz, namely the data type of the original data is 10G LAN, frequency multiplication is carried out on the initial clock frequency of 156.25MHz to obtain 10.3125GHZ, namely the clock frequency is determined to be 10.3125 GHZ; when the initial clock frequency input by the receiving programmable clock module is 155.52MHZ and the data type of the original data is 10G WAN, carrying out frequency multiplication on the initial clock frequency of 155.52MHZ to obtain 9.953GHZ, namely determining that the programmable clock frequency is 9.953 GHZ; when the initial clock frequency input by the receiving programmable clock module is 155.52MHz and the data type of the original data is 10G POS, the initial clock frequency of 155.52MHz is multiplied to obtain 9.953GHZ, namely, the clock frequency is determined to be 9.953 GHZ.
Fig. 3 shows an implementation flowchart of step S30 in the data transmission method shown in fig. 1, fig. 4 shows a first functional block diagram of an FPGA in the data transmission method provided by the embodiment of the present invention, fig. 5 shows a second functional block diagram of the FPGA in the data transmission method provided by the embodiment of the present invention, fig. 6 shows a third functional block diagram of the FPGA in the data transmission method provided by the embodiment of the present invention, and with reference to fig. 4, fig. 5, and fig. 6, the implementation flowchart of step S30 is detailed as follows:
s301: and if the data type is 10G LAN, selecting a 10G LAN configuration file, wherein a data transmission channel generated by the configuration file comprises a physical coding sublayer and a media intervention control layer.
And if the data type is 10G LAN, selecting a corresponding 10G LAN configuration file. Referring to fig. 4, a 10G LAN data transmission channel generated by a 10G LAN profile includes a physical coding sublayer for performing physical coding and a media access control layer for constructing the physical layer bitstream framing, error checking and providing an access method.
S302: and if the data type is 10G WAN, selecting a 10G WAN configuration file, wherein a data transmission channel generated by the configuration file comprises an SDH de-framer, a WAN interface sublayer, a physical coding sublayer, a media intervention control layer and an SDH framer.
And if the data type is 10G WAN, selecting a corresponding 10G WAN configuration file. Referring to fig. 5, the 10G WAN data transmission path generated by the 10G WAN profile includes a sync header for finding SDH frames while removing various overheads and passing data streams, a SDH deframer for generating ethernet data streams adapted to a specific transmission format, a physical coding sublayer for performing physical coding, a media intervention control layer for constructing the physical layer bit stream framing, error checking and providing access methods, and a SDH framer for adding various transmission overheads of SDH to the outside of a virtual container.
S303: if the data type is 10G POS, selecting a 10G POS configuration file, wherein a data transmission channel generated by the configuration file comprises an SDH deframer, a POS demapper, a high-level data link control module, a protocol conversion module, a media intervention control layer, a POS mapper and an SDH framer.
And if the data type is 10G POS, selecting a corresponding 10G POS configuration file. Referring to fig. 6, the 10G POS data transmission channel generated by the 10G POS configuration file includes an SDH deframer for finding a synchronization header of an SDH frame while removing various overheads and transferring a data stream, a POS demapper for extracting a payload from a virtual container in SDH and outputting the payload to a high level data link control module, a high level data link control module for implementing a bit oriented data link control protocol function, a protocol conversion module for converting a PPP packet into an ethernet packet so that the data stream passed through the module becomes an ethernet frame, a media intervention control layer for constructing said physical layer bit stream framing, error checking and providing access methods, a data stream for outputting said high level data link control module, a POS mapper for loading into a virtual container in SDH and a SDH framer for adding various transport overheads of SDH outside the virtual container.
Preferably, selecting the corresponding configuration file according to the data type further includes:
judging whether the data type is a default type;
if yes, based on the default model;
and if not, manually configuring a configuration file corresponding to the data type, and generating the data transmission channel and the clock frequency based on the configuration file.
The default data type is set as the data type of the FPGA physical interface that has been accessed last time on the hardware board, for example, the data type that has been accessed last time is 10G LAN.
With reference to figure 7 of the drawings,
the signal definition on the FPGA side is taken as an example for explanation:
SCL is known as Serial Clock Line, i.e., I2C Serial Clock Line;
SDA is known as Serial Data Line, i.e., I2C Serial Data Line;
I2C is all called Inter-Integrated Circuit.
The loading mode of the FPGA is set as a Slave Serial Configuration (Slave Serial Configuration), and the CPU uses GPIO to simulate a Configuration interface, namely 5 signals loaded to the FPGA are all simulated by the GPIO signals of the CPU.
After the CPU system is started, the CPU configures 10G LAN for the FPGA by default. The CPU configures the frequency of the programmable clock to be the frequency point 156.25MHz required by the 10G LAN through I2C, and the CPU loads the 10G LAN configuration file of the 10G LAN to the FPGA.
After the system is up, if the type of the accessed data is judged not to be 10G LAN but 10G POS, then: the CPU pulls down a signal of 'Program _ B' simulated by the GPIO; the CPU configures the frequency of the programmable clock to be the frequency point 155.52MHZ required by 10G POS through I2C; and the CPU loads a 10G POS configuration file of the 10G POS into the FPGA.
In order to achieve the effect that the required working mode can be automatically loaded after the system is powered on again or reset only by once configuration during application. Preferably, any one of the three 10G LAN, 10G WAN or 10G POS is set as default starting item according to actual needs.
The configuration files of the FPGA are a 10G LAN configuration file, a 10G WAN configuration file and a 10G POS configuration file. The 10G LAN profile includes 10G LAN data type required files, the 10G WAN profile includes 10G WAN data type required files, and the 10G POS profile includes 10G POS data type required files. The configuration file memory is used for storing a 10G LAN configuration file, a 10G WAN configuration file and a 10G POS configuration file of the FPGA.
Preferably, the data transmission method further includes: clock debounce the clock frequency.
The jitter of the clock recovered from the line is very large, so that the requirement of a system cannot be met, the recovered clock needs to be subjected to jitter removal to achieve the purpose of reducing the jitter of the clock, and then the jitter-removed clock is transmitted to each relevant unit.
Corresponding to the data transmission method described in the above embodiment, fig. 8 shows a structural block diagram of the data transmission device provided in the embodiment of the present invention, which is detailed as follows:
referring to fig. 8, the apparatus includes:
a receiving module 80, configured to receive original data;
a determining module 81, configured to determine a data type of the original data, where the data type includes 10G LAN, 10GWAN, or 10G POS;
a selecting module 82, configured to select a corresponding configuration file according to the data type;
a generating module 83, configured to generate a corresponding data transmission channel and a clock frequency based on the configuration file;
and a processing module 84, configured to perform data transmission processing based on the corresponding data transmission channel and a clock frequency, so as to output target data, where the clock frequency is a clock frequency corresponding to the data type of the received original data.
Optionally, the generating module 83 includes:
a generating unit 830, configured to generate a corresponding data transmission channel according to the configuration file;
and a frequency doubling unit 831, configured to frequency-double the initial clock frequency according to the configured clock frequency in the configuration file, and determine the clock frequency.
Optionally, the selection module 82 includes:
a first selecting unit 821 for selecting a 10G LAN configuration file if the data type is a 10G LAN. The data transmission channel generated by the configuration file comprises a physical coding sublayer and a media intervention control layer;
a second selecting unit 822, configured to select a 10G WAN profile if the data type is a 10G WAN. The data transmission channel generated by the configuration file comprises an SDH de-framer, a WAN interface sublayer, a physical coding sublayer, a media intervention control layer and an SDH framer;
a third selecting unit 823, configured to select a 10G POS configuration file if the data type is a 10G POS. The data transmission channel generated by the configuration file comprises an SDH de-framer, a POS de-mapper, a high-level data link control module, a protocol conversion module, a media intervention control layer, a POS mapper and an SDH framer.
Optionally, the selecting module 82 further includes:
820 judging unit, configured to judge whether the data type is a default type;
if yes, based on the default model;
and if not, manually configuring a configuration file corresponding to the data type, and generating the data transmission channel and the clock frequency based on the configuration file.
Optionally, the apparatus further comprises;
a debounce module 85 configured to perform clock debounce on the clock frequency.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the described unit or division of units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be implemented in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.