CN117978739A - Message sending method and device, storage medium and electronic device - Google Patents

Message sending method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117978739A
CN117978739A CN202410123106.4A CN202410123106A CN117978739A CN 117978739 A CN117978739 A CN 117978739A CN 202410123106 A CN202410123106 A CN 202410123106A CN 117978739 A CN117978739 A CN 117978739A
Authority
CN
China
Prior art keywords
message
port
sending
determining
partial
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.)
Pending
Application number
CN202410123106.4A
Other languages
Chinese (zh)
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.)
Suzhou Centec Communications Co Ltd
Original Assignee
Suzhou Centec Communications 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 Suzhou Centec Communications Co Ltd filed Critical Suzhou Centec Communications Co Ltd
Priority to CN202410123106.4A priority Critical patent/CN117978739A/en
Publication of CN117978739A publication Critical patent/CN117978739A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a message sending method and device, a storage medium and an electronic device, wherein the method comprises the following steps: determining a first partial message which is not transmitted in a target data stream under the condition that the data amount of the target data stream to be transmitted on the switch is greater than or equal to a preset data amount threshold value; determining whether to send each message in the first partial message through the second port according to the sending state of each message in the second partial message in the target data stream; under the condition that each message in the first part of messages is not sent through the second port, the first port used for sending each message in the first part of messages on the switch is determined, and each message in the first part of messages is sent through the first port.

Description

