Message sending method and device and electronic equipment
By merging the authorization request messages of the virtual queue, the payload and utilization rate of network transmission are improved, and the low utilization rate problem caused by the filling of authorization request messages in the virtual output queue is solved.
Patent Information
- Application Number
- CN202411291618.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-14
AI Technical Summary
In the prior art, the virtual output queue (VOQ) technology causes low payload due to filling of authorization request messages, resulting in low network transmission utilization.
By detecting the authorization status information of the virtual queue, multiple request messages are merged into target request messages, the payload of each message is increased, and the stream is actively pulled at the receiving end to avoid congestion.
It improves the utilization rate of network transmission, reduces the frequency of authorized packets, and enhances the utilization efficiency of network bandwidth.
Smart Images

Figure CN119254732A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message sending method, device and electronic device. Background Art
[0002] With the rapid development of artificial intelligence technology, the scale of networks continues to increase, and the communication between network nodes is facing greater and greater challenges. In order to meet users' demand for network speed, network communication is evolving towards high bandwidth, low latency, and especially low long-tail latency.
[0003] At present, the relevant technologies for low long-tail latency include Virtual Output Queue (VOQ) technology, which distributes the messages received in the network to different virtual output queues to avoid the network delay caused by header blocking. The above technology makes an authorization request for each virtual output queue. Since the authorization request message usually has a small number of bytes, each authorization target request message needs to be padded during transmission to meet the minimum byte requirement. However, the payload of the padded message is low, resulting in low utilization of network transmission. Summary of the invention
[0004] The embodiments of the present application provide a message sending method, device and electronic device to solve the problem that the effective load of the message is low, resulting in low utilization rate of network transmission.
[0005] To solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a message sending method, which is applied to a first device, and the method includes:
[0007] Detecting authorization status information of a virtual queue of the first device, where the authorization status information is used to indicate a resource status of remaining authorizations in the virtual queue;
[0008] Acquire N request messages to be sent to the second device triggered by the authorization status information, wherein each request message is used to apply for authorization from the second device or to request the second device to stop authorization;
[0009] The N request messages are combined into a target request message, and the target request message is sent to the second device, where N is an integer greater than or equal to 1.
[0010] Optionally, the acquiring N request messages to be sent to the second device triggered by the authorization status information includes at least one of the following:
[0011] When the authorization status information indicates that the state of the remaining authorized resources is switched from the first state to the second state, obtaining a first request message to be sent to the second device in real time;
[0012] When the authorization status information indicates that the state of the remaining authorized resources maintains the first state or the second state, obtaining a second request message to be sent to the second device at a predetermined time interval;
[0013] The N request messages include the first request message and / or the second request message.
[0014] Optionally, the first state is used to represent sufficient resources, the second state is used to represent insufficient resources, the first request message includes an authorization request message, and / or the second request message includes an authorization request message or a stop authorization request message;
[0015] or,
[0016] The first state is used to represent a lack of resources, the second state is used to represent sufficient resources, the first request message includes a stop authorization request message, and / or the second request message includes a stop authorization request message or an authorization request message;
[0017] The authorization request message is used to apply for authorization from the second device, and the stop authorization request message is used to request the second device to stop authorization.
[0018] Optionally, the target request message carries at least one of an authorization request identification bit, the identity identification number ID of the second device, the total number of request messages contained in the target request message, the port information of the second device, the priority information of the target request message, and the status of remaining authorized resources, wherein the authorization request identification bit is used to indicate the type of the target request message.
[0019] Optionally, the method further comprises:
[0020] If no message is received from the server within the first preset time period, the current virtual queue is deleted.
[0021] In a second aspect, an embodiment of the present application provides a message sending method, which is applied to a second device, and the method includes:
[0022] Determine the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device;
[0023] receiving a target request message sent by a first device, and determining a target weight of the number of authorization requests in the target request message relative to the number of all authorization requests received by the second device;
[0024] Determine a target authorization amount allocated by the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount;
[0025] The M response messages are combined into a target response message, and the target response message is sent to the first device, where M is an integer greater than or equal to 1.
[0026] Optionally, after determining the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device, the method further includes:
[0027] Determine the authorization amount of each virtual queue according to the authorization amount of each port and the scheduling relationship of the virtual queue corresponding to each port;
[0028] The step of determining the target authorization amount allocated by the first device according to the authorization amount of each port and the target weight includes:
[0029] The target authorization amount allocated by the first device is determined by a weighted average calculation method according to the authorization amount of each virtual queue and the target weight.
[0030] Optionally, the target response message carries at least one of an authorization response identification bit, the ID of the first device, the total number of response messages contained in the target response message, the port information of the second device, the priority information of the target response message, and the number of authorization messages, wherein the authorization response identification bit is used to indicate the type of the target response message.
[0031] Optionally, the method further comprises:
[0032] When no target request message sent by the first device is received within a second preset time period, stop allocating authorization to the virtual queue corresponding to the first device.
[0033] In a third aspect, an embodiment of the present application provides a message sending method, which is applied to a third device, and the method includes:
[0034] receiving a target message sent by a first target device, wherein the target message is formed by merging multiple messages;
[0035] Sending the target message to a second target device;
[0036] The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
[0037] Optionally, the target message carries an authorization identification bit, and the authorization identification bit is used to indicate the type of the target message;
[0038] The sending the target message to the second target device includes:
[0039] The target message is sent to the second target device according to a priority corresponding to the type of the target message.
[0040] In a fourth aspect, an embodiment of the present application provides a message sending device, which is applied to a first device, and the device includes:
[0041] a detection module, configured to detect authorization status information of a virtual queue of the first device, wherein the authorization status information is used to indicate a resource status of remaining authorizations in the virtual queue;
[0042] an acquisition module, configured to acquire N request messages to be sent to the second device triggered by the authorization status information, wherein each of the request messages is used to apply for authorization from the second device or to request the second device to stop authorization;
[0043] A sending module is used to merge the N request messages into a target request message and send the target request message to the second device, where N is an integer greater than or equal to 1.
[0044] Optionally, the acquisition module includes at least one of the following:
[0045] A first acquisition submodule, configured to acquire a first request message to be sent to the second device in real time when the authorization status information indicates that the state of the remaining authorized resources is switched from the first state to the second state;
[0046] A second acquisition submodule is used to acquire a second request message to be sent to the second device at a predetermined time interval when the authorization status information indicates that the remaining authorized resource status maintains the first state or the second state;
[0047] The N request messages include the first request message and / or the second request message.
[0048] Optionally, the first state is used to represent sufficient resources, the second state is used to represent insufficient resources, the first request message includes an authorization request message, and / or the second request message includes an authorization request message or a stop authorization request message;
[0049] or,
[0050] The first state is used to represent a lack of resources, the second state is used to represent sufficient resources, the first request message includes a stop authorization request message, and / or the second request message includes a stop authorization request message or an authorization request message;
[0051] The authorization request message is used to apply for authorization from the second device, and the stop authorization request message is used to request the second device to stop authorization.
[0052] Optionally, the target request message carries at least one of an authorization request identification bit, the identity identification number ID of the second device, the total number of request messages contained in the target request message, the port information of the second device, the priority information of the target request message, and the status of remaining authorized resources, wherein the authorization request identification bit is used to indicate the type of the target request message.
[0053] Optionally, the device further comprises:
[0054] The deleting module is used to delete the current virtual queue when no message is received from the server within a first preset time period.
[0055] In a fifth aspect, an embodiment of the present application provides a message sending device, which is applied to a second device, and the device includes:
[0056] A first determination module, configured to determine the authorization amount of each port according to the total authorization amount generated in a target time period and the bandwidth of each port of the second device;
[0057] A receiving module, configured to receive a target request message sent by a first device, and determine a target weight of the number of authorization requests in the target request message relative to the number of all authorization requests received by the second device;
[0058] A second determination module, configured to determine a target authorization amount allocated by the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount;
[0059] A sending module is used to merge the M response messages into a target response message and send the target response message to the first device, where M is an integer greater than or equal to 1.
[0060] Optionally, the device further comprises:
[0061] A third determining module, configured to determine the authorization amount of each virtual queue according to the authorization amount of each port and the scheduling relationship of the virtual queue corresponding to each port;
[0062] The second determining module is specifically used for:
[0063] The target authorization amount allocated by the first device is determined by taking a weighted average approach according to the authorization amount of each virtual queue and the target weight.
[0064] Optionally, the target response message carries at least one of an authorization response identification bit, the ID of the first device, the total number of response messages contained in the target response message, the port information of the second device, the priority information of the target response message, and the number of authorization messages, wherein the authorization response identification bit is used to indicate the type of the target response message.
[0065] Optionally, the device further comprises:
[0066] The allocation module is used to stop allocating authorization to the virtual queue corresponding to the first device when no target request message sent by the first device is received within a second preset time period.
[0067] In a sixth aspect, an embodiment of the present application provides a message sending device, which is applied to a third device, and the device includes:
[0068] A receiving module, used for receiving a target message sent by a first target device, wherein the target message is formed by merging multiple messages;
[0069] A sending module, used for sending the target message to a second target device;
[0070] The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
[0071] Optionally, the target message carries an authorization identification bit, and the authorization identification bit is used to indicate the type of the target message;
[0072] The sending module is specifically used for:
[0073] The target message is sent to the second target device according to a priority corresponding to the type of the target message.
[0074] In the seventh aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the message sending method described in the first aspect, the second aspect, or the third aspect.
[0075] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the message sending method described in the first aspect, the second aspect or the third aspect are implemented.
[0076] In a ninth aspect, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the message sending method as described in the first aspect, the second aspect or the third aspect.
[0077] In an embodiment of the present application, the first device combines N request messages to be sent to the second device into one message and then sends it, thereby increasing the effective load of each message and improving network utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0079] Figure 1 This is one of the flow charts of a message sending method provided in an embodiment of the present application;
[0080] Figure 2 This is the second flowchart of a message sending method provided in an embodiment of the present application;
[0081] Figure 3 This is the third flowchart of a message sending method provided in an embodiment of the present application;
[0082] Figure 4 This is one of the structural schematic diagrams of a message sending device provided in an embodiment of the present application;
[0083] Figure 5 This is a second structural diagram of a message sending device provided in an embodiment of the present application;
[0084] Figure 6 This is a third structural diagram of a message sending device provided in an embodiment of the present application;
[0085] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0087] The embodiments of the present application provide a message sending method, device and electronic device to solve the problem that the effective load of the message is low, resulting in low utilization rate of network transmission.
[0088] In related technologies, for low long-tail latency, a VOQ+Credit communication mechanism can be used. The Credit communication mechanism determines that the receiving end has sufficient cache space or processing power before sending data packets. The amount of packet data entering the switching network will not exceed the forwarding capacity of the entire network, thereby eliminating congestion probability with the maximum probability and optimizing long-tail latency.
[0089] When the above communication mechanism is used for scheduling, the relevant technology is to make a Credit authorization request and response for each VOQ. In this application, the authorization request and response are based on the device level rather than the queue level, and multiple authorization requests and responses are combined into one message for sending, which reduces the frequency of sending authorization messages and increases the payload of each authorization message, thereby improving network utilization. And the receiving end actively pulls the stream to avoid congestion with the greatest probability.
[0090] The embodiments of the present application are described in detail below.
[0091] See also Figure 1 , Figure 1 is a flowchart of a message sending method provided in an embodiment of the present application, which is applied to a first device, such as Figure 1 As shown, the method comprises the following steps:
[0092] Step 101: Detect authorization status information of a virtual queue of the first device, where the authorization status information is used to indicate a resource status of remaining authorizations in the virtual queue;
[0093] Step 102: Obtain N request messages to be sent to the second device triggered by the authorization status information, wherein each request message is used to apply for authorization from the second device or to request the second device to stop authorization;
[0094] Step 103: merge the N request messages into a target request message, and send the target request message to the second device, where N is an integer greater than or equal to 1.
[0095] The first device and the second device may be a source global scheduling processing device (GSP) and a destination GSP device, respectively. For example, the first device and the second device are access switches.
[0096] Before the first device and the second device send information, a virtual channel is first established between the first device and the second device, and the first device and the second device can send messages through the virtual channel.
[0097] Each interface of the first device may include multiple virtual queues, and the authorization status information of each virtual queue is detected. According to the authorization status information, it can be determined whether the remaining authorized resource status in the virtual queue is sufficient. The remaining authorized resource status can be determined by the relative size of the number of request messages to be sent and the number of authorizations. For example, the number of cached messages and the number of remaining tokens in the virtual queue are obtained. When the number of cached messages is greater than the number of remaining tokens, it indicates that the number of remaining tokens is insufficient, that is, the remaining authorized resource status is lacking; when the number of cached messages is less than the number of remaining tokens, it indicates that the number of remaining tokens is sufficient, that is, the remaining authorized resource status is sufficient.
[0098] The first device sends a request message to the second device according to the resource status corresponding to the authorization status information, so as to apply for authorization from the second device or request the second device to stop authorization. For example, when the resource status is sufficient, the first device is requested to stop authorization; when the resource status is insufficient, the first device is requested to authorize.
[0099] When multiple requests need to be sent to the second device, the first device combines the N request messages to be sent into a target request message, and sends the target request message to the second device. For example, if the size of each request message is 8B, when there are 8 request messages to be sent, these 8 request messages are packaged and combined into a target request message of 64B in size, and the target request message is sent to the second device.
[0100] When the request message is packaged, the size of the multiple request messages is determined according to the size of each request message to be sent, and when the size of the multiple request messages reaches a preset value (fixed message size value) or is close to the preset value, the target request message is sent to the second device. In extreme cases, for example, there may be only one valid queue between the two devices, and the message can also be sent using one request message.
[0101] The first device combines N request messages to be sent to the second device into one message and then sends it, which reduces the frequency of message sending, increases the effective load of each message, and improves network utilization.
[0102] Optionally, the acquiring N request messages to be sent to the second device triggered by the authorization status information includes at least one of the following:
[0103] When the authorization status information indicates that the state of the remaining authorized resources is switched from the first state to the second state, obtaining a first request message to be sent to the second device in real time;
[0104] When the authorization status information indicates that the state of the remaining authorized resources maintains the first state or the second state, obtaining a second request message to be sent to the second device at a predetermined time interval;
[0105] The N request messages include the first request message and / or the second request message.
[0106] The first state and the second state may be a resource sufficient state and a resource insufficient state respectively. When the state changes, the first device is triggered to send a first request message to the second device in real time to request authorization or stop authorization.
[0107] When the resource status remains unchanged, the first device sends a second request message to the second device at a predetermined time interval to request authorization or stop authorization. In this way, by periodically sending messages, it is possible to prevent information loss due to packet loss.
[0108] The N request messages to be sent by the first device to the second device may include multiple of the above-mentioned first request messages or multiple of the above-mentioned second request messages, and may also include the first request message and the second request message at the same time.
[0109] Optionally, the first state is used to represent sufficient resources, the second state is used to represent insufficient resources, the first request message includes an authorization request message, and / or the second request message includes an authorization request message or a stop authorization request message;
[0110] or,
[0111] The first state is used to represent a lack of resources, the second state is used to represent sufficient resources, the first request message includes a stop authorization request message, and / or the second request message includes a stop authorization request message or an authorization request message;
[0112] The authorization request message is used to apply for authorization from the second device, and the stop authorization request message is used to request the second device to stop authorization.
[0113] In an optional implementation, the first state is used to represent sufficient resources, and the second state is used to represent insufficient resources.
[0114] When the state of the remaining authorized resources switches from a sufficient state to a scarce state, the first device sends an authorization request message to the second device in real time.
[0115] When the remaining authorized resources remain in a sufficient state, the first device sends a stop authorization request message to the second device at a predetermined time interval; or, when the remaining authorized resources remain in a scarce state, the first device sends an apply authorization request message to the second device at a predetermined time interval.
[0116] In an optional implementation, the first state is used to represent a lack of resources, and the second state is used to represent sufficient resources.
[0117] When the resource status of the remaining authorization switches from the insufficient state to the sufficient state, the first device sends a stop authorization request message to the second device in real time.
[0118] When the remaining authorized resources remain in a lack state, the first device sends an authorization request message to the second device at a predetermined time interval; or, when the remaining authorized resources remain in a sufficient state, the first device sends a stop authorization request message to the second device at a predetermined time interval.
[0119] Through the above manner, sending an authorization request message to the second device or stopping the authorization request message according to the remaining authorized resource status can reduce information congestion and improve network transmission efficiency.
[0120] Optionally, the target request message carries at least one of an authorization request identification bit, the identity identification number ID of the second device, the total number of request messages contained in the target request message, the port information of the second device, the priority information of the target request message, and the status of remaining authorized resources, wherein the authorization request identification bit is used to indicate the type of the target request message.
[0121] The target request message carries an authorization request identification bit, which is used to indicate the type of the message. For example, the priority of the authorization request message is higher than that of the data message. When the core switch receives the target request message carrying the authorization request identification bit, it sends the target request message in priority to the data message.
[0122] The total number of request messages contained in the target request message is N;
[0123] The first device may include multiple ports, each port includes multiple queues, and information of each port may be obtained;
[0124] The priority information of the target request message can be understood as the priority of sending. High-priority messages are sent before low-priority messages.
[0125] The resource status of the remaining authorization can be understood as whether the remaining tokens are in a sufficient state or a lacking state.
[0126] By carrying the above information, the priority of the target request message can be determined, and the target request message is sent to the second device according to the priority, so that after receiving the target request message, the second device responds according to the information carried in the target request message.
[0127] Optionally, the method further comprises:
[0128] If no message is received from the server within the first preset time period, the current virtual queue is deleted.
[0129] The first device obtains a message sent by the server and sends it through a virtual queue. When no message sent by the server is received within a first preset time period, the current virtual queue is deleted or revoked. The first preset time period can be set according to actual conditions.
[0130] In the embodiment of the present application, the first device combines multiple request messages to be sent into one target request message and then sends it, which can increase the effective load of the message and thus improve the utilization rate of the network bandwidth.
[0131] See also Figure 2 , Figure 2 is a flowchart of a message sending method provided in an embodiment of the present application, which is applied to a second device, such as Figure 2 As shown, the method comprises the following steps:
[0132] Step 201: Determine the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device;
[0133] Step 202: Receive a target request message sent by the first device, and determine a target weight of the number of authorization requests in the target request message in the total number of authorization requests received by the second device;
[0134] Step 203: Determine a target authorization amount allocated to the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount;
[0135] Step 204: Merge the M response messages into a target response message, and send the target response message to the first device, where M is an integer greater than or equal to 1.
[0136] The second device periodically generates authorization (e.g., token) and allocates authorization to the request sender according to the authorization request. Assuming that the time interval between two authorization generation operations is Δt, and the total bandwidth of the second device's downlink server is B (bps), the total amount of authorization generated by the second device within Δt is Δt×B×Speed_up_factor÷8 (Byte). Since there is a certain jitter in the forwarding delay of the authorization signaling between the first device and the second device, in order to absorb the jitter, the second device sets a certain acceleration ratio Speed_up_factor for the authorization, for example, set it to 1.05.
[0137] The second device divides the total amount of authorization generated into each slice using the bandwidth of the forwarding chip slice as the weight, and generates authorization for each slice. Each slice then divides the authorization of the slice into ports using the bandwidth of its downstream port as the weight, and generates authorization for each port.
[0138] After receiving the request message sent by the sending end device (including the first device), the second device allocates authorization according to the weight of the number of each authorization request in the total number of authorization requests.
[0139] Among them, the number of authorization requests contained in the target request message sent by the first device can be understood as the authorization quantity requested for allocation. The first device sends the authorization message to the second device according to the authorization allocated by the second device, so as to avoid information congestion.
[0140] For example, the second device receives authorization requests from three sending devices. The first device requests 3 authorizations, the second device requests 6 authorizations, and the third device requests 1 authorization. The second device calculates the weight of the authorizations requested by each device as a percentage of the total generated authorizations. The weight of the first device is 30%, the weight of the second device is 60%, and the weight of the third device is 10%.
[0141] After determining the authorization amount of each port, the second device obtains the authorization amount of the port corresponding to the first device, performs weighted averaging based on the authorization amount of each port and the request weight of the device corresponding to each port, and distributes it to each sending end device.
[0142] When the second device sends a response message to the first device, it merges the M response messages into a target response message and sends the target response message to the first device. In this way, the payload of the message can be increased and the network utilization rate can be improved. The second device calculates the authorization of each device by weighted average according to the authorization amount of each port and the request weight of each device, which can reduce congestion.
[0143] Optionally, after determining the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device, the method further includes:
[0144] Determine the authorization amount of each virtual queue according to the authorization amount of each port and the scheduling relationship of the virtual queue corresponding to each port;
[0145] The step of determining the target authorization amount allocated by the first device according to the authorization amount of each port and the target weight includes:
[0146] The target authorization amount allocated by the first device is determined by a weighted average calculation method according to the authorization amount of each virtual queue and the target weight.
[0147] After the second device distributes the periodically generated authorization amount to the port, each port further divides the port authorization into flow queues according to the scheduling relationship of the queues under it, and determines the authorization amount of each virtual queue. If the queue belongs to Strict Priority (SP) scheduling, it is given priority to the high priority queue. If it is Weighted Fair Queuing (WFQ) scheduling, it is divided according to the weight to realize the authorization generation of each queue.
[0148] The second device uses the request status value (number of authorization requests) of each sending device (including the first device) as a weight, and according to the correspondence between each queue and the device, distributes the generated authorizations of each queue to each sending device (including the first device) in a weighted average manner.
[0149] Optionally, the target response message carries at least one of an authorization response identification bit, the ID of the first device, the total number of response messages contained in the target response message, the port information of the second device, the priority information of the target response message, and the number of authorization messages, wherein the authorization response identification bit is used to indicate the type of the target response message.
[0150] The authorization response flag is used to indicate the type of the target response message. When the message type is an authorization message, it indicates a higher priority, and the message is sent first. The total number of response messages included in the target response message is M; the number of authorization messages can be understood as the actual length of the message allowed to be sent.
[0151] By carrying the above information, after receiving the response message, the first device can obtain authorization according to the above information.
[0152] Optionally, the method further comprises:
[0153] When no target request message sent by the first device is received within a second preset time period, stop allocating authorization to the virtual queue corresponding to the first device.
[0154] The second preset time period can be set according to actual conditions.
[0155] In this embodiment, the second device packages and merges multiple response messages to be sent to the first device into a target response message before sending it, which can increase the effective load of the message and improve network utilization. In addition, the first device sends the message according to the authorization of the second device, which can reduce data congestion.
[0156] See also Figure 3 , Figure 3 is a flowchart of a message sending method provided in an embodiment of the present application, which is applied to a third device, such as Figure 3 As shown, the method comprises the following steps:
[0157] Step 301: Receive a target message sent by a first target device, where the target message is formed by merging multiple messages;
[0158] Step 302: Send the target message to the second target device;
[0159] The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
[0160] In the case where the first target device is the first device and the second target device is the second device, the target message is merged from a plurality of request messages, and the third device sends the target message to the second device.
[0161] In the case where the first target device is the second device and the second target device is the first device, the target message is merged from a plurality of response messages, and the third device sends the target message to the first device.
[0162] Optionally, the target message carries an authorization identification bit, and the authorization identification bit is used to indicate the type of the target message;
[0163] The sending the target message to the second target device includes:
[0164] The target message is sent to the second target device according to a priority corresponding to the type of the target message.
[0165] In the case where the first target device is the first device and the second target device is the second device, the third device receives the target message sent by the first device, checks whether the message header of the target message carries an authorization identification bit, and forwards it to the second device according to the priority corresponding to the type of the target message;
[0166] In the case where the first target device is the second device and the second target device is the first device, the third device receives the target message sent by the second device, checks whether the message header of the target message carries the authorization identification bit, and forwards it to the first device according to the priority corresponding to the type of the target message. Among them, the message carrying the authorization identification bit is forwarded with high priority, and the message not carrying the authorization identification bit is forwarded as normal.
[0167] The third device is, for example, a core switch or a data center switch.
[0168] For ease of understanding, the present embodiment is described below by way of example. The message sending method includes the following steps:
[0169] 1. The source global scheduling processing device (GSP) binds the dynamic global scheduling queue (DGSQ) with the destination GSP and the destination GSP outbound interface;
[0170] 2. The source GSP records the number of cached messages and the number of remaining tokens in the DGSQ. If the number of cached messages is greater than the number of remaining tokens, the Request State is set to 1. If the number of cached messages is less than the number of remaining tokens, the Request State is set to 0.
[0171] 3. The source GSP checks the status of Request State before sending each data message. If Request State changes from 0 to 1, it means that the number of remaining tokens is insufficient. At this time, the source GSP sends an authorization request message to the destination GSP in real time to apply for authorization; if Request State changes from 1 to 0, it means that the number of remaining tokens is sufficient. At this time, the source GSP sends an authorization request message to the destination GSP in real time to stop authorization; if Request State remains at 1, it means that the number of remaining tokens is insufficient. At this time, the source GSP regularly sends an authorization request message to the destination GSP at a certain time interval to apply for authorization; if Request State remains at 0, it means that the number of remaining tokens is sufficient. At this time, the source GSP regularly sends an authorization request message to the destination GSP at a certain time interval to stop authorization.
[0172] 4. When the source GSP sends an authorization request, it takes the destination GSP as the unit, and all authorization requests under the same destination GSP are merged into one authorization request message. The size of the authorization request message is fixed at 64B. If there are too many authorization requests to be packaged, and the packaged size exceeds 64B, it will be split into multiple authorization request messages. The authorization request message carries the authorization request identification bit to indicate that it is an authorization request message, and carries the destination GSP-ID, the total number of authorization requests covered by this authorization request, port information and priority information, and authorization request status information.
[0173] 5. After receiving the message, the Global Scheduling Ethernet Fabric (GSF) device checks whether the message header carries the authorization request flag. If it does, it directly forwards it with high priority. If not, it forwards it normally.
[0174] 6. The destination GSP periodically performs authorization generation operations.
[0175] 7. The destination GSP divides the total amount of authorization generated into each slice using the bandwidth of the forwarding chip slice as the weight. Each slice then divides the slice's authorization into ports using the bandwidth of its downstream port as the weight. Each port then divides the port's authorization into flow queues based on the scheduling relationship of its downstream queues, thereby realizing authorization generation for each queue.
[0176] 8. After receiving the authorization request message, the destination GSP uses the authorization request status value of each source DGSQ as the weight and distributes the generated queue authorizations to each source DGSQ in a weighted average.
[0177] 9. The authorization response sent by the destination GSP is based on the source GSP, and all authorization responses under the same source GSP are merged into one message. The size of the authorization response message is fixed at 64B. If there are too many authorization requests to be packaged, and the packaged size exceeds 64B, it will be split into multiple authorization response messages. The authorization response message carries the authorization response identification bit to indicate that it is an authorization response message, and carries the source GSP-ID, the total number of authorization responses covered by this authorization request, port information and priority information, and the number of authorizations.
[0178] 10. After receiving the message, the GSF device checks whether the message header carries the authorization response flag. If it does, it will directly forward it with high priority. If not, it will forward it normally.
[0179] 11. If the DGSQ of the source GSP does not receive a message from the server for a period of time, the DGSQ will be aged.
[0180] 12. If the destination GSP does not receive a DGSQ authorization request message from the source GSP within a period of time, it will stop allocating authorization to the DGSQ.
[0181] Intelligent computing services have high requirements for bandwidth and latency. In order to improve bandwidth utilization and reduce long-tail latency, when the VOQ+Credit mechanism is adopted, messages will be sent to each VOQ only when there are sufficient Credits. However, currently both authorization requests and authorization responses are based on VOQ granularity. In a 16kGPU scale network, there are at least 16K VOQs in the intelligent computing center, and the length of the authorization signaling message is generally only 20 to 30 bytes. In order to meet the Ethernet minimum 64-byte limit, a large amount of invalid information needs to be filled in. The frequent interaction of authorization requests and responses greatly affects the network bandwidth.
[0182] The authorization request and response of this application are based on devices. The network is networked on a 16K GPU scale, with approximately 500 GSP devices, which greatly reduces the frequency of sending authorization requests and responses. Secondly, multiple authorization requests and responses are merged into one message, breaking through the minimum 64-byte limit of Ethernet, increasing the payload of the message, and thus improving network bandwidth utilization.
[0183] See also Figure 4 , Figure 4 is a structural diagram of a message sending device provided in an embodiment of the present application, which is applied to a first device, such as Figure 4 As shown, the message sending device 400 includes:
[0184] A detection module 401 is used to detect authorization status information of a virtual queue of the first device, where the authorization status information is used to indicate a status of remaining authorized resources in the virtual queue;
[0185] An acquisition module 402 is used to acquire N request messages to be sent to the second device triggered by the authorization status information, wherein each request message is used to apply for authorization from the second device or request to stop authorization from the second device;
[0186] The sending module 403 is used to merge the N request messages into a target request message, and send the target request message to the second device, where N is an integer greater than or equal to 1.
[0187] Optionally, the acquisition module includes at least one of the following:
[0188] A first acquisition submodule, configured to acquire a first request message to be sent to the second device in real time when the authorization status information indicates that the state of the remaining authorized resources is switched from the first state to the second state;
[0189] A second acquisition submodule is used to acquire a second request message to be sent to the second device at a predetermined time interval when the authorization status information indicates that the remaining authorized resource status maintains the first state or the second state;
[0190] The N request messages include the first request message and / or the second request message.
[0191] Optionally, the first state is used to represent sufficient resources, the second state is used to represent insufficient resources, the first request message includes an authorization request message, and / or the second request message includes an authorization request message or a stop authorization request message;
[0192] or,
[0193] The first state is used to represent a lack of resources, the second state is used to represent sufficient resources, the first request message includes a stop authorization request message, and / or the second request message includes a stop authorization request message or an authorization request message;
[0194] The authorization request message is used to apply for authorization from the second device, and the stop authorization request message is used to request the second device to stop authorization.
[0195] Optionally, the target request message carries at least one of an authorization request identification bit, the identity identification number ID of the second device, the total number of request messages contained in the target request message, the port information of the second device, the priority information of the target request message, and the status of remaining authorized resources, wherein the authorization request identification bit is used to indicate the type of the target request message.
[0196] Optionally, the device further comprises:
[0197] The deleting module is used to delete the current virtual queue when no message is received from the server within a first preset time period.
[0198] The message sending device 400 can realize Figure 1 The various processes implemented in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described again here.
[0199] See also Figure 5 , Figure 5 is a structural diagram of a message sending device provided in an embodiment of the present application, which is applied to a second device, such as Figure 5 As shown, the message sending device 500 includes:
[0200] A first determination module 501, configured to determine the authorization amount of each port according to the total authorization amount generated in a target time period and the bandwidth of each port of the second device;
[0201] The receiving module 502 is used to receive a target request message sent by the first device, and determine a target weight of the number of authorization requests in the target request message in the total number of authorization requests received by the second device;
[0202] A second determination module 503 is used to determine a target authorization amount allocated by the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount;
[0203] The sending module 504 is used to merge the M response messages into a target response message, and send the target response message to the first device, where M is an integer greater than or equal to 1.
[0204] Optionally, the device further comprises:
[0205] A third determining module, configured to determine the authorization amount of each virtual queue according to the authorization amount of each port and the scheduling relationship of the virtual queue corresponding to each port;
[0206] The second determining module is specifically used for:
[0207] The target authorization amount allocated by the first device is determined by taking a weighted average approach according to the authorization amount of each virtual queue and the target weight.
[0208] Optionally, the target response message carries at least one of an authorization response identification bit, the ID of the first device, the total number of response messages contained in the target response message, the port information of the second device, the priority information of the target response message, and the number of authorization messages, wherein the authorization response identification bit is used to indicate the type of the target response message.
[0209] Optionally, the device further comprises:
[0210] The allocation module is used to stop allocating authorization to the virtual queue corresponding to the first device when no target request message sent by the first device is received within a second preset time period.
[0211] The message sending device 500 can realize Figure 2 The various processes implemented in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described again here.
[0212] See also Figure 6 , Figure 6is a structural diagram of a message sending device provided in an embodiment of the present application, which is applied to a third device, such as Figure 6 As shown, the message sending device 600 includes:
[0213] The receiving module 601 is used to receive a target message sent by a first target device, where the target message is formed by merging multiple messages;
[0214] A sending module 602, configured to send the target message to a second target device;
[0215] The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
[0216] Optionally, the target message carries an authorization identification bit, and the authorization identification bit is used to indicate the type of the target message;
[0217] The sending module is specifically used for:
[0218] The target message is sent to the second target device according to a priority corresponding to the type of the target message.
[0219] The message sending device 600 can realize Figure 3 The various processes implemented in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described again here.
[0220] like Figure 7 As shown, the embodiment of the present application further provides an electronic device 700, including: a processor 701, a memory 702, and a program stored in the memory 702 and executable on the processor 701, wherein the program is executed by the processor 701 to implement the above Figures 1 to 3 The various processes of the corresponding message sending method embodiments can achieve the same technical effects, and will not be described again here to avoid repetition.
[0221] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned message sending method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0222] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figures 1 to 3 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0223] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0224] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0225] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A message sending method, characterized in that: Applied to a first device, comprising: Detecting authorization status information of a virtual queue of the first device, where the authorization status information is used to indicate a resource status of remaining authorizations in the virtual queue; Acquire N request messages to be sent to the second device triggered by the authorization status information, wherein each request message is used to apply for authorization from the second device or to request the second device to stop authorization; The N request messages are combined into a target request message, and the target request message is sent to the second device, where N is an integer greater than or equal to 1.
2. The method according to claim 1, characterized in that The acquiring N request messages to be sent to the second device triggered by the authorization status information includes at least one of the following: When the authorization status information indicates that the state of the remaining authorized resources is switched from the first state to the second state, obtaining a first request message to be sent to the second device in real time; When the authorization status information indicates that the state of the remaining authorized resources maintains the first state or the second state, obtaining a second request message to be sent to the second device at a predetermined time interval; The N request messages include the first request message and / or the second request message.
3. The method according to claim 2, characterized in that The first state is used to indicate that resources are sufficient, the second state is used to indicate that resources are insufficient, the first request message includes an authorization request message, and / or the second request message includes an authorization request message or a stop authorization request message; or, The first state is used to represent a lack of resources, the second state is used to represent sufficient resources, the first request message includes a stop authorization request message, and / or the second request message includes a stop authorization request message or an authorization request message; The authorization request message is used to apply for authorization from the second device, and the stop authorization request message is used to request the second device to stop authorization.
4. The method according to any one of claims 1 to 3, characterized in that The target request message carries an authorization request identification bit, the identity identification number ID of the second device, the total number of request messages contained in the target request message, the port information of the second device, the priority information of the target request message, and at least one of the remaining authorized resource statuses, wherein the authorization request identification bit is used to indicate the type of the target request message.
5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If no message is received from the server within the first preset time period, the current virtual queue is deleted.
6. A message sending method, characterized in that: Applied to the second device, comprising: Determine the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device; receiving a target request message sent by a first device, and determining a target weight of the number of authorization requests in the target request message relative to the number of all authorization requests received by the second device; Determine a target authorization amount allocated by the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount; The M response messages are combined into a target response message, and the target response message is sent to the first device, where M is an integer greater than or equal to 1.
7. The method according to claim 6, characterized in that After determining the authorization amount of each port according to the total authorization amount generated in the target time period and the bandwidth of each port of the second device, the method further includes: Determine the authorization amount of each virtual queue according to the authorization amount of each port and the scheduling relationship of the virtual queue corresponding to each port; The step of determining the target authorization amount allocated by the first device according to the authorization amount of each port and the target weight includes: The target authorization amount allocated by the first device is determined by a weighted average calculation method according to the authorization amount of each virtual queue and the target weight.
8. The method according to claim 6 or 7, characterized in that: The target response message carries an authorization response identification bit, the ID of the first device, the total number of response messages contained in the target response message, the port information of the second device, the priority information of the target response message, and at least one of the number of authorization messages, wherein the authorization response identification bit is used to indicate the type of the target response message.
9. The method according to claim 6 or 7, characterized in that: The method further comprises: When no target request message sent by the first device is received within a second preset time period, stop allocating authorization to the virtual queue corresponding to the first device.
10. A message sending method, characterized in that: Applicable to third-party devices, including: receiving a target message sent by a first target device, wherein the target message is formed by merging multiple messages; Sending the target message to a second target device; The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
11. The method according to claim 10, characterized in that The target message carries an authorization flag, where the authorization flag is used to indicate the type of the target message; The sending the target message to the second target device includes: The target message is sent to the second target device according to a priority corresponding to the type of the target message.
12. A message sending device, characterized in that: Applied to a first device, comprising: a detection module, configured to detect authorization status information of a virtual queue of the first device, wherein the authorization status information is used to indicate a resource status of remaining authorizations in the virtual queue; an acquisition module, configured to acquire N request messages to be sent to the second device triggered by the authorization status information, wherein each of the request messages is used to apply for authorization from the second device or to request the second device to stop authorization; A sending module is used to merge the N request messages into a target request message and send the target request message to the second device, where N is an integer greater than or equal to 1.
13. A message sending device, characterized in that: Applied to the second device, comprising: A first determination module, configured to determine the authorization amount of each port according to the total authorization amount generated in a target time period and the bandwidth of each port of the second device; A receiving module, configured to receive a target request message sent by a first device, and determine a target weight of the number of authorization requests in the target request message in the total number of authorization requests received by the second device; A second determination module, configured to determine a target authorization amount allocated by the first device according to the authorization amount of each port and the target weight, and determine M response messages to be sent to the first device according to the target authorization amount; A sending module is used to merge the M response messages into a target response message and send the target response message to the first device, where M is an integer greater than or equal to 1.
14. A message sending device, characterized in that: Applicable to third-party devices, including: A receiving module, used for receiving a target message sent by a first target device, wherein the target message is formed by merging multiple messages; A sending module, used for sending the target message to a second target device; The first target device is a first device, and the second target device is a second device; or the first target device is the second device, and the second target device is the first device.
15. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the program implements the steps of the message sending method as described in any one of claims 1 to 5, or the steps of the message sending method as described in any one of claims 6 to 9, or the steps of the message sending method as described in claim 10 or 11.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the message sending method according to any one of claims 1 to 5, or the steps of the message sending method according to any one of claims 6 to 9, or the steps of the message sending method according to claim 10 or 11.
17. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the message sending method according to any one of claims 1 to 5, or the steps of the message sending method according to any one of claims 6 to 9, or the steps of the message sending method according to claim 10 or 11.
Citation Information
Patent Citations
Method and equipment for sending and receiving data
CN101415276A
Method and system for controlling authorization request state information
CN102694715A
Traffic scheduling device and method
CN103379038A
Coalescing small payloads
CN110661720A
Business processing method and device and electronic equipment
CN111327691A
