Data transmission method, electronic equipment and computer readable storage medium
By finding the mapping relationship between service type and MSS value, dynamically adjusting the MSS value of the transmission protocol stack layer, solving the problem that MSS value in IPv6 affects the transmission quality, and achieving efficient and reliable data transmission.
Patent Information
- Application Number
- CN202311080332.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2025-03-04
AI Technical Summary
In Internet Protocol Version 6 (IPv6), the intermediate device does not perform sharding operations, resulting in a greater impact on transmission quality. A larger MSS value can improve transmission efficiency, but if it exceeds the maximum transmission unit (MTU) length of the intermediate device, it will lead to packet loss risk and reduce connectivity.
By looking for the mapping relationship between service type and MSS value, dynamically adjust the MSS value of the transmission protocol stack layer, determine the data packet length corresponding to the data transmission request based on the type of the target service, and ensure that the data packet length does not exceed the minimum MTU length on the link.
It realizes dynamic adjustment of MSS value according to different service types, meets the data transmission needs of different services, improves transmission efficiency and reliability, and reduces packet loss risk and network bandwidth waste.
Smart Images

Figure CN119561912A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data transmission method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In Internet Protocol Version 6 (IPv6), intermediate devices (such as routers) do not perform fragmentation operations, so the Maximum Segment Size (MSS) has a greater impact on the transmission quality of the service. A larger MSS value can improve transmission efficiency to a certain extent, but if the MSS value exceeds the length of the Maximum Transmission Unit (MTU) of the intermediate device, there will be a risk of packet loss, resulting in transmission failure, thereby reducing connectivity. Therefore, how to dynamically adjust the MSS value to meet the data transmission requirements of different services is an urgent problem to be solved. Summary of the invention
[0003] The embodiments of the present application provide a data transmission method, an electronic device, and a computer-readable storage medium to dynamically adjust the MSS value to meet the data transmission requirements of different services.
[0004] In the first aspect, an embodiment of the present application provides a data transmission method, including: in response to a data transmission request from a client for a target service, obtaining the type of the target service; looking up the mapping relationship between the service type and the MSS value, and determining the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer; determining the length of the data packet corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer; and transmitting the data packet to the client according to the length of the data packet.
[0005] In the second aspect, an embodiment of the present application provides a data transmission method, including: sending a data transmission request for a target service to a server to trigger the server to look up the mapping relationship between the service type and the maximum segment length MSS value, determine the MSS value corresponding to the service type of the target service, and use the corresponding MSS value as the MSS value of the transmission protocol stack layer; receive the data packet transmitted by the server in response to the data transmission request, and the length of the data packet is determined according to the MSS value of the transmission protocol stack layer.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, and the processor implements the method provided in any embodiment of the present application when executing the computer program.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided in any embodiment of the present application is implemented.
[0008] Compared with the prior art, the technical solution of the embodiment of the present application has the following advantages:
[0009] By looking up the mapping relationship between the service type and the MSS value, the MSS value corresponding to the type of the target service is determined, and the MSS value corresponding to the type of the target service is used as the MSS value of the transmission protocol stack layer. The length of the data message corresponding to the data transmission request is determined according to the MSS value of the transmission protocol stack layer. The MSS value of the transmission protocol stack layer can be dynamically adjusted based on the type of the target service, thereby meeting the data transmission requirements of different types of services.
[0010] By establishing a mapping relationship between service types and MSS values according to the rule that the MSS value corresponding to the first service is less than the MSS value corresponding to the second service, for services with high efficiency requirements, the MSS value is larger, so that the network bandwidth can be more fully utilized during data transmission, effectively improving data transmission efficiency; for services with high connectivity requirements, the MSS value is smaller, so that congestion and delay problems caused by network transmission mismatch can be avoided during data transmission, reducing the risk of packet loss and transmission interruption, and being able to meet the needs of different types of services in a differentiated manner, so that data transmission can better meet the actual needs of the target service.
[0011] By selecting the smaller value between the MSS value of the transport protocol stack layer and the MSS value of the routing layer as the target MSS value, during the data transmission process, it is ensured that the data packet can adapt to the limitations of the transport protocol stack layer and the network link, avoiding packet loss during the data transmission process. By determining the length of the data message corresponding to the data transmission request according to the target MSS value, the data can be segmented according to the target MSS value to ensure that the length of each data packet does not exceed the target MSS value, thereby optimizing data transmission and improving data transmission efficiency.
[0012] By making the length of the data message less than or equal to the MSS value of the transport protocol stack layer, the length of the data message corresponding to the data transmission request is guaranteed not to exceed the length of the minimum MTU on the link. Under IPv6, the risk of packet loss during data transmission can be effectively reduced, and the reliability of data transmission can be improved. Moreover, the length of the data message set in this way can effectively utilize the network bandwidth, make the data packet more compact, reduce the transmission time and resource consumption, and thus improve the transmission efficiency.
[0013] By obtaining the mapping relationship between the service type and the MSS value from the database, it is convenient to add, modify, and delete the mapping relationship without modifying the code or configuration files, which has high flexibility and scalability. In addition, when there are multiple service access gateways, the database can be used as a shared data source so that all service access gateways can access the same mapping relationship data. By obtaining the mapping relationship between the service type and the MSS value from the service access gateway, it is faster to obtain the mapping relationship in scenarios with high real-time requirements. Moreover, obtaining the mapping relationship directly from the service access gateway can reduce dependence on the database and avoid the impact of database failures or performance issues on the service.
[0014] By periodically obtaining the mapping relationship from the database and caching the mapping relationship in the service access gateway, the server can quickly obtain the mapping relationship between the service type and the MSS value from the service access gateway without having to access the database every time. This can reduce the database load and the query frequency of the database, thereby improving the performance and responsiveness of the database, while reducing waiting time and enhancing the responsiveness of the system. In addition, since the service access gateway is usually located in the edge network, it is closer to the client. By caching the mapping relationship in the service access gateway, the server does not need to traverse the entire network to access the database, but directly obtains the mapping relationship from the service access gateway, thereby reducing the network delay of data transmission. In addition, when the database fails or is unavailable, since the mapping relationship has been cached in the service access gateway, the system can still provide services, improving the stability and availability of the system.
[0015] By sending an MSS value pending notification to the client when the MSS value corresponding to the type of the target service is not found in the mapping relationship, so that the client determines the MSS value of the transmission protocol stack layer according to the MSS value pending notification, the fault tolerance of the system can be enhanced to ensure that the data transmission of the target service can still proceed normally when the MSS value corresponding to the type of the target service is not found.
[0016] By sending a preset MSS value to the client when the MSS value corresponding to the type of the target service is not found in the mapping relationship, so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value, the fault tolerance of the system can also be enhanced to ensure that the data transmission of the target service can still proceed normally when the MSS value corresponding to the type of the target service is not found.
[0017] By using the MSS value of the transmission protocol stack layer as the MSS value corresponding to the type of the target service, and adding the type of the target service and the corresponding MSS value to the mapping relationship, the mapping relationship between the service type and the MSS value can be updated, and the mapping relationship between the service type and the MSS value can be made more complete. When the client sends a data transmission request for the target service again, the MSS value corresponding to the type of the target service can be found in the mapping relationship, and the MSS value corresponding to the type of the target service can be directly used as the MSS value of the transmission protocol stack layer, thereby avoiding the problem of missing MSS value corresponding to the service type in the mapping relationship.
[0018] By obtaining the domain name information of the data transmission request as the type of the target service, the MSS value of the transmission protocol stack layer can be dynamically adjusted based on the domain name information of the data transmission request for the target service, thereby meeting the data transmission requirements of different services.
[0019] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0021] Figure 1 An application scenario diagram of the data transmission method provided by an embodiment of the present application is shown;
[0022] Figure 2 A flowchart showing a data transmission method provided in Embodiment 1 of the present application is shown;
[0023] Figure 3 An example diagram showing an application of the data transmission method provided by an embodiment of the present application;
[0024] Figure 4 Another example diagram of an application of the data transmission method provided by an embodiment of the present application is shown;
[0025] Figure 5 A flowchart showing a data transmission method provided in Embodiment 2 of the present application is shown;
[0026] Figure 6 The following is an architecture diagram of a data transmission device provided in Embodiment 3 of the present application;
[0027] Figure 7 The following is an architecture diagram of a data transmission device provided in Embodiment 4 of the present application;
[0028] Figure 8 A block diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0030] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.
[0031] The following terms are used in this article:
[0032] Transmission Control Protocol (TCP): a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0033] Availability: refers to the proportion of successful requests, which is the opposite of the failure rate.
[0034] Connectivity: refers to the proportion of successful requests during the TCP connection establishment phase. It reflects how many requests to establish TCP connections are successfully established within a certain period of time.
[0035] Cloud services: refers to migrating traditional services and applications to cloud computing platforms to provide more efficient, flexible and scalable solutions by leveraging the advantages of cloud computing. Cloud services utilize cloud computing infrastructure, platforms and services to provide faster, more reliable and cost-effective services. This approach can change the organization's operating model and enable it to better adapt to market needs and changes. In cloud services, traditional hardware devices, servers, storage and network resources are migrated to the data center of the cloud service provider.
[0036] TCP Segment: Divide large data streams into smaller units for transmission in the network.
[0037] Kernel: The core part of the operating system, responsible for managing computer hardware resources, providing basic system services, driving hardware devices, scheduling tasks and other core functions.
[0038] struct tcp_sock data structure: A data structure used in the kernel to represent a TCP connection.
[0039] setsockopt interface: A network programming interface used to set socket options, usually used in programming to customize the behavior and configuration of sockets.
[0040] Region: refers to the geographical location of the data centers managed by the cloud service provider. Each cloud service provider has established a series of data centers in different geographical areas, which are usually distributed in different cities or countries around the world. Each data center constitutes a "region".
[0041] Hot standby disaster recovery: means that the backup database can quickly take over the work of the primary database at any time. This means that the backup database always keeps the latest data and can immediately take over the work of the primary database without the need for a long recovery process. This can minimize system interruption time and ensure service continuity.
[0042] Client: The client is the party that initiates the request for data transfer. In network communications, a client is a computer, device, or application that requests a service or resource. It sends a request to the server and waits for a response. Typical client applications include web browsers, mobile applications, and software that communicates with other devices over the network.
[0043] Server: The server is the party that responds to data transfer requests. It is a computer, device, or application that provides services or resources. The server receives data transfer requests from the client, processes the data transfer requests, and sends responses back to the client. The server is usually responsible for processing business logic, storing data, and coordinating with multiple clients. The client initiates a data transfer request, the server receives the data transfer request, processes it, and then sends a response back to the client. The client and server usually run on different physical devices and communicate through a network connection. The communication between the client and the server can be based on different protocols and technologies.
[0044] According to statistics from the IPv6 Development Monitoring Platform, as of February 2023, the proportion of mobile network IPv6 reached 50.08%, achieving a historic breakthrough in mobile network IPv6 traffic exceeding IPv4 traffic, marking a new milestone in the progress of IPv6 in mobile networks. With the scale of IPv6 services, ensuring the transmission quality of IPv6 has become a vital task.
[0045] In the related art, when the MSS value is large, the transmission efficiency is high because the payload of the data message is large. When the MSS value exceeds the MTU length of the intermediate device, IPv6 prohibits fragmentation of the intermediate device, which will cause the risk of packet loss, reducing availability and connectivity. In IPv6, when the MSS is small, the transmission efficiency is relatively low because the payload of the data message is small, but the MSS value will not exceed the MTU length of the intermediate device, so the availability and connectivity are high.
[0046] There are many different cloud services, and different services have different requirements for transmission efficiency, availability, and connectivity. For example, services such as file download and on-demand services pursue download speed, have higher requirements for transmission efficiency, and can retry even if the request fails; services such as financial transactions and games have higher requirements for availability and connectivity, and the cost of retrying after a request fails is too high, and even leads to unacceptable losses. Therefore, how to dynamically adjust the MSS value to meet the data transmission requirements of different services is an urgent problem to be solved.
[0047] Figure 1 The following is a diagram showing an application scenario of the data transmission method provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes a client 101 and a server 102 .
[0048] The client 101 sends a data transmission request for a target service to the server 102. The server 102 can respond to the data transmission request for the target service from the client 101, obtain the type of the target service, and then find the mapping relationship between the service type and the MSS value, determine the MSS value corresponding to the type of the target service, and use the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer. The server 102 then determines the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer, and finally transmits the data message to the client 101 according to the length of the data message. The client 101 receives the data message transmitted by the server 102 in response to the data transmission request.
[0049] Exemplarily, the service types in the mapping relationship may include types of high efficiency demand classes and types of high connectivity demand classes. Among them, types of high efficiency demand classes refer to types with relatively high requirements for transmission efficiency and relatively low requirements for availability and connectivity, such as download types, on-demand types, etc. Types of high connectivity demand classes refer to types with relatively high requirements for availability and connectivity, and relatively low requirements for transmission efficiency, such as financial transaction types and game types, etc. In the above mapping relationship, the MSS value corresponding to the type of high efficiency demand class is larger to ensure that the payload of the data message is large and the transmission efficiency is improved; the MSS value corresponding to the type of high connectivity demand class is smaller to ensure that the request is successful and avoid transmission interruption.
[0050] Exemplarily, when the client 101 sends a data transmission request for a download service, the server 102 responds to the data transmission request for the download service from the client 101 and obtains the type of the download service. The server 102 can determine a larger MSS value corresponding to the type of the download service by searching for a mapping relationship between the service type and the MSS value, and uses the determined MSS value as the MSS value of the transmission protocol stack layer. Since the MSS value of the transmission protocol stack layer is larger, the length of the data message corresponding to the data transmission request determined according to the MSS value of the transmission protocol stack layer is larger, thereby making the payload of the data message larger. Based on the larger length of the data message, the data message is transmitted to the client 101 to meet the high transmission efficiency requirements of the download service. When the client 101 sends a data transmission request for a game service, the server 102 responds to the data transmission request for the game service from the client 101 and obtains the type of the game service. By searching for a mapping relationship between the service type and the MSS value, a smaller MSS value corresponding to the type of the game service can be determined, and the determined MSS value is used as the MSS value of the transmission protocol stack layer. Since the MSS value of the transmission protocol stack layer is small, the length of the data message corresponding to the data transmission request determined according to the MSS value of the transmission protocol stack layer is small, so that the effective load of the data message is small. Based on the small data message length, the data message is transmitted to the client 101, meeting the high availability and high connectivity requirements of the game service.
[0051] Exemplarily, the client 101 may be hardware, such as electronic devices such as mobile phones, personal computers, tablet computers, wearable devices, etc., or an application (Application, APP) installed in the above electronic devices. The server 102 may be a single server such as an edge server, or a cloud server array and a virtual machine (Virtual Machine, VM) running in the cloud server array, or other devices, such as computers, mobile phones, notebooks, etc., which are terminal devices capable of running corresponding service programs, and the embodiments of the present application do not limit this.
[0052] The data transmission method of the embodiment of the present application can find the mapping relationship between the service type and the MSS value, determine the MSS value corresponding to the type of the target service, and use the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer. The MSS value of the transmission protocol stack layer can be dynamically adjusted based on the type of the target service, thereby meeting the data transmission requirements of different types of services.
[0053] It should be noted that the above-mentioned application scenarios or application examples of the data transmission method provided in the embodiments of the present application are for ease of understanding, and the embodiments of the present application do not specifically limit the application of the data transmission method.
[0054] Embodiment 1
[0055] Figure 2 The flowchart of the data transmission method provided by the embodiment of the present application is shown. The data transmission method can be applied to a server such as an edge server or a cloud server. Figure 2 As shown, the data transmission method includes:
[0056] Step S201: In response to a data transmission request from a client for a target service, the type of the target service is obtained.
[0057] Exemplarily, the types of services include, but are not limited to, download service types, financial transaction service types, game service types, on-demand service types, etc. When the server receives a data transmission request for a target service, it is necessary to first determine the type of the target service. The server can determine the type of the target service through specific fields or parameters in the data transmission request. For example: the domain name information corresponding to the data transmission requests of different services is different. When the server receives a data transmission request for a target service from the client, it can obtain the domain name information of the data transmission request through specific fields or parameters in the data transmission request, and determine the type of the target service based on the domain name information.
[0058] In an application example, when a user enters an application store and clicks the "Download" button on the display interface of an application named "A" (hereinafter referred to as the application) to download the application named "A" (hereinafter referred to as the application), the client is the terminal device of the user who applies to download application A, and the server may be the server that provides service resources for downloading application A. The terminal device will send a data transmission request for downloading application A to the server of the application store, and the server of the application store can obtain the domain name information "www.download.com" of the data transmission request, and determine the type of the target service as a download service type based on the domain name information.
[0059] Step S202: Look up the mapping relationship between the service type and the MSS value, and determine the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer.
[0060] Among them, the mapping relationship between the service type and the MSS value can be pre-established. In this mapping relationship, the MSS values corresponding to different service types can be different. In the process of establishing the mapping relationship between the service type and the MSS value, the types of multiple services can be first classified according to the transmission efficiency requirements and connectivity requirements, and the type of each service can be determined as a high efficiency requirement class or a high connectivity requirement class. Then, based on the classification results of each service type, different MSS values are configured for each service, thereby realizing the establishment of a mapping relationship between the service type and the MSS value. For example: when the service type is a high efficiency requirement class, a larger MSS value can be configured for the service; when the service type is a high connectivity requirement class, a smaller MSS value can be configured for the service. Among them, each service can be a service on a content delivery network (Content Delivery Network, CDN) platform or a cloud computing platform. The transmission protocol stack layer can be a TCP transmission protocol stack layer.
[0061] Step S203: Determine the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer.
[0062] Step S204: Transmit the data message to the client according to the length of the data message.
[0063] In this way, the length of the data message corresponding to the data transmission request can match the MSS value of the transmission protocol stack layer. A larger MSS value of the transmission protocol stack layer can correspond to a larger data message length, and a smaller MSS value of the transmission protocol stack layer can correspond to a smaller data message length, so that the data message can fill each TCP segment as much as possible, fully utilize the network bandwidth, maximize the data transmission efficiency, and reduce the waste of network bandwidth. At the same time, it can avoid packet loss due to the length of the data message exceeding the MTU length of the intermediate device, ensure that the data message can be sent to the client, and improve the reliability of data transmission. Moreover, since each TCP segment has its own header information, the length of the data message set in this way can reduce unnecessary header overhead and increase the proportion of valid data. In addition, it can also shorten the transmission time of each TCP segment, reduce the overall transmission delay, improve user experience, and reduce the potential impact of network congestion, and improve data stability and reliability.
[0064] According to the data transmission method of the embodiment of the present application, the MSS value corresponding to the type of the target service is determined by looking up the mapping relationship between the service type and the MSS value, and the MSS value corresponding to the type of the target service is used as the MSS value of the transmission protocol stack layer. The length of the data packet corresponding to the data transmission request is determined according to the MSS value of the transmission protocol stack layer. The MSS value of the transmission protocol stack layer can be dynamically adjusted based on the type of the target service, thereby meeting the data transmission requirements of different types of services.
[0065] In one embodiment, the service type may include a high efficiency requirement class and a high connectivity requirement class. The data transmission method provided in the embodiment of the present application also includes: establishing a mapping relationship between the service type and the MSS value according to the rule that the MSS value corresponding to the first service is less than the MSS value corresponding to the second service; wherein the type of the first service is a high connectivity requirement class, and the type of the second service is a high efficiency requirement class. The first service has a lower demand for transmission efficiency than the second service, and the first service has a higher demand for availability and connectivity than the second service.
[0066] Among them, since the type of the first service is a high connectivity demand class, the first service has high requirements for availability and connectivity, and low requirements for transmission efficiency, so the MSS value corresponding to the first service is smaller, so as to ensure the success of the data transmission request and avoid transmission interruption. Correspondingly, since the type of the second service is a high efficiency demand class, the second service has high requirements for transmission efficiency, and low requirements for availability and connectivity, so the MSS value corresponding to the second service is larger, so as to ensure that the payload of the data message is large and improve the transmission efficiency. Based on this, a rule that the MSS value corresponding to the first service is smaller than the MSS value corresponding to the second service can be determined. According to the rule, corresponding MSS values are configured for different types of services respectively, and a mapping relationship between service types and MSS values is established, so as to achieve a mapping relationship between service types and MSS values according to the rule that the MSS value corresponding to the first service is smaller than the MSS value corresponding to the second service. Specifically, when the service is the first service, a smaller MSS value is configured for the service; when the service is the second service, a larger MSS value is configured for the service. Exemplarily, multiple services on the platform can be classified first, and the type of each service can be determined as a high efficiency demand class or a high connectivity demand class. For services with high efficiency requirements (i.e., the second service), you can configure the largest possible MSS value, such as 1350 bytes, 1450 bytes, etc. For services with high connectivity requirements (i.e., the first service), you can configure the smallest possible MSS value, such as 1280 bytes, 1000 bytes, etc. For example, for services with high connectivity requirements, you can use the minimum MTU length (i.e., 1280 bytes) specified by IPv6 to calculate the corresponding MSS value.
[0067] In the embodiment of the present application, a mapping relationship between service types and MSS values is established according to the rule that the MSS value corresponding to the first service is less than the MSS value corresponding to the second service. For services with high efficiency demand types, the MSS value is relatively large, so that the network bandwidth can be more fully utilized during data transmission, effectively improving the data transmission efficiency; for services with high connectivity demand types, the MSS value is relatively small, so that congestion and delay problems caused by network transmission mismatch can be avoided during data transmission, reducing the risk of packet loss and transmission interruption, and being able to differentiate to meet the needs of different types of services, so that data transmission can better meet the actual needs of the target service.
[0068] In one embodiment, in step S203, determining the length of the data packet corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer may include: determining the MSS value of the routing layer; selecting a smaller value between the MSS value of the transmission protocol stack layer and the MSS value of the routing layer as the target MSS value; determining the length of the data packet according to the target MSS value; wherein the length of the data packet is less than or equal to the target MSS value.
[0069] The routing layer is the above-mentioned intermediate device, also known as a router. The MSS value of the routing layer is the MSS value saved by the routing layer. The MSS value can be a value calculated by the local host kernel based on the local network environment and MTU, which is used to guide the data segmentation of the TCP connection initiated locally. For example, the MSS value of the routing layer can be the MTU minus the TCP header length and the IP data packet header length to adapt to the limitations of the network link. The MSS value of the routing layer can also be a value learned during the data transmission process.
[0070] Exemplarily, when the determined MSS value of the transmission protocol stack layer is smaller than the MSS value of the routing layer, the MSS value of the transmission protocol stack layer is a smaller value. In this case, the MSS value of the transmission protocol stack layer can be used as the target MSS value, and the length of the data packet corresponding to the data transmission request for the target task is determined according to the MSS value of the transmission protocol stack layer; when the determined MSS value of the transmission protocol stack layer is greater than the MSS value of the routing layer, the MSS value of the routing layer is a smaller value. In this case, the MSS value of the routing layer can be used as the target MSS value, and the length of the data packet corresponding to the data transmission request for the target task is determined according to the MSS value of the routing layer.
[0071] In the embodiment of the present application, by selecting a smaller value from the MSS value of the transmission protocol stack layer and the MSS value of the routing layer as the target MSS value, during the data transmission process, it is ensured that the data packet can adapt to the limitations of the transmission protocol stack layer and the network link, and the packet loss problem during the data transmission process is avoided. By determining the length of the data message corresponding to the data transmission request according to the target MSS value, the data can be segmented according to the target MSS value to ensure that the length of each data packet does not exceed the target MSS value, thereby optimizing data transmission and improving data transmission efficiency.
[0072] In one implementation, the length of the data message is less than or equal to the MSS value of the transport protocol stack layer. This setting ensures that the length of the data message corresponding to the data transmission request does not exceed the length of the minimum MTU on the link. Under IPv6, the risk of packet loss during data transmission can be effectively reduced, and the reliability of data transmission can be improved. Moreover, the length of the data message set in this way can effectively utilize the network bandwidth, make the data packet more compactly transmitted, reduce transmission time and resource consumption, and thus improve transmission efficiency.
[0073] In one implementation, before step S202, the data transmission method provided in the embodiment of the present application may further include: acquiring a mapping relationship between a service type and an MSS value from a database; or acquiring a mapping relationship between a service type and an MSS value from a service access gateway.
[0074] Figure 3 The following is an example diagram showing an application of the data transmission method provided in an embodiment of the present application. Figure 3 Four services are shown in the figure, namely the first service, the second service, the third service and the fourth service. By classifying the types of the four services, it can be determined that the types of the first service and the second service are high connectivity demand classes, and the types of the third service and the fourth service are high efficiency demand classes. Based on the classification results of each service type, an MSS value of 1000 bytes is configured for the first service, an MSS value of 1280 bytes is configured for the second service, an MSS value of 1450 bytes is configured for the third service, and an MSS value of 1350 bytes is configured for the fourth service, thereby establishing a mapping relationship between service types and MSS values. The mapping relationship between service types and MSS values is then stored in the database.
[0075] In one example, when the client sends a data transmission request for the target service, the server responds to the client's data transmission request for the target service, obtains the type of the target service, and then obtains the mapping relationship between the service type and the MSS value from the database, thereby finding the mapping relationship between the service type and the MSS value, and determining the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer, so that the MSS value of the transmission protocol stack layer can match the type of the target service to meet the data transmission requirements of different types of services. Then, the length of the data packet corresponding to the data transmission request is determined according to the MSS value of the transmission protocol stack layer. Finally, the data packet is transmitted to the client based on the length of the data packet. Among them, the construction of the database can adopt multi-region deployment and hot standby disaster recovery strategy.
[0076] Therefore, the server can directly obtain the mapping relationship between the service type and the MSS value from the database. As a centralized data storage location, the database can centrally manage and maintain the mapping relationship between different service types and MSS values. This makes it easy to add, modify, and delete the mapping relationship without modifying the code or configuration files, which has high flexibility and scalability. In addition, when there are multiple service access gateways, the database can be used as a shared data source so that all service access gateways can access the same mapping relationship data.
[0077] In another example, combining Figure 3 , the server can obtain the mapping relationship between the service type and the MSS value from the database, and cache the mapping relationship in the service access gateway. When the client sends a data transmission request for the target service, the server responds to the client's data transmission request for the target service, obtains the type of the target service, and then obtains the mapping relationship between the service type and the MSS value from the service access gateway, thereby finding the mapping relationship between the service type and the MSS value, and determining the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer, so that the MSS value of the transmission protocol stack layer can match the type of the target service to meet the data transmission requirements of different types of services. Then, the length of the data message corresponding to the data transmission request is determined according to the MSS value of the transmission protocol stack layer. Finally, the data message is transmitted to the client based on the length of the data message. For example: the service access gateway can be programs such as nginx, tengine, and apache.
[0078] In this example, obtaining the mapping relationship from the service access gateway can reduce the overhead of database queries, thereby reducing the response delay of the system. In scenarios with high real-time requirements, it is faster to obtain the mapping relationship directly from the service access gateway. In addition, obtaining the mapping relationship directly from the service access gateway can reduce dependence on the database and avoid the impact of database failures or performance issues on the service.
[0079] In one implementation, the data transmission method provided in the embodiment of the present application further includes: periodically acquiring a mapping relationship from a database, and caching the mapping relationship in a service access gateway.
[0080] Although the mapping relationship between the service type and the MSS value in the database may change, the frequency of change of the mapping relationship between the service type and the MSS value is low. Moreover, the system usually has a fault-tolerant mechanism, so it can operate normally even if the mapping relationship between the service type and the MSS value fails to be updated synchronously in some cases. Therefore, the frequency of obtaining the mapping relationship from the database should not be too high, so as to avoid frequent queries to the database and reduce system resource consumption and delays. Exemplarily, the server can obtain the mapping relationship from the database once every 1 to 5 minutes (including the endpoint value) and cache the mapping relationship in the service access gateway. Of course, the frequency of obtaining the mapping relationship from the database can be adjusted according to actual needs, and this application does not limit this.
[0081] For example, when it is necessary to efficiently find the mapping relationship between the service type and the MSS value, the mapping relationship can be cached in the memory of the service access gateway. For example, in a scenario where multiple data transmission requests are concurrent, the mapping relationship between the service type and the MSS value can be found for multiple data transmission requests at the same time to improve data transmission efficiency.
[0082] In an embodiment of the present application, by periodically obtaining a mapping relationship from a database and caching the mapping relationship in a service access gateway, the server can quickly obtain the mapping relationship between the service type and the MSS value from the service access gateway without having to access the database every time, which can reduce the database load and the query frequency of the database, thereby improving the performance and responsiveness of the database, and at the same time can reduce waiting time and enhance the responsiveness of the system. In addition, since the service access gateway is usually located in the edge network, it is closer to the client. By caching the mapping relationship in the service access gateway, the server does not need to traverse the entire network to access the database, but directly obtains the mapping relationship from the service access gateway, thereby reducing the network delay of data transmission. In addition, when the database fails or is unavailable, since the mapping relationship has been cached in the service access gateway, the system can still provide services, improving the stability and availability of the system.
[0083] In one embodiment, before step S203, the data transmission method provided in the embodiment of the present application also includes: if the MSS value corresponding to the type of the target service is not found in the mapping relationship, sending an MSS value pending notification to the client, so that the client determines the MSS value of the transmission protocol stack layer according to the MSS value pending notification.
[0084] After obtaining the type of the target service, the server searches for the mapping relationship between the service type and the MSS value. If the MSS value corresponding to the type of the target service can be found in the mapping relationship, the MSS value found in the mapping relationship is used as the MSS value of the transport protocol stack layer; if the MSS value corresponding to the type of the target service is not found in the mapping relationship, an MSS value pending notification is sent to the client, so that the client determines the MSS value of the transport protocol stack layer according to the MSS value pending notification. At this time, the MSS value of the transport protocol stack layer can be customized by the user.
[0085] For example: when the type of the target service is a new service type introduced in the platform, and the mapping relationship between the service type and the corresponding MSS value has not been established, or when the mapping relationship between the type of the target service and the corresponding MSS value is lost due to some abnormal circumstances, the MSS value corresponding to the type of the target service cannot be found in the mapping relationship. If the server completely stops responding in this case, it will affect the entire service. Therefore, sending an MSS value pending notification to the client so that the client can determine the MSS value of the transmission protocol stack layer according to the MSS value pending notification can ensure the reliability and stability of the system.
[0086] In an embodiment of the present application, by sending an MSS value pending notification to the client when the MSS value corresponding to the type of the target service is not found in the mapping relationship, so that the client determines the MSS value of the transmission protocol stack layer according to the MSS value pending notification, the fault tolerance of the system can be enhanced to ensure that the data transmission of the target service can still proceed normally when the MSS value corresponding to the type of the target service is not found.
[0087] In one embodiment, before step S203, the data transmission method provided in the embodiment of the present application also includes: if the MSS value corresponding to the type of the target service is not found in the mapping relationship, sending a preset MSS value to the client, so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value.
[0088] After obtaining the type of the target service, the server searches for the mapping relationship between the service type and the MSS value. If the MSS value corresponding to the type of the target service can be found in the mapping relationship, the MSS value found in the mapping relationship is used as the MSS value of the transmission protocol stack layer; if the MSS value corresponding to the type of the target service is not found in the mapping relationship, the preset MSS value is sent to the client so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value. Users can use the preset MSS value as the MSS value of the transmission protocol stack layer, or customize the MSS value of the transmission protocol stack layer.
[0089] For example: when the type of the target service is a new service type introduced in the platform, and the mapping relationship between the service type and the corresponding MSS value has not been established, or when the mapping relationship between the type of the target service and the corresponding MSS value is lost due to some abnormal circumstances, the MSS value corresponding to the type of the target service cannot be found in the mapping relationship. If the server completely stops responding in this case, it will affect the entire service. Therefore, sending a preset MSS value to the client so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value can also ensure the reliability and stability of the system.
[0090] In an embodiment of the present application, by sending a preset MSS value to the client when the MSS value corresponding to the type of the target service is not found in the mapping relationship, so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value, the fault tolerance of the system can also be enhanced to ensure that the data transmission of the target service can still proceed normally when the MSS value corresponding to the type of the target service is not found.
[0091] In one embodiment, the data transmission method provided by the embodiment of the present application further includes: using the MSS value of the transmission protocol stack layer as the MSS value corresponding to the type of the target service, and adding the type of the target service and the corresponding MSS value to the mapping relationship. In this way, the mapping relationship between the service type and the MSS value can be updated, and the mapping relationship between the service type and the MSS value can be made more complete. When the client sends a data transmission request for the target service again, the MSS value corresponding to the type of the target service can be found in the mapping relationship, and the MSS value corresponding to the type of the target service can be directly used as the MSS value of the transmission protocol stack layer, avoiding the problem of missing MSS value corresponding to the service type in the mapping relationship.
[0092] In one embodiment, the service type is represented as domain name information. In step S201, in response to a data transmission request from a client for a target service, obtaining the type of the target service may include: in response to a data transmission request from a client for a target service, obtaining the domain name information of the data transmission request as the type of the target service.
[0093] Exemplarily, when a client sends a data transmission request for a target service, the data transmission request for the target service includes domain name information of the target service. The domain name information may be an easily readable string used to identify a specific server or a specific service on the network, for example, the domain name information of a data transmission request for a download service may be "www.download.com". The mapping relationship between the service type and the MSS value may be a mapping relationship between the domain name information of the data transmission request corresponding to the service and the MSS value.
[0094] Figure 4 Another example diagram of an application of the data transmission method provided by an embodiment of the present application is shown. Figure 4 In the example, a database, a struct tcp_sock data structure, an MSS value calculation device and a TCP protocol stack data sending device are included. After establishing a mapping relationship between the domain name information of the data transmission request corresponding to the service and the MSS value, the mapping relationship can be stored in the database. The server obtains the mapping relationship from the database at regular intervals and caches the mapping relationship in the service access gateway. After the data transmission request (such as HTTP / HTTPS data transmission request) is accessed, that is, after the client sends a data transmission request for the target service, the data transmission request reaches the server through the service access gateway, and the server obtains the domain name information of the data transmission request, and obtains the mapping relationship between the domain name information of the service and the MSS value from the service access gateway, and then searches for the mapping relationship between the domain name information of the data transmission request corresponding to the service and the MSS value, and determines the MSS value corresponding to the domain name information of the data transmission request of the target service as the MSS value of the transmission protocol stack layer. The setsockopt interface is used to set the MSS value corresponding to the domain name information of the data transmission request of the target service to the struct tcp_sock structure of the kernel. The MSS value calculation device is used to determine the MSS value of the routing layer, and select the smaller value between the MSS value of the transmission protocol stack layer and the MSS value of the routing layer as the target MSS value. The TCP protocol stack data sending device is used to determine the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer, and finally transmit the data message to the client based on the length of the data message.
[0095] In an embodiment of the present application, by obtaining the domain name information of the data transmission request as the type of the target service, the MSS value of the transmission protocol stack layer can be dynamically adjusted based on the domain name information of the data transmission request for the target service, thereby meeting the data transmission requirements of different services.
[0096] Embodiment 2
[0097] Figure 5 The flowchart of the data transmission method provided in the second embodiment of the present application is shown. The data transmission method can be applied to the client. Figure 5 As shown, the data transmission method includes:
[0098] Step S501: Send a data transmission request for the target service to the server to trigger the server to find the mapping relationship between the service type and the maximum segment length MSS value, determine the MSS value corresponding to the service type of the target service, and use the corresponding MSS value as the MSS value of the transmission protocol stack layer.
[0099] Exemplarily, the client sends a data transmission request to the server. When the server receives the data transmission request for the target service, it needs to first determine the type of the target service. The server can determine the type of the target service through specific fields or parameters in the data transmission request. For example: the domain name information corresponding to the data transmission requests of different services is different. When the server receives the data transmission request for the target service from the client, it can obtain the domain name information of the data transmission request through specific fields or parameters in the data transmission request, and determine the type of the target service based on the domain name information. Among them, the target service can be a download service, a video-on-demand service, a financial transaction service, or a game service, etc.
[0100] In an application example, when a user enters an application store and clicks the "Download" button on the display interface of an application named "A" (hereinafter referred to as the application) to download the application named "A" (hereinafter referred to as the application), the client is the terminal device of the user who applies to download application A, and the server may be the server that provides service resources for downloading application A. The terminal device will send a data transmission request for downloading application A to the server of the application store, and the server of the application store can obtain the domain name information "www.download.com" of the data transmission request, and determine the type of the target service as a download service type based on the domain name information.
[0101] Among them, the mapping relationship between the service type and the MSS value can be pre-established. In this mapping relationship, the MSS values corresponding to different service types can be different. In the process of establishing the mapping relationship between the service type and the MSS value, the types of multiple services can be first classified according to the transmission efficiency requirements and connectivity requirements, and the type of each service can be determined as a high efficiency requirement class or a high connectivity requirement class. Then, based on the classification results of each service type, different MSS values are configured for each service, thereby realizing the establishment of a mapping relationship between the service type and the MSS value. For example: when the service type is a high efficiency requirement class, a larger MSS value can be configured for the service; when the service type is a high connectivity requirement class, a smaller MSS value can be configured for the service. Among them, each service can be a service on a CDN platform or a cloud computing platform. The transmission protocol stack layer can be a TCP transmission protocol stack layer.
[0102] Step S502: receiving a data message transmitted by the server in response to a data transmission request, wherein the length of the data message is determined according to the MSS value of the transmission protocol stack layer.
[0103] The server can determine the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer, and transmit the data message to the client according to the length of the data message. In this way, the length of the data message corresponding to the data transmission request can match the MSS value of the transmission protocol stack layer. A larger MSS value of the transmission protocol stack layer can correspond to a larger data message length, and a smaller MSS value of the transmission protocol stack layer can correspond to a smaller data message length, so that the data message can fill each TCP segment as much as possible, make full use of the network bandwidth, maximize the data transmission efficiency, reduce the waste of network bandwidth, and avoid packet loss due to the length of the data message exceeding the MTU length of the intermediate device, ensure that the client can receive the data message sent by the server, and improve the reliability of data transmission. Moreover, since each TCP segment has its own header information, the length of the data message set in this way can reduce unnecessary header overhead and increase the proportion of valid data. In addition, it can also shorten the transmission time of each TCP segment, reduce the overall transmission delay, improve user experience, and reduce the potential impact of network congestion, and improve the stability and reliability of data.
[0104] According to the data transmission method of the embodiment of the present application, a data transmission request for the target service is sent to the server to trigger the server to find the mapping relationship between the service type and the maximum segment length MSS value, and the MSS value corresponding to the service type of the target service is determined. The corresponding MSS value is used as the MSS value of the transmission protocol stack layer. The MSS value of the transmission protocol stack layer can be dynamically adjusted based on the type of the target service, thereby meeting the data transmission requirements of different types of services.
[0105] Embodiment 3
[0106] Corresponding to the method provided in the first embodiment of the present application, the embodiment of the present application provides a data transmission device. Figure 6 The structure diagram of the data transmission device provided in the embodiment of the present application is shown. Figure 6 As shown, the data transmission device includes: a type acquisition module 601, which is used to respond to a data transmission request of a client for a target service and obtain the type of the target service; a first determination module 602, which is used to find the mapping relationship between the service type and the MSS value, and determine the MSS value corresponding to the type of the target service as the MSS value of the transmission protocol stack layer; a length determination module 603, which is used to determine the length of the data packet corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer; a data transmission module 604, which is used to transmit the data packet to the client according to the length of the data packet.
[0107] In one embodiment, the data transmission device provided in the embodiment of the present application also includes: a mapping relationship establishment module, which is used to establish a mapping relationship between service type and MSS value according to the rule that the MSS value corresponding to the first service is less than the MSS value corresponding to the second service; wherein the type of the first service is a high connectivity requirement class, and the type of the second service is a high efficiency requirement class.
[0108] In one embodiment, the length determination module 603 is also used to: determine the MSS value of the routing layer; select a smaller value between the MSS value of the transmission protocol stack layer and the MSS value of the routing layer as the target MSS value; determine the length of the data message according to the target MSS value; wherein the length of the data message is less than or equal to the target MSS value.
[0109] In one implementation, the length of the data message is less than or equal to the MSS value of the transport protocol stack layer.
[0110] In one implementation, the data transmission device provided in the embodiment of the present application further includes: a mapping relationship acquisition module: used to obtain the mapping relationship between the service type and the MSS value from a database; or, to obtain the mapping relationship between the service type and the MSS value from a service access gateway.
[0111] In one implementation, the data transmission device provided in the embodiment of the present application further includes: a cache module, which is used to periodically obtain the mapping relationship from the database and cache the mapping relationship in the service access gateway.
[0112] In one implementation, the data transmission device provided by the embodiment of the present application further includes: a second determination module, configured to use a preset MSS value as the MSS value of the transmission protocol stack layer if the MSS value corresponding to the type of the target service is not found in the mapping relationship.
[0113] In one implementation, the data transmission device provided in the embodiment of the present application further includes: an adding module, configured to add the type of the target service and the corresponding preset MSS value to the mapping relationship.
[0114] In one implementation, the service type is represented as domain name information, and the type acquisition module 601 is further used to: respond to a data transmission request from the client for a target service, and acquire the domain name information of the data transmission request as the type of the target service.
[0115] Embodiment 4
[0116] Corresponding to the method provided in the second embodiment of the present application, the embodiment of the present application provides a data transmission device. Figure 7 The structure diagram of the data transmission device provided in the embodiment of the present application is shown. Figure 7As shown, the data transmission device includes: a request sending module 701, which is used to send a data transmission request for a target service to the server, so as to trigger the server to find the mapping relationship between the service type and the maximum segment length MSS value, determine the MSS value corresponding to the service type of the target service, and use the corresponding MSS value as the MSS value of the transmission protocol stack layer; a data message receiving module 702, which is used to receive the data message transmitted by the server in response to the data transmission request, and the length of the data message is determined according to the MSS value of the transmission protocol stack layer.
[0117] In one implementation, the target service may be a download service, a video-on-demand service, a financial transaction service, a game service, or the like.
[0118] Figure 8 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Figure 8 As shown, the electronic device includes: a memory 801 and a processor 802. The memory 801 stores a computer program that can be run on the processor 802. When the processor 802 executes the computer program, the method in the above embodiment is implemented. The number of the memory 801 and the processor 802 can be one or more.
[0119] The electronic device also includes: a communication interface 803, which is used to communicate with external devices and perform data exchange transmission.
[0120] If the memory 801, the processor 802 and the communication interface 803 are implemented independently, the memory 801, the processor 802 and the communication interface 803 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0121] Optionally, in a specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on a chip, the memory 801, the processor 802 and the communication interface 803 can communicate with each other through an internal interface.
[0122] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method provided in any embodiment of the present application.
[0123] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes a method provided in any embodiment of the present application.
[0124] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in any embodiment of the application.
[0125] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.
[0126] Optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example: Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Sync Link DRAM (SLDRAM) and Direct Rambus RAM (DRRAM).
[0127] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0128] It should be noted that the user information (including but not limited to user device information, user personal information, user operation information, etc.) and data (including but not limited to data used for processing, data for analysis, data for storage, data for display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant information and data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0129] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0131] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or used in combination with these instruction execution systems, devices or apparatuses.
[0133] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0134] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data transmission method, comprising: In response to a data transmission request from a client for a target service, obtaining a type of the target service; Finding a mapping relationship between a service type and a maximum segment length MSS value, and determining an MSS value corresponding to the type of the target service as an MSS value of a transmission protocol stack layer; Determine the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer; The data packet is transmitted to the client according to the length of the data packet.
2. The method according to claim 1, further comprising: According to the rule that the MSS value corresponding to the first service is less than the MSS value corresponding to the second service, a mapping relationship between the service type and the MSS value is established; wherein the type of the first service is a high connectivity requirement class, and the type of the second service is a high efficiency requirement class.
3. The method according to claim 1, wherein: Determining the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer includes: Determine the MSS value of the routing layer; Selecting a smaller value between the MSS value of the transport protocol stack layer and the MSS value of the routing layer as the target MSS value; The length of the data message is determined according to the target MSS value; wherein the length of the data message is less than or equal to the target MSS value.
4. The method according to claim 1, wherein: The length of the data message is less than or equal to the MSS value of the transmission protocol stack layer.
5. The method according to claim 1, before searching for the mapping relationship between the service type and the MSS value, further comprises: Get the mapping relationship between service type and MSS value from the database; or, Obtain the mapping relationship between the service type and the MSS value from the service access gateway.
6. The method according to claim 5, further comprising: The mapping relationship is obtained from the database at regular intervals, and the mapping relationship is cached in the service access gateway.
7. The method according to claim 1, before determining the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer, further comprising: If the MSS value corresponding to the type of the target service is not found in the mapping relationship, an MSS value pending notification is sent to the client, so that the client determines the MSS value of the transmission protocol stack layer according to the MSS value pending notification.
8. The method according to claim 1, before determining the length of the data message corresponding to the data transmission request according to the MSS value of the transmission protocol stack layer, further comprising: If the MSS value corresponding to the type of the target service is not found in the mapping relationship, a preset MSS value is sent to the client, so that the client determines the MSS value of the transmission protocol stack layer according to the preset MSS value.
9. The method according to claim 7 or 8, further comprising: The MSS value of the transmission protocol stack layer is used as the MSS value corresponding to the type of the target service, and the type of the target service and the corresponding MSS value are added to the mapping relationship.
10. The method according to claim 1, wherein: The service type is represented as domain name information, and in response to a data transmission request from a client for a target service, obtaining the type of the target service includes: In response to the data transmission request of the client for the target service, domain name information of the data transmission request is acquired as the type of the target service.
11. A data transmission method, comprising: Send a data transmission request for a target service to a server to trigger the server to search for a mapping relationship between a service type and a maximum segment length MSS value, determine an MSS value corresponding to the service type of the target service, and use the corresponding MSS value as the MSS value of a transmission protocol stack layer; A data message transmitted by the server in response to the data transmission request is received, wherein the length of the data message is determined according to the MSS value of the transmission protocol stack layer.
12. The method according to claim 11, wherein the target service is a download service, a video-on-demand service, a financial transaction service or a game service.
13. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.