Message sending method and device, storage medium and electronic device
Technical Field
The present application relates to the field of computers, and in particular, to a method and apparatus for sending a message, a storage medium, and an electronic device.
Background
In the related art, the load balancing policy adopted by the switch when forwarding the message is often that different load balancing algorithms are selected in the dimension of the data flow, it can be understood that in this way, the same load balancing algorithm may not have good load balancing effect under the condition that an elephant flow (data flow with larger data volume) and a mouse flow (data flow with smaller data volume) coexist, and no matter how long the duration of the elephant flow is, the congestion and packet loss may be caused, which may bring direct negative influence to the application, and it can be understood that in the related art, the message sending efficiency is lower.
Aiming at the problems of low message sending efficiency and the like in the related technology, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a message sending method and device, a storage medium and an electronic device, which are used for at least solving the problems of low message sending efficiency and the like in the related technology.
According to an embodiment of the present application, there is provided a method for sending a message, including: determining a first partial message which is not transmitted in a target data flow under the condition that the data volume of the target data flow to be transmitted on a switch is greater than or equal to a preset data volume threshold value; determining whether to send each message in the first partial message through a second port according to the sending state of each message in a second partial message in the target data stream, wherein the second port comprises a port on the switch for sending each message in the second partial message, and the second partial message comprises at least part of the sent messages in the target data stream; and under the condition that each message in the first part of messages is not transmitted through the second port, determining a first port on the switch for transmitting each message in the first part of messages, and transmitting each message in the first part of messages through the first port.
In an exemplary embodiment, the determining, in the target data stream, the first partial packet that has not been sent includes: determining message identifications carried in each message in the target data stream to obtain a group of message identifications, wherein each message identification in the group of message identifications is used for representing the sending sequence of each message in the target data stream through the switch, and the sending sequence is used for representing the sequence of each message in the target data stream sent by the switch; determining a first partial message which is not transmitted in the target data stream according to the sequence of the transmission sequence and the preset message number, wherein the message number in the first partial message is the preset message number, and the transmission sequence of the first partial message is earlier than the transmission sequence of the messages except the first partial message in the messages which are not transmitted in the target data stream.
In an exemplary embodiment, the determining, according to the sending status of each packet in the second partial packet in the target data stream, whether to send each packet in the first partial packet through the second port includes: determining the message length and the sending duration of the second partial message sent through the second port, wherein the message length of the second partial message is equal to the sum of the message lengths of all the messages in the second partial message, and the sending duration is equal to the duration between the time when the first message in the second partial message starts to be sent through the second port and the time when the last message in the second partial message finishes to be sent through the second port; determining a sending rate to be equal to a value obtained by dividing the message length by the sending duration, wherein the sending rate is used for indicating the rate of sending the second part of messages through the second port; and under the condition that the sending rate is smaller than or equal to a preset sending rate threshold value, determining that each message in the first partial message is not sent through the second port.
In an exemplary embodiment, the determining, on the switch, the first port for sending each of the first partial messages if it is determined that each of the first partial messages is not sent through the second port includes: determining a first load balancing algorithm from a preset load balancing algorithm set, wherein the load balancing algorithm set comprises one or more load balancing algorithms, and the one or more load balancing algorithms comprise the first load balancing algorithm; the first port is determined from a first set of ports of the switch according to the first load balancing algorithm, wherein the first set of ports includes ports on the switch other than the second port.
In an exemplary embodiment, the determining the first load balancing algorithm from the preset load balancing algorithm set includes: randomly selecting a load balancing algorithm from the load balancing algorithm set as the first load balancing algorithm; or randomly selecting one load balancing algorithm from the load balancing algorithms except for the second load balancing algorithm in the load balancing algorithm set as the first load balancing algorithm, wherein the second port used for sending each message in the second partial message is a port determined according to the second load balancing algorithm.
In one exemplary embodiment, the determining the first port from the first set of ports of the switch according to the first load balancing algorithm includes one of: under the condition that the first load balancing algorithm comprises a dynamic link load algorithm, determining the rate of sending messages of all ports in the first group of ports to obtain a first group of sending rates, and determining a port corresponding to the fastest sending rate in the first group of sending rates as the first port; determining an ith port in the first group of ports as the first port under the condition that the first load balancing algorithm comprises a round robin balancing algorithm, wherein each port in the first group of ports is set to send messages in turn, and i is a positive integer; under the condition that the first load balancing algorithm comprises a hash balancing algorithm, determining a hash seed corresponding to the first part of message, determining a target hash value corresponding to the first part of message according to the hash seed and a preset hash key value, and determining the first port corresponding to the target hash value from the hash value and ports with corresponding relations, wherein the ports on the switch have hash values corresponding to one another.
In an exemplary embodiment, before the determining the first partial message that has not been sent in the target data stream, the method further comprises: determining load information of a second group of ports on the switch to obtain a group of load information, wherein the second group of ports are ports on the switch for sending messages in the target data stream; and determining whether the data volume of the target data flow is greater than or equal to the data volume threshold according to the set of load information.
In an exemplary embodiment, the determining, according to the set of load information, whether the data amount of the target data flow is greater than or equal to the data amount threshold value includes one of: when the set of load information includes the flow ratio of each port in the second set of ports, determining that the data flow of the target data flow is greater than or equal to the data volume threshold value when the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold value, wherein the flow ratio of a j-th port in the second set of ports is equal to the number of messages being sent by the j-th port divided by the maximum number of messages allowed to be sent by the j-th port, and j is a positive integer; and determining that the data volume of the target data flow is greater than or equal to the data volume threshold under the condition that the set of load information comprises the flow ratio of each port in the second set of ports and the duration that the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold and the duration that the flow ratio of each port in the second set of ports is greater than or equal to the flow ratio threshold is greater than or equal to a preset duration threshold.
According to another embodiment of the present application, there is also provided a message sending apparatus, including: a first determining module, configured to determine, in a target data flow to be sent on a switch, a first partial packet that has not yet been sent, if a data amount of the target data flow is greater than or equal to a preset data amount threshold; a second determining module, configured to determine whether to send each message in the first partial message through a second port according to a sending state of each message in a second partial message in the target data stream, where the second port includes a port on the switch for sending each message in the second partial message, and the second partial message includes at least a part of the messages sent in the target data stream; and the third determining module is used for determining a first port on the switch for sending each message in the first partial message under the condition that each message in the first partial message is determined not to be sent through the second port, and sending each message in the first partial message through the first port.
According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described message sending method when executed.
According to still another aspect of the embodiment of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above-mentioned method for sending a message through the computer program.
In the embodiment of the present application, when the data amount of the target data stream to be sent on the switch is greater than or equal to the preset data amount threshold, it may be indicated that the packet Wen Jiaoduo in the target data stream has not yet been sent, in this case, but not limited to determining the first partial packet in the packet that has not yet been sent in the target data stream, determining, according to the sending state of the second partial packet that has been sent in the target data stream, whether to continue sending each packet in the first partial packet through the second port that sends each packet in the second partial packet, and in the case that it is determined that each packet in the first partial packet is not sent through the second port, it may be understood that the possibility that congestion of the second port is greater, and continuing sending each packet in the first partial packet through the second port may cause higher delay or packet loss, and then, but not limited to sending each packet in the first partial packet through the redetermined first port. By means of the method, the data flow with larger data volume is decomposed into multiple parts of messages, the sending state of each part of messages is analyzed, accurate control of rerouting of the subsequent part of messages which are not sent is achieved, the condition of network congestion is greatly optimized, and meanwhile the effective bandwidth of the network is improved. By adopting the technical scheme, the problems of lower message sending efficiency and the like in the related technology are solved, and the technical effect of improving the message sending efficiency is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a message sending method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of transmitting data according to an embodiment of the application;
FIG. 3 is a schematic diagram of an alternative slice Block in accordance with an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative determination of whether a data stream is an elephant stream, in accordance with an embodiment of the application;
FIG. 5 is a schematic diagram of an alternative messaging method according to an embodiment of the present application;
fig. 6 is a block diagram of a message transmitting apparatus according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method embodiments provided by the embodiments of the present application may be performed in a computer terminal, a device terminal, or a similar computing apparatus. Taking a computer terminal as an example, fig. 1 is a schematic diagram of a hardware environment of a method for sending a message according to an embodiment of the present application. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and in one exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, a computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than the equivalent functions shown in FIG. 1 or more than the functions shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for sending a message in an embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for sending a message is provided and applied to the computer terminal, and fig. 2 is a flowchart of a method for transmitting data according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
Step S202, determining a first partial message which is not transmitted in a target data stream under the condition that the data amount of the target data stream to be transmitted on a switch is greater than or equal to a preset data amount threshold value;
Step S204, determining whether to send each message in the first partial message through a second port according to a sending state of each message in a second partial message in the target data stream, where the second port includes a port on the switch for sending each message in the second partial message, and the second partial message includes at least a portion of the messages sent in the target data stream;
step S206, determining a first port on the switch for sending each message in the first partial message, and sending each message in the first partial message through the first port, where it is determined that each message in the first partial message is not sent through the second port.
Through the above steps, in the embodiment of the present application, in the case where the data amount of the target data stream to be sent on the switch is greater than or equal to the preset data amount threshold, it may be indicated that the packet Wen Jiaoduo in the target data stream has not yet been sent, in this case, but not limited to, determining the first partial packet in the packet that has not yet been sent in the target data stream, determining, according to the sending state of the second partial packet that has been sent in the target data stream, whether to continue sending each packet in the first partial packet through the second port that sends each packet in the second partial packet, and in the case where it is determined that each packet in the first partial packet is not sent through the second port, it may be understood that the possibility that congestion of the second port is greater, and continuing sending each packet in the first partial packet through the second port may cause higher delay or packet loss, and then, but not limited to, sending each packet in the first partial packet through the redetermined first port. By means of the method, the data flow with larger data volume is decomposed into multiple parts of messages, the sending state of each part of messages is analyzed, accurate control of rerouting of the subsequent part of messages which are not sent is achieved, the condition of network congestion is greatly optimized, and meanwhile the effective bandwidth of the network is improved. By adopting the technical scheme, the problems of lower message sending efficiency and the like in the related technology are solved, and the technical effect of improving the message sending efficiency is realized.
In the technical solution provided in step S202, in the case where the data amount of the target data flow to be sent on the switch is greater than or equal to the preset data amount threshold, it may be understood that the number of messages that are not yet sent in the target data flow is already greater than or equal to the preset number threshold, in which case the target data flow may be an elephant flow, and in the case where the data amount of the target data flow to be sent on the switch is less than the preset data amount threshold, it may be understood that the number of messages that are not yet sent in the target data flow is less than or equal to the preset number threshold, in which case the target data flow may be a mouse flow.
Alternatively, in this embodiment, the data amount in the target data stream to be sent may be changed in different time periods, and it may be understood that the data amount of the target data stream in the first time period may be greater than or equal to a preset data amount threshold, and the data amount of the target data stream in the second time period may be a western european whisper preset data amount threshold, where the first time period may be, but is not limited to, before the second time period.
Optionally, in this embodiment, the first partial packet may, but is not limited to, include a continuous packet in a packet that is not yet sent in the target data stream, and it is understood that each packet in the first partial packet is a packet that is sent in sequence.
In one exemplary embodiment, the first partial message that has not been sent may be, but is not limited to, determined in the target data stream by: determining message identifications carried in each message in the target data stream to obtain a group of message identifications, wherein each message identification in the group of message identifications is used for representing the sending sequence of each message in the target data stream through the switch, and the sending sequence is used for representing the sequence of each message in the target data stream sent by the switch; determining a first partial message which is not transmitted in the target data stream according to the sequence of the transmission sequence and the preset message number, wherein the message number in the first partial message is the preset message number, and the transmission sequence of the first partial message is earlier than the transmission sequence of the messages except the first partial message in the messages which are not transmitted in the target data stream.
Optionally, in this embodiment, the destination field in each packet in the destination data stream may, but is not limited to, carry a packet identifier, and may, but is not limited to, read the packet identifier from the destination field, for example, read the value of the destination field as the packet identifier, for example, carry the packet identifier in the Identification field of the packet, and may, but is not limited to, read the value of the Identification field to determine the packet identifier of the packet. Identification is a unique Identification of each IP message sent by the host, typically one message per sent, its value being incremented by one. The number (corresponding to the message identifier) of the IP message can be determined by the value of the Identification field. Since the Identification field has a size of 16bits, the number of IP packets in one stream is at most 0 to 65535.
Optionally, in this embodiment, the preset number of messages may be determined, but is not limited to, by: the number of blocks (blocks, one Block corresponds to a part of messages, for example Bolck corresponds to a first part of messages) divided by the messages in the target data stream is set through a chip in the switch, and the number of messages in the target data stream is divided by the number of blocks to obtain the number of messages (corresponding to the preset number of messages) included in each Block, or the preset number of messages is set directly through the chip in the switch.
Fig. 3 is a schematic diagram of an optional slice Block according to an embodiment of the present application, where, as shown in fig. 3, the chip support configures the size of the Block (corresponding to the preset number of messages). By default, the slice module in the chip sets the Block number to 256, that is, the elephant stream is divided into 256 blocks, the IP packet sequence number is at most 0 to 65535, then the packet with the sequence number of 0 to 255 belongs to the first Block, for example, but not limited to, dividing the messages with the Identification field value of 0x0000 to 0x00FF into Block 0, dividing the messages with the Identification field value of 0x0100 to 0x01FF into Block 1.
In the technical solution provided in step S204, the second portion of messages and the first portion of messages include a plurality of messages sequentially sent in the target data stream, and it can be understood that the last message in the second portion of messages and the first message in the first portion of messages are sent adjacently.
In order to improve the message sending efficiency, the sending state of the sent message in the target data stream may be but not limited to detected, so as to determine whether to continue sending the first partial message through the second port, or optionally, in this embodiment, whether to continue sending the first partial message through the second port may also be determined, but not limited to, according to the sending state of each partial message in the N partial messages sent by the second port, where N is a positive integer greater than or equal to 2.
As an optional example, it may be, but not limited to, determining whether to send each message in the first partial message through the second port according to the sending state of each message in the sent third partial message and the sending state of each message in the sent second partial message in the target data stream, where the second port includes a port on the switch for sending each message in the second partial message and a port of each message in the third partial message, and the sending order of each message in the third partial message is earlier than the sending order of each message in the second partial message.
In one exemplary embodiment, it may be determined whether to send each message in the first partial message through the second port according to the sending status of each message in the second partial message in the target data stream by, but not limited to: determining the message length and the sending duration of the second partial message sent through the second port, wherein the message length of the second partial message is equal to the sum of the message lengths of all the messages in the second partial message, and the sending duration is equal to the duration between the time when the first message in the second partial message starts to be sent through the second port and the time when the last message in the second partial message finishes to be sent through the second port; determining a sending rate to be equal to a value obtained by dividing the message length by the sending duration, wherein the sending rate is used for indicating the rate of sending the second part of messages through the second port; and under the condition that the sending rate is smaller than or equal to a preset sending rate threshold value, determining that each message in the first partial message is not sent through the second port.
Optionally, in this embodiment, when the sending rate is greater than the preset sending rate threshold, it may be understood that the load of the second port is lower, so that timely sending of the first portion of the message can be ensured, and in this case, it is determined that each message in the first portion of the message is sent through the second port.
Optionally, in this embodiment, the sending rate of each port on the switch may be, but not limited to, recorded in the target load table, and as an optional example, the sending rate of only the second port sending the second partial packet may be, but not limited to, recorded in the target load table, so that instantaneity of determining the port sending the first partial packet is improved. As another alternative example, but not limited to, the sending rate of the multiple ports may be recorded in the target load table, for example, the sending rate of the second port sending the second partial message and the sending rate of the third port sending the third partial message are recorded in the target load table, so that, in combination with the sending rates of the multiple ports of the sent partial messages, the rationality of determining the ports for sending the respective messages in the first partial message is improved.
In the technical solution provided in step S206, in the case that it is determined that each message in the first partial message is not sent through the second port, it may be understood that the load of the second port is higher at this time, and timely sending of the first partial message cannot be guaranteed.
Optionally, in this embodiment, in the case where it is determined that each message in the first partial packet is sent through the second port, the port for sending the first partial packet is not required to be re-determined, and each message in the first partial packet is directly sent through the first port. By the method, computer resources required by determining the port for transmitting the first partial message again are saved, the timely transmission of each message in the first partial message can be ensured, and the utilization rate of the computer resources is improved.
In one exemplary embodiment, the first port on the switch for sending each of the first partial messages may be determined, but is not limited to, by determining that each of the first partial messages is not sent through the second port: determining a first load balancing algorithm from a preset load balancing algorithm set, wherein the load balancing algorithm set comprises one or more load balancing algorithms, and the one or more load balancing algorithms comprise the first load balancing algorithm; the first port is determined from a first set of ports of the switch according to the first load balancing algorithm, wherein the first set of ports includes ports on the switch other than the second port.
Optionally, in this embodiment, the preset load balancing algorithm set may include, but is not limited to, one or more load balancing algorithms, and in this case, in order to improve the average of the messages sent by each port of the switch, a situation that loads of some ports are very high and loads of some ports are very low is avoided, so that multiple data flows (especially long flows) are easily collided on paths, which leads to link congestion and reduced application performance. The first port may be determined from ports other than the second port in the switch according to, but not limited to, a first load balancing algorithm.
Optionally, in this embodiment, each load balancing algorithm in the preset load balancing algorithm set may be, but not limited to, used for balancing the data volume of the packet sent by each port on the switch, for example, the preset load balancing algorithm set may be, but not limited to, a Round-robin (Round robin) mode, a HASH (HASH mode), a Dynamic load balance (dynamic link load), and so on, and the load balancing algorithm included in the load balancing algorithm set is not limited by the present application.
HASH mode: for example, according to five-tuple information of a source IP (Internet Protocol ) address, a destination IP address, a source port number, a destination port number and a protocol of a packet header, a corresponding hash value is calculated, and different data streams are dispersed on an equal cost multipath.
Round-robin mode: i.e. each equivalent route arriving at the same destination address in turn carries out forwarding of traffic. For the known unicast message, if the lengths of the messages are relatively close, the configuration can be selected to perform a packet-by-packet load sharing mode based on a round robin mode so as to balance traffic load.
Dynamic load balance (dynamic link load): and distributing the port with the lightest load to each path according to the current load of the port of the path by using the flow information perceived by the switching chip. This approach can improve the congestion caused by the Path selection collision using HASH routing in ECMP (Equal-Cost Multi-Path routing).
In one exemplary embodiment, the first load balancing algorithm may be, but is not limited to, determined from a set of preset load balancing algorithms by: randomly selecting a load balancing algorithm from the load balancing algorithm set as the first load balancing algorithm; or randomly selecting one load balancing algorithm from the load balancing algorithms except for the second load balancing algorithm in the load balancing algorithm set as the first load balancing algorithm, wherein the second port used for sending each message in the second partial message is a port determined according to the second load balancing algorithm.
Optionally, in this embodiment, the first load balancing algorithm may also be determined, but is not limited to, by: and selecting the load balancing algorithm with the largest use times from the load balancing algorithms except the second load balancing algorithm in the preset load balancing algorithm set as the first load balancing algorithm.
Optionally, in this embodiment, the first load balancing algorithm may also be determined, but is not limited to, by: and selecting the load balancing algorithm with the largest use times from a preset load balancing algorithm set as a first load balancing algorithm.
In one exemplary embodiment, the first port may be determined from a first set of ports of the switch according to the first load balancing algorithm by one of the following:
in a first manner, when the first load balancing algorithm includes a dynamic link load algorithm, determining a rate of sending a message of each port in the first group of ports, obtaining a first group of sending rates, and determining a port corresponding to a fastest sending rate in the first group of sending rates as the first port.
Alternatively, in the present embodiment, the first set of transmission rates may be obtained, but is not limited to, by: in the case that the first load balancing algorithm includes a dynamic link load algorithm (or referred to as Dynamic load balance (dynamic link load)), determining a rate of a last message sent by each port in the first group of ports to obtain a first group of sending rates, or determining a rate of a last M messages sent by each port in the first group of ports, and performing an average operation on the rates of the last M messages sent by each port in the first group of ports to obtain the first group of sending rates.
Optionally, in this embodiment, the rate of sending the packet by the r-th port of the Q ports may be determined, but is not limited to, by performing the following steps, where r is a positive integer less than Q, and the first set of ports includes the Q ports: and determining the rate of the messages sent by the r port as the length of the r message divided by the length of the r message, wherein the length of the r message sent is the sum of messages in a fourth part of messages sent by the r port last time, and the length of the r message sent is equal to the difference between the time when the first message in the fourth part of messages starts to be sent through the r port and the time when the last message in the fourth part of messages finishes being sent through the r port.
In a second manner, in the case that the first load balancing algorithm includes a round robin balancing algorithm, an ith port in the first group of ports is determined to be the first port, where each port in the first group of ports is set to send a message in turn, and i is a positive integer.
Alternatively, in this embodiment, in the case where the first load balancing algorithm includes a Round-robin (Round-robin) algorithm (or referred to as Round-robin mode), the partial packets in the target data stream are sent through ports on the switch in turn, and it is understood that the partial packets in the target data stream are distributed to ports on the switch in turn, and the second port is the port on the switch that is last to send the packet to the i-th port, which needs to be stated that the second port and the i-th port are not necessarily physically adjacent.
In a third mode, under the condition that the first load balancing algorithm includes a hash balancing algorithm, determining a hash seed corresponding to the first part of message, determining a target hash value corresponding to the first part of message according to the hash seed and a preset hash key value, and determining the first port corresponding to the target hash value from the hash value and ports with corresponding relations, wherein the ports on the switch have hash values corresponding to one another.
Optionally, in this embodiment, in the case where the first load balancing algorithm includes a Hash balancing algorithm (or referred to as a Hash mode), the Hash Seed corresponding to the first portion of the packet and the Hash Seed corresponding to each portion of the packet in the target data stream having the correspondence relationship are determined from the target load table, where the Hash Seed (Hash Seed) corresponding to each portion of the packet in the target data stream is recorded in the target load table, and the corresponding Hash value may be generated by using, but not limited to, the Hash Seed and the Hash Key (Hash Key), and it is noted that in the embodiment of the present application, the manner of generating the Hash value by using the Hash Seed and the Hash Key is not limited.
Optionally, in this embodiment, the state of the port (for example, whether the port (or referred to as an egress) transmitting each partial packet in the target data flow is congested) and whether rerouting is required (redetermining the port transmitting the partial packet) are recorded in the target load table, and as an alternative example, the state of the port is identified by the state identification in the target load table, for example, the egress is not congested by the identification of "0", the egress congestion is identified by the identification of "1", and whether the data amount of the data flow is greater than or equal to a preset data amount threshold is identified by the data flow identification in the target load table, for example, the data amount of the data flow is less than the preset data amount threshold by the identification of "0", in which case the data flow is not an elephant flow; by identifying "1" it is identified that the data amount of the data stream is greater than or equal to a preset data amount threshold, in which case the data stream is an elephant stream or the like. The target load table may be, but is not limited to being, as shown in table 1.
TABLE 1
In the reduced mode, each stream may be, but is not limited to, only requiring recording two blocks (previous and current) of information to provide basis for routing in order to reduce the time required to determine whether to continue sending individual ones of the first partial messages through the second port, as shown in table 2.
TABLE 2
In an exemplary embodiment, before the determining the first partial packet that has not been sent in the target data stream, the method further includes: determining load information of a second group of ports on the switch to obtain a group of load information, wherein the second group of ports are ports on the switch for sending messages in the target data stream; and determining whether the data volume of the target data flow is greater than or equal to the data volume threshold according to the set of load information.
Optionally, in this embodiment, the load information of the second group of ports on the switch may include, but is not limited to, a length of a message being sent by each port in the second group of ports, a time period when each port in the second group of ports has completed sending a part of the message in the data stream last time, and a rate at which each port in the second group of ports sends the message, and so on.
Alternatively, in this embodiment, at different time, the relationship between the data amount of the target data stream and the data amount threshold may be changed, for example, at time T1, the data amount of the target data stream is greater than or equal to the data amount threshold, and at time T2, the data amount of the target data stream is less than the data amount threshold. By the message transmission method in the embodiment of the application, whether the data volume of the target data flow is larger than or equal to the data volume threshold value is determined in real time.
In one exemplary embodiment, it may be determined whether the data amount of the target data stream is greater than or equal to the data amount threshold based on the set of load information by one of the following:
In a first manner, when the set of load information includes a flow ratio of each port in the second set of ports, and when the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold, determining that a data flow of the target data flow is greater than or equal to the data volume threshold, where the flow ratio of a jth port in the second set of ports is equal to a number of messages being sent by the jth port divided by a maximum number of messages allowed to be sent by the jth port, and j is a positive integer.
In a second mode, when the set of load information includes a flow rate ratio of each port in the second set of ports, and a duration that the flow rate ratio of each port in the second set of ports is greater than or equal to a preset flow rate ratio threshold, and the duration that the flow rate ratio of each port in the second set of ports is greater than or equal to the flow rate ratio threshold is greater than or equal to a preset duration threshold, determining that the data size of the target data flow is greater than or equal to the data size threshold.
Optionally, in this embodiment, it may also be determined, but not limited to, whether the data amount of the target data stream is greater than or equal to the data amount threshold by: and under the condition that the receiving rate of the message of the target data flow to be forwarded received by the switch is greater than or equal to a preset receiving rate threshold, determining that the data volume of the target data flow is greater than or equal to a preset data volume threshold.
Optionally, in this embodiment, the maximum number of messages allowed to be sent by the jth port may be determined according to, but not limited to, the bandwidth of the jth port and the maximum number of messages allowed to be sent by the jth port may be in a proportional relationship, for example, the greater the bandwidth of the jth port, the greater the maximum number of messages allowed to be sent by the jth port.
In order to better understand the method for sending a message in the embodiment of the present application, the following description will explain and explain, with reference to an optional embodiment, whether the data amount threshold of the data flow in the embodiment of the present application is greater than or equal to the preset data amount, which may be but not limited to being applicable to the embodiment of the present application.
The embodiment of the application can be used for but not limited to two detection, wherein the first detection is carried out, the chip is identified according to a detection template configured by a user, and the template supports the following mode to identify the elephant flow: i. the proportion of the total flow of the port in the time period; duration of flow; user configured minimum rate; detecting for the second time, after the chip IP message is based on the slicing, detecting the real elephant flow for each block, the proportion of the total flow of the port, the duration of the flow, the sending speed and the identification algorithm of the flow; the twice identification mode improves the identification accuracy of the elephant flow, and the elephant flow supports the marking according to the blocks, thereby providing necessary basis for whether the subsequent blocks reroute.
FIG. 4 is a schematic diagram of an alternative determination of whether a data stream is an elephant stream, according to an embodiment of the application, as shown in FIG. 4, may include, but is not limited to, the following steps:
step 402, a flow table is built according to the IP five-tuple.
Step 404, detecting the elephant flow according to the Block granularity.
Step 406, determining whether the bandwidth ratio is satisfied within a unit time, if it is determined that the bandwidth ratio is satisfied, executing step 412, and if it is determined that the bandwidth ratio is not satisfied, executing step 408.
Step 408, determining whether the flow duration meets the requirement, if it is determined that the requirement is met, executing step 412, and if it is determined that the requirement is not met, executing step 410.
Step 410, determining whether the minimum rate (corresponding to the preset receiving rate threshold) requirement is satisfied, if yes, executing step 412, and if not, executing step 404.
At step 412, an elephant flow table is created.
Fig. 5 is a schematic diagram of an alternative message sending method according to an embodiment of the present application, as shown in fig. 5, which may include, but is not limited to, the following steps:
Step 501, detecting an elephant flow and building a table.
Step 502, the current bolck information is recorded for the IP flow slice.
Step 503, taking the previous Block information to decide whether to reroute, and if so, executing steps 504 to 505, 509 to 510, or executing steps 506 to 507, 509 to 510, or executing steps 508 to 510.
It will be appreciated that the switch chip comprehensively decides whether the next block is to be rerouted based on the statistics of records of the previous block of the same stream. The elephant flow analysis and the outlet congestion condition of the last block provide basis for whether the next block is rerouted or not, and the chip only reroutes the blocks meeting the conditions, and can effectively avoid the disorder problem by sensing the sending condition of the previous block and then carrying out load balancing. As to whether to reroute or not, the chip supports two configuration modes: one is the elephant flow flag (corresponding to whether the data volume of the data flow is greater than or equal to a preset data volume threshold value) and whether the exit is congested (corresponding to the speed of the sending rate), and both conditions are met to re-route; the other is whether the elephant flow flag or the exit is congested, and both conditions are met for rerouting as soon as they are.
Step 504, dynamic routing is enabled.
Step 505, trigger the chip to select the path with the least load.
In step 506, polling routing is enabled.
Step 507, polling different blocks of the same stream.
And step 508, selecting a static link according to the message hash value.
Step 509, send the message using the selected path.
At step 510, the statistical block sends information to update the elephant flow table (corresponding to the target load table).
By the method, compared with the related art, the load balancing method at the stream level transmits the data packets of the same stream on the same path, and the problem of disorder can be effectively avoided. However, under the network traffic with high dynamic and strong burst, the static load balancing method is not only easy to generate tailing caused by congestion and collision, but also can not flexibly switch paths, and is difficult to fully utilize network bandwidth. In order to fully utilize network bandwidth, many load balancing schemes use data packets as the scheduling granularity. The packet-level load balancing scheme can fully utilize multipath resources and improve the utilization rate of the network. However, under an asymmetric topology, the packet-level scheme is very prone to out-of-order problems, resulting in reduced TCP (Transmission Control Protocol ) performance.
By the message sending method in the embodiment of the application, the IP stream (equivalent to the data stream) is sliced according to the identifier (equivalent to the message identifier) and is decomposed into a plurality of blocks. Through the flow analysis technology of the exchange chip, the rerouting is accurately controlled, the condition of network congestion is greatly optimized on the basis of not changing a load balancing algorithm, and meanwhile, the effective bandwidth of the network is improved. The method comprises the steps of slicing an elephant flow, dividing the elephant flow into a plurality of sections of data blocks, and providing accurate control for the route selection of each data block by adopting an accurate and efficient analysis mode. The network efficiency is greatly improved. The slicing scheme designs a multi-packet granularity load balancing scheme with adjustable sensitivity so as to avoid the problem of disorder of data messages and ensure the orderly sending of the messages.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present application.
Fig. 6 is a block diagram of a message transmitting apparatus according to an embodiment of the present application; as shown in fig. 6, includes:
a first determining module 602, configured to determine, in a case where a data amount of a target data flow to be sent on a switch is greater than or equal to a preset data amount threshold, a first partial packet that has not yet been sent in the target data flow;
A second determining module 604, configured to determine whether to send each message in the first partial message through a second port according to a sending state of each message in a second partial message in the target data stream, where the second port includes a port on the switch for sending each message in the second partial message, and the second partial message includes at least a part of the messages sent in the target data stream;
A third determining module 606, configured to determine a first port on the switch for sending each message in the first partial message, and send each message in the first partial message through the first port, where it is determined that each message in the first partial message is not sent through the second port.
Through the foregoing embodiment, in the embodiment of the present application, in the case where the data amount of the target data stream to be sent on the switch is greater than or equal to the preset data amount threshold, it may be indicated that the packet Wen Jiaoduo in the target data stream has not yet been sent, in this case, but not limited to determining the first partial packet in the packet that has not yet been sent in the target data stream, determining, according to the sending state of the second partial packet that has been sent in the target data stream, whether to continue sending each packet in the first partial packet through the second port that sends each packet in the second partial packet, and in the case where it is determined that each packet in the first partial packet is not sent through the second port, it may be understood that the possibility that congestion of the second port is high, and continuing sending each packet in the first partial packet through the second port may result in a higher delay or packet loss, and then, but not limited to sending each packet in the first partial packet through the redetermined first port. By means of the method, the data flow with larger data volume is decomposed into multiple parts of messages, the sending state of each part of messages is analyzed, accurate control of rerouting of the subsequent part of messages which are not sent is achieved, the condition of network congestion is greatly optimized, and meanwhile the effective bandwidth of the network is improved. By adopting the technical scheme, the problems of lower message sending efficiency and the like in the related technology are solved, and the technical effect of improving the message sending efficiency is realized.
In one exemplary embodiment, the first determining module includes:
A first determining unit, configured to determine a packet identifier carried in each packet in the target data stream, to obtain a set of packet identifiers, where each packet identifier in the set of packet identifiers is used to indicate a sending sequence of each packet in the target data stream, and the sending sequence is used to indicate a sequence of sending each packet in the target data stream by the switch;
And the second determining unit is used for determining a first part of messages which are not transmitted yet in the target data stream according to the sequence of the transmission sequence and the preset message number, wherein the message number in the first part of messages is the preset message number, and the transmission sequence of the first part of messages is earlier than the transmission sequence of the messages except the first part of messages in the messages which are not transmitted yet in the target data stream.
In an exemplary embodiment, the second determining module includes:
A third determining unit, configured to determine a message length and a sending duration of the second partial message sent through the second port, where the message length of the second partial message is equal to a sum of message lengths of respective messages in the second partial message, and the sending duration is equal to a duration between a time when the second port starts to send a first message in the second partial message and a time when the second port finishes sending a last message in the second partial message;
a fourth determining unit, configured to determine a sending rate to be equal to a value obtained by dividing the message length by the sending duration, where the sending rate is used to represent a rate of sending the second portion of the message through the second port;
And a fifth determining unit, configured to determine not to send each message in the first partial message through the second port when the sending rate is less than or equal to a preset sending rate threshold.
In an exemplary embodiment, the third determining module includes:
A sixth determining unit, configured to determine a first load balancing algorithm from a preset load balancing algorithm set, where the load balancing algorithm set includes one or more load balancing algorithms, and the one or more load balancing algorithms include the first load balancing algorithm;
a seventh determining unit, configured to determine, according to the first load balancing algorithm, the first port from a first group of ports of the switch, where the first group of ports includes ports on the switch other than the second port.
In an exemplary embodiment, the sixth determining unit is configured to:
Randomly selecting a load balancing algorithm from the load balancing algorithm set as the first load balancing algorithm; or randomly selecting one load balancing algorithm from the load balancing algorithms except for the second load balancing algorithm in the load balancing algorithm set as the first load balancing algorithm, wherein the second port used for sending each message in the second partial message is a port determined according to the second load balancing algorithm.
In an exemplary embodiment, the seventh determining unit is configured to one of:
Under the condition that the first load balancing algorithm comprises a dynamic link load algorithm, determining the rate of sending messages of all ports in the first group of ports to obtain a first group of sending rates, and determining a port corresponding to the fastest sending rate in the first group of sending rates as the first port;
Determining an ith port in the first group of ports as the first port under the condition that the first load balancing algorithm comprises a round robin balancing algorithm, wherein each port in the first group of ports is set to send messages in turn, and i is a positive integer;
Under the condition that the first load balancing algorithm comprises a hash balancing algorithm, determining a hash seed corresponding to the first part of message, determining a target hash value corresponding to the first part of message according to the hash seed and a preset hash key value, and determining the first port corresponding to the target hash value from the hash value and ports with corresponding relations, wherein the ports on the switch have hash values corresponding to one another.
In an exemplary embodiment, the apparatus further comprises:
A fourth determining module, configured to determine load information of a second set of ports on the switch before the first portion of the packets that have not been sent are determined in the target data flow, to obtain a set of load information, where the second set of ports are ports on the switch that are used to send the packets in the target data flow;
and a fifth determining module, configured to determine, according to the set of load information, whether the data amount of the target data flow is greater than or equal to the data amount threshold.
In an exemplary embodiment, the fifth determining module includes one of:
An eighth determining unit, configured to determine, when the set of load information includes a flow ratio of each port in the second set of ports, that a data flow of the target data flow is greater than or equal to the data volume threshold when the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold, where the flow ratio of a jth port in the second set of ports is equal to a number of messages being sent by the jth port divided by a maximum number of messages allowed to be sent by the jth port, and j is a positive integer;
A ninth determining unit, configured to determine that, when the set of load information includes a flow ratio of each port in the second set of ports and a duration in which the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold, and the duration in which the flow ratio of each port in the second set of ports is greater than or equal to the flow ratio threshold is greater than or equal to a preset duration threshold, the data amount of the target data flow is greater than or equal to the data amount threshold.
An embodiment of the present application also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
S1, determining a first partial message which is not transmitted in a target data stream to be transmitted on a switch under the condition that the data amount of the target data stream is greater than or equal to a preset data amount threshold value;
S2, determining whether to send each message in the first partial message through a second port according to the sending state of each message in a second partial message in the target data stream, wherein the second port comprises a port on the switch for sending each message in the second partial message, and the second partial message comprises at least part of the messages sent in the target data stream;
S3, under the condition that each message in the first part of messages is determined not to be sent through the second port, determining a first port on the switch for sending each message in the first part of messages, and sending each message in the first part of messages through the first port.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
S1, determining a first partial message which is not transmitted in a target data stream to be transmitted on a switch under the condition that the data amount of the target data stream is greater than or equal to a preset data amount threshold value;
S2, determining whether to send each message in the first partial message through a second port according to the sending state of each message in a second partial message in the target data stream, wherein the second port comprises a port on the switch for sending each message in the second partial message, and the second partial message comprises at least part of the messages sent in the target data stream;
S3, under the condition that each message in the first part of messages is determined not to be sent through the second port, determining a first port on the switch for sending each message in the first part of messages, and sending each message in the first part of messages through the first port.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a removable hard disk, a magnetic disk, or an optical disk, etc., which can store program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (11)

