A data transmission method and related equipment
By generating paths in the cloud service system and sending data in advance, the problem of detention caused by data transmission waiting for arbitrator permission is solved, and data transmission efficiency and reliability are improved.
Patent Information
- Application Number
- CN202110707685.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-24
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-06-24
AI Technical Summary
In the cloud service system, data transmission needs to be approved by the arbitrator, causing data to be stuck inside the first server, increasing the transmission time and reducing efficiency.
The first server stores the data into the target data queue before sending it, and obtains the queue creation time. If the difference is less than the threshold and it is idle, it generates a path by itself and sends data in advance until it receives the arbitrator's reply and switches to the path planned by the arbitrator.
Reduce the data stay time inside the server, improve data transmission efficiency, reduce transmission time, and ensure the reliability of data transmission through packet loss mechanism and retransmission mechanism.
Smart Images

Figure CN115604355B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud technology, and in particular to a data transmission method and related equipment. Background Art
[0002] With the rapid development of cloud technology, cloud service systems are growing in scale. Cloud service systems typically deploy multiple physical servers, enabling data transmission between them. Furthermore, cloud service systems also employ an arbitrator to centrally manage all servers, for example, by planning routes for data transmission between servers.
[0003] Specifically, if the first server needs to send data to the second server, it will usually send a request message to the arbitrator. The arbitrator can plan a data transmission path for the first server based on the request message and return a response message to the first server, so that the first server can determine the data transmission path based on the response information and send data to the second server along the path, thereby completing the data transmission.
[0004] It can be seen from this that when the first server has a need for data transmission, it needs to wait for the permission of the arbitrator (i.e., receive the response information of the arbitrator) before data transmission can be carried out. The data to be sent often needs to stay in the first server for a certain period of time, which increases the time required for data transmission and results in low data transmission efficiency. Summary of the Invention
[0005] The embodiments of the present application provide a data transmission method and related equipment, which can reduce the time that target data stays inside the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0006] A first aspect of an embodiment of the present application provides a data transmission method, the method comprising:
[0007] When the first server generates target data to be sent to the second server, that is, the first server has a need to send the target data to the second server, the first server can store the target data in the target data queue and send a request information for the target data to the arbitrator. The request information is used to indicate that the first server needs to send the target data to the second server.
[0008] It should be noted that the operation of the first server storing the target data into the target data queue may fall into the following two situations: (1) The first server creates the target data queue with the target data as the first data (i.e., the head of the target data queue) and records the creation time of the target data queue. (2) The first server may directly store the target data into the created target data queue. In this case, the creation time of the target data queue is before the time when the target data is stored into the created target data queue.
[0009] Next, the first server may obtain the creation time of the target data queue and calculate the difference between the creation time of the target data queue and the current time. The first server may then detect whether the difference is less than a preset threshold and the state of the first server. If the difference between the creation time of the target data queue and the current time is less than the preset threshold and the first server is in an idle state, the first server may determine that it has not yet received a response message for the target data from the arbitrator and is not sending data to any server. Therefore, the first server may generate a first path and send the target data along the first path to the second server.
[0010] It can be seen from the above method that: after the first server generates the target data that needs to be sent to the second server, it can send a request information for the target data to the arbitrator and store the target data in the target data queue. Then, the first server obtains the creation time of the target data queue. If the difference between the creation time of the target data queue and the current time is less than the preset threshold, and the first server is in an idle state, the first server can determine that it has not received the response information for the target data and it is in an idle state. Therefore, the first server can generate a first path and send the target data to the second server along the first path. It can be seen that before receiving the response information for the target data, the first server can plan the first path by itself and send the target data to the second server in advance along the first path, reducing the time that the target data stays inside the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0011] In one possible implementation, the method further includes: the first server sending a request message to the arbitrator, the request message being used to instruct the target data to be sent to the second server; the first server receiving a response message from the arbitrator, the response message being used to indicate the second path; the first server switching from the first path to the second path indicated by the response message; and the first server sending the target data to the second server along the second path. In the aforementioned implementation, before the first server sends the target data to the second server along the first path in advance, the first server has already sent a request message for the target data to the arbitrator. Therefore, after the first server receives the response message for the target data from the arbitrator, it switches from the first path to the second path indicated by the response message, stops sending the target data using the first path generated by itself, and sends the target data using the second path generated by the arbitrator.
[0012] In one possible implementation, the first server generates a first path including: the first server selects a target data queue from a plurality of data queues according to a preset queue priority, and in the plurality of data queues, the difference between the creation time of each data queue and the current time is less than a threshold; the first server generates the first path with the first server as the starting point and the second server corresponding to the target data queue as the end point. In the aforementioned implementation, since the first server usually has multiple data queues, the multiple data queues correspond one-to-one to the multiple servers, that is, for any data queue, the data queue stores data to be sent to the server corresponding to the data queue. The first server determines that in the plurality of data queues, the difference between the creation time of each data queue and the current time is less than a threshold, and the first server is in an idle state, then the first server selects a data queue from the plurality of data queues as the target data queue, and generates the first path with the first server as the starting point and the second server corresponding to the target data queue as the end point, so as to send the target data to the second server in advance along the first path.
[0013] In one possible implementation, the first server sends target data to the second server along the second path, including: if the first server has received confirmation information from the second server, and the confirmation information is used to indicate sub-data in the target data that has been received by the second server, the first server determines the sub-data in the target data that has not been received by the second server based on the confirmation information; and the first server sends the sub-data that has not been received by the second server to the second server along the second path. In the aforementioned implementation, if the first server determines that it has received confirmation information from the second server before receiving a response information for the target data from the arbitrator, and the confirmation information is used to indicate sub-data in the target data that has been received in advance by the second server, the first server can determine the sub-data in the target data that has not been received by the second server based on the confirmation information. Then, the first server sends the sub-data in the target data that has not been received by the second server to the second server along the second path. At this point, the first server has successfully sent all sub-data of the target data to the second server.
[0014] In one possible implementation, the first server sending the target data to the second server along the second path includes: if no confirmation information is received from the second server, the first server sending all sub-data of the target data to the second server along the second path. In the aforementioned implementation, if the first server determines that it has not received confirmation information from the second server before receiving a response information regarding the target data from the arbitrator, the first server sends all sub-data of the target data to the second server along the second path indicated by the response information, regardless of whether the first server sent the target data in advance. This is equivalent to the first server successfully sending all sub-data of the target data to the second server.
[0015] In one possible implementation, the preset threshold is the round-trip time between the first server and the arbitrator, which is the sum of the time required for the first server to send information to the arbitrator, the time required for the arbitrator to process the information, and the time required for the arbitrator to send the information to the first server.
[0016] In a possible implementation, the target data is the first data in the target data queue, that is, the target data is the head of the target data queue.
[0017] A second aspect of an embodiment of the present application provides a server, which serves as a first server, and the first server includes: a processing module, used to obtain the creation time of a target data queue, where the target data queue stores target data to be sent to a second server; the processing module is also used to generate a first path if the difference between the creation time of the target data queue and the current time is less than a preset threshold and the first server is in an idle state; and a sending module, used to send the target data to the second server along the first path.
[0018] It can be seen from the above device that: after the first server generates the target data that needs to be sent to the second server, it can send a request information for the target data to the arbitrator and store the target data in the target data queue. Then, the first server obtains the creation time of the target data queue. If the difference between the creation time of the target data queue and the current time is less than the preset threshold, and the first server is in an idle state, the first server can determine that it has not received the response information for the target data and it is in an idle state. Therefore, the first server can generate a first path and send the target data to the second server along the first path. It can be seen that before receiving the response information for the target data, the first server can plan the first path by itself and send the target data to the second server in advance along the first path, reducing the time the target data stays in the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0019] In one possible implementation, the sending module is further configured to send a request message to the arbitrator, where the request message is used to instruct the target data to be sent to the second server; the first server further includes a receiving module configured to receive a response message from the arbitrator, where the response message is used to indicate the second path; the processing module is further configured to switch from the first path to the second path indicated by the response message; and the sending module is further configured to send the target data to the second server along the second path.
[0020] In one possible implementation, the processing module is used to: select a target data queue from multiple data queues based on a preset queue priority, where the difference between the creation time of each data queue and the current time is less than a threshold; and generate a first path with the first server as the starting point and the second server corresponding to the target data queue as the end point.
[0021] In one possible implementation, the sending module is configured to: if confirmation information has been received from the second server, and the confirmation information is used to indicate sub-data in the target data that has been received by the second server, determine sub-data in the target data that has not been received by the second server based on the confirmation information; and send the sub-data that has not been received by the second server to the second server along the second path.
[0022] In a possible implementation, the sending module is configured to, if the first server does not receive confirmation information from the second server, send all sub-data of the target data to the second server along the second path.
[0023] In a possible implementation, the threshold is a round-trip time between the first server and the arbitrator.
[0024] In a possible implementation, the target data is the first data in the target data queue.
[0025] A third aspect of an embodiment of the present application provides a server, which serves as a first server. The first server includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the first server executes the method described in the first aspect or any possible implementation method of the first aspect.
[0026] A fourth aspect of the embodiments of the present application provides a cloud service system, which includes an arbitrator, a second server, and the first server as described in the third aspect, wherein the arbitrator is connected to the first server, and the first server is connected to the second server.
[0027] A fifth aspect of an embodiment of the present application provides a computer storage medium, which stores one or more instructions, which, when executed by one or more computers, enables the one or more computers to implement the method described in the first aspect or any possible implementation method of the first aspect.
[0028] A sixth aspect of the embodiments of the present application provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the method described in the first aspect or any possible implementation of the first aspect.
[0029] In an embodiment of the present application, after the first server generates target data that needs to be sent to the second server, it can send a request message for the target data to the arbitrator and store the target data in the target data queue. Then, the first server obtains the creation time of the target data queue. If the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state, the first server can determine that it has not received a response message for the target data and is in an idle state. Therefore, the first server can generate a first path and send the target data to the second server along the first path. It can be seen that before receiving the response message for the target data, the first server can plan the first path by itself and send the target data to the second server in advance along the first path, reducing the time the target data stays inside the first server, thereby reducing the time required for data transmission and improving data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of the structure of the cloud service system provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of a data transmission method provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0033] Figure 4 Another structural diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The embodiments of the present application provide a data transmission method and related equipment, which can reduce the time that target data stays inside the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0035] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0036] With the rapid development of cloud technology, cloud service systems are growing in scale. Cloud service systems typically deploy multiple physical servers, enabling data transmission between them. Furthermore, cloud service systems also employ an arbitrator to centrally manage all servers, performing tasks such as routing and allocating time slots for data transmission between servers.
[0037] Specifically, if the first server needs to send data to the second server, the first server will usually send a request message to the arbitrator. The arbitrator can determine that the first server requests to send data to the second server based on the request message. Therefore, the arbitrator can plan a data transmission path for the first server (a path starting from the first server and ending at the second server), and return a response message to the first server, so that the first server determines the data transmission path based on the response information and sends data to the second server along the path, thereby completing the data transmission.
[0038] It can be seen from this that when the first server has a need for data transmission, it needs to wait for the permission of the arbitrator (i.e., receive the response information of the arbitrator) before data transmission can be carried out. The data to be sent often needs to stay in the first server for a certain period of time, which increases the time required for data transmission and results in low data transmission efficiency.
[0039] In order to solve the above problems, the embodiment of the present application provides a data transmission method, which can be applied to Figure 1 The cloud service system shown ( Figure 1 A schematic diagram of a cloud service system provided in an embodiment of the present application) is provided below. Figure 1 As shown, the cloud service system includes: an arbitrator, multiple core switches, multiple top of rack (TOR) switches and multiple physical servers.
[0040] Each TOR switch is connected to a server group, typically consisting of multiple physical servers. Physical servers can provide cloud services to users in a variety of ways. For example, a physical server can host multiple virtual instances, such as virtual machines (VMs) and containers (Docker). These virtual instances can be assigned to users to provide cloud services. Alternatively, a physical server can directly provide cloud services to users as a bare metal server (i.e., the physical server itself).
[0041] Furthermore, TOR switches can be connected to each other through the core switch. In this way, data can be transmitted between servers in different groups through the TOR switches and then the core switches. Servers in the same group can also transmit data through the TOR switches.
[0042] The arbitrator is the center for managing the entire cloud service system. It can be a physical server, an offload card, or a heterogeneous card. Offload cards can take the form of field programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), while heterogeneous cards can take the form of graphics processing units (GPUs) or network interface controllers (NICs). The arbitrator is connected to at least one TOR switch, allowing it to manage all servers through the connected TOR switch, for example, by performing path planning and time slot allocation for data transmission between servers.
[0043] In order to further understand the workflow of the above cloud service system, the following Figure 2 This paper further introduces the cloud service system. Figure 2 A flow chart of a data transmission method provided in an embodiment of the present application, which can be applied to Figure 1For the convenience of explanation, the following will introduce the cloud service system shown in the figure using any two servers in the system, where the server serving as the data sending end is called the first server, and the server serving as the data receiving end is called the second server. The first server and the second server can be two servers in the same server group or two servers in different server groups, which will not be described in detail later. Figure 2 As shown, the method includes:
[0044] 201. A first server sends a request message to an arbitrator, where the request message is used to instruct the first server to send target data to a second server.
[0045] In this embodiment, when the first server generates target data to be sent to the second server, that is, the first server needs to send the target data to the second server, the first server can detect whether there is a target data queue corresponding to the second server. If it does not exist (that is, the target data queue has not been created), it means that before the target data is generated, there is no data in the first server that needs to be sent to the second server. Therefore, the first server creates a target data queue with the target data as the first data (that is, the head of the target data queue) and records the creation time of the target data queue (also known as the creation moment). The target data queue can be used to store data (including target data) to be sent to the second server. If it exists (that is, the target data queue has been created), it means that before the target data is generated, there is already data in the first server that needs to be sent to the second server. Therefore, the first server can directly store the target data in the created target data queue. In this case, the creation time of the target data queue is before the time when the target data is stored in the created target data queue.
[0046] For example, after server 1 generates data 1 to be sent to server 2, if it is determined that data queue 1 corresponding to server 2 does not exist, it means that before data 1 was generated, server 1 did not have any data that needed to be sent to server 2. Therefore, server 1 creates data queue 1 corresponding to server 2 with data 1 as the first data and records the time of creating data queue 1. If it is determined that data queue 1 corresponding to server 2 exists, it means that before data 1 was generated, server 1 had data such as data 2 that needed to be sent to server 2, and these data were all stored in data queue 1. Therefore, server 1 can store data 1 in data queue 1 (in this case, the creation time of data queue 1 is before the time of storing data 1 in data queue 1), so that server 1 can send the data in data queue 1 to server 2 one by one.
[0047] Furthermore, the first server may also send a request message to the arbitrator, which includes information such as the amount of target data, the identifier of the first server, and the identifier of the second server. Therefore, the request message may be used to indicate that the first server needs to send the target data to the second server.
[0048] It should be understood that the operation of the first server storing the target data into the created target data queue (or creating the target data queue with the target data as the first data) and the operation of the first server sending the request information for the target data can be executed synchronously or asynchronously. When the two are executed asynchronously, the execution time of the two is generally similar, and the former may be executed before the latter, or the latter may be executed before the former, without limitation herein.
[0049] It should also be understood that the data queue in this embodiment can be presented in various forms. For example, the data queue can be presented in the form of a virtual output queue (VOQ), etc., which is not limited in this embodiment.
[0050] It should also be understood that the "data" mentioned in this embodiment can also be understood as "data stream", and "sub-data" can be understood as "data packet", so a data containing multiple sub-data can also be understood as a data stream containing multiple data packets, which will not be repeated later.
[0051] 202. The first server obtains a creation time of a target data queue, where the target data queue stores target data to be sent to the second server.
[0052] For any data in the target data queue, since the first server has sent a request message for the data to the arbitrator, before receiving a response message for the data, the first server may attempt to informally send the data (pre-send) until it receives a response message for the data, and then formally send the data based on the response message. It should be noted that the data typically contains at least one sub-data. When the first server informally sends the data, it may only send some of the sub-data in the data to the second server in advance (the sub-data in the data that have not been sent in advance can be sent during the formal sending process), or it may send all of the sub-data in the data to the second server in advance, depending on the time when the first server receives the response message for the data. Furthermore, when formally sending the data, the first server may send all of the sub-data in the data (including the sub-data that have been sent in advance and the sub-data that have not been sent in advance) to the second server, or only send some of the sub-data in the data to the second server, and so on. As for how the first server performs the formal sending, we will not elaborate on it here.
[0053] Since the first server will send the data in the target data queue to the second server one by one, when the first server creates the target data queue with the target data as the first data, the first server can directly determine whether to informally send the target data. When the first server stores the target data in the target data queue, the first server needs to complete the informal sending of all data in the target data queue that precedes the target data (i.e., all data in the target data queue that precedes the target data has been sent to the second server in advance, at which point the target data becomes the first data in the target data queue) before it can determine whether to informally send the target data. Still using the above example, assume that before server 1 stores data 1 in data queue 1 corresponding to server 2, data queue 1 already contains only data 2. After server 1 stores data 1 in data queue 1, server 1 sends data 2 completely to server 2 in advance (i.e., completes the informal sending of data 2), and data 1 becomes the head of data queue 1. Therefore, server 1 can begin to determine whether to informally send data 1. It should be noted that the informal sending of data 2 can refer to the relevant description of the informal sending of data 1 in this embodiment, and will not be repeated here.
[0054] As can be seen, when the target data is at the head of the target data queue, the first server will determine whether the target data can be informally sent. When determining whether the target data can be informally sent, the first server can first obtain the creation time of the target data queue and make subsequent judgments based on the creation time of the target data queue.
[0055] 203. If the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state, the first server generates a first path.
[0056] 204. The first server sends target data to the second server along the first path.
[0057] After the first server obtains the creation time of the target data queue, it can calculate the difference between the creation time of the target data queue and the current time. Then, the first server can detect whether the difference is less than a preset threshold and detect the state of the first server. Specifically, the threshold can be the round-trip time between the first server and the arbitrator. The round-trip time between the first server and the arbitrator is the sum of the time (also referred to as duration) required for the first server to send information (e.g., request information) to the arbitrator, the time required for the arbitrator to process the information (e.g., the arbitrator processes the request information and obtains a response information), and the time required for the arbitrator to send information (e.g., response information) to the first server.
[0058] If the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state, it means that the first server has not received any response information for any data in the target data queue, and the first server has not sent data to any server, so the first server determines that it can attempt to send the target data informally. Still as in the above example, after determining that the difference between the creation time of data queue 1 and the current time is less than the threshold, and server 1 is in an idle state, server 1 can determine that it has not received a response information for data 2 (it can be understood that since the request information for data 2 must be sent before the request information for data 1, the response information for data 1 must not have been received at this time), and server 1 has not sent data to any server, so server 1 can send data 1 to server 2 in advance.
[0059] If the difference between the creation time of the target data queue and the current time is greater than or equal to the preset threshold, it means that the first server has received response information for a certain data in the target data queue, that is, the first server is already formally sending the data, and may subsequently receive response information for the remaining data in the target data queue. The first server may continue to formally send the data in the target data queue. Since the priority of formal sending is higher than informal sending, the first server determines not to perform informal sending of the target data.
[0060] It is worth noting that the first server can informally send the target data in the following ways:
[0061] The first server first selects a target data queue from multiple data queues based on a preset queue priority. For each of these data queues, the difference between its creation time and the current time is less than a threshold. The first server then generates a first path, starting with the first server and ending at the second server corresponding to the target data queue. Finally, the first server sends the target data along the first path to the second server.
[0062] Specifically, since the first server usually has multiple data queues, the multiple data queues correspond one-to-one to the multiple servers, that is, for any data queue, the data queue stores the data to be sent to the server corresponding to the data queue. The first server can detect these multiple data queues in parallel to determine whether the first data in each data queue can be informally sent. It should be noted that the process of the first server performing parallel detection on multiple data queues can be repeated multiple times. If in a certain parallel detection, the first server determines that in multiple data queues, the difference between the creation time and the current time of each data queue is less than a threshold, and the first server is in an idle state, then the first server can determine that the first data in these multiple data queues can be informally sent. Since the first server has only one output port and cannot send data from multiple data queues at the same time, the first server selects a data queue from these multiple data queues as the target data queue and informally sends the first data in the target data queue (i.e., the target data).
[0063] Furthermore, the first server may select a target data queue from the plurality of data queues according to a preset queue priority, which may be the size of the first data in the data queue, the number of the server corresponding to the data queue, etc., which is not limited here.
[0064] Still taking the above example, suppose that in the current parallel detection, server 1 determines that the difference between the creation time of data queue 1 corresponding to server 2 and the current time is less than the threshold, the difference between the creation time of data queue 2 corresponding to server 3 and the current time is less than the threshold, and the difference between the creation time of data queue 3 corresponding to server 4 and the current time is less than the threshold. Then, server 1 determines that data 1 of data queue 1, data 3 of data queue 2, and data 4 of data queue 3 can be informally sent. Since the size of data 1 is the smallest among the three data, server 1 chooses to informally send data 1 of data queue 1. As for data 3 of data queue 2 and data 4 of data queue 3, if they meet the requirements of the next parallel detection of server 1, they can still be selected by server 1 as candidate data queues, and no further details will be given here.
[0065] After the first server determines that the target data in the target data queue should be informally transmitted, it can generate a first path starting from the first server and ending at the second server corresponding to the target data queue. The target data can then be sent to the second server along the first path, thereby initiating informal transmission of the target data. The first path passes through a switch. To enable the switch to identify whether the data transmission process is informal or formal, the first server can include a first identifier in the target data, indicating informal transmission. Since the target data can contain multiple sub-data, the first server can sequentially send the sub-data of the target data to the switch, with each sub-data being sent carrying the first identifier. Therefore, upon receiving the sub-data of the target data, the switch can determine that the sub-data is informally transmitted based on the first identifier carried in the sub-data.
[0066] It should be noted that if the first server receives a response message for the data preceding the target data (data sent to the second server) during the informal transmission of the target data, it will temporarily stop the informal transmission of the target data, and complete the formal transmission of the data preceding the target data based on the response message, and then continue the informal transmission of the target data. Continuing with the above example, if Server 1 receives a response message for Data 2 while sending Data 1 to Server 2 in advance, Server 1 will stop the informal transmission of Data 1, and use the response message to formally send Data 2, and then continue the informal transmission of Data 1 until it receives a response message for Data 1.
[0067] It is worth noting that the switch has a packet loss mechanism. The following describes the packet loss mechanism based on the switch type:
[0068] (1) If the switch is a switch with a cache, a packet loss threshold is preset in the switch. When multiple servers (including the first server) send sub-data to the second server through the switch at the same time, these sub-data will accumulate in the switch to form a data queue, and the switch will send the data in the data queue to the second server one by one. If the switch determines that the length of the data queue (that is, the size of all data in the data queue) is greater than the packet loss threshold, the switch will discard the received sub-data carrying the first identifier and store the received sub-data carrying the second identifier in the data queue, and the second identifier is used to indicate formal transmission. If the switch determines that the length of the data queue is less than or equal to the packet loss threshold, regardless of whether the switch receives sub-data carrying the first identifier or sub-data carrying the second identifier, the switch will store the data in the data queue. It can be seen that the sub-data of the target data sent in advance by the first server may be discarded by the switch, resulting in it not being received by the second server.
[0069] (2) If the switch is a switch without a cache (i.e., a zero-cache switch), when multiple servers (including the first server) simultaneously send sub-data to the second server through the switch, these sub-data cannot form a data queue in the switch, and the switch can only select one sub-data to send to the second server. If these sub-data are all sub-data carrying the first identifier, the switch randomly selects one sub-data from them and sends it to the second server, and discards the remaining sub-data. If these sub-data include sub-data carrying the first identifier and sub-data carrying the second identifier, the switch randomly selects one sub-data from the sub-data carrying the second identifier and sends it to the second server, and discards the remaining sub-data. It can be seen that the sub-data of the target data sent in advance by the first server may be discarded by the switch, resulting in it not being received by the second server.
[0070] 205. The first server receives response information from the arbitrator, where the response information is used to indicate the second path.
[0071] 206. The first server switches from the first path to the second path indicated by the response information.
[0072] 207. The first server sends the target data to the second server along the second path.
[0073] In this embodiment, after the arbitrator receives a request message for target data, the arbitrator may parse the request message to obtain information such as the target data volume, the identifier of the first server, and the identifier of the second server. Based on this information, the arbitrator may determine that the first server needs to send the target data to the second server. The arbitrator may then generate a second path starting from the first server and ending at the second server (the second path and the first path may be the same or different, and this is not a limitation here). The arbitrator may then send a response message for the target data to the first server. The response message may include information such as the second path and the identifier of the second server. Therefore, the response message may be used to instruct the first server to send the target data to the second server along the second path.
[0074] During or after the informal sending of the target data, the first server may receive response information regarding the target data from the arbitrator. The first server may then parse the response information to obtain information such as the second path and the identifier of the second server. Based on this information, the first server may determine that the target data needs to be formally sent. The first server may then switch from the first path to the second path and send the target data to the second server along the second path.
[0075] It is worth noting that when the first server sends the target data to the second server along the second path, there may be multiple situations, which are described below:
[0076] (1) If the first server determines that it has received confirmation information from the second server before receiving the response information for the target data from the arbitrator, and the confirmation information is used to indicate the sub-data in the target data that has been received in advance by the second server (that is, the sub-data in the target data that has been successfully informally sent by the first server), the first server can determine the sub-data in the target data that has not been received by the second server based on the confirmation information. Then, the first server sends the sub-data in the target data that has not been received by the second server to the second server along the second path. At this point, all the sub-data of the target data have been successfully sent to the second server, and the formal sending of the target data has been completed. Continuing with the above example, assume that data 1 contains sub-data 1, sub-data 2, and sub-data 3. During the informal transmission of data 1 by server 1 (assuming that server 1 has sent sub-data 1 and sub-data 2 to server 2 along path 1, but has not yet sent sub-data 3), server 1 receives a response message from the arbitrator regarding data 1. Therefore, server 1 will check whether it has received a confirmation message from server 2. If it receives a confirmation message indicating that sub-data 1 has been successfully received (i.e., sub-data 2 was discarded at the switch), server 1 can send sub-data 2 and sub-data 3 to server 2 along path 2 indicated by the response message, thereby allowing server 2 to successfully receive the complete data 1.
[0077] (2) If the first server determines that it has not received the confirmation information from the second server before receiving the response information for the target data from the arbitrator, the first server sends all the sub-data of the target data to the second server along the second path. Then, if some of the sub-data have been received in advance by the second server after the informal transmission of the target data is completed, the second server will receive this part of the sub-data again after the formal transmission of the target data is completed. Therefore, it can be deduplicated, which is equivalent to the first server successfully sending all the sub-data of the target data to the second server, that is, completing the formal transmission of the target data. Still taking the above example, suppose that data 1 contains sub-data 1, sub-data 2 and sub-data 3. During the informal transmission of data 1 (assuming that the server has sent sub-data 1 and sub-data 2 to server 2 along path 1, but has not yet sent sub-data 3), server 1 receives the response information for data 1 from the arbitrator. Therefore, server 1 will detect whether it has received the confirmation information from server 2. If it has not received the confirmation information, server 1 can send sub-data 1, sub-data 2 and sub-data 3 to server 2 along path 2 indicated by the response information. Assume that server 1 successfully receives sub-data 1 in advance. Then, server 2 will deduplicate the two received sub-data 1, which is equivalent to successfully receiving the complete data 1.
[0078] (3) If the first server determines that it has received confirmation information from the second server before receiving the response information for the target data from the arbitrator, and the confirmation information is used to indicate that all sub-data of the target data have been received in advance by the second server (that is, in the target data, all sub-data are successfully sent informally by the first server to the second server, and no sub-data are discarded by the switch), then the first server can determine based on the confirmation information that it will no longer perform the formal transmission of the target data and terminate the operation on the target data. As in the above example, suppose that data 1 contains sub-data 1, sub-data 2, and sub-data 3. Server 1 has completed the informal transmission of data 1 (that is, server 1 has sent sub-data 1, sub-data 2, and sub-data 3 to server 2 along path 1) and received the response information for data 1 from the arbitrator. Therefore, server 1 will detect whether it has received the confirmation information from server 2. If it receives the confirmation information indicating that sub-data 1, sub-data 2, and sub-data 3 have been successfully received (that is, all sub-data have not been discarded by the switch), server 1 will terminate the operation on data 1.
[0079] In an embodiment of the present application, after the first server generates target data that needs to be sent to the second server, it can send a request message for the target data to the arbitrator and store the target data in the target data queue. Then, the first server obtains the creation time of the target data queue. If the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state, the first server can determine that it has not received a response message for the target data and is in an idle state. Therefore, the first server can generate a first path and send the target data to the second server along the first path. It can be seen that before receiving the response message for the target data, the first server can plan the first path by itself and send the target data to the second server in advance along the first path, reducing the time the target data stays inside the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0080] Furthermore, the embodiment of the present application also ensures that the officially sent sub-data will not be affected by the informally sent sub-data by providing a combination of a packet loss mechanism and a retransmission mechanism, thereby improving the reliability of data transmission.
[0081] Furthermore, the embodiment of the present application utilizes the amount of information brought by the arbitrator feedback scheduling in the centralized scheduling, thereby avoiding unnecessary opportunistic transmission, improving the effective utilization of the network, and avoiding congestion and queuing that may be caused by informal transmission.
[0082] The above is a detailed description of the data transmission method provided in the embodiment of the present application. The following is an introduction to the server provided in the embodiment of the present application. Figure 3 A structural diagram of a server provided in an embodiment of the present application, such as Figure 3 As shown, the server can serve as a first server, and the first server includes:
[0083] The processing module 302 is used to obtain the creation time of the target data queue, where the target data queue stores target data to be sent to the second server;
[0084] The processing module 302 is further configured to generate a first path if the difference between the creation time of the target data queue and the current time is less than a preset threshold and the first server is in an idle state;
[0085] The sending module 303 is configured to send target data to the second server along the first path.
[0086] It can be seen from the above device that: after the first server generates the target data that needs to be sent to the second server, it can send a request information for the target data to the arbitrator and store the target data in the target data queue. Then, the first server obtains the creation time of the target data queue. If the difference between the creation time of the target data queue and the current time is less than the preset threshold, and the first server is in an idle state, the first server can determine that it has not received the response information for the target data and it is in an idle state. Therefore, the first server can generate a first path and send the target data to the second server along the first path. It can be seen that before receiving the response information for the target data, the first server can plan the first path by itself and send the target data to the second server in advance along the first path, reducing the time the target data stays in the first server, thereby reducing the time required for data transmission and improving data transmission efficiency.
[0087] In one possible implementation, the sending module 303 is further configured to send a request message to the arbitrator, where the request message is used to instruct the target data to be sent to the second server. The first server further includes a receiving module 301, which is configured to receive a response message from the arbitrator, where the response message is used to indicate the second path. The processing module 302 is further configured to switch from the first path to the second path indicated by the response message. The sending module 303 is further configured to send the target data to the second server along the second path.
[0088] In one possible implementation, the processing module 302 is used to: select a target data queue from multiple data queues based on a preset queue priority, where the difference between the creation time of each data queue and the current time is less than a threshold; and generate a first path with the first server as the starting point and the second server corresponding to the target data queue as the end point.
[0089] In one possible implementation, the sending module 303 is configured to: if confirmation information has been received from the second server, and the confirmation information is used to indicate sub-data in the target data that has been received by the second server, determine sub-data in the target data that has not been received by the second server based on the confirmation information; and send the sub-data that has not been received by the second server to the second server along the second path.
[0090] In a possible implementation, the sending module 303 is configured to, if the first server does not receive confirmation information from the second server, send all sub-data of the target data to the second server along the second path.
[0091] In a possible implementation, the threshold is a round-trip time between the first server and the arbitrator.
[0092] In a possible implementation, the target data is the first data in the target data queue.
[0093] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the embodiment of the present application, and no further details will be given here.
[0094] Figure 4 Another structural diagram of the server provided in the embodiment of the present application. Figure 4 As shown, in an embodiment of the present application, the server can serve as a first server. An embodiment of the first server may include one or more central processing units 401, a memory 402, an input and output interface 403, a wired or wireless network interface 404, and a power supply 405.
[0095] The memory 402 may be a temporary storage or a permanent storage. Furthermore, the central processing unit 401 may be configured to communicate with the memory 402 and execute a series of instruction operations in the memory 402 on the first server.
[0096] In this embodiment, the CPU 401 can execute the aforementioned Figure 3 The operations performed by the first server in the illustrated embodiment will not be described in detail here.
[0097] In this embodiment, the specific functional module division in the central processing unit 401 can be the same as the above Figure 4 The division of the receiving module, processing module, sending module and other modules described in is similar and will not be repeated here.
[0098] The present application also relates to a computer storage medium storing one or more instructions, wherein the instructions, when executed by one or more computers, enable the one or more computers to implement the following Figure 2 The method described.
[0099] The embodiment of the present application also relates to a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the following Figure 2 The method described.
[0100] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0101] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0103] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A data transmission method, characterized in that: The method comprises: The first server sends a request message to the arbitrator, where the request message is used to instruct the second server to send target data; The first server obtains a creation time of a target data queue, wherein the target data queue stores target data to be sent to the second server; If the first server does not receive a response message from the arbitrator, and the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state, the first server generates a first path; The first server sends the target data to the second server along the first path.
2. The method according to claim 1, characterized in that The method further comprises: The first server receives response information from the arbitrator, where the response information is used to indicate the second path; The first server switches from the first path to the second path indicated by the response information; The first server sends the target data to the second server along the second path.
3. The method according to claim 1, characterized in that The first server generating the first path includes: The first server selects the target data queue from a plurality of data queues according to a preset queue priority, wherein a difference between a creation time of each data queue and the current time is less than the threshold value. The first server generates a first path with the first server as a starting point and the second server corresponding to the target data queue as an end point.
4. The method according to claim 2, characterized in that The first server sending the target data to the second server along the second path includes: If confirmation information has been received from the second server, and the confirmation information is used to indicate the sub-data in the target data that has been received by the second server, the first server determines the sub-data in the target data that has not been received by the second server according to the confirmation information; The first server sends the sub-data that is not received by the second server to the second server along the second path.
5. The method according to claim 2, characterized in that The first server sending the target data to the second server along the second path includes: If no confirmation information is received from the second server, the first server sends all sub-data of the target data to the second server along the second path.
6. The method according to any one of claims 1 to 5, characterized in that The threshold is the round trip time between the first server and the arbitrator.
7. The method according to any one of claims 1 to 5, characterized in that The target data is the first data in the target data queue.
8. A server, characterized in that: The server serves as a first server, and the first server includes: A sending module, configured to send a request message to the arbitrator, wherein the request message is used to instruct the target data to be sent to the second server; a processing module, configured to obtain a creation time of a target data queue, wherein the target data queue stores target data to be sent to the second server; The processing module is further configured to generate a first path if the first server does not receive a response message from the arbitrator, the difference between the creation time of the target data queue and the current time is less than a preset threshold, and the first server is in an idle state; The sending module is further configured to send the target data to the second server along the first path.
9. The server according to claim 8, wherein: The first server further includes a receiving module, configured to receive response information from the arbitrator, wherein the response information is used to indicate the second path; The processing module is further configured to switch from the first path to the second path indicated by the response information; The sending module is further configured to send the target data to the second server along the second path.
10. The server according to claim 8, wherein: The processing module is used to: selecting the target data queue from a plurality of data queues according to a preset queue priority, wherein a difference between a creation time of each data queue and the current time in the plurality of data queues is less than the threshold; A first path is generated with the first server as a starting point and the second server corresponding to the target data queue as an end point.
11. The server according to claim 9, wherein: The sending module is used to: If confirmation information has been received from the second server, and the confirmation information is used to indicate the sub-data in the target data that has been received by the second server, determining the sub-data in the target data that has not been received by the second server according to the confirmation information; The sub-data not received by the second server is sent to the second server along the second path.
12. The server according to claim 9, wherein: The sending module is configured to, if the first server does not receive confirmation information from the second server, send all sub-data of the target data to the second server along the second path.
13. The server according to any one of claims 8 to 12, characterized in that: The threshold is the round trip time between the first server and the arbitrator.
14. The server according to any one of claims 8 to 12, characterized in that: The target data is the first data in the target data queue.
15. A server, characterized in that: The server serves as a first server, and the first server includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the first server executes the method according to any one of claims 1 to 7.
16. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method of any one of claims 1 to 7.
17. A computer program product, characterized in that The computer program product stores instructions, which, when executed by a computer, enable the computer to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multilevel queue scheduling method based on service type
CN103929374A
Message management method and device
CN110113721A