Switch, system and data transmission method based on MCU for data transmission
By introducing MCU and additional temporary storage areas into the switch, data loss and congestion problems when high-speed ports transmit data to low-speed ports are solved, and more efficient data transmission and optimized switch control are achieved.
Patent Information
- Application Number
- CN202411562910.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-05
AI Technical Summary
When existing switches transmit data to low-speed ports on high-speed ports, the temporary storage area of low-speed ports cannot transmit data in time, resulting in data loss and congestion, affecting switch performance.
The MCU and its communication circuit are introduced into the switch. The MCU determines whether the data transmission speeds of the two ports to be transmitted match. If they do not match, the data transmission request of the low-speed port will be suspended and the data will be stored in an additional temporary storage area until the data is Resend the transmission request after the amount reaches the threshold.
Improve data transmission efficiency, reduce data loss and congestion, optimize the data transmission control of the switch, and improve the performance and flexibility of the switch.
Smart Images

Figure CN119094447B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computers and switches, and in particular to a switch, a system and a data transmission method for performing data transmission based on an MCU. Background Art
[0002] In the field of computer network technology, a switch is an important network device that connects multiple network nodes (such as computers, servers, etc.) to achieve data transmission between different nodes. The main functions of a switch include data packet routing, switching, and flow control. Among them, transmission control is one of the important technologies to ensure the smooth transmission of data within the switch.
[0003] In the field of microcontroller technology, a microcontroller unit (MCU) is an integrated circuit that controls other electronic devices by executing software programs. MCU has the advantages of fast processing speed and diverse functions, so it is widely used in various electronic devices. In the field of switch design and control technology, data transmission control technology is one of the core technologies. It mainly involves data transmission rate matching, data packet routing selection, and optimization of transmission efficiency.
[0004] Existing transmission control technology is mainly implemented through hardware. For example, by setting a threshold circuit in the port buffer area in the switch, when the amount of data in the port buffer area reaches a certain threshold, a request signal is sent, and transmission begins after receiving a confirmation signal.
[0005] Although the existing transmission control technology has solved the problem of data transmission to a certain extent, there are still some problems. For example, when a high-speed port wants to transmit data to a low-speed port, the low-speed port buffer cannot transmit the data in the port buffer to the target device in time, resulting in transmission data loss, data congestion and other problems, thus affecting the performance of the switch.
[0006] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of the present application, nor does it necessarily provide technical guidance. In the absence of clear evidence that the above content has been disclosed before the filing date of the present application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0007] The object of the present invention is to provide a switch, a system and a data transmission method for performing data transmission based on an MCU, which can improve data transmission efficiency and reduce data loss and congestion.
[0008] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0009] A switch for data transmission based on an MCU, comprising a plurality of ports, an MCU and an additional temporary storage area, wherein the MCU is electrically connected to each of the ports, the ports are configured to transmit data to other ports, and under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports;
[0010] The switch is configured to perform data transmission in the following manner:
[0011] The MCU determines whether the data transmission speeds of the two ports to be used for data transmission match, and if they do not match, performs the following steps:
[0012] The MCU determines that one of the two ports is a first port and the other is a second port, the data transmission speed of the first port is lower than the data transmission speed of the second port, and the MCU suspends sending a data transmission request sent by the first port;
[0013] The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by the first port in the additional temporary storage area;
[0014] When the amount of data received by the first port reaches a threshold, the MCU resends the data transmission request sent by the first port.
[0015] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the threshold is determined by the following method:
[0016] determining a total amount of data to be transmitted between the first port and the second port;
[0017] The threshold is determined based on matching the time taken by the first port to transmit the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
[0018] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the threshold is determined by the following method:
[0019] Determine the time T required for the second port to transmit the total amount of data according to the data transmission speed of the second port and the total amount of data;
[0020] The threshold is determined by the following formula:
[0021] Q E =(V2-V1)T±Q0,
[0022] Among them, Q Erepresents the threshold value, V2 represents the data transmission speed of the second port, V1 represents the data transmission speed of the second port, T represents the time required for the second port to transmit the total amount of data, and Q0 represents a preset data amount error.
[0023] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the threshold is determined by the following method:
[0024] The maximum data volume of the additional temporary storage area for storing data at the first port is determined as the first data volume, and the threshold is determined by the following formula: Q E =αQ E1 , where Q E represents the threshold, Q E1 represents the first data amount, α represents the first proportional coefficient, and 0<α≤1.
[0025] Further, according to any one of the technical solutions or a combination of multiple technical solutions described above, the value range of α is 0.3 to 0.9.
[0026] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the threshold is determined by the following method:
[0027] Determine the total amount of target data transmitted between the first port and the second port, and determine the threshold value by the following formula: Q E =βQ T , where Q E represents the threshold, Q T represents the total amount of data, β represents the second proportionality coefficient, and 0.3<β<1.
[0028] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, each of the ports is configured with a port temporary storage area;
[0029] The first port is configured with a first port temporary storage area, and data received by the first port is preferentially stored in the first port temporary storage area.
[0030] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, a state table is configured in the MCU, and the data transmission speed of each of the ports is stored in the state table;
[0031] The MCU reads the data transmission speed of the port to be used for data transmission stored in the status table to determine whether the data transmission speeds of the two ports match.
[0032] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the data transmission speed of each of the ports stored in the state table is determined by the following method:
[0033] Pre-acquire the data transmission speed of each port and store it in the status table; or,
[0034] The data transmission speed of each port is determined according to the historical data transmission speed of each port and stored in the state table, wherein the historical data transmission speed is the previous data transmission speed of the port.
[0035] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the first port is a data sending end, the data sending end is configured to receive data transmitted by an external device and transmit the received data to other ports, and the second port is a data receiving end, the data receiving end is configured to receive data transmitted by other ports and transmit the received data to an external device;
[0036] When the MCU determines that the data transmission speeds of the two ports to be used for data transmission do not match, the MCU suspends the data transmission request sent by the first port to the second port;
[0037] When the amount of data received by the first port reaches the threshold, the MCU resends the data transmission request sent by the first port to the second port.
[0038] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the first port is a data receiving end, the data receiving end is configured to receive data transmitted by other ports and transmit the received data to an external device, and the second port is a data sending end, the data sending end is configured to receive data transmitted by an external device and transmit the received data to other ports;
[0039] When the MCU determines that the data transmission speeds of the two ports to be used for data transmission do not match, the MCU suspends the data transmission request sent by the first port to the external device;
[0040] When the amount of data received by the first port reaches the threshold, the MCU resends the data transmission request sent by the first port to the external device.
[0041] According to another aspect of the present invention, the present invention provides a system for data transmission based on MCU, including a switch for data transmission based on MCU as described in any one of the above technical solutions or a combination of multiple technical solutions and multiple external devices, each of the external devices is electrically and communicatively connected to the switch through the port.
[0042] According to another aspect of the present invention, the present invention provides a switch data transmission method based on MCU, comprising the following steps:
[0043] The MCU preset in the switch is used to determine whether the data transmission speeds of the two ports to be used for data transmission match. If they do not match, the following steps are performed:
[0044] The MCU determines that one of the two ports is a first port and the other is a second port, a data transmission speed of the first port is lower than a data transmission speed of the second port, and the MCU suspends a data transmission request sent by the first port;
[0045] The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by it in the additional temporary storage area; under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports;
[0046] When the amount of data received by the first port reaches a threshold, the MCU resends the data transmission request sent by the first port.
[0047] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the threshold is determined by the following method:
[0048] determining a total amount of data to be transmitted between the first port and the second port;
[0049] The threshold is determined based on matching the time taken by the first port to transmit the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
[0050] The beneficial effects brought by the technical solution provided by the present invention are as follows:
[0051] a. Improve data transmission efficiency: The present invention realizes effective control of two ports with mismatched data transmission speeds by adding an MCU and its connecting circuit in the switch. When the low-speed port, i.e., the first port, wants to transmit data to the high-speed port, i.e., the second port, the MCU intercepts and takes over the control of the data transmission request from the low-speed port buffer area to the high-speed port buffer area. By adjusting the threshold for sending data transmission requests, the high-speed port can receive data from other ports before receiving the data transmission request, thereby improving the data transmission efficiency of the high-speed port;
[0052] b. Reduce data loss and congestion: The present invention adjusts the size of the low-speed port temporary storage area through the additional temporary storage area, and controls the data to be transmitted at the same speed between the low-speed port temporary storage area and the high-speed port temporary storage area according to the data transmission speed of the two ports. Specifically, since the low-speed port, i.e., the first port, receives a part of the data in advance, the high-speed port, i.e., the second port, receives all the data and the first port receives the remaining data, and the time taken by the two is equivalent, which can reduce the possibility of data loss and congestion and improve the performance of the switch;
[0053] c. Improve the flexibility of switch data transmission: The data transmission control scheme provided by the present invention can be adjusted according to the transmission speed of different ports, which has high flexibility; thus, the transmission control of the switch can be optimized according to actual needs, thereby improving the performance of the switch;
[0054] d. Easy to implement: The data transmission control scheme of the switch of the present invention realizes effective control when the speeds of the two ports do not match by adding an MCU, an additional temporary storage area and its connecting circuit in the switch, which is easy to implement and has low cost;
[0055] e. Optimizing the data transmission control of the switch: The present invention receives the signal of each port when performing a protocol with an external device through the MCU, and uses a state table to record the data transmission speed of each port and the external device protocol or the actual data transmission speed, and determines the amount of data pre-stored in the low-speed port, i.e., the first port, according to the data transmission speed, thereby optimizing the transmission control; this not only improves the efficiency of data transmission, reduces the possibility of data loss and congestion, but also can automatically optimize the data transmission control of the switch according to the data transmission speed between the two ports, thereby improving the performance of the switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A module block diagram of a switch for performing data transmission based on an MCU provided as an exemplary embodiment of the present invention;
[0058] Figure 2 A block diagram of an additional temporary storage area provided for an exemplary embodiment of the present invention;
[0059] Figure 3A schematic diagram of a data transmission principle of two ports with matched data transmission speeds provided for an exemplary embodiment of the present invention;
[0060] Figure 4 A schematic diagram of the data transmission principle of two ports with mismatched data transmission speeds provided by an exemplary embodiment of the present invention;
[0061] Figure 5 A schematic diagram of the principle of extending the storage space of the low-speed port temporary storage area provided by an exemplary embodiment of the present invention;
[0062] Figure 6 A schematic flow chart of a switch data transmission method based on an MCU provided as an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0065] In one embodiment of the present invention, a switch based on MCU for data transmission is provided. Figure 1 and Figure 2 , the switch includes a plurality of ports, an MCU and an additional temporary storage area, the MCU is electrically connected to each of the ports, the ports are configured to transmit data to other ports, and under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports;
[0066] like Figure 6 As shown, the switch is configured to perform data transmission in the following manner:
[0067] The MCU determines whether the data transmission speeds of the two ports to be used for data transmission match, and if they do not match, performs the following steps:
[0068] The MCU determines that one of the two ports is a first port and the other is a second port, a data transmission speed of the first port is lower than a data transmission speed of the second port, and the MCU suspends a data transmission request sent by the first port;
[0069] The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by the first port in the additional temporary storage area;
[0070] When the amount of data received by the first port reaches a threshold, the MCU resends the data transmission request sent by the first port.
[0071] The switch for data transmission based on MCU provided by the present invention has the following advantages:
[0072] Improve data transmission efficiency: The present invention realizes effective control of two ports with mismatched data transmission speeds by adding an MCU and its connecting circuit in the switch. When the low-speed port, i.e., the first port, wants to transmit data to the high-speed port, i.e., the second port, the MCU intercepts and takes over the control of the data transmission request from the low-speed port buffer area to the high-speed port buffer area. By adjusting the threshold for sending data transmission requests, the high-speed port can receive data from other ports before receiving the data transmission request, thereby improving the data transmission efficiency of the high-speed port;
[0073] Reducing data loss and congestion: The present invention adjusts the size of the low-speed port temporary storage area through the additional temporary storage area, and controls the data to be transmitted at the same speed between the low-speed port temporary storage area and the high-speed port temporary storage area according to the data transmission speed of the two ports. Specifically, since the low-speed port, i.e., the first port, receives a part of the data in advance, the high-speed port, i.e., the second port, receives all the data and the first port receives the remaining data, and the time taken by the two is equivalent, which can reduce the possibility of data loss and congestion and improve the performance of the switch;
[0074] Improve the flexibility of switch data transmission: The data transmission control scheme provided by the present invention can be adjusted according to the transmission speed of different ports, and has high flexibility; thus, the transmission control of the switch can be optimized according to actual needs, thereby improving the performance of the switch;
[0075] Easy to implement: The data transmission control scheme of the switch of the present invention realizes effective control when the speeds of the two ports do not match by adding an MCU, an additional temporary storage area and a connecting circuit thereof in the switch, which is easy to implement and has low cost.
[0076] See also Figure 3 , if two high-speed devices transmit data through the two high-speed ports of the switch, the MCU determines that the transmission speeds of the two ports match, does not intercept the data transmission request, and the data is transmitted normally. It should be noted that, generally speaking, the external device and port corresponding to the data transmission speed of the port and the external device protocol or the actual data transmission speed greater than the preset first speed value are respectively called high-speed devices and high-speed ports, and correspondingly, the external device and port whose data transmission speed is not greater than the preset first speed value are respectively low-speed devices and low-speed ports.
[0077] See also Figure 4 If a low-speed device transmits data to a high-speed device through a low-speed port of the switch to another high-speed port, the MCU determines that the transmission speeds of the two ports do not match, intercepts the data transmission request, and stops sending the data transmission request to the high-speed port. Figure 5 As shown, the MCU will expand the storage space of the low-speed port buffer area through the additional buffer area so that the low-speed port will pre-receive the required amount of data before sending the original request signal, that is, the data transmission request, to the high-speed port.
[0078] Preferably, any two ports in the switch are electrically connected and bidirectionally connected, and each port can be a data sending end or a data receiving end. The data sending end is configured to receive data transmitted by an external device and transmit the received data to other ports. The data sending end receives data sent by an external device connected to the switch, and sends a data transmission request to the MCU, and the MCU determines whether the data transmission request can be sent to other ports. If it is determined that it cannot be sent, the data transmission request is intercepted and sent again when it meets the sending requirements; if it is determined that it can be sent, the MCU sends the data transmission request to other ports, and one of the other ports matching the data transmission request returns a confirmation signal. After receiving the confirmation signal, the data sending end performs data transmission with the matching port. The data receiving end is configured to receive data transmitted by other ports and transmit the received data to external devices. Similarly, the data receiving end receives data transmitted from other ports and sends a data transmission request to the MCU, and the MCU determines whether the data transmission request can be sent to the external device. If it is determined that it cannot be sent, the data transmission request is intercepted and sent again when the sending requirements are met; if it is determined that it can be sent, the MCU sends the data transmission request to the external device, so that the data receiving end transmits the data to the external device.
[0079] If the first port is a data transmitting end and the second port is a data receiving end, when the MCU determines that the data transmission speeds of the two ports to be transmitted do not match, the MCU intercepts the data transmission request sent by the first port to the second port / all ports. At this time, the first port (data transmitting end) with a slower speed is still receiving data, but does not send data to the second port. The second port can receive data from other ports and send it to an external device. When the amount of data received by the first port reaches the threshold, the MCU sends the intercepted data transmission request to all ports / second ports. At this time, the MCU replaces the low-speed port buffer, i.e., the first port buffer, to send a request signal to the high-speed port buffer, i.e., the second port buffer. After receiving the request signal, the high-speed port buffer will reply a confirmation signal to the low-speed port buffer and the MCU. After receiving the confirmation signal, the low-speed port buffer starts to transmit the data in its buffer (including the low-speed port buffer and part or all of the extended additional buffer) to the high-speed port buffer.
[0080] If the first port is a data receiving end and the second port is a data sending end, when the MCU determines that the data transmission speeds of the two ports to be used for data transmission do not match, the MCU suspends (intercepts and takes over) the data transmission request sent by the first port to the external device. When the amount of data received by the first port reaches the threshold, the MCU resends the data transmission request to the external device.
[0081] In a specific embodiment of the present invention, the number of ports of the switch is 4. Figure 1 As shown, the four ports are port 1 to port 4. Each of the ports is configured with a port buffer area, that is, port 1 to port 4 are respectively configured with buffer areas 1 to 4, buffer area 1 is used to cache data received by port 1, and buffer areas 2, 3, and 4 are respectively used to cache data received by ports 2, 3, and 4. The data received by each port is preferentially stored in its corresponding port buffer area, for example, the data received by port 1 is preferentially stored in buffer area 1.
[0082] The additional temporary storage area is an independent temporary storage area independent of the port temporary storage areas corresponding to each port. The additional temporary storage area is electrically connected to ports one to four respectively, and the MCU is also electrically connected to ports one to four respectively. Under the control of the MCU, the additional temporary storage area is electrically connected to one or more of ports one to four.
[0083] In one embodiment, the additional temporary storage area is an integral storage area, and the MCU can only control the additional temporary storage area to be electrically connected to one port at a time to expand the temporary storage space corresponding to the port.
[0084] Another better way is Figure 2 As shown, the additional temporary storage area is divided into a plurality of additional temporary storage units, including additional temporary storage unit 1 to additional temporary storage unit N (given that the switch has at least two ports, N is a positive integer greater than or equal to 2), and the MCU can control the plurality of additional temporary storage units to be electrically connected to different ports respectively, so as to realize the simultaneous expansion of the temporary storage space corresponding to the plurality of ports. The storage space corresponding to the plurality of additional temporary storage units can be the same or different.
[0085] Corresponds to Figure 1 In the specific embodiment shown, the additional temporary storage area is divided into 4 additional temporary storage units, including additional temporary storage unit 1 to additional temporary storage unit 4, wherein additional temporary storage unit 1 is electrically connected to port 1, additional temporary storage unit 2 is electrically connected to port 2, additional temporary storage unit 3 is electrically connected to port 3, and additional temporary storage unit 4 is electrically connected to port 4.
[0086] For example, at a certain moment, port one sends data to port three, and port two sends data to port four. The MCU determines that port one and port four are low-speed ports. Then the MCU simultaneously controls the additional temporary storage unit one to be electrically connected to port one and the additional temporary storage unit four to be electrically connected to port four, thereby simultaneously expanding the temporary storage space of port one and port four.
[0087] There are several ways to determine whether the data transmission speeds of different ports match.
[0088] One method is to pre-acquire the protocol data transmission speed between each port and the external device connected to it and store it in a storage unit or the MCU as the data transmission speed. The MCU reads the pre-stored data transmission speed of each port and compares the data transmission speeds corresponding to the two ports for data transmission to determine whether the data transmission speeds of the two ports match.
[0089] It should be noted that there are multiple criteria for judging whether the data transmission speeds of two ports match. The first criterion is that if the data transmission speeds of the two ports are the same, then the data transmission speeds of the two ports are judged to match; the second criterion is that if the data transmission speed levels of the two ports are the same, then the data transmission speeds of the two ports are judged to match. This standard is applicable to the data transmission speeds of each port represented / divided by corresponding speed levels such as high, medium, and low; the third criterion is that if the difference between the data transmission speeds of the two ports is within a preset speed difference threshold range, then the data transmission speeds of the two ports are judged to match. In other embodiments, the data transmission speeds of the two ports can also be judged to match by other methods of judging that the data transmission speeds of the two ports are close.
[0090] Another way is to configure a state table in the MCU, as shown in Table 1, in which the name / serial number corresponding to each port, the port address configured for each port, the external device information connected to each port, and the data transmission speed of each port are stored; the MCU reads the data transmission speed of the port to be transmitted stored in the state table to determine whether the data transmission speeds of the two ports match. Among them, the port address is used to track the data process between different ports and the corresponding information of each port, including the external device information connected to it, the data transmission speed, etc.
[0091] Preferably, the data transmission speed of each of the ports stored in the status table is determined by:
[0092] The data transmission speed of each port is determined according to the historical data transmission speed between each port and the external device and stored in the state table, wherein the historical data transmission speed is the actual data transmission speed between the port and the external device in the past. In this embodiment, the first data transmission speed recorded in the state table is the protocol data transmission speed between the port and the external device.
[0093] For example, the most recent data transmission speed between the port and the external device is used as the data transmission speed and stored in the status table; or, the average of the most recent data transmission speeds between the port and the external device is used as the data transmission speed and stored in the status table.
[0094]
[0095] In one embodiment of the present invention, the threshold is determined by:
[0096] determining a total amount of data to be transmitted between the first port and the second port;
[0097] The threshold is determined based on matching the time taken by the first port to receive the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
[0098] Specifically, the threshold value can be determined in the following manner:
[0099] Determine the time T required for the second port to transmit the total amount of data according to the data transmission speed of the second port and the total amount of data;
[0100] The threshold is determined by the following formula: Q E =(V2-V1)T±Q0,
[0101] Among them, Q E represents the threshold value, V2 represents the data transmission speed of the second port, V1 represents the data transmission speed of the second port, T represents the time required for the second port to transmit the total amount of data, and Q0 represents a preset data amount error.
[0102] The present invention receives the signal of each port when performing a protocol with an external device through an MCU, and uses a state table to record the data transmission speed or actual data transmission speed of each port and the external device protocol, and determines the amount of data pre-stored in the low-speed port, i.e., the first port, according to the data transmission speed, thereby optimizing the transmission control; this not only improves the efficiency of data transmission and reduces the possibility of data loss and congestion, but also can automatically optimize the data transmission control of the switch according to the data transmission speed between the two ports, thereby improving the performance of the switch.
[0103] In another embodiment of the present invention, the threshold is determined by:
[0104] The maximum data volume of the additional temporary storage area for storing data at the first port is determined as the first data volume, and the threshold is determined by the following formula: Q E =αQ E1 , where Q E represents the threshold, Q E1 Represents the first data volume, α represents the first proportionality coefficient, and 0<α≤1. Preferably, the value range of α is 0.3 to 0.9. Specifically, α can take the values of 0.3, 0.4, 0.5, 0.6, 0.7, and 0.8. In other embodiments, the first proportionality coefficient α can also be a non-fixed value, and the first proportionality coefficient α is determined according to the transmission speed difference between the first port and the second port, the total amount of data, and the maximum amount of data stored in the additional temporary storage area for the first port.
[0105] In another embodiment of the present invention, the threshold is determined by:
[0106] Determine the total amount of target data transmitted between the first port and the second port, and determine the threshold value by the following formula: Q E =βQ T , where Q E represents the threshold, Q T represents the total amount of data, β represents the second proportionality coefficient, and 0.3<β<1.
[0107] In one embodiment of the present invention, a system for data transmission based on an MCU is provided, comprising a switch for data transmission based on an MCU as described in any one of the above embodiments and a plurality of external devices, each of the external devices being electrically and communicatively connected to the switch through the port.
[0108] In one embodiment of the present invention, a switch data transmission method based on an MCU is provided, comprising the following steps:
[0109] The MCU preset in the switch is used to determine whether the data transmission speeds of the two ports to be used for data transmission match. If they do not match, the following steps are performed:
[0110] The MCU determines that the port with a slow data transmission speed among the two ports is the first port, and the port with a fast data transmission speed is the second port, and the MCU suspends the first port from sending a data transmission request;
[0111] The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by it in the additional temporary storage area; under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports;
[0112] When the amount of data received by the first port reaches a threshold, the MCU controls the first port to resume sending data transmission requests.
[0113] The threshold is determined by:
[0114] determining a total amount of data to be transmitted between the first port and the second port;
[0115] The threshold is determined based on matching the time taken by the first port to transmit the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
[0116] The switch, system and data transmission method based on MCU for data transmission provided by the present invention have many advantages such as improving data transmission efficiency, reducing data loss and congestion, optimizing data transmission control of the switch, high flexibility, easy implementation and low cost, so it can be widely used in application fields such as computer network technology, microcontroller technology and switch design and control technology. In the field of computer network technology, the technical solution realizes accurate control of data transmission by adding MCU, additional temporary storage area and its connecting circuit in the switch, thereby improving the efficiency and reliability of data transmission. This technical solution can be applied to large-scale network environments, such as data centers, cloud computing centers, etc., to achieve efficient data transmission and processing. In the field of microcontroller technology, the technical solution utilizes the fast processing capability and diversified functions of MCU to achieve effective processing when the speed of two ports in the switch does not match. This technical solution can be applied to various electronic devices that require efficient data transmission, such as smart homes, Internet of Things devices, etc., to achieve intelligence and efficiency of equipment.
[0117] In the field of switch design and control technology, this technical solution improves switch performance by improving data transmission rate matching, data packet routing selection, and transmission efficiency optimization. This technical solution can be applied to various switches that require efficient data transmission, such as enterprise-level switches, carrier-level switches, etc., to achieve switch stability and reliability.
[0118] In general, this technical solution has broad application prospects in application fields such as computer network technology, microcontroller technology, and switch design and control technology. It has huge market demand and is expected to promote technological progress and industrial development in related fields.
[0119] It should be noted that the system for data transmission based on MCU and the embodiment of the switch data transmission method based on MCU provided by the present invention are the same as the inventive concept of the above-mentioned switch embodiment for data transmission based on MCU. The entire content of the switch embodiment for data transmission based on MCU is incorporated into the system for data transmission based on MCU and the embodiment of the switch data transmission method based on MCU by introduction.
[0120] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0121] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A switch for data transmission based on MCU, characterized in that: It comprises a plurality of ports, an MCU and an additional temporary storage area, wherein the MCU is electrically connected to each of the ports respectively, the ports are configured to transmit data to other ports, and under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports; The switch is configured to perform data transmission in the following manner: The MCU determines whether the data transmission speeds of the two ports to be used for data transmission match, and if they do not match, performs the following steps: The MCU determines that one of the two ports is a first port and the other is a second port, the data transmission speed of the first port is lower than the data transmission speed of the second port, and the MCU suspends sending a data transmission request sent by the first port; The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by the first port in the additional temporary storage area; When the amount of data received by the first port reaches a threshold, the MCU resends the data transmission request sent by the first port.
2. The switch for data transmission based on MCU according to claim 1, characterized in that: The threshold is determined by: determining a total amount of data to be transmitted between the first port and the second port; The threshold is determined based on matching the time taken by the first port to transmit the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
3. The switch for data transmission based on MCU according to claim 2, characterized in that: The threshold is determined by: Determine the time T required for the second port to transmit the total amount of data according to the data transmission speed of the second port and the total amount of data; The threshold is determined by the following formula: Q E =(V2-V1)T±Q0, Among them, Q E represents the threshold value, V2 represents the data transmission speed of the second port, V1 represents the data transmission speed of the second port, T represents the time required for the second port to transmit the total amount of data, and Q0 represents a preset data amount error.
4. The switch for data transmission based on MCU according to claim 1, characterized in that: The threshold is determined by: The maximum data volume of the additional temporary storage area for storing data at the first port is determined as the first data volume, and the threshold is determined by the following formula: Q E =αQ E1 , where Q E represents the threshold, Q E1 represents the first data amount, α represents the first proportional coefficient, and 0<α≤1.
5. The switch for data transmission based on MCU according to claim 4, characterized in that: The value range of α is 0.3 to 0.
9.
6. The switch for data transmission based on MCU according to claim 1, characterized in that: The threshold is determined by: Determine the total amount of target data transmitted between the first port and the second port, and determine the threshold value by the following formula: Q E =βQ T , where Q E represents the threshold, Q T represents the total amount of data, β represents the second proportionality coefficient, and 0.3<β<1.
7. The switch for data transmission based on MCU according to claim 1, characterized in that: Each of the ports is configured with a port temporary storage area; The first port is configured with a first port temporary storage area, and data received by the first port is preferentially stored in the first port temporary storage area.
8. The switch for data transmission based on MCU according to claim 1, characterized in that: The MCU is provided with a state table, and the state table stores the data transmission speed of each port; The MCU reads the data transmission speed of the port to be used for data transmission stored in the status table to determine whether the data transmission speeds of the two ports match.
9. The switch for data transmission based on MCU according to claim 8, characterized in that: The data transmission speed of each of the ports stored in the state table is determined in the following manner: Pre-acquire the data transmission speed of each port and store it in the status table; or, The data transmission speed of each port is determined according to the historical data transmission speed of each port and stored in the state table, wherein the historical data transmission speed is the previous data transmission speed of the port.
10. The switch for data transmission based on MCU according to claim 1, characterized in that: The first port is a data transmitting end, and the data transmitting end is configured to receive data transmitted by an external device and transmit the received data to other ports; the second port is a data receiving end, and the data receiving end is configured to receive data transmitted by other ports and transmit the received data to an external device; When the MCU determines that the data transmission speeds of the two ports to be used for data transmission do not match, the MCU suspends the data transmission request sent by the first port to the second port; When the amount of data received by the first port reaches the threshold, the MCU resends the data transmission request sent by the first port to the second port.
11. The switch for data transmission based on MCU according to claim 1, characterized in that: The first port is a data receiving end, which is configured to receive data transmitted by other ports and transmit the received data to an external device, and the second port is a data transmitting end, which is configured to receive data transmitted by an external device and transmit the received data to other ports; When the MCU determines that the data transmission speeds of the two ports to be used for data transmission do not match, the MCU suspends the data transmission request sent by the first port to the external device; When the amount of data received by the first port reaches the threshold, the MCU resends the data transmission request sent by the first port to the external device.
12. A system for data transmission based on MCU, characterized in that: It comprises a switch for data transmission based on MCU as described in any one of claims 1 to 11 and a plurality of external devices, each of the external devices being electrically and communicatively connected to the switch through the port.
13. A switch data transmission method based on MCU, characterized in that: The following steps are involved: The MCU preset in the switch is used to determine whether the data transmission speeds of the two ports to be used for data transmission match. If they do not match, the following steps are performed: The MCU determines that one of the two ports is a first port and the other is a second port, a data transmission speed of the first port is lower than a data transmission speed of the second port, and the MCU suspends a data transmission request sent by the first port; The MCU controls the additional temporary storage area to be electrically connected to the first port, so that the first port stores the data received by it in the additional temporary storage area; under the control of the MCU, the additional temporary storage area is configured to be electrically connected to one or more of the ports; When the amount of data received by the first port reaches a threshold, the MCU resends the data transmission request sent by the first port.
14. The switch data transmission method based on MCU according to claim 13, characterized in that: The threshold is determined by: determining a total amount of data to be transmitted between the first port and the second port; The threshold is determined based on matching the time taken by the first port to transmit the remaining data amount with the time taken by the second port to transmit the total data amount, wherein the remaining data amount is the difference between the total data amount and the threshold.
Citation Information
Patent Citations
Reliable media stream transmission device
CN105721950A
Data transmission method and data transmission system
CN111865741A