1. A method for sending a message, comprising:
determining a first partial message which is not transmitted in a target data flow under the condition that the data volume of the target data flow to be transmitted on a switch is greater than or equal to a preset data volume threshold value;
Determining whether to send each message in the first partial message through a second port according to the sending state of each message in a second partial message in the target data stream, wherein the second port comprises a port on the switch for sending each message in the second partial message, and the second partial message comprises at least part of the sent messages in the target data stream;
And under the condition that each message in the first part of messages is not transmitted through the second port, determining a first port on the switch for transmitting each message in the first part of messages, and transmitting each message in the first part of messages through the first port.
2. The method of claim 1, wherein determining the first portion of messages in the target data stream that have not been sent comprises:
Determining message identifications carried in each message in the target data stream to obtain a group of message identifications, wherein each message identification in the group of message identifications is used for representing the sending sequence of each message in the target data stream through the switch, and the sending sequence is used for representing the sequence of each message in the target data stream sent by the switch;
Determining a first partial message which is not transmitted in the target data stream according to the sequence of the transmission sequence and the preset message number, wherein the message number in the first partial message is the preset message number, and the transmission sequence of the first partial message is earlier than the transmission sequence of the messages except the first partial message in the messages which are not transmitted in the target data stream.
3. The method according to claim 1, wherein determining whether to send each message in the first partial message through the second port according to the sending status of each message in the second partial message in the target data stream comprises:
Determining the message length and the sending duration of the second partial message sent through the second port, wherein the message length of the second partial message is equal to the sum of the message lengths of all the messages in the second partial message, and the sending duration is equal to the duration between the time when the first message in the second partial message starts to be sent through the second port and the time when the last message in the second partial message finishes to be sent through the second port;
Determining a sending rate to be equal to a value obtained by dividing the message length by the sending duration, wherein the sending rate is used for indicating the rate of sending the second part of messages through the second port;
And under the condition that the sending rate is smaller than or equal to a preset sending rate threshold value, determining that each message in the first partial message is not sent through the second port.
4. The method of claim 1, wherein determining the first port on the switch for sending each of the first partial messages if it is determined that each of the first partial messages is not sent through the second port comprises:
Determining a first load balancing algorithm from a preset load balancing algorithm set, wherein the load balancing algorithm set comprises one or more load balancing algorithms, and the one or more load balancing algorithms comprise the first load balancing algorithm;
The first port is determined from a first set of ports of the switch according to the first load balancing algorithm, wherein the first set of ports includes ports on the switch other than the second port.
5. The method of claim 4, wherein determining a first load balancing algorithm from a set of preset load balancing algorithms comprises:
Randomly selecting a load balancing algorithm from the load balancing algorithm set as the first load balancing algorithm; or alternatively
And randomly selecting one load balancing algorithm from the load balancing algorithms except for a second load balancing algorithm in the load balancing algorithm set as the first load balancing algorithm, wherein the second port used for sending each message in the second partial message is a port determined according to the second load balancing algorithm.
6. The method of claim 4, wherein said determining said first port from said first set of ports of said switch according to said first load balancing algorithm comprises one of:
Under the condition that the first load balancing algorithm comprises a dynamic link load algorithm, determining the rate of sending messages of all ports in the first group of ports to obtain a first group of sending rates, and determining a port corresponding to the fastest sending rate in the first group of sending rates as the first port;
Determining an ith port in the first group of ports as the first port under the condition that the first load balancing algorithm comprises a round robin balancing algorithm, wherein each port in the first group of ports is set to send messages in turn, and i is a positive integer;
Under the condition that the first load balancing algorithm comprises a hash balancing algorithm, determining a hash seed corresponding to the first part of message, determining a target hash value corresponding to the first part of message according to the hash seed and a preset hash key value, and determining the first port corresponding to the target hash value from the hash value and ports with corresponding relations, wherein the ports on the switch have hash values corresponding to one another.
7. The method according to any one of claims 1 to 6, wherein before said determining the first partial message in the target data stream that has not yet been sent, the method further comprises:
Determining load information of a second group of ports on the switch to obtain a group of load information, wherein the second group of ports are ports on the switch for sending messages in the target data stream;
And determining whether the data volume of the target data flow is greater than or equal to the data volume threshold according to the set of load information.
8. The method of claim 7, wherein said determining whether the data amount of the target data stream is greater than or equal to the data amount threshold based on the set of load information comprises one of: when the set of load information includes the flow ratio of each port in the second set of ports, determining that the data flow of the target data flow is greater than or equal to the data volume threshold value when the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold value, wherein the flow ratio of a j-th port in the second set of ports is equal to the number of messages being sent by the j-th port divided by the maximum number of messages allowed to be sent by the j-th port, and j is a positive integer; and determining that the data volume of the target data flow is greater than or equal to the data volume threshold under the condition that the set of load information comprises the flow ratio of each port in the second set of ports and the duration that the flow ratio of each port in the second set of ports is greater than or equal to a preset flow ratio threshold and the duration that the flow ratio of each port in the second set of ports is greater than or equal to the flow ratio threshold is greater than or equal to a preset duration threshold.
9. A message transmitting apparatus, comprising:
A first determining module, configured to determine, in a target data flow to be sent on a switch, a first partial packet that has not yet been sent, if a data amount of the target data flow is greater than or equal to a preset data amount threshold;
A second determining module, configured to determine whether to send each message in the first partial message through a second port according to a sending state of each message in a second partial message in the target data stream, where the second port includes a port on the switch for sending each message in the second partial message, and the second partial message includes at least a part of the messages sent in the target data stream;
And the third determining module is used for determining a first port on the switch for sending each message in the first partial message under the condition that each message in the first partial message is determined not to be sent through the second port, and sending each message in the first partial message through the first port.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the method of any of claims 1 to 8 by means of the computer program.
CN202410123106.4A 2024-01-29 2024-01-29 Message sending method and device, storage medium and electronic device Pending CN117978739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410123106.4A CN117978739A (en) 2024-01-29 2024-01-29 Message sending method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410123106.4A CN117978739A (en) 2024-01-29 2024-01-29 Message sending method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117978739A true CN117978739A (en) 2024-05-03

