[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113556289B - Data transmission method and device and field programmable gate array - Google Patents

Data transmission method and device and field programmable gate array Download PDF

Info

Publication number
CN113556289B
CN113556289B CN202110846854.1A CN202110846854A CN113556289B CN 113556289 B CN113556289 B CN 113556289B CN 202110846854 A CN202110846854 A CN 202110846854A CN 113556289 B CN113556289 B CN 113556289B
Authority
CN
China
Prior art keywords
frame
data frames
value
data
frame interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110846854.1A
Other languages
Chinese (zh)
Other versions
CN113556289A (en
Inventor
姚浩
周柯
习伟
王晓明
李肖博
林翔宇
陶伟
李文伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of Guangxi Power Grid Co Ltd
Southern Power Grid Digital Grid Research Institute Co Ltd
Original Assignee
Electric Power Research Institute of Guangxi Power Grid Co Ltd
Southern Power Grid Digital Grid Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Electric Power Research Institute of Guangxi Power Grid Co Ltd, Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Electric Power Research Institute of Guangxi Power Grid Co Ltd
Priority to CN202110846854.1A priority Critical patent/CN113556289B/en
Publication of CN113556289A publication Critical patent/CN113556289A/en
Application granted granted Critical
Publication of CN113556289B publication Critical patent/CN113556289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a data transmission method, a data transmission device and a field programmable gate array. The method comprises the steps of determining a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; determining a target number according to the decimal value of the frame interval value and the number of the data frames; and transmitting the data frames of the target number according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval. The data transmission method can avoid larger errors existing when the data frames are directly transmitted according to the integer value of the frame interval value, so that the bandwidth precision can be improved.

Description

Data transmission method and device and field programmable gate array
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data sending method, a data sending device, and a field programmable gate array.
Background
With the wide application of intelligent substations, the normal operation of the intelligent substations is very important. In order to ensure the normal operation of the intelligent substation, network test and simulation are required to be carried out on the intelligent substation. When network testing and simulation is performed on an intelligent substation, high-precision network traffic needs to be output, namely high-precision bandwidth is needed. In general, the purpose of adjusting the bandwidth accuracy can be achieved by adjusting the frame interval, and the frame interval value must be an integer when transmitting data of a given frame length.
In the conventional technology, the frame interval value determined by the set bandwidth and the given frame length may be a fraction, and a large error exists in the process of rounding the frame interval value, which may reduce the accuracy of the bandwidth.
Disclosure of Invention
Based on the foregoing, it is necessary to provide a data transmission method, a data transmission device and a field programmable gate array.
In a first aspect, an embodiment of the present application provides a data transmission method, including:
determining a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; the frame interval value is used for representing the interval between adjacent data frames;
determining a target number according to the decimal value of the frame interval value and the number of the data frames;
transmitting a target number of data frames according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit.
In one embodiment, determining the target number from the fractional value of the frame interval value and the number of data frames includes:
performing difference operation on the decimal values of the 1 and the frame interval value to obtain a difference value;
and multiplying the difference value and the number of the data frames to obtain a target number.
In one embodiment, transmitting a target number of data frames according to a first frame interval, and transmitting remaining data frames to be transmitted according to a second frame interval, includes:
transmitting the first N data frames in the data frames according to the first frame interval, wherein N is an integer greater than or equal to 1, and the value of N is equal to the target number;
and transmitting the last M data frames in the data frames according to the second frame interval, wherein M is an integer greater than or equal to 1, and the sum of N and M is less than or equal to the number of the data frames.
In one embodiment, transmitting a target number of data frames according to a first frame interval, and transmitting remaining data frames to be transmitted according to a second frame interval, includes:
when the data frame sending operation is executed, adding 1 to the value of the frame counter, and judging whether the value of the frame counter is smaller than or equal to the target number;
if the value of the frame counter is smaller than or equal to the target number, executing the sending operation of the next data frame according to the first frame interval;
and if the value of the frame counter is larger than the target number, executing the transmission operation of the next data frame according to the second frame interval until the value of the frame counter is equal to the number of the data frames, and resetting the value of the frame counter.
In one embodiment, after the frame counter is cleared, the data transmission method further includes:
acquiring the transmission time length of a transmitted data frame;
judging whether the transmission time length is equal to the preset data transmission time length or not;
if not, the sending operation of the data frame is executed.
In one embodiment, the data transmission method further includes:
and correcting the bandwidth of the transmission link according to the Beidou second pulse signal.
In one embodiment, determining the frame interval value and the number of data frames according to the bandwidth of the transmission link, the length of the data frames to be transmitted, and the bandwidth duty ratio of the data frames includes:
determining the number of data frames and a total interval value according to the bandwidth of a transmission link, the length of the data frames and the bandwidth duty ratio of the data frames;
the frame interval value is determined based on the number of data frames and the total interval value.
In one embodiment, determining the number of data frames and the total interval value according to the bandwidth of the transmission link, the length of the data frames and the bandwidth duty ratio of the data frames includes:
determining the effective bandwidth of the transmission link according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame;
determining the number of data frames according to the length and the effective bandwidth of the data frames;
the total interval value is determined based on the bandwidth of the transmission link and the number of data frames.
In a second aspect, an embodiment of the present application provides a data transmitting apparatus, including:
the frame interval value determining module is used for determining a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; the frame interval value is used for representing the interval between adjacent data frames;
a target number determining module, configured to determine a target number according to the fractional value of the frame interval value and the number of the data frames;
the sending module is used for sending the data frames of the target number according to the first frame interval and sending the rest data frames to be sent according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit.
In a third aspect, an embodiment of the present application provides a field programmable gate array for implementing the steps of the method as provided in the above embodiments.
The embodiment of the application provides a data transmission method, a data transmission device and a field programmable gate array, wherein the method determines a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; determining a target number according to the decimal value of the frame interval value and the number of the data frames; and transmitting the data frames of the target number according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval. According to the data transmission method provided by the embodiment of the application, when the frame interval value is decimal, the data frames with the target number are transmitted according to the first interval (the integer value of the frame interval value), and the rest data frames to be transmitted are transmitted according to the second interval (which is different from the first interval by one data metering unit), so that larger errors can be avoided when the data frames are directly transmitted according to the integer value of the frame interval value, and the accuracy of the bandwidth can be improved.
Drawings
In order to more clearly illustrate the technical solutions of embodiments or conventional techniques of the present application, the drawings that are required to be used in the description of the embodiments or conventional techniques will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for different persons skilled in the art.
Fig. 1 is a schematic flow chart of steps of a data transmission method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of steps of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of steps of a data transmission method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating steps of a data transmission method according to an embodiment of the present application;
fig. 5 is a flowchart illustrating steps of a data transmission method according to an embodiment of the present application;
fig. 6 is a flowchart illustrating steps of a data transmission method according to an embodiment of the present application;
fig. 7 is a flowchart illustrating steps of a data transmission method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a data transmitting apparatus according to an embodiment of the present application.
Detailed Description
In order to make the above objects, features and advantages of the present application more comprehensible, embodiments accompanied with figures are described in detail below. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other forms than those described herein and similar modifications can be made by those skilled in the art without departing from the spirit of the application, and therefore the application is not to be limited to the specific embodiments disclosed below.
With the development of society and the progress of information technology, intelligent transformer stations are increasingly widely used. In order to ensure the normal operation of the intelligent substation, network test and simulation are required to be carried out on the intelligent substation. When network testing and simulation is performed on an intelligent substation, high-precision network traffic needs to be output, namely high-precision bandwidth is needed. In general, the purpose of adjusting the bandwidth accuracy can be achieved by adjusting the frame interval, and the frame interval value must be an integer when transmitting data of a given frame length. In the conventional technology, the frame interval value determined by the set bandwidth and the given frame length may be a fraction, and a large error exists in the process of rounding the frame interval value, which may reduce the accuracy of the bandwidth. Aiming at the problems in the prior art, the application provides a data transmission method.
The following describes the technical solution of the present application and how the technical solution of the present application solves the technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present application provides a data transmission method, which is described by using a Field programmable gate array (Field-Programmable Gate Array, FPGA) as an execution body. The method comprises the following specific steps:
step 100, determining a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; the frame interval value is used to characterize the interval between adjacent data frames.
The bandwidth of the transmission link refers to a bandwidth set for transmitting the data frame to be transmitted, and the bandwidth ratio of the data frame to be transmitted refers to a ratio of the transmission frame to the total transmission link. The length of the data frame to be transmitted is set according to the communication network, and the structures of the data frames of different communication networks are different. For example: the structure of a frame of valid data defined by the Ethernet communication network is as follows: the preamble fcs+data frame length fame_len+minimum frame interval ipg_min, the preamble FCS is fixed to 8 bytes, and the minimum frame interval ipg_min is 12 bytes. The bandwidth of the transmission link, the length of the data frame to be transmitted, and the bandwidth ratio of the data frame may all be set by the user, which is not limited in this embodiment. The FPGA can determine the frame interval value and the number of the data frames according to the set bandwidth of the transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames. The frame interval value refers to the size of an interval between one data frame and its neighboring data frame among the data frames to be transmitted. The number of data frames refers to the number of data frames that can be transmitted in the bandwidth of the transmission link.
Step 110, determining the target number according to the decimal value of the frame interval value and the number of data frames.
After obtaining the frame interval value, the FPGA separates the obtained frame interval value into an integer part and a decimal part when the decimal exists in the frame interval value. The integer part is an integer value of the frame interval value, and the fractional part is a fractional value of the frame interval value. When the frame interval value is an integer, the fractional value of the frame interval value is zero. The FPGA can determine the target number according to the obtained decimal value of the frame interval value and the number of the data frames. The target number refers to the number of data frames that can be transmitted with an integer value of the frame interval value. The present embodiment does not impose any limitation on the specific algorithm for determining the target number as long as the function thereof can be realized.
Step 120, transmitting a target number of data frames according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit.
After the target number is determined, the FPGA sends the data frames of the target number according to the first frame interval, and sends the rest data frames to be sent according to the second interval. That is, the number of data frames transmitted according to the second interval is the difference between the number of data frames to be transmitted and the target number. The first frame interval is an integer value of a frame interval value, and the second frame interval is a value added to the first frame interval and one data metering unit. If the frame interval value is in bytes, one data measurement unit is one byte, that is, the second interval is a value obtained by adding the first interval to one byte. Assuming that the first frame interval is 23 bytes, the second interval is 24 bytes.
According to the data transmission method provided by the embodiment of the application, the frame interval value and the number of the data frames are determined according to the bandwidth of the transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; determining a target number according to the decimal value of the frame interval value and the number of the data frames; and transmitting the data frames of the target number according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval. According to the data transmission method provided by the embodiment of the application, when the frame interval value is decimal, the data frames with the target number are transmitted according to the first interval (the integer value of the frame interval value), and the rest data frames to be transmitted are transmitted according to the second interval (which is different from the first interval by one data metering unit), so that larger errors can be avoided when the data frames are directly transmitted according to the integer value of the frame interval value, and the accuracy of the bandwidth can be improved.
In one embodiment, the data transmission method further includes:
and correcting the bandwidth of the transmission link according to the Beidou second pulse signal.
The bandwidth of the transmission link may be the number of bits transmitted per second, and the FPGA corrects the unit second time in the bandwidth of the transmission link according to the beidou second pulse signal, so that the bandwidth of the transmission link may be corrected.
In an alternative embodiment, the bandwidth of the transmission link, the length of the data frame to be transmitted, and the frame interval value may all be expressed in bytes. The total number of bytes of the bandwidth of the transmission link refers to the total number of bytes that can be transmitted per second, and the determined number of data frames is also the total number of data frames that can be transmitted per second. The specific process of the FPGA for correcting the bandwidth of the transmission link according to the Beidou second pulse signal comprises the following steps: the FPGA obtains a plurality of internal clock statistical values according to the acquired Beidou second pulse signals; and calculating the average value of a plurality of internal clock statistical values, and determining the total byte number of the bandwidth of the transmission link according to the bandwidth of the transmission link and the average value. Can be expressed by the following formula:
TX_FULL_DW=(REAL_DW_BYTE_SEC*8bit)/T_sec
=(REAL_DW_BYTE_SEC*8bit)/(DB_SEC_CNT_AVG*8ns)
where tx_full_dw is the bandwidth of the transmission link, t_sec is the unit time (seconds), real_dw_byte_sec is the total number of BYTEs of the bandwidth of the transmission link (in units of time), db_sec_cnt_avg is the average of the multiple internal clock statistics. At a bandwidth of 1Gbps for the transmission link and a frequency of 125MHZ for the internal clock, the total number of bytes of the bandwidth of the transmission link is the same as the average of the statistics of the internal clocks. The FPGA can determine the number of bytes of the frame interval value according to the total number of bytes of the bandwidth of the transmission link, the number of bytes of the length of the data frame to be transmitted, and the bandwidth duty cycle of the data frame.
In this embodiment, the total number of bytes of the bandwidth of the transmission link is determined by the beidou second pulse signal, so that frequency deviation existing in the crystal oscillator in the FPGA can be avoided, and therefore the accuracy of the determined total number of bytes of the bandwidth of the transmission link is improved, and further the accuracy of the bandwidth is improved.
Referring to fig. 2, in one embodiment, the step of determining the target number from the fractional value of the frame interval value and the number of data frames includes:
and 200, performing difference operation on the decimal values of the 1 and the frame interval value to obtain a difference value.
After the decimal value of the frame interval value is obtained, the FPGA calculates the difference between 1 and the decimal value of the frame interval value. Expressed by the formula: 1-thy_ipg_val_dec, wherein thy_ipg_val_dec represents a frame interval value of a fractional value.
Step 210, performing multiplication processing on the difference value and the number of the data frames to obtain a target number.
After obtaining the difference, the FPGA performs a multiplication operation on the difference and the number of data frames, that is, calculates the product of the difference and the number of data frames, so as to obtain the target number. Expressed by the formula:
ipg_int_num_of=frame_num_sec (1-th_ipg_val_dec), where ipg_int_num_of is the target number and frame_num_sec is the number OF data FRAMEs to be transmitted.
In this embodiment, the algorithm for calculating the target number is low in complexity, so that the efficiency for calculating the target number can be improved, and the efficiency for transmitting the data frame can be improved.
Referring to fig. 3, in one embodiment, the step of transmitting a target number of data frames according to a first frame interval and transmitting the remaining data frames to be transmitted according to a second frame interval includes:
step 300, transmitting the first N data frames in the data frames according to the first frame interval, where N is an integer greater than or equal to 1, and the value of N is equal to the target number.
Step 310, transmitting the last M data frames in the data frames according to the second frame interval, wherein M is an integer greater than or equal to 1, and the sum of N and M is less than or equal to the number of data frames.
After determining the target number, the FPGA may determine the number N of data frames to be transmitted according to the first frame interval and the number M of data frames to be transmitted according to the second frame interval. When the sum of N and M is equal to the number of data frames, the FPGA transmits the first N (target number) data frames according to the first frame interval, and after transmitting the second M data frames according to the second interval, all the data frames to be transmitted are transmitted. When the sum of N and M is smaller than the number of data frames, the data frames between the first N data frames and the last M data frames in the data frames to be transmitted may be transmitted according to the first frame interval or may be transmitted according to the second frame interval, which is not limited in this embodiment, as long as the total frame interval in the transmission process is smaller than the frame interval value.
In this embodiment, in the process of transmitting the data frame, M data frames are transmitted according to the second frame interval, so that an error can be reduced and the accuracy of the bandwidth can be improved.
In an alternative embodiment, the counter may be used to determine N data frames when the first N data frames of the data frames are transmitted in the first frame interval; the first N data frames may be marked, and specifically, the last data frame of the first N data frames may be marked, so that the FPGA may determine that the number of data frames transmitted reaches N.
Referring to fig. 4, in one embodiment, transmitting a target number of data frames according to a first frame interval, and transmitting remaining data frames to be transmitted according to a second frame interval includes:
step 400, when the data frame transmission operation is performed, the value of the frame counter is increased by 1, and whether the value of the frame counter is smaller than or equal to the target number is determined.
The initial value of the frame counter is zero, the value of the frame counter is increased by 1 when the FPGA executes the transmission operation of the data frame, and the FPGA transmits one data frame when executing the transmission operation of the data frame. That is, the FPGA will increment the frame counter by 1 every time it sends a data frame. After the value of the frame counter is increased by 1, it is determined whether the value of the frame counter is less than or equal to the target number. The value of the frame counter may represent the number of transmitted data frames, so by comparing the value of the frame counter with the target number, it may be determined whether the number of transmitted data frames reaches the target number.
Step 410, if the value of the frame counter is less than or equal to the target number, the sending operation of the next data frame is performed according to the first frame interval.
If the value of the frame counter is smaller than or equal to the target number through judgment and determination by the FPGA, the number of the transmitted data frames does not reach the target number, and then the next data frame transmission operation is executed according to the first frame interval, namely the next data frame is transmitted according to the first frame interval.
And step 420, if the value of the frame counter is greater than the target number, performing the transmission operation of the next data frame according to the second frame interval until the value of the frame counter is equal to the number of the data frames, and resetting the value of the frame counter.
If the FPGA determines that the value of the frame counter is larger than the target number, the FPGA indicates that the number of the transmitted data frames reaches the target number, and then the next data frame transmission operation is executed according to the second frame interval, namely the next data frame is transmitted according to the second frame interval. If the FPGA determines that the value of the frame counter is equal to the number of the data frames through judgment, the fact that the data frames to be sent are sent is finished is indicated, the value of the frame counter is cleared, and therefore retransmission of the data frames is facilitated.
In this embodiment, by setting the frame counter, it is possible to facilitate in determining whether the number of transmitted data frames reaches the target number, so that when the number of transmitted data frames is less than or equal to the target number, the next data frame can be transmitted according to the first frame interval, and when the number of transmitted data frames is greater than the target number, the next data frame can be transmitted according to the second frame interval.
Referring to fig. 5, in one embodiment, after the frame counter is cleared, the method further includes:
step 500, obtaining the transmission time length of the sent data frame.
After the FPGA clears the value of the frame counter, the transmission time length of the transmitted data frame is acquired, namely, the time from the beginning of the transmission of the data frame to the completion of the transmission of the data frame. The present embodiment does not have any limitation on the transmission time period for acquiring the transmission data frame as long as the function thereof can be realized.
In an alternative embodiment, a timer may be set, which starts counting when the transmission of the data frame is started, and stops counting after the transmission of the data frame is completed. The FPGA can acquire the transmission time length of the sent data frame through the timer.
Step 510, determining whether the transmission duration is equal to the preset data transmission duration.
After the FPGA acquires the transmission time length, the transmission time length is compared with the preset data transmission time length, and whether the transmission time length is equal to the preset data transmission time length is judged. The preset data transmission duration may be preset by a user, which is not limited in this embodiment.
If not, step 520 is performed to perform the data frame transmission operation.
If the FPGA determines that the transmission time length is not equal to the preset data transmission time length, the sending operation of the data frame is executed, namely the data frame is continuously sent. And if the FPGA determines that the transmission duration is equal to the preset data transmission duration, stopping executing the sending operation of the data frame. When the FPGA determines that the transmission duration is not equal to the preset data transmission duration, the transmitted data frame may be the same as the data frame transmitted last time or may be different from the data frame transmitted last time when the data frame is continuously transmitted, which is not limited in this embodiment.
In a specific embodiment, if the bandwidth of the transmission link is expressed as bytes (total bytes transmitted per second), and the number of data frames is the number of data frames that can be transmitted per second, the transmission duration of transmitting the entire number of data frames is 1 second. If the preset data transmission duration is 5 seconds, after the FPGA transmits all the data frames for 5 times, the transmission duration is equal to the preset data transmission duration, and the transmission of the data frames is stopped.
Referring to fig. 6, in one embodiment, determining a frame interval value and a data amount of a data frame according to a bandwidth of a transmission link, a length of a data frame to be transmitted, and a bandwidth ratio of the data frame includes:
step 600, determining the number of data frames and the total interval value according to the bandwidth of the transmission link, the length of the data frames and the bandwidth ratio of the data frames.
Step 610, determining a frame interval value according to the number of data frames and the total interval value.
In one embodiment, the FPGA determines the number of data frames and the total interval value according to the bandwidth of the transmission link, the length of the data frames, and the bandwidth ratio of the data frames as shown in fig. 7, and includes:
step 700, determining the effective bandwidth of the transmission link according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame.
Step 710, determining the number of data frames according to the length of the data frames and the effective bandwidth.
Step 720, determining a total interval value according to the bandwidth of the transmission link and the number of data frames.
The FPGA performs multiplication operation on the bandwidth of the transmission link and the bandwidth duty ratio of the data frame, so that the effective bandwidth of the transmission link can be obtained. The number of data frames can be determined by dividing the effective bandwidth and the length of the data frames. And calculating the difference between the bandwidth ratio of the 1 and the data frame to obtain the bandwidth ratio of the total interval value, and performing multiplication operation on the bandwidth ratio of the total interval value and the bandwidth of the transmission link to obtain the total interval value. The FPGA may obtain a frame interval value by performing a division operation on the number of data frames and the total interval value, and specifically, dividing the total interval value by the number of data frames.
In an alternative embodiment, when the bandwidth of the transmission link is expressed in terms of total bytes, the bandwidth of the valid transmission data frame (the number of bytes of the valid transmission data frame per unit time (seconds)) can be expressed as: all_val_txbyte_sec=set_dw_dw_byte_sec, where set_dw__% is the bandwidth ratio of the data frame and all_val_txbyte_sec is the number of BYTEs of the data frame that are effectively transmitted per unit time (seconds). The total interval value (number of bytes) can be expressed as: all_ipg_sec= (1-set_dw_%). Real_dw_byte_sec, where all_ipg_sec represents the total interval value per unit time (seconds). The FRAME interval value (number of bytes) can be expressed as thy_ipg_val=all_ipg_sec/frame_num_sec, where thy_ipg_val represents the FRAME interval value.
It should be understood that, although the steps in the flowcharts in the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or other steps.
In a specific embodiment, it is assumed that the ethernet communication mode is used to send data, the ethernet bandwidth is 1gbps, the internal clock frequency of the fpga is 125MHZ, the frequency deviation is 30PPM, the actual frequency is 125,003,750.112503HZ, the period is 7.99976ns, the length of the data frame to be sent is 84 bytes (frame preamble (8 bytes) +frame length (64 bytes) +minimum frame interval (12 bytes)), and the bandwidth occupied by the data is 33%.
The actual total number of bytes per second in the conventional technology is: 125,003,750 = 1000,000,000/7.99976;
the total number of bytes effectively transmitted per second is: 41,251,238 =125, 003,750×33%;
number of transmitted data frames per second: 491,086 = 41,251,238/(8+64+12);
total interval value per second: 83,752,513 = 125,003,750 (1-33%);
frame interval value: 170.545510512 = 83,752,513/491,086;
the frame interval value is taken as an integer of 170;
therefore, the configuration of one frame of data is: frame preamble (8 bytes) +frame length (64 bytes) +minimum frame interval (12 bytes) +frame interval value (170 bytes) =254 bytes;
according to 254 bytes of one frame, the number of data frames in one second is 492,140 = 125,003,750/254;
the actual number of valid bytes in one second is: 41,339,760 = (8+64+12) × 492,140;
the actual bandwidth is: (41,339,760×8)/(125,000,000×8 ns) = 330.71808Mbps;
therefore, the bandwidth error with ethernet is: 330.71808-1000 x 33% = 0.71808Mbps;
the data transmission method provided by the application comprises the following steps:
the actual total number of bytes per second is: 125,003,750 = 1000,000,000/7.99976;
the total number of bytes effectively transmitted per second is: 41,251,238 =125, 003,750×33%;
the total number of frames transmitted per second is: 491,086 = 41,251,238/(8+64+12);
total interval value per second: 83,752,513 = 125,003,750 (1-33%);
frame interval value: 170.545510512 = 83,752,513/491,086;
the frame interval value integer part thy_ipg_val_int=170;
the frame interval value fraction thy_ipg_val_dec= 0.545510512;
target number: ipg_int_num_of= 491,086 (1-0.545510512) = 223,193;
therefore, in the first 223,193 frames of the data frames, the frame interval is 170, and when the transmission frame number is greater than 223,193 frames, the frame interval is 171.
The number of total bytes sent in each second is: 41,251,224 = (8+64+12) × 491,086;
the actual bandwidth is: (41,251,224 x 8)/(125,003,750 x 8 ns) = 329.999892Mbps;
therefore, the bandwidth error with ethernet is: 329.999892-1000 x 33% = 0.000108Mbps.
According to the above example, it can be clearly determined that the bandwidth accuracy of the data transmission method provided by the application is higher.
Referring to fig. 8, an embodiment of the present application provides a data transmission apparatus 10, which includes a frame interval determining module 11, a target number determining module 12, and a transmitting module 13. Wherein,,
the frame interval value determining module 11 is configured to determine a frame interval value and the number of data frames according to the bandwidth of the transmission link, the length of the data frames to be transmitted, and the bandwidth duty ratio of the data frames;
the target number determining module 12 is configured to determine a target number according to the fractional value of the frame interval value and the number of data frames;
the transmitting module 13 is configured to transmit a target number of data frames according to the first frame interval, and transmit the remaining data frames to be transmitted according to the second frame interval.
In one embodiment, the target number determination module 12 includes a first acquisition unit and a second acquisition unit. The first acquisition unit is used for carrying out difference operation processing on the decimal values of the 1 and the frame interval value to obtain a difference value; the second obtaining unit is used for performing multiplication operation processing on the difference value and the number of the data frames to obtain the target number.
In one embodiment, the transmission module 13 includes a first transmission unit and a second transmission unit. The first transmitting unit is configured to transmit first N data frames in the data frames according to the first frame interval, where N is an integer greater than or equal to 1, and a value of N is equal to the target number. The second sending unit is used for sending the last M data frames in the data frames according to the second frame interval, wherein M is an integer greater than or equal to 1, and the sum of N and M is less than or equal to the number of the data frames.
In one embodiment, the transmitting module 13 further includes a judging unit, a third transmitting unit, and a fourth transmitting unit. The judging unit is used for adding 1 to the value of the frame counter when the sending operation of the data frame is executed, and judging whether the value of the frame counter is smaller than or equal to the target number; the third sending unit is configured to perform a sending operation of a next data frame according to the first frame interval if the value of the frame counter is less than or equal to the target number; and the fourth sending unit is used for executing the sending operation of the next data frame according to the second frame interval if the value of the frame counter is larger than the target number until the value of the frame counter is equal to the number of the data frames, and resetting the value of the frame counter.
In one embodiment, the data transmission apparatus 10 further includes: the device comprises an acquisition module, a judgment module and an execution module. The acquisition module is used for acquiring the transmission time length of the sent data frame; the judging module is used for judging whether the transmission time length is equal to the preset data transmission time length or not; and the execution module is used for executing the sending operation of the data frame if not.
In one embodiment, the data transmission apparatus 10 further includes a correction module. The correction module is used for correcting the bandwidth of the transmission link according to the Beidou second pulse signal.
In one embodiment, the frame interval value determining module 11 includes a first determining unit and a second determining unit. The first determining unit is used for determining the number of the data frames and the total interval value according to the bandwidth of the transmission link, the length of the data frames and the bandwidth ratio of the data frames; the second determining unit is configured to determine the frame interval value according to the number of data frames and the total interval value.
In one embodiment, the first determination unit includes a first determination subunit, a second determination subunit, and a third determination subunit. The first determining subunit is configured to determine an effective bandwidth of the transmission link according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame; the second determining subunit is used for determining the number of the data frames according to the length of the data frames and the effective bandwidth; the third determining subunit is configured to determine a total interval value according to the bandwidth of the transmission link and the number of data frames.
The specific limitation regarding the data transmission apparatus 10 described above may be referred to as limitation of the data transmission method hereinabove, and will not be described herein. The respective modules in the data transmission apparatus 10 may be implemented in whole or in part by software, hardware, and combinations thereof. The devices, modules or units can be embedded in the FPGA in a hardware form or independent from the FPGA, and can also be stored in a memory in the FPGA in a software form, so that the FPGA can call and execute the operations corresponding to the devices or modules.
In one embodiment, a field programmable gate array is provided, an FPGA for implementing the steps of:
determining a frame interval value and the number of data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; the frame interval value is used for representing the interval between adjacent data frames;
determining a target number according to the decimal value of the frame interval value and the number of the data frames;
transmitting a target number of data frames according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit.
In one embodiment, the FPGA is further configured to implement the steps of: performing difference operation on the decimal values of the 1 and the frame interval value to obtain a difference value; and multiplying the difference value and the number of the data frames to obtain a target number.
In one embodiment, the FPGA is further configured to implement the steps of: and transmitting the first N data frames in the data frames according to the first frame interval, wherein N is an integer greater than or equal to 1, and the value of N is equal to the target number. And transmitting the last M data frames in the data frames according to the second frame interval, wherein M is an integer greater than or equal to 1, and the sum of N and M is less than or equal to the number of the data frames.
In one embodiment, the FPGA is further configured to implement the steps of: when the data frame sending operation is executed, adding 1 to the value of the frame counter, and judging whether the value of the frame counter is smaller than or equal to the target number; if the value of the frame counter is smaller than or equal to the target number, executing the sending operation of the next data frame according to the first frame interval; and if the value of the frame counter is larger than the target number, executing the transmission operation of the next data frame according to the second frame interval until the value of the frame counter is equal to the number of the data frames, and resetting the value of the frame counter.
In one embodiment, the FPGA is further configured to implement the steps of: acquiring the transmission time length of a transmitted data frame; judging whether the transmission time length is equal to the preset data transmission time length or not; if not, the sending operation of the data frame is executed.
In one embodiment, the FPGA is further configured to implement the steps of: and correcting the bandwidth of the transmission link according to the Beidou second pulse signal.
In one embodiment, the FPGA is further configured to implement the steps of: determining the number of data frames and a total interval value according to the bandwidth of a transmission link, the length of the data frames and the bandwidth duty ratio of the data frames; the frame interval value is determined based on the number of data frames and the total interval value.
In one embodiment, the FPGA is further configured to implement the steps of: determining the effective bandwidth of the transmission link according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame; determining the number of data frames according to the length and the effective bandwidth of the data frames; the total interval value is determined based on the bandwidth of the transmission link and the number of data frames.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A data transmission method, comprising:
determining a frame interval value and the number of the data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth duty ratio of the data frames; the frame interval value is used for representing the interval between adjacent data frames;
determining a target number according to the decimal value of the frame interval value and the number of the data frames;
transmitting the data frames of the target number according to the first frame interval, and transmitting the rest data frames to be transmitted according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit;
wherein determining a frame interval value and the number of the data frames according to the bandwidth of the transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames includes:
determining the effective bandwidth of the transmission link according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame;
determining the number of the data frames according to the length of the data frames and the effective bandwidth;
determining a total interval value according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame;
determining the frame interval value according to the number of the data frames and the total interval value;
wherein the determining the target number according to the fractional value of the frame interval and the number of the data frames includes:
performing difference operation on the decimal values of the frame interval value 1 and the frame interval value to obtain a difference value;
and multiplying the difference value and the number of the data frames to obtain the target number.
2. The data transmission method according to claim 1, wherein the transmitting the target number of data frames according to the first frame interval and transmitting the remaining data frames to be transmitted according to the second frame interval includes:
transmitting the first N data frames in the data frames according to the first frame interval, wherein N is an integer greater than or equal to 1, and the value of N is equal to the target number;
and transmitting the last M data frames in the data frames according to the second frame interval, wherein M is an integer greater than or equal to 1, and the sum of N and M is less than or equal to the number of the data frames.
3. The data transmission method according to claim 1, wherein the transmitting the target number of data frames according to the first frame interval and transmitting the remaining data frames to be transmitted according to the second frame interval includes:
when the data frame sending operation is executed, adding 1 to the value of a frame counter, and judging whether the value of the frame counter is smaller than or equal to the target number;
if the value of the frame counter is smaller than or equal to the target number, executing the transmission operation of the next data frame according to the first frame interval;
and if the value of the frame counter is larger than the target number, executing the sending operation of the next data frame according to the second frame interval until the value of the frame counter is equal to the number of the data frames, and resetting the value of the frame counter.
4. A data transmission method according to claim 3, wherein after said clearing the value of the frame counter, the method further comprises:
acquiring the transmission time length of the data frame;
judging whether the transmission time length is equal to a preset data transmission time length or not;
and if not, executing the sending operation of the data frame.
5. The data transmission method according to claim 1, characterized in that the method further comprises:
and correcting the bandwidth of the transmission link according to the Beidou second pulse signal.
6. The data transmission method according to claim 1, wherein the determining the total interval value according to the bandwidth of the transmission link and the bandwidth ratio of the data frame comprises:
calculating the difference between the bandwidth ratio of the 1 and the data frame to obtain the bandwidth ratio of the total interval value;
and multiplying the bandwidth duty ratio of the total interval value and the bandwidth of the transmission link to obtain the total interval value.
7. A data transmission apparatus, comprising:
the frame interval value determining module is used for determining a frame interval value and the number of the data frames according to the bandwidth of a transmission link, the length of the data frames to be transmitted and the bandwidth ratio of the data frames; the frame interval value is used for representing the interval between adjacent data frames;
a target number determining module, configured to determine a target number according to the fractional value of the frame interval value and the number of the data frames;
the sending module is used for sending the data frames with the target number according to the first frame interval and sending the rest data frames to be sent according to the second frame interval; wherein the first frame interval is a frame interval determined according to an integer part of the frame interval value, and a difference between a length of the second frame interval and a length of the first frame interval is one data metering unit;
the frame interval value determining module is specifically configured to determine an effective bandwidth of the transmission link according to a bandwidth of the transmission link and a bandwidth duty ratio of the data frame; determining the number of the data frames according to the length of the data frames and the effective bandwidth; determining a total interval value according to the bandwidth of the transmission link and the bandwidth duty ratio of the data frame; determining the frame interval value according to the number of the data frames and the total interval value;
the target data determining module is specifically configured to perform a difference operation on the fractional values of the 1 and the frame interval value to obtain a difference value; and multiplying the difference value and the number of the data frames to obtain the target number.
8. The data transmission apparatus according to claim 7, wherein the transmission module includes a first transmission unit and a second transmission unit;
the first sending unit is configured to send first N data frames in the data frames according to the first frame interval, where N is an integer greater than or equal to 1, and a value of N is equal to the target number;
the second sending unit is configured to send the last M data frames in the data frames according to the second frame interval, where M is an integer greater than or equal to 1, and a sum of N and M is less than or equal to the number of data frames.
9. The data transmission apparatus according to claim 7, wherein the transmission module further comprises a judgment unit, a third transmission unit, and a fourth transmission unit;
the judging unit is used for adding 1 to the value of the frame counter when the sending operation of the data frame is executed, and judging whether the value of the frame counter is smaller than or equal to the target number;
the third sending unit is configured to perform a sending operation of a next data frame according to the first frame interval if the value of the frame counter is less than or equal to the target number;
and the fourth sending unit is configured to, if the value of the frame counter is greater than the target number, perform a sending operation of the next data frame according to the second frame interval until the value of the frame counter is equal to the number of the data frames, and clear the value of the frame counter.
10. A field programmable gate array for implementing the steps of the method of any one of claims 1 to 6.
CN202110846854.1A 2021-07-26 2021-07-26 Data transmission method and device and field programmable gate array Active CN113556289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110846854.1A CN113556289B (en) 2021-07-26 2021-07-26 Data transmission method and device and field programmable gate array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110846854.1A CN113556289B (en) 2021-07-26 2021-07-26 Data transmission method and device and field programmable gate array

Publications (2)

Publication Number Publication Date
CN113556289A CN113556289A (en) 2021-10-26
CN113556289B true CN113556289B (en) 2023-06-30

Family

ID=78104483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110846854.1A Active CN113556289B (en) 2021-07-26 2021-07-26 Data transmission method and device and field programmable gate array

Country Status (1)

Country Link
CN (1) CN113556289B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015025413A1 (en) * 2013-08-22 2015-02-26 株式会社 東芝 Wireless communication apparatus and method
CN112131423B (en) * 2019-06-25 2024-08-27 杭州海康威视数字技术股份有限公司 Picture acquisition method, device and system
CN111917661B (en) * 2020-07-29 2023-05-02 抖音视界有限公司 Data transmission method, device, electronic equipment and computer readable storage medium
CN112332951B (en) * 2020-11-20 2022-06-24 昆高新芯微电子(江苏)有限公司 Ethernet frame preemption method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113556289A (en) 2021-10-26

Similar Documents

Publication Publication Date Title
US10314107B2 (en) Communication device, communication method, and communication system
CN105636056A (en) Spectrum resource self-optimization energy-saving method, apparatus and system
CN103955257A (en) Method and device for calibrating system clocks of single chip microcomputers, and air conditioner control system
CN100581094C (en) Network clock synchronizing method for short distance radio communication network
CN113556289B (en) Data transmission method and device and field programmable gate array
CN104580484A (en) Remote upgrading method for GPRS terminal
CN113992472A (en) Working method and system of FlexRay bus IP core
CN114285515A (en) Method and device for realizing any TSN time window period
CN106714189A (en) Method and device for analyzing cell over coverage
CN103401624A (en) Method for detecting SWR (standing-wave ratio) of PDD (Frequency Division Duplex) LTE (Long Term Evolution) RRU (Remote Radio Unit)
CN102387260B (en) Method and system for determining dropped call rate
US20160323837A1 (en) Techniques for optimizing network event timers
CN112492637A (en) Method and device for predicting cell traffic
CN114786275B (en) Data transmission method and device of Internet of things gateway
EP3249978A1 (en) Closed-loop clock calibration method, terminal and computer storage medium
CN102970726B (en) Link selecting method and equipment
EP1878128B1 (en) Noise estimation in wireless communication systems
CN102484794B (en) Spectrum sharing method and device for distributed network
CN115347968A (en) BD3 high-precision time service method, system, computer equipment and medium
CN110859001B (en) Carrier aggregation scheduling method and system
EP2624622B1 (en) Method and equipment for submitting multi-carrier measurement report
CN101232344A (en) Method and apparatus for frame alignment
CN114124334B (en) Processing method, client, equipment and medium of air interface data packet
CN105307212A (en) Processing method for traffic data of base station and base station
CN113115427B (en) Power quality monitoring equipment and power quality data transmission method and device thereof

Legal Events

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