Communication method and apparatus, and storage medium
By sending a congestion notification message to the server when a first link between the gateway and the terminal device is congested, the problem of difficult to effectively solve the link congestion in the prior art is solved, and efficient service data transmission is achieved.
Patent Information
- Application Number
- PCT/CN2024/129757
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-17
- Filing Date
- 2024-11-04
- Publication Date
- 2025-05-22
AI Technical Summary
When the first link between the gateway and the terminal device is congested, the prior art is difficult to effectively solve the congestion problem, resulting in low efficiency in service data transmission.
When a first link between the gateway and the terminal device is congested, a congestion notification message is sent to the server, including information for identifying services, so that the server can actively reduce the transmission rate of the service data to avoid link congestion.
It effectively avoids congestion in the first link, improves the transmission efficiency of service data, avoids data loss and retransmission, and improves the stability and efficiency of the system.
Smart Images

Figure CN2024129757_22052025_PF_FP_ABST
Abstract
Description
Communication method, device and storage medium
[0001] This application claims priority to Chinese patent application number 202311554377.7, filed on November 17, 2023, with invention name “Communication Method, Device and Storage Medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and in particular to a communication method, device, and storage medium. Background Art
[0003] A gateway connecting the cloud and the internet can forward data between the two. For example, the internet consists of terminal devices, and the cloud consists of servers. When a terminal device requests a service from a server, it sends a service request to the gateway, which then forwards the request to the server. Based on the service request, the server sends the service data for the service to the gateway, which then forwards the service data to the terminal device.
[0004] Typically, the Internet's transmission rate is lower than the cloud's, causing the bandwidth of the first link established between the gateway and the terminal device over the Internet to be lower than the bandwidth of the second link established between the gateway and the server in the cloud. This can lead to congestion on the first link when the gateway receives service data from the server over the second link and forwards this service data to the terminal device over the first link. To avoid congestion on the first link, the gateway can monitor the throughput of service data transmitted on the first link. If this throughput exceeds a threshold, the unforwarded service data is discarded.
[0005] The bandwidth of the primary link on the Internet changes dynamically. Sometimes, the bandwidth of the primary link is too low, making it impossible for the throughput of service data transmitted on the primary link to exceed the threshold. In such cases, the gateway will not lose the unforwarded service data, which leads to persistent congestion on the primary link. Furthermore, the server must resend the lost unforwarded service data, resulting in inefficient service data transmission.
[0006] Summary of the Invention
[0007] This application provides a communication method, apparatus, and storage medium to stop congestion on the first link between a gateway and a terminal device and improve the efficiency of sending service data. The technical solution is as follows:
[0008] In a first aspect, the present application provides a communication method, the method being applied to a gateway, through which service data of a first service is transmitted between a server and a terminal device. In the method, when congestion occurs on a first link between the gateway and the terminal device, first information is obtained, the first information being used to identify the first service on the server. A first congestion notification message is sent to the server, the first congestion notification message including the first information, the first congestion notification message being used to instruct the server to reduce the rate at which service data of the first service is transmitted based on the first information.
[0009] When congestion occurs on the first link, the gateway sends a first congestion notification message to the server, and the first congestion notification message includes first information on the server that identifies the first service. This allows the server to proactively reduce the rate at which it sends service data for the first service based on the first information, making the rate at which the server sends service data for the first service less than the rate at which the first link between the gateway and the terminal device transmits service data for the first service, thereby stopping the congestion on the first link. When congestion occurs on the first link, the server proactively reduces the rate at which it sends service data for the first service based on the first information, so that the gateway does not lose service data, and thus does not need to resend service data, thereby improving the efficiency of sending service data.
[0010] In one possible implementation, the first information includes a first sequence number and a service type of the first service. The first sequence number is the message sequence number of the first service request, which is a request from the gateway to the server on behalf of the terminal device for the first service. In this implementation, the first sequence number and service type can accurately identify the first service on the server.
[0011] In another possible implementation, the first information further includes a link identifier of a second link, where the second link is a link between the gateway and the server, and the second link is used to transmit service data of the first service. This can improve the accuracy of the first information in identifying the first service on the server.
[0012] In another possible implementation, when congestion occurs on the first link, second information is obtained, and the second information is used to identify the first service on the gateway. Based on the first correspondence and the second information, the first information is obtained, where the first correspondence includes the second information and the first information. The terminal device is located on the Internet, and the server is located in the cloud. In this way, the second information and the first information identify the first service on the Internet and in the cloud, respectively, improving cloud security.
[0013] In another possible implementation, the second information includes a second sequence number and a link identifier of the first link. The second sequence number is the message sequence number of the second service request, and the second service request is a request from the terminal device to the gateway for the first service. In this implementation, the second sequence number and the link identifier of the first link can accurately identify the first service on the gateway.
[0014] In another possible implementation, the second information further includes the service type of the first service, which can improve the accuracy of the second information in identifying the first service on the gateway.
[0015] In another possible implementation, a second service request is received from a terminal device, the second service request including second information. Based on the second information, a first service request is sent to a server, the first service request including first information, the first service request being used to request the server to send service data for the first service. In this way, the terminal device uses the second information to request the first service from the gateway, and the gateway uses the first information to request the first service from the server. The first and second information isolate the internet and the cloud, thereby improving cloud security.
[0016] In another possible implementation, a first correspondence between the first information and the second information is stored. Thus, when congestion occurs on the first link, the gateway can obtain the second information used to identify the first service on the gateway, and then obtain the first information based on the second information and the first correspondence. The gateway then sends the first information to the server, allowing the server to obtain the first service based on the first information. This successfully reduces the rate at which service data for the first service is sent.
[0017] In another possible implementation, when congestion on the first link ceases, a second congestion notification message is sent to the server. The second congestion notification message includes the first information and is used to instruct the server to increase the rate at which service data of the first service is transmitted based on the first information. When congestion on the first link ceases, the server may appropriately increase the rate at which service data of the first service is transmitted to improve the efficiency of transmitting service data.
[0018] In a second aspect, the present application provides a communication device for executing the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.
[0019] In a third aspect, the present application provides a communication device comprising at least one processor and a memory, wherein the at least one processor is used to couple with the memory, read and execute instructions in the memory to implement the method in the first aspect or any possible implementation of the first aspect.
[0020] In a fourth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method of the above-mentioned first aspect or any possible implementation method of the first aspect.
[0021] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program is loaded by a processor to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect.
[0022] In a sixth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a schematic diagram of a network architecture structure provided by an embodiment of the present application;
[0024] FIG2 is a schematic diagram of another network architecture structure provided in an embodiment of the present application;
[0025] FIG3 is a schematic diagram of another network architecture structure provided in an embodiment of the present application;
[0026] FIG4 is a flow chart of a communication method provided in an embodiment of the present application;
[0027] FIG5 is a schematic diagram of another network architecture structure provided in an embodiment of the present application;
[0028] FIG6 is a schematic diagram of a service request structure provided in an embodiment of the present application;
[0029] FIG7 is a schematic diagram of another network architecture structure provided in an embodiment of the present application;
[0030] FIG8 is a schematic structural diagram of a communication device provided in an embodiment of the present application;
[0031] FIG9 is a schematic diagram of the structure of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following are terms used in the embodiments of this application:
[0033] The first link and the second link are both links used to transmit business data of the first business. The first business is the business requested by the terminal device. The first link is the link between the gateway and the terminal device. The second link is the link between the gateway and the server. There is a one-to-many relationship between the second link and the first link.
[0034] The service data is data belonging to the first service. For example, when the first service is a video service, the service data belonging to the first service is video data. For another example, when the first service is a voice service, the service data belonging to the first service is voice data.
[0035] The first service request and the second service request are both requests for the first service. The second service request is a request sent by the terminal device to the gateway, and the first service request is a request sent by the gateway to the server on behalf of the terminal device.
[0036] The first sequence number and the second sequence number are both message sequence numbers of a request for a first service. The first sequence number is the message sequence number of the first service request, and the second sequence number is the message sequence number of the second service request.
[0037] Referring to Figure 1, an embodiment of the present application provides a network architecture 100, which includes a terminal device 101, a gateway 102 and a server 103. The terminal device 101 is located in the Internet, the server 103 is located in the cloud, and the gateway 102 is used to connect the Internet and the cloud.
[0038] Optionally, since the gateway 102 is used to connect the Internet and the cloud, the gateway 102 is deployed between the Internet and the cloud. The gateway 102 is the entrance from the cloud to the Internet or the entrance from the Internet to the cloud. The gateway 102 can be called a cloud gateway.
[0039] Among them, the terminal device 101 can communicate with the gateway 102, and the gateway 102 can communicate with the server 103.
[0040] For example, a first link is established between terminal device 101 and gateway 102, and a second link is established between gateway 102 and server 103. Terminal device 101 sends a second service request to gateway 102 via the first link. The second service request is used to request a first service. Gateway 102 receives the second service request and, based on the second service request, sends a first service request to server 103 via the second link. The first service request is also used to request the first service.
[0041] Server 103 receives the first service request, determines the requested first service based on the first service request, and sends service data of the first service via the second link to gateway 102. Gateway 102 receives the service data of the first service and sends the service data of the first service to terminal device 101 via the first link.
[0042] In some embodiments, referring to FIG2 , gateway 102 includes a transmitting interface, a receiving interface, a transmitting buffer space corresponding to a first link, and a receiving buffer space corresponding to a second link. When gateway 102 receives service data of a first service from the second link via the receiving interface, it first caches the service data of the first service in the receiving buffer space. Gateway 102 transfers the service data of the first service stored in the receiving buffer space to the transmitting buffer space, then reads the service data of the first service from the transmitting buffer space, and transmits the read service data to terminal device 101 via the transmitting interface on the first link.
[0043] In some embodiments, the operation of the gateway 102 transferring the service data of the first service stored in the receiving cache space to the sending cache space may be: the gateway 102 reads the service data of the first service from the receiving cache space and caches the read service data in the sending cache space.
[0044] In some embodiments, referring to FIG3 , the network architecture 100 includes one or more terminal devices 101. When the network architecture 100 includes multiple terminal devices 101, a first link can be established between each terminal device 101 and the gateway 102. There is at least one terminal device 101 among the multiple terminal devices 101, and the second link between the gateway 102 and the server 103 corresponds to the at least one terminal device 101.
[0045] The second link is used to transmit data of the at least one terminal device 101. For example, for each terminal device 101 in the at least one terminal device 101, the server 103 can send service data of the service requested by the terminal device 101 to the gateway 102 via the second link. The gateway 102 receives the service data and sends the service data to the terminal device 101 via the first link between the server 103 and the terminal device 101.
[0046] In some embodiments, one or more second links may be established between the gateway 102 and the server 103. For each second link between the gateway 102 and the server 103, the second link corresponds to at least one terminal device 101 and is used to transmit data of the at least one terminal device 101.
[0047] Because the cloud's transmission rate is higher than the Internet's, the first link between terminal device 101 and gateway 102 is located in the Internet, while the second link between gateway 102 and server 103 is located in the cloud. Therefore, the bandwidth of the second link is typically higher than the bandwidth of the first link. This results in the rate at which server 103 sends service data of the first service to gateway 102 via the second link being higher than the rate at which gateway 102 sends service data of the first service to terminal device 101 via the first link. In other words, the rate at which gateway 102 receives service data of the first service from the second link is higher than the rate at which gateway 102 sends service data of the first service on the first link. As a result, the sending buffer space in gateway 102 corresponding to the first link may gradually fill up with service data of the first service. When the sending buffer space is filled with service data of the first service, it indicates that congestion has occurred on the first link between gateway 102 and terminal device 101.
[0048] When congestion occurs on the first link between the gateway 102 and the terminal device 101, the congestion can be resolved by reducing the rate at which the server 103 sends the service data of the first service. In this way, the gateway 102 can read the service data of the first service from the sending buffer space in a timely manner and send the read service data to the terminal device 101 on the first link, so that the sending buffer space will not be filled with the service data of the first service, and the congestion on the first link between the gateway 102 and the terminal device 101 is stopped.
[0049] The rate at which server 103 transmits service data for the first service can be reduced in the following manner. Referring to FIG2 , gateway 102 receives service data for the first service from server 103 via the second link via a receiving interface and caches the service data in a receiving buffer space. The service data for the first service cached in the receiving buffer space is transferred to a transmitting buffer space. The service data for the first service is then read from the transmitting buffer space and transmitted to terminal device 101 via the transmitting interface via the first link. Terminal device 101 receives the service data for the first service from the first link.
[0050] When the rate at which gateway 102 receives service data of the first service from the second link is greater than the rate at which it sends service data of the first service from the first link, the sending buffer space in gateway 102 is gradually filled with service data of the first service. When the sending buffer space is full with service data of the first service, gateway 102 detects congestion on the first link and stops transferring service data of the first service cached in the receiving buffer space to the sending buffer space.
[0051] However, the gateway 102 will continue to receive the service data of the first service sent by the server 103 on the second link through the receiving interface, and save the received service data to the receiving buffer space, so that the receiving buffer space will gradually be filled with the service data of the first service. When the receiving buffer space is filled with the service data of the first service, the gateway 102 will lose the service data of the first service received from the second link through the receiving interface. At this time, the server 103 detects that the gateway 102 has lost the service data of the first service, and concludes that the first link between the gateway 102 and the terminal device 101 is congested, and reduces the rate at which the service data of the first service is sent from the second link to the gateway 102.
[0052] When the server 103 reduces the rate of sending the business data of the first business from the second link to the gateway 102, the rate at which the gateway 102 receives the business data of the first business from the second link through the receiving interface is also reduced. The gateway 102 also reduces the rate of transferring the business data of the first business from the receiving cache space to the sending cache space, so that the sending cache space will not continue to be filled with the business data of the first business, and the congestion of the first link between the gateway 102 and the terminal device 101 will stop.
[0053] Although this approach can resolve congestion on the first link between gateway 102 and terminal device 101, it results in a significant delay and service data loss on gateway 102. This delay is caused by the fact that upon detecting congestion on the first link between gateway 102 and terminal device 101, server 103 needs to wait until the receiving buffer space in gateway 102 is filled with service data for the first service before reducing the rate at which service data for the first service is sent.
[0054] In order to resolve the congestion of the first link between the gateway 102 and the terminal device 101 and avoid the above-mentioned delay and the loss of business data by the gateway 102, the embodiment of the present application can resolve the congestion of the first link between the gateway 102 and the terminal device 101 through any of the following embodiments.
[0055] Referring to Figure 4, an embodiment of the present application provides a communication method 400, which is applied to the network architecture 100 shown in Figure 1, Figure 2 or Figure 3, and the communication method 400 includes the following process.
[0056] Step 401: The first terminal device sends a second service request to the gateway. The second service request includes second information, and the second information is used to identify the first service on the gateway.
[0057] The first service is a service that the first terminal device needs to request the gateway to download through the second service request. The server includes service data of the first service.
[0058] In step 401, a first link is established between a first terminal device and a gateway, and a second service request is sent to the gateway through the first link. The application layer protocol header of the second service request includes second information.
[0059] In some embodiments, the second information includes a second sequence number and a link identifier of the first link, the second sequence number being the message sequence number of the second service request and being allocated by the first terminal device to the second service request. Optionally, the second information may also include a service type of the first service.
[0060] The network architecture 100 may also include a terminal device other than the first terminal device, and the terminal device may also send a service request to the gateway to request the gateway to download a service. The service request also includes a message sequence number assigned by the terminal device, which may be the same as or different from the second sequence number.
[0061] The first link is the link between the first terminal device and the gateway. The second sequence number is used to identify the second service request sent by the first terminal device to the gateway over the first link. Therefore, the gateway can identify the first service requested by the first terminal device based on the link identifier of the first link and the second sequence number. In this way, the second information can be used to identify the first service requested by the first terminal device on the gateway.
[0062] The first terminal device includes an application, and the service type of the first service may be provided by the application. The second serial number may be allocated by the first terminal device for the second service request.
[0063] In some embodiments, referring to FIG5 , the first terminal device includes an application, a first application layer and a first transport layer, the first application layer includes a service marking module, and the first transport layer includes a first transport layer protocol. When the application in the first terminal device requires service data of the first service, the application transmits the service type of the first service to the first application layer. A second service request is generated in the first application layer, the service marking module assigns a second sequence number to the second service request, and an application layer protocol header is added to the header of the second service request. The application layer protocol header includes second information, that is, the application layer protocol header includes the second sequence number and the link identifier of the first link. Optionally, the application layer protocol header may also include the service type of the first service. The second service request is transmitted to the first transport layer, and in the first transport layer, the second service request is sent to the gateway via the first link based on the first transport layer protocol in the first transport layer.
[0064] Referring to the second service request shown in FIG6 , the second service request includes a header and a payload. The header includes an Internet Protocol (IP) header, a Transmission Control Protocol / User Datagram Protocol (TCP / UDP) header, and an application layer protocol header. The application layer protocol header includes second information (such as the link identifier of the first link, the second sequence number, and the service type of the first service in FIG6 ). Optionally, the second service request may also include a reserved field, and the payload includes information such as the service identifier of the first service that the terminal device needs to request.
[0065] Optionally, the first link may be a session, and the link identifier of the first link may be a session identifier (session id) and the like.
[0066] Step 402: The gateway receives the second service request, and obtains first information based on the second service request, where the first information is used to identify the first service on the server.
[0067] The first information includes a first sequence number and a service type of the first service. The first sequence number is a message sequence number of the first service request. The first service request is a request from the gateway to the server for the first terminal device to request the first service.
[0068] Optionally, the first information also includes a link identifier of the second link, where the second link is a connection between the gateway and the server, and the second link is used to transmit data of at least one terminal device, the at least one terminal device including a first terminal device, and the data of the first terminal device includes business data of the first business, that is, the second link is used to transmit business data of the first business.
[0069] Optionally, when there is a single second link between the gateway and the server, the first information may or may not include a link identifier for the second link. When there are multiple second links between the gateway and the server, the first terminal device corresponds to one of the second links, which is used to transmit data of the first terminal device, and the first information includes the link identifier of the second link corresponding to the first terminal device.
[0070] In step 402, the gateway may establish a second link with the server. The second link corresponds to at least one terminal device, including the first terminal device. The gateway and the server may use the second link to transmit data from the at least one terminal device. The gateway obtains the service type of the first service based on the second service request and assigns a first sequence number to the first service request based on the service type of the first service. This obtains the first sequence number and the service type of the first service included in the first information. Alternatively, the link identifier of the second link included in the first information may also be obtained.
[0071] The first serial number is used to identify the first service request sent by the gateway to the server on the second link. When there is a second link between the gateway and the server, the gateway can send service requests to the server for different terminal devices through the second link to request services for different terminal devices. For multiple service requests requesting different services, the gateway may assign the same message serial number or different message serial numbers to the multiple service requests. For multiple service requests requesting the same service, the gateway assigns different message serial numbers to the multiple service requests. Therefore, the gateway can identify the first service requested by the first terminal device to the server through the first serial number and the service type of the first service. In other words, the server can identify the first service requested by the gateway for the first terminal device through the first serial number and the service type of the first service, so the first information can identify the first service on the server.
[0072] When there are multiple second links between the gateway and the server, the gateway can send service requests to the server on behalf of different terminal devices through a particular second link to request services for different terminal devices. For multiple service requests requesting different services on the same second link, the gateway may assign the same message sequence number or different message sequence numbers to these multiple service requests. For multiple service requests requesting the same service on the same second link, the gateway assigns different message sequence numbers to these multiple service requests.
[0073] For multiple service requests requesting services on different second links, regardless of whether the services requested by the multiple service requests are the same, the gateway may assign the same message sequence number or different message sequence numbers to the multiple service requests. Therefore, the gateway can identify the first service requested by the first terminal device to the server by the first sequence number, the service type of the first service, and the link identifier of the second link corresponding to the first terminal device. In other words, the server can identify the first service requested by the gateway for the first terminal device by the first sequence number, the service type of the first service, and the link identifier of the second link corresponding to the first terminal device, so the first information can identify the first service on the server.
[0074] Optionally, the application layer protocol header of the first service request includes the service type of the first service, and the gateway obtains the service type of the first service from the application layer protocol header of the first service request. Or,
[0075] Optionally, the payload portion of the first service request includes a service identifier of the first service. The gateway obtains the service identifier of the first service from the payload portion of the first service request, and obtains the service type of the first service based on the service identifier of the first service.
[0076] Optionally, the second link may be a session, and the link identifier of the second link may be a session ID.
[0077] In some embodiments, the gateway obtains the second information from the second service request, and saves the corresponding relationship between the second information and the first information in the corresponding relationship between the second information and the first information.
[0078] In some embodiments, referring to FIG5 , the gateway includes a second transport layer and a second application layer, the second transport layer includes a first transport layer protocol, and the second application layer includes an application layer current limiting module. Based on the first transport layer protocol in the second transport layer, the gateway receives a second service request via a first link and transmits the second service request to the second application layer. In the second application layer, the application layer current limiting module obtains the first information based on the second service request and obtains the second information included in the second service request, and stores the corresponding relationship between the second information and the first information in the corresponding relationship between the second information and the first information.
[0079] Step 403: The gateway sends a first service request to the server, where the first service request includes first information.
[0080] In step 403, the gateway obtains the first service request based on the second service request, and sends the first service request to the server through the second link.
[0081] In some embodiments, referring to FIG5 , the second transport layer in the gateway further includes a second transport layer protocol. In the second application layer of the gateway, the application layer current limiting module updates the second information included in the application layer protocol header of the second service request with the first information, obtains the first service request, and transmits the first service request to the second transport layer of the gateway. In the second transport layer, based on the second transport layer protocol in the second transport layer, the first service request is sent to the server via the second link.
[0082] In some embodiments, referring to FIG7 , the second transport layer in the gateway further includes a first network card. In the second application layer of the gateway, the application layer current limiting module updates the second information included in the application layer protocol header of the second service request with the first information, obtains the first service request, and transmits the first service request to the second transport layer of the gateway. In the second transport layer, the first service request is sent to the server on the second link via the first network card in the second transport layer. Optionally, the first network card can be a remote direct memory access (RDMA) network card or other network card.
[0083] Optionally, the operation of the application layer current limiting module updating the second information included in the application layer protocol header of the second service request to the first information can be: the application layer current limiting module updates the link identifier of the first link included in the application layer protocol header of the second service request to the link identifier of the second link, and / or updates the second sequence number included in the application layer protocol header of the second service request to the first sequence number to obtain the first service request.
[0084] Step 404: The server receives the first service request, and sends service data of the first service to the gateway based on the first service request.
[0085] In step 404, the server receives a first service request from the second link. The payload of the first service request includes a service identifier of the first service. The server obtains service data of the first service based on the service identifier of the first service and sends the service data of the first service to the gateway via the second link. Optionally, the service data of the first service may include first information.
[0086] In some embodiments, the application layer protocol header of the first service request includes first information, and the server further stores the first information and the service identifier of the first service in a corresponding relationship between the first information and the service identifier.
[0087] In some embodiments, referring to FIG5 , the server includes a third transport layer and a third application layer, the third transport layer includes a second transport layer protocol, and the third application layer includes a service flow control module. Based on the second transport layer protocol in the third transport layer, the server receives a first service request via a second link and transmits the first service request to the third application layer. In the third application layer, the service flow control module obtains the first information and the service identifier of the first service from the first service request, obtains the service data of the first service based on the service identifier of the first service, sends the service data of the first service to the gateway via the second link, and stores the correspondence between the first information and the service identifier of the first service in the correspondence between the first information and the service identifier.
[0088] In some embodiments, referring to FIG7 , the server includes a third transport layer and a third application layer, the third transport layer includes a second network interface card (NIC), and the third application layer includes a service flow control module. The server receives a first service request from a second link via the second network interface card (NIC) in the third transport layer and transmits the first service request to the third application layer. In the third application layer, the service flow control module obtains first information and a service identifier of the first service from the first service request, obtains service data of the first service based on the service identifier of the first service, sends the service data of the first service to the gateway via the second network interface card over the second link, and stores the correspondence between the first information and the service identifier of the first service in a correspondence between the first information and the service identifier.
[0089] In some embodiments, the first transport layer protocol in the first transport layer and the first transport layer protocol in the second transport layer are the same type of transport layer protocols or different types of transport layer protocols. The second transport layer protocol in the second transport layer and the second transport layer protocol in the third transport layer are the same type of transport layer protocols.
[0090] Step 405: The gateway receives the service data of the first service, and sends the service data of the first service to the first terminal device.
[0091] In step 405, the gateway receives service data of the first service, obtains first information from the service data of the first service, and based on the first information, obtains corresponding second information from the correspondence between the second information and the first information. Based on the link identifier of the first link between the gateway and the terminal device included in the second information, the gateway obtains the first link, and sends the service data of the first service to the first terminal device via the first link.
[0092] In some embodiments, the gateway includes a receiving interface, a sending interface, a sending buffer space corresponding to the first link, and a receiving buffer space corresponding to the second link. The gateway receives the business data of the first business from the second link through the receiving interface, and caches the business data of the first business in the receiving buffer space. The business data of the first business is read from the receiving buffer space, and the first information is obtained from the read business data. Based on the first information, the corresponding second information is obtained from the correspondence between the second information and the first information. The first information included in the read business data is updated to the second information, and the updated business data is cached in the sending buffer space. The business data of the first business is read from the sending buffer space, and the read business data is sent from the first link to the first terminal device through the sending interface.
[0093] Among them, the server can continuously send the business data of the first business to the gateway through the second link, and the gateway can continuously forward the business data of the first business to the first terminal device through the first link. Since the second link between the gateway and the server is located in the cloud, and the first link between the gateway and the first terminal device is located in the Internet, the transmission rate of the cloud is greater than the transmission rate of the Internet, resulting in the bandwidth of the second link being greater than the bandwidth of the first link, and the rate at which the second link transmits the business data of the first business is greater than the rate at which the first link transmits the business data of the first business. This will cause congestion on the first link between the gateway and the first terminal device. In order to stop the congestion, the server can reduce the rate at which it sends the business data of the first business. When the rate at which the server sends the business data of the first business is less than the rate at which the first link transmits the business data of the first business, the congestion on the first link will stop. Next, the congestion can be stopped through the following process.
[0094] Step 406: The gateway detects in real time whether congestion occurs in the first link between the gateway and the first terminal device, and obtains first information when congestion occurs in the first link.
[0095] In step 406, when the gateway detects that congestion occurs on the first link, it obtains second information, and based on the second information, obtains corresponding first information from the corresponding relationship between the second information and the first information.
[0096] In some embodiments, the gateway detects the sending buffer space corresponding to the first link. When it detects that the sending buffer space is filled with business data of the first business, it detects that congestion has occurred in the first link, obtains the link identifier of the first link and obtains the second sequence number corresponding to the first business to obtain second information, the second information including the second sequence number and the link identifier of the first link.
[0097] Optionally, the service type of the first service may also be obtained, and the second information further includes the service type of the first service.
[0098] In some embodiments, the service data of the first service stored in the sending cache space includes the second information. The gateway can obtain the link identifier of the first link and the second sequence number corresponding to the first service from the service data stored in the sending cache space, or also obtain the service type of the first service to obtain the second information.
[0099] Step 407: The gateway sends a first congestion notification message to the server, where the first congestion notification message includes first information.
[0100] The first congestion notification message is used to instruct the server to reduce the rate of sending service data of the first service based on the first information.
[0101] In step 407, there is a second link between the gateway and the server, and the gateway sends a first congestion notification message to the server via the second link. There are multiple second links between the gateway and the server, and the first information includes a link identifier of the second link corresponding to the first terminal device. The gateway obtains the second link based on the link identifier of the second link and sends the first congestion notification message to the server via the second link.
[0102] Step 408: The server receives the first congestion notification message, and reduces the rate of sending service data of the first service based on the first information included in the first congestion notification message.
[0103] In step 408, the server receives the first congestion notification message, obtains first information from the first congestion notification message, obtains the service identifier of the first service from the correspondence between the first information and the service identifier based on the first information, and reduces the rate of sending service data of the first service based on the service identifier of the first service.
[0104] In some embodiments, the server sends service data of the first service to the gateway at a first rate. Upon receiving the first congestion notification message, the server reduces the first rate to obtain a second rate, and then sends the service data of the first service to the gateway at the second rate.
[0105] Optionally, the server reduces the first rate by the first offset to obtain the second rate.
[0106] If congestion still occurs on the first link between the gateway and the first terminal device after the server reduces the rate at which it sends service data for the first service, the gateway will continue to send a first congestion notification message to the server upon detecting that the first link is still congested. After receiving the first congestion notification message, the server will continue to reduce the rate at which it sends service data for the first service until the rate at which the server sends service data for the first service is lower than the rate at which the first link transmits service data for the first service, at which point the congestion on the first link ceases.
[0107] In some embodiments, when congestion on the first link ceases, the gateway obtains the first information and sends a second congestion notification message to the server, where the second congestion notification message includes the first information. The server receives the second congestion notification message, obtains the first information included in the second congestion notification message, and increases the rate at which service data of the first service is sent based on the first information.
[0108] The operation of the gateway obtaining the first information may refer to the operation of obtaining the first information in step 406 above, which will not be described in detail here.
[0109] Optionally, assuming that the server sends service data of the first service based on the second rate, when receiving the second congestion notification message, the server increases the second rate to obtain a third rate, and then sends the service data of the first service to the gateway based on the third rate.
[0110] Optionally, the server increases the second rate by a second offset to obtain a third rate. The first offset and the second offset may be equal or unequal.
[0111] Because the Internet is a shared network, its bandwidth is shared. The bandwidth of the first link established between the first terminal device and the gateway on the Internet changes dynamically. When congestion on the first link ceases, the bandwidth of the first link may increase. The gateway then sends a second congestion notification message to the server, causing the server to increase the rate at which it sends service data for the first service based on the second congestion notification message, thereby improving the efficiency of sending service data.
[0112] In some embodiments, if the server increases the rate at which service data for the first service is sent and congestion occurs again on the first link, the gateway further sends a first congestion notification message to the server. The server receives the first congestion notification message and reduces the rate at which service data for the first service is sent based on the first information included in the first congestion notification message.
[0113] Assume that before the server increases the rate at which the service data of the first service is sent, the rate at which the server sends the service data of the first service is equal to the second rate, and after the server increases the rate at which the service data of the first service is sent, the rate at which the server sends the service data of the first service is equal to the third rate. When the server sends the service data of the first service at the third rate, congestion occurs again on the first link, indicating that the rate at which the service data of the first service is transmitted by the first link is between the second rate and the third rate. The server receives the first congestion notification message, and after reducing the rate at which the service data of the first service is sent based on the first information included in the first congestion notification message, the reduced rate may be equal to the second rate. The service data of the first service is then sent at the reduced rate. In this way, the server will not dynamically change the rate at which the service data of the first service is sent, thereby saving communication resources and ensuring communication stability.
[0114] In an embodiment of the present application, upon detecting congestion on a first link between the gateway and a first terminal device, the gateway obtains first information used to identify a first service on a server and sends a first congestion notification message to the server. The server receives the first congestion notification message and, based on the first information included in the first congestion notification message, reduces the rate at which service data for the first service is transmitted. For the first link established between the gateway and the first terminal device over the Internet, after the server reduces the rate at which service data for the first service is transmitted, congestion on the first link ceases when the reduced rate is less than the rate at which service data for the first service is transmitted over the first link. This allows congestion on the first link to be resolved and stopped, even if the bandwidth of the first link changes dynamically. Because the gateway sends the first congestion notification message to the server upon detecting congestion on the first link, there is no need to wait for the gateway's receive buffer to be full before the server reduces the rate at which service data for the first service is transmitted, resulting in no delay. Since the server reduces the rate at which service data for the first service is transmitted after receiving the first congestion notification message, the gateway does not lose service data for the first service, eliminating the need for the server to resend lost service data for the first service and preventing a reduction in the efficiency of transmitting service data for the first service.
[0115] Referring to FIG8 , an embodiment of the present application provides a communication device 800, through which service data of a first service is transmitted between a server and a terminal device. The device 800 is deployed on the gateway in any of the above embodiments. For example, the device 800 is deployed on the gateway in the network architecture 100 shown in FIG1 , FIG2 , or FIG3 , or the device 800 is deployed on the gateway in the method 400 shown in FIG4 . The device 800 includes:
[0116] The processing unit 801 is configured to obtain first information when congestion occurs in a first link between the apparatus 800 and a terminal device, where the first information is used to identify a first service on a server;
[0117] The sending unit 802 is configured to send a first congestion notification message to the server, where the first congestion notification message includes first information and is used to instruct the server to reduce a rate of sending service data of a first service based on the first information.
[0118] Optionally, the detailed implementation process of the processing unit 801 obtaining the first information refers to the relevant content in step 406 of the method 400 shown in FIG4 , which will not be described in detail here.
[0119] Optionally, the detailed implementation process of the sending unit 802 sending the first congestion notification message to the server refers to the relevant content in step 407 of the method 400 shown in FIG4 , which will not be described in detail here.
[0120] Optionally, the first information includes a first sequence number and a service type of the first service, the first sequence number is a message sequence number of the first service request, and the first service request is a request by the apparatus 800 for the terminal device to request the first service from the server.
[0121] Optionally, the first information further includes a link identifier of a second link, where the second link is a link between the device 800 and the server, and the second link is used to transmit service data of the first service.
[0122] Optionally, the processing unit 801 is configured to:
[0123] When congestion occurs on the first link, obtaining second information, where the second information is used to identify the first service on the apparatus 800;
[0124] Based on the first corresponding relationship and the second information, the first information is acquired, where the first corresponding relationship includes the second information and the first information.
[0125] Optionally, the detailed implementation process of the processing unit 801 obtaining the second information refers to the relevant content in step 406 of the method 400 shown in FIG4 , which will not be described in detail here.
[0126] Optionally, the detailed implementation process of the processing unit 801 obtaining the first information based on the first correspondence and the second information refers to the relevant content in step 406 of the method 400 shown in FIG4 , which will not be described in detail here.
[0127] Optionally, the second information includes a second sequence number and a link identifier of the first link, the second sequence number is a message sequence number of the second service request, and the second service request is a request from the terminal device to the apparatus 800 for the first service.
[0128] Optionally, the second information further includes a service type of the first service.
[0129] Optionally, the apparatus 800 further includes a receiving unit 803;
[0130] The receiving unit 803 is configured to receive a second service request from a terminal device, where the second service request includes second information;
[0131] The sending unit 802 is further configured to send a first service request to the server based on the second information. The first service request includes the first information and is used to request the server to send service data of the first service.
[0132] Optionally, the detailed implementation process of the receiving unit 803 receiving the second service request from the terminal device refers to the relevant content in step 402 of the method 400 shown in FIG4 , which will not be described in detail here.
[0133] Optionally, for the detailed implementation process of the sending unit 802 sending the first service request to the server based on the second information, please refer to the relevant content in step 403 of the method 400 shown in FIG4 , which will not be described in detail here.
[0134] Optionally, the processing unit 801 is further configured to save a first correspondence between the first information and the second information.
[0135] Optionally, the detailed implementation process of the processing unit 801 storing the first correspondence relationship including the first information and the second information can be found in the relevant content of step 402 of the method 400 shown in FIG4 , which will not be described in detail here.
[0136] Optionally, the sending unit 802 is further configured to:
[0137] When the congestion on the first link stops, a second congestion notification message is sent to the server, the second congestion notification message including the first information, and the second congestion notification message is used to instruct the server to increase the rate of sending service data of the first service based on the first information.
[0138] Optionally, the detailed implementation process of the sending unit 802 sending the second congestion notification message to the server refers to the relevant content in step 408 of the method 400 shown in FIG4 , which will not be described in detail here.
[0139] In an embodiment of the present application, when congestion occurs on the first link, the sending unit sends a first congestion notification message to the server, and the first congestion notification message includes first information on the server for identifying the first service. This allows the server to proactively reduce the rate at which service data for the first service is sent based on the first information, and can make the rate at which the server sends service data for the first service less than the rate at which the first link transmits service data for the first service, so that congestion on the first link stops. When congestion occurs on the first link, the server proactively reduces the rate at which service data for the first service is sent based on the first information, so that the device does not lose service data, and thus does not need the server to resend service data, thereby improving the efficiency of sending service data.
[0140] Referring to Figure 9 , an embodiment of the present application provides a schematic diagram of a communication device 900. The device 900 may be the gateway provided in any of the above embodiments, for example, the gateway in the network architecture 100 shown in Figures 1 , 2 , or 3 , or the gateway in the method 400 shown in Figure 4 . The device 900 includes at least one processor 901, an internal connection 902, a memory 903, and at least one transceiver 904.
[0141] The device 900 is a hardware structure device that can be used to implement the functional modules in the device 800 shown in FIG. 8 .
[0142] For example, those skilled in the art may imagine that the processing unit 801 in the device 800 shown in Figure 8 can be implemented by calling the code in the memory 903 by the at least one processor 901, and the sending unit 802 and the receiving unit 803 in the device 800 shown in Figure 8 can be implemented by the at least one transceiver 904.
[0143] The device 900 may also be used to implement the gateway function in any of the above embodiments.
[0144] The processor 901 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0145] The internal connection 902 may include a path for transmitting information between the components, and may be a single board or a bus.
[0146] The at least one transceiver 904 is configured to communicate with other devices or a communication network.
[0147] The above-mentioned memory 903 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.
[0148] The memory 903 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 901. The processor 901 is used to execute the application code stored in the memory 903 and cooperate with at least one transceiver 904, so that the device 900 can implement the functions of the method of the present invention.
[0149] In a specific implementation, as an embodiment, the processor 901 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 9 .
[0150] In a specific implementation, as an embodiment, the apparatus 900 may include multiple processors, such as processor 901 and processor 907 in FIG9 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0151] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0152] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A communication method, characterized in that: The method is applied to a gateway, and the service data of the first service is transmitted between the server and the terminal device through the gateway, and includes: When congestion occurs in a first link between the gateway and the terminal device, acquiring first information, where the first information is used to identify the first service on the server; A first congestion notification message is sent to the server, where the first congestion notification message includes the first information, and the first congestion notification message is used to instruct the server to reduce a rate of sending service data of the first service based on the first information.
2. The method according to claim 1, characterized in that The first information includes a first sequence number and a service type of the first service, the first sequence number is a message sequence number of a first service request, and the first service request is a request made by the gateway to request the first service from the server on behalf of the terminal device.
3. The method according to claim 2, characterized in that The first information also includes a link identifier of a second link, where the second link is a link between the gateway and the server, and the second link is used to transmit the service data.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When congestion occurs on the first link, acquiring second information, where the second information is used to identify the first service on the gateway; The obtaining of the first information includes: The first information is acquired based on a first corresponding relationship and the second information, where the first corresponding relationship includes the second information and the first information.
5. The method according to claim 4, characterized in that The second information includes a second sequence number and a link identifier of the first link, the second sequence number is a message sequence number of a second service request, and the second service request is a request from the terminal device to the gateway for the first service.
6. The method according to claim 5, characterized in that The second information also includes a service type of the first service.
7. The method according to any one of claims 4 to 6, characterized in that: The method further comprises: receiving a second service request from the terminal device, where the second service request includes the second information; A first service request is sent to the server based on the second information, where the first service request includes the first information and is used to request the server to send service data of the first service.
8. The method according to claim 7, characterized in that The method further comprises: The first corresponding relationship including the first information and the second information is saved.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the congestion on the first link stops, a second congestion notification message is sent to the server, the second congestion notification message includes the first information, and the second congestion notification message is used to instruct the server to increase a rate for sending service data of the first service based on the first information.
10. A communication device, characterized in that: The service data of the first service is transmitted between the server and the terminal device through the device, and the device includes: a processing unit, configured to obtain first information when congestion occurs in a first link between the apparatus and the terminal device, wherein the first information is used to identify the first service on the server; A sending unit is used to send a first congestion notification message to the server, where the first congestion notification message includes the first information, and the first congestion notification message is used to instruct the server to reduce a rate of sending service data of the first service based on the first information.
11. The device according to claim 10, characterized in that The first information includes a first sequence number and a service type of the first service, the first sequence number is a message sequence number of a first service request, and the first service request is a request made by the apparatus to request the first service from the server on behalf of the terminal device.
12. The device according to claim 11, characterized in that The first information also includes a link identifier of a second link, where the second link is a link between the device and the server, and the second link is used to transmit the service data.
13. The device according to any one of claims 10 to 12, characterized in that: The processing unit is used for: When congestion occurs on the first link, acquiring second information, where the second information is used to identify the first service on the device; The first information is acquired based on a first corresponding relationship and the second information, where the first corresponding relationship includes the second information and the first information.
14. The device according to claim 13, characterized in that The second information includes a second sequence number and a link identifier of the first link, the second sequence number is a message sequence number of a second service request, and the second service request is a request from the terminal device to the apparatus for the first service.
15. The device according to claim 14, characterized in that The second information also includes a service type of the first service.
16. The device according to any one of claims 13 to 15, characterized in that: The device also includes a receiving unit; The receiving unit is configured to receive a second service request from the terminal device, where the second service request includes the second information; The sending unit is further used to send a first service request to the server based on the second information, where the first service request includes the first information and is used to request the server to send service data of the first service.
17. The device according to claim 16, characterized in that The processing unit is further used to save the first corresponding relationship including the first information and the second information.
18. The device according to any one of claims 10 to 17, characterized in that The sending unit is further used for: When the congestion on the first link stops, a second congestion notification message is sent to the server, the second congestion notification message includes the first information, and the second congestion notification message is used to instruct the server to increase a rate for sending service data of the first service based on the first information.
19. A communication device, characterized in that: The communication device comprises at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the communication device executes the method according to any one of claims 1 to 9.
20. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
21. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Communication method and device and storage medium
CN120021220A
Congestion control methods, devices and system
CN108667739A
Congestion control method, device and system
CN110784417A
Techniques for congestion management in a network
US20190386924A1