Family

ID=90847257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410123106.4A Pending CN117978739A (en) 2024-01-29 2024-01-29 Message sending method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117978739A (en)

Similar Documents

Publication Publication Date Title
CN106998302B (en) Service flow distribution method and device
Prabhavat et al. Effective delay-controlled load distribution over multipath networks
US8279753B2 (en) Efficient determination of fast routes when voluminous data is to be sent from a single node to many destination nodes via other intermediate nodes
US9007906B2 (en) System and method for link aggregation group hashing using flow control information
EP3496346B1 (en) Data message forwarding method and apparatus
EP2702731A1 (en) Hierarchical profiled scheduling and shaping
CN107613528B (en) Method and system for controlling service flow
US9350631B2 (en) Identifying flows causing undesirable network events
CN108965121A (en) Transmit method, host and the interchanger of data
CN112804075A (en) Method, device and system for sending message and receiving message for OAM (operation administration and maintenance)
CN107547425B (en) Convergence layer data transmission method and system
JP6055553B2 (en) Queue scheduling method, apparatus and system
CN111404839B (en) Message processing method and device
US8660001B2 (en) Method and apparatus for providing per-subscriber-aware-flow QoS
CN116582493A (en) Data center network link selection method and device and electronic equipment
US11012378B2 (en) Methods and apparatus for shared buffer allocation in a transport node
CN117978739A (en) Message sending method and device, storage medium and electronic device
Nithin et al. Efficient load balancing for multicast traffic in data center networks using SDN
CN113839884B (en) Flow control method and device
CN110336759B (en) RDMA (remote direct memory Access) -based protocol message forwarding method and device
KR101395009B1 (en) Method and apparatus for selecting route
KR102128417B1 (en) Multiple path priority routing methods for wireless sensor network and routing apparatus for performing the same
CN113612698A (en) Data packet sending method and device
Balakiruthiga et al. A simple congestion avoidance mechanism for opendaylight (odl)-multipath tcp (mptcp) network structure in software defined data center (sddc)
CN113691459A (en) Data transmission method and device based on identification message

Legal Events

Date Code Title Description
PB01 Publication