Data transmission control method and electronic device
Patent Information
- Application Number
- CN202411975843.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-12-30
AI Technical Summary
[0003]但重传会导致设备之间的传输资源过度消耗,影响数据传输效率
[0039]从上述技术方案可以看出,本申请公开的一种数据传输控制方法及电子设备中,在第一设备上发送第一信息时,将与在先被发送的第二信息相匹配的目标内容携带在第一信息中,由此,第二设备在没有接收到第二信息时也可以发送匹配目标内容的目标数据包给第一设备,不需要第一设备向第二设备重传第二信息也可以使得第二设备将目标内容所指向的目标数据包发送给第一设备,由此可以减少第一设备与第二设备之间传输非数据包类型的信息的传输量,从而降低对设备之间传输资源的消耗,进而能够降低数据传输延迟,达到提高数据传输效率的目的。
Smart Images

Figure CN119853871B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data transmission control method and electronic device. Background Technology
[0002] In the Network File System (NFS), if packet loss occurs, the lost packets can be retransmitted.
[0003] However, retransmission can lead to excessive consumption of transmission resources between devices, affecting data transmission efficiency. Summary of the Invention
[0004] In view of this, this application provides a data transmission control method and an electronic device, as follows:
[0005] A data transmission control method, the method comprising:
[0006] First information is obtained on a first device; the first information contains target content that matches the second information; the second information is historical information that was sent from the first device to the second device before the first information.
[0007] The first information is sent to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device if the second device does not receive the second information.
[0008] In the above method, preferably, when the first information and the second information are read requests, the target content includes: the read parameters corresponding to the second information, wherein the read parameters point to the data packet that the first device requests to read from the second device;
[0009] When the first information and the second information are write responses, the target content includes: the write parameters corresponding to the second information, wherein the write parameters point to the data packet that the second device has written to the first device.
[0010] A data transmission control method, comprising:
[0011] The second device receives first information sent by the first device; the first information contains target content that matches the second information; the second information is historical information that was sent to the second device by the first device before the first information.
[0012] Based on the target content, determine whether the second device has received the second information;
[0013] If it is determined that the second device has not received the second information, a target data packet matching the target content is determined based on the target content;
[0014] The target data packet is sent to the first device.
[0015] The above method, preferably, involves determining whether the second device has received the second information, including:
[0016] The target content is compared with the historical information already received by the second device to determine whether any of the historical information matches the target content.
[0017] If no historical information matches the target content, it is determined that the second device has not received the second information;
[0018] If the historical information matches the target content, it is determined that the second device has received the second information.
[0019] In the above method, preferably, the first information further includes a first identifier corresponding to the first information, the first identifier being used to uniquely represent the first information; the target content at least includes a target identifier corresponding to the second information, the target identifier being used to uniquely represent the second information;
[0020] The comparison of the target content with historical information already received by the second device includes:
[0021] The target identifier in the target content is compared with the information identifier corresponding to the historical information already received by the second device;
[0022] Wherein, if the information identifier corresponding to the historical information is consistent with the target identifier in the target content, it indicates that the historical information matches the target content;
[0023] If no information identifier corresponding to the historical information matches the target identifier in the target content, it indicates that no historical information matches the target content.
[0024] In the above method, preferably, the target content includes: access parameters corresponding to the second information, wherein the access parameters point to the data packet that the second device needs to transmit to the first device;
[0025] The process of determining the target data packet that matches the target content includes:
[0026] According to the access parameters in the target content, packet addressing is performed in the second device to obtain the target data packet.
[0027] Preferably, in the above method, sending the target data packet to the first device includes:
[0028] The target data packet is divided into multiple data segments; the data segments have a transmission order.
[0029] The data segments are sent to the first device sequentially according to the transmission order.
[0030] Wherein, the data segments that are ordered in the last N times of transmission carry at least one target segment, and there is redundancy between the data segments and the target segments they carry, where N is a positive integer greater than or equal to 1.
[0031] In the above method, preferably, the number of target segments carried by the data segment is related to the transmission order of the data segments.
[0032] An electronic device, as a first device, includes:
[0033] The processing module is used to obtain first information; the first information contains target content that matches the second information; the second information is historical information that was sent to the second device by the first device before the first information.
[0034] A communication module is used to send the first information to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device if the second device does not receive the second information.
[0035] An electronic device, as a second device, includes:
[0036] A communication module is configured to receive first information sent by a first device on a second device; the first information contains target content that matches second information; the second information is historical information that was sent by the first device to the second device before the first information.
[0037] The processing module is configured to determine whether the second device has received the second information based on the target content; and if it is determined that the second device has not received the second information, to determine a target data packet matching the target content based on the target content.
[0038] The communication module is also used to send the target data packet to the first device.
[0039] As can be seen from the above technical solution, in the data transmission control method and electronic device disclosed in this application, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between the devices, and thus reducing data transmission delay and improving data transmission efficiency. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating a data transmission control method provided in an embodiment of this application;
[0042] Figure 2 This is an architecture diagram of the first device and the second device in the embodiments of this application;
[0043] Figure 3 This is an example diagram illustrating the sequential transmission of second information and first information between the first device and the second device in an embodiment of this application.
[0044] Figure 4 A flowchart illustrating another data transmission control method provided in this application embodiment;
[0045] Figure 5 This is a partial flowchart of a data transmission control method provided in an embodiment of this application;
[0046] Figure 6 This is another part of a flowchart of a data transmission control method provided in an embodiment of this application;
[0047] Figure 7 This is an example diagram illustrating the transmission of data packets between the first device and the second device in an embodiment of this application;
[0048] Figure 8 This is a schematic diagram of the structure of a data transmission control device provided in an embodiment of this application;
[0049] Figure 9This is a schematic diagram of another data transmission control device provided in an embodiment of this application;
[0050] Figure 10 This is a schematic diagram of the result of an electronic device provided in an embodiment of this application;
[0051] Figure 11 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] refer to Figure 1 The diagram shown is a flowchart illustrating the implementation of a data transmission control method according to an embodiment of this application. This method can be applied to electronic devices capable of data transmission, such as... Figure 2 The first device and the second device shown are electronic devices participating in data transmission within a network file system. The second device sends data packets to the first device. For example, the first device requests to read a data packet from the second device; or, the second device requests to write a data packet from the first device. The first device can be one of a client and a server, and the second device can be the other. The technical solution in this embodiment is mainly used to reduce the consumption of transmission resources between devices, thereby improving data transmission efficiency.
[0054] Specifically, the method in this embodiment may include the following steps:
[0055] Step 101: Obtain first information on the first device.
[0056] The first information contains target content that matches the second information. The second information is historical information that was sent from the first device to the second device before the first information.
[0057] For example, such as Figure 3 As shown, before the first message, the first device sends at least one second message to the second device. The first and second messages are used to instruct the second device to send a corresponding data packet to the first device.
[0058] In one scenario, the first and second information can be read request information, meaning the first device sequentially sends multiple read requests to the second device to request the reading of corresponding data packets from the second device. The first device has already sent at least one second read request to the second device before the first read request, and the first read request contains target content that matches the second read request.
[0059] In another scenario, the first and second information can be write response information. That is, after the second device sequentially writes data packets to the first device, the first device sequentially sends corresponding write responses to the second device. Each write response indicates that the data packets have been successfully written to the first device. The first device has already sent at least one second write response to the second device before the first write response, and the first write response contains target content that matches the second write response.
[0060] Step 102: Send the first information to the second device.
[0061] The target content is used by the second device to send a target data packet matching the target content to the first device when it has not received the second information.
[0062] In one scenario, the first information is a first read request. After the first read request is sent to the second device, the second device can obtain the target content from the first read request. If the second device does not receive the second read request, it can also determine the target data packet corresponding to the second read request, i.e., the target data packet that the first device failed to read, according to the target content in the first read request. Based on this, the second device can send a target data packet matching the target content to the first device. In this process, the first device does not need to resend the second read request to the second device.
[0063] In another scenario, the first information is the first write response. After sending the first write response to the second device, the second device can obtain the target content from the first write response. If the second device does not receive the second write response, it can also determine the target data packet corresponding to the second write response, i.e., the data packet that was not successfully written to the first device, based on the target content in the first write response. Based on this, the second device can send a target data packet matching the target content to the first device. In this process, the first device does not need to resend the second write response to the second device.
[0064] As can be seen from the above technical solution, in the data transmission control method provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0065] In one implementation, when the first information and the second information are read requests, the target content may include: read parameters corresponding to the second information, whereby the read parameters point to the data packet requested by the first device from the second device.
[0066] The reading parameters may include the offset address of the target data packet and the data length of the target data packet.
[0067] Furthermore, the first information includes a corresponding read identifier and read parameters. The read identifier uniquely identifies the first information and the order in which the first information is sent to the second device by the first device. The read parameters point to the data packet that the first device, as represented by the first information, requests to be read from the second device.
[0068] For example, the format of a read request is as follows:
[0069] Stuct Read_req{
[0070] Nfs_header0[fix_len0];
[0071] int xid; / / Read identifier
[0072] int prog; / / A fixed value representing the type of read request, used to identify FS_RAED
[0073] Nfs_header1[fix_len1];
[0074] int offset; / / Offset address
[0075] int count; / / Data length
[0076] Char contprevious; / / Read identifier of the previously sent read request
[0077] int offset_previous[contprevious] / / The offset address corresponding to the earlier read request. Int count_previous[contprevious] / / The data length corresponding to the earlier read request.
[0078] }
[0079] In this embodiment, a separate identifier (i.e., xid) range is set for read requests, such as [xid_write_min, xid_write_max]. The read identifiers xid in the identifier range are consecutive, so that the second device can determine read requests that have not been received.
[0080] In another implementation, when the first and second information are write responses, the target content may include: the write parameters corresponding to the second information, which point to the data packet that the second device has written to the first device.
[0081] The write parameters may include the data length of the target data packet.
[0082] Furthermore, the first information includes a corresponding write identifier and write parameters. The write identifier uniquely identifies the first information and the order in which the first information is sent from the first device to the second device. The write parameters point to the data packet written by the second device to the first device, as represented by the first information.
[0083] For example, the response format is as follows:
[0084] The response format for writing a file is as follows:
[0085] Stuct Write_rsp{
[0086] Nfs_header_rsp0[fix_len0];
[0087] int xid; / / Write identifier
[0088] Int prog;
[0089] Nfs_header_rsp1[fix_len1];
[0090] int count; / / Data length
[0091] Char contprevious; / / Write identifier corresponding to the previously sent write response
[0092] int count_previous[contprevious]; / / The length of the data corresponding to the first write response sent.
[0093] }
[0094] In this embodiment, a separate identifier (i.e., xid) range is set for write requests, such as [xid_write_min, xid_write_max]. The write identifier xid in the write response is consistent with the write identifier xid in the corresponding write request. The write identifier xids in the identifier range are continuous, so that the second device can determine the write response that has not been received.
[0095] refer to Figure 4 This is a flowchart illustrating the implementation of a data transmission control method provided in an embodiment of this application. This method can be applied to electronic devices capable of data transmission, such as... Figure 2 The second device shown is illustrated. The technical solution in this embodiment is mainly used to reduce the consumption of transmission resources between devices, thereby improving data transmission efficiency.
[0096] Specifically, the method in this embodiment may include the following steps:
[0097] Step 401: Receive the first information sent by the first device on the second device.
[0098] The first information contains target content that matches the second information. The second information is historical information that was sent from the first device to the second device before the first information.
[0099] It should be noted that the information format of the first information in this embodiment can refer to the content of the previous embodiment, and will not be described in detail here.
[0100] Step 402: Based on the target content, determine whether the second device has received the second information. If it is determined that the second device has not received the second information, proceed to step 403.
[0101] Step 403: Determine the target data packet that matches the target content based on the target content.
[0102] Step 404: Send the target data packet to the first device.
[0103] In one scenario, the first information is a first read request. After sending the first read request to the second device, the second device can obtain the target content from the first read request. The second device determines whether it has received the second read request based on the target content. If the second read request is not received, the second device can also determine the target data packet corresponding to the second read request, i.e., the target data packet that the first device failed to read, based on the target content in the first read request. Based on this, the second device can send a target data packet matching the target content to the first device. In this process, the first device does not need to resend the second read request to the second device.
[0104] In another scenario, the first information is a first write response. After sending the first write response to the second device, the second device can obtain the target content from the first write response. The second device determines whether it has received the second write response based on the target content. If the second write response is not received, the second device can also determine the target data packet corresponding to the second write response, i.e., the target data packet that was not successfully written to the first device, based on the target content in the first write response. Based on this, the second device can send a target data packet matching the target content to the first device. In this process, the first device does not need to resend the second write response to the second device.
[0105] As can be seen from the above technical solution, in the data transmission control method provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0106] In one implementation, step 402, when determining whether the second device has received the second information, can be achieved in the following way: Figure 5 As shown:
[0107] Step 501: Compare the target content with the historical information already received by the second device to determine whether there is historical information matching the target content. If there is no historical information matching the target content, proceed to step 502; if there is historical information matching the target content, proceed to step 503.
[0108] Step 502: Determine that the second device has not received the second information.
[0109] Step 503: Determine that the second device has received the second information.
[0110] In the specific implementation, the first information and the second information are respectively associated with information identifiers, such as the read identifier xid of a read request or the write identifier xid of a write response. The information identifier is used to uniquely represent the corresponding information and the order in which the information is sent from the first device to the second device.
[0111] For example, in addition to the target content, the first information also includes a first identifier corresponding to the first information, which uniquely identifies the first information and the order in which the first information is sent to the second device by the first device; similarly, the second information also includes a target identifier corresponding to the second information, which uniquely identifies the second information and the order in which the second information is sent to the second device by the first device. Accordingly, the target content in the first information includes a target identifier that identifies the second information.
[0112] Based on this, in step 502, the target identifier in the target content can be compared with the information identifier corresponding to the historical information already received by the second device to determine whether there is historical information matching the target content.
[0113] Specifically, if the information identifier corresponding to historical information matches the target identifier in the target content, it indicates that historical information matches the target content, and it can be determined that the second device has received the second information; if the information identifier corresponding to historical information does not match the target identifier in the target content, it indicates that no historical information matches the target content, and it can be determined that the second device has not received the second information.
[0114] In one implementation, the target content further includes: access parameters corresponding to the second information, which point to the data packet that the second device needs to transmit to the first device. For example, if the second information is a second read request, the target content includes read parameters corresponding to the second read request, which point to the data packet that the first device requests to read from the second device; as another example, if the second information is a second write response, the target content includes write parameters corresponding to the second write response, which point to the data packet that the second device has written to the first device.
[0115] Based on this, in step 403, when determining the target data packet that matches the target content, the data packet can be addressed in the second device according to the access parameters in the target content to obtain the target data packet.
[0116] In the case where the first information and the second information are read requests, the target content includes the read parameters corresponding to the second information. Based on this, in this embodiment, the corresponding target data packet is read in the second device according to the offset address and data length in the read parameters.
[0117] In the case where the first information and the yield information are write responses, the target content includes the write parameters corresponding to the second information. Based on this, in this embodiment, the corresponding target data packet is read in the second device according to the data length in the write parameters.
[0118] In one implementation, when sending the target data packet to the first device in step 404, it can be achieved in the following way, such as... Figure 6 As shown:
[0119] Step 601: Divide the target data packet into multiple data segments.
[0120] The data segments have a transmission order. For example, such as Figure 7 As shown in the figure, in this embodiment, the target data packet is divided into multiple data segments, such as data segments 1 to M, where M is a positive integer greater than or equal to 2.
[0121] Step 602: Send the data segments to the first device in sequence according to the transmission order.
[0122] Among them, the data segments that are transmitted in the last N order carry at least one target segment, and there is redundancy between the data segments and the target segments they carry. N is a positive integer greater than or equal to 1.
[0123] For example, such as Figure 7 As shown in the illustration, in this embodiment, when transmitting data segments within the target data packet, the data segments are transmitted in different ways based on the transmission order. At least one data segment that appears earlier in the transmission order does not carry a redundant target segment, while at least one redundant target segment is carried for the last N data segments in the transmission order. This reduces the likelihood of transmission failure in the latter half (the last N data segments) by carrying a redundant target segment, thereby reducing the probability of data segment retransmission and consequently reducing the amount of retransmission requests. This reduces the consumption of transmission resources between devices, ultimately improving data transmission efficiency.
[0124] Based on the above implementation, the number of target segments carried by a data segment is related to the transmission order of the corresponding data segments.
[0125] The later the transmission order, the more target segments the data segment carries.
[0126] Specifically, in this embodiment, the data transmission delay between the first device and the second device is first obtained, denoted by RTT, where one RTT represents the transmission of one data segment. If the transmission time of the currently transmitted data segment is greater than k*RTT (i.e., the time taken to transmit the remaining data segments is not in the last N segments of the transmission order), the second device retransmits the data segment in response to the feedback signal of unsuccessful transmission. If the transmission time of the currently transmitted data segment is less than k*RTT (i.e., the data segment is in the last N segments of the transmission order), the second device carries redundant target segments for the data segment, and the number of redundant target segments is related to the transmission time of the currently transmitted data segment. The closer to the end, the more redundant target segments the data segment carries.
[0127] refer to Figure 8 This is a schematic diagram of a data transmission control device provided in an embodiment of this application. This device can be deployed in... Figure 2 In the first device shown.
[0128] Specifically, the apparatus in this embodiment may include the following units:
[0129] Information acquisition unit 801 is used to acquire first information on a first device; the first information includes target content that matches second information; the second information is historical information that was sent to the second device by the first device before the first information.
[0130] The information sending unit 802 is used to send the first information to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device when it does not receive the second information.
[0131] Wherein, when the first information and the second information are read requests, the target content includes: the read parameters corresponding to the second information, wherein the read parameters point to the data packet that the first device requests to read from the second device;
[0132] When the first information and the second information are write responses, the target content includes: the write parameters corresponding to the second information, wherein the write parameters point to the data packet that the second device has written to the first device.
[0133] As can be seen from the above technical solution, in the data transmission control device provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0134] refer to Figure 9 This is a schematic diagram of a data transmission control device provided in an embodiment of this application. This device can be deployed in... Figure 2 In the second device shown.
[0135] Specifically, the apparatus in this embodiment may include the following units:
[0136] The information receiving unit 901 is used to receive first information sent by the first device on the second device; the first information contains target content that matches the second information; the second information is historical information that was sent by the first device to the second device before the first information.
[0137] The receiving determination unit 902 is used to determine whether the second device has received the second information based on the target content; if it is determined that the second device has not received the second information, the data packet determination unit 903 is triggered.
[0138] The data packet determination unit 903 is used to determine a target data packet that matches the target content based on the target content;
[0139] The data packet sending unit 904 is used to send the target data packet to the first device.
[0140] As can be seen from the above technical solution, in the data transmission control device provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0141] In one implementation, the receiving and determining unit 902 is specifically configured to: compare the target content with historical information already received by the second device to determine whether any historical information matches the target content; if no historical information matches the target content, determine that the second device has not received the second information; if historical information matches the target content, determine that the second device has received the second information.
[0142] The first information further includes a first identifier corresponding to the first information, the first identifier being used to uniquely represent the first information; the target content includes at least a target identifier corresponding to the second information, the target identifier being used to uniquely represent the second information; wherein, when the receiving and determining unit 902 compares the target content with historical information already received by the second device, it is specifically used to: compare the target identifier in the target content with the information identifier corresponding to the historical information already received by the second device; wherein, if there is an information identifier corresponding to the historical information that matches the target identifier in the target content, it indicates that there is historical information matching the target content; if there is no information identifier corresponding to the historical information that matches the target identifier in the target content, it indicates that there is no historical information matching the target content.
[0143] In one implementation, the target content includes: access parameters corresponding to the second information, wherein the access parameters point to the data packet that the second device needs to transmit to the first device;
[0144] Specifically, the data packet determination unit 903 is used to: perform data packet addressing in the second device according to the access parameters in the target content, so as to obtain the target data packet.
[0145] In one implementation, the data packet sending unit 904 is specifically used to: divide the target data packet into multiple data segments; the data segments have a transmission order; and send the data segments to the first device sequentially according to the transmission order; wherein the data segments in the last N transmission order carry at least one target segment, and there is redundancy between the data segments and the target segments they carry, where N is a positive integer greater than or equal to 1.
[0146] In one implementation, the number of target segments carried by the data segment is related to the transmission order of the data segments.
[0147] It should be noted that the specific implementation of each unit in this embodiment can be referred to the corresponding content above, and will not be described in detail here.
[0148] refer to Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device, as a first device, may include the following structure:
[0149] The processing module 1001, such as a central processing unit (CPU), is used to obtain first information; the first information contains target content that matches the second information; the second information is historical information that was sent to the second device by the first device before the first information.
[0150] The communication module 1002, such as an antenna, is used to send the first information to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device when it does not receive the second information.
[0151] As can be seen from the above technical solution, in the electronic device provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0152] refer to Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device, as a second device, may include the following structure:
[0153] The communication module 1101, such as a CPU, is used to receive first information sent by the first device on the second device; the first information contains target content that matches the second information; the second information is historical information that was sent by the first device to the second device before the first information.
[0154] The processing module 1102, such as an antenna, is used to determine whether the second device has received the second information based on the target content; if it is determined that the second device has not received the second information, it determines a target data packet matching the target content based on the target content.
[0155] The communication module 1101 is also used to send the target data packet to the first device.
[0156] As can be seen from the above technical solution, in the electronic device provided in this application embodiment, when the first device sends the first information, the target content that matches the second information sent earlier is carried in the first information. Thus, the second device can also send the target data packet that matches the target content to the first device even if it has not received the second information. The second device can send the target data packet pointed to by the target content to the first device without the first device retransmitting the second information to the second device. This can reduce the amount of non-data packet type information transmitted between the first device and the second device, thereby reducing the consumption of transmission resources between devices, and thus reducing data transmission latency and achieving the purpose of improving data transmission efficiency.
[0157] Taking the file read / write scenario between devices in NFS as an example, the technical solution of this application is described below:
[0158] This application primarily addresses the protection against weak network conditions and packet loss during NFS file read / write operations. Since NFS read signaling is largely the same except for the offset address and data length, redundancy for read requests can be achieved by simply redundanting the offset and length information in different packets, achieving the same effect as a regular FEC (Feature Controller). The opposite applies to write operations. While a large amount of data is written, the write response is almost identical except for the returned length. Therefore, for write response packets, redundancy is only needed for the returned length.
[0159] Furthermore, for read and write data packets, this application applies different FEC redundancy weights to packet segmentation for different User Datagram Protocol (UDP) protocols. Since read and write operations may involve reading up to 1MB of data at a time, the overall data packet transmission delay can be significant. If the entire data packet is divided into multiple UDP packets and reassembled at the receiving end, the earlier UDP packets have sufficient time for retransmission, but the time required decreases as the packet progresses. If retransmission is not completed before the last packet arrives, it will increase the packet assembly time. Therefore, this application adopts a low-to-high FEC protection strategy for the entire data packet segmentation, applying a higher level of FEC protection to later data packets.
[0160] The specific process is as follows:
[0161] The first step is to set a separate xid range [xid_read_min, xid_read_max] for read requests, so that the xids of read requests are continuous in order to handle packet loss.
[0162] The second step is that when the client sends a read request, if it is for the same file, the offset and data length count of the previous n requests are put into the offset_previous and count_previous fields of this read request, and the xid of the read request is incremented by 1.
[0163] The third step is that after the server receives the read request from the client, it divides the data packet corresponding to the read request into N data segments, sends one data segment at a time, and listens for the client's feedback, such as P0, P1, P2, ACK0 (feedback of p0), P3, ACK1 (feedback of p1), etc.
[0164] Based on this, the data packet transmission delay is estimated (Ack0-P0 delay), and the final delay number rtt is calculated using Kalman filtering. When the distance from the end of the current data segment is greater than k*rtt, only NACK is used for retransmission. For packets with a distance from the end of the segment less than k*rtt, fec weighted weight (ki) / k is used to generate fec packets, with the weight increasing as the packet approaches the end.
[0165] It should be noted that for write requests, unlike read requests, the data written by the client to the server needs to be divided into N fragments. The NACK and FEC strategies are similar to the strategies used by the server to send read responses to the client.
[0166] For redundancy strategies in write responses, the redundancy effect can be achieved by adding the count of the data packets corresponding to the previous contprevious write requests to the previous write response.
[0167] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0168] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0169] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0170] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission control method, the method comprising: Obtain the first information on the first device; The first information contains target content that matches the second information; The second information is historical information that was sent from the first device to the second device before the first information; the target content is only a portion of the data from the previously sent second information, and the target content is used to indicate the offset address of the target data packet and / or the data length of the target data packet; The first information is sent to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device when the second device has not received the second information, without the first device needing to retransmit the second information to the second device.
2. The method according to claim 1, wherein when the first information and the second information constitute a read request, the target content includes: The second information corresponds to the read parameters, which point to the data packet that the first device requests to be read from the second device; When the first information and the second information are write responses, the target content includes: the write parameters corresponding to the second information, wherein the write parameters point to the data packet that the second device has written to the first device.
3. A data transmission control method, comprising: Receive the first information sent by the first device on the second device; The first information contains target content that matches the second information; The second information is historical information that was sent from the first device to the second device before the first information, and the first device does not need to retransmit the second information to the second device; The target content is only a portion of the data from the previously sent second information, and the target content is used to indicate the offset address of the target data packet and / or the data length of the target data packet; Based on the target content, determine whether the second device has received the second information; If it is determined that the second device has not received the second information, a target data packet matching the target content is determined based on the target content; The target data packet is sent to the first device.
4. The method according to claim 3, wherein determining whether the second device has received the second information comprises: The target content is compared with the historical information already received by the second device to determine whether any of the historical information matches the target content. If no historical information matches the target content, it is determined that the second device has not received the second information; If the historical information matches the target content, it is determined that the second device has received the second information.
5. The method according to claim 4, wherein the first information further includes a first identifier corresponding to the first information, the first identifier being used to uniquely represent the first information; the target content includes at least a target identifier corresponding to the second information, the target identifier being used to uniquely represent the second information; in, Comparing the target content with historical information already received by the second device includes: The target identifier in the target content is compared with the information identifier corresponding to the historical information already received by the second device; Wherein, if the information identifier corresponding to the historical information is consistent with the target identifier in the target content, it indicates that the historical information matches the target content; If no information identifier corresponding to the historical information matches the target identifier in the target content, it indicates that no historical information matches the target content.
6. The method according to claim 4 or 5, wherein the target content includes: The access parameters corresponding to the second information point to the data packet that the second device needs to transmit to the first device; The process of determining the target data packet that matches the target content includes: According to the access parameters in the target content, packet addressing is performed in the second device to obtain the target data packet.
7. The method according to claim 4 or 5, wherein sending the target data packet to the first device comprises: The target data packet is divided into multiple data segments; the data segments have a transmission order. The data segments are sent to the first device sequentially according to the transmission order. The data segments that are transmitted in the last N order carry at least one target segment, and there is redundancy between the data segments and the target segments they carry, where N is a positive integer greater than or equal to 1.
8. The method according to claim 7, wherein the number of target segments carried by the data segment is related to the transmission order corresponding to the data segment.
9. An electronic device, comprising, as a first device: The processing module is used to obtain the first information; The first information contains target content that matches the second information; The second information is historical information that was sent from the first device to the second device before the first information; the target content is only a portion of the data from the previously sent second information, and the target content is used to indicate the offset address of the target data packet and / or the data length of the target data packet; The communication module is used to send the first information to the second device; the target content is used by the second device to send a target data packet matching the target content to the first device when it does not receive the second information, without requiring the first device to retransmit the second information to the second device.
10. An electronic device, comprising as a second device: The communication module is used to receive first information sent by the first device on the second device; The first information contains target content that matches the second information; The second information is historical information that was sent from the first device to the second device before the first information, and the first device does not need to retransmit the second information to the second device; The target content is only a portion of the data from the previously sent second information, and the target content is used to indicate the offset address of the target data packet and / or the data length of the target data packet; The processing module is configured to determine whether the second device has received the second information based on the target content; and if it is determined that the second device has not received the second information, to determine a target data packet matching the target content based on the target content. The communication module is also used to send the target data packet to the first device.
Citation Information
Patent Citations
Network transmission method and related device
CN111510447A
Data transmission method and device, electronic equipment and storage medium
CN118540773A