Data transmission method and device, equipment and storage medium
By dynamically switching transmission protocols in the public network intercom system and updating them based on the average reception time, the problem of information transmission delay is solved, and the efficiency and immediacy of data transmission are improved.
Patent Information
- Application Number
- CN202511802590.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-03
AI Technical Summary
In public network intercom, there is a significant delay in information transmission between the terminal and the intercom platform, as well as among the devices within the intercom platform, resulting in reduced information transmission efficiency.
By dynamically switching transmission protocols and utilizing either Transmission Control Protocol (TCP) long-lived connections or Fast User Datagram Protocol (HTP) network connections, the protocol is updated based on the average reception time to improve data transmission efficiency.
By dynamically switching transmission protocols, data transmission efficiency is improved, information transmission latency is reduced, and the immediacy of information transmission is enhanced.
Smart Images

Figure CN121603889A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a data transmission method, apparatus, device, and storage medium. Background Technology
[0002] Public network walkie-talkie (Push To Talk Over Cellular, PoC) is a communication method that uses a mobile terminal's wireless network to achieve walkie-talkie functionality (Push To Talk, PTT).
[0003] In public network intercom, terminals can communicate with an intercom platform to transmit information. This intercom platform typically includes signaling service equipment, message queue service equipment, business service equipment, message push service equipment, etc. The various devices in the intercom platform interact with each other to enable information to be transmitted between terminals.
[0004] When a terminal communicates with an intercom platform, it typically establishes a Transmission Control Protocol (TCP) connection with each device on the intercom platform, and then communicates through the TCP connection.
[0005] When a large amount of information needs to be transmitted, the TCP connection pushes messages sequentially, resulting in significant delays in information transmission between the terminal and the intercom platform, as well as among the devices within the intercom platform, thus reducing information transmission efficiency.
[0006] Based on this, this application provides a data transmission method. Summary of the Invention
[0007] This application provides a data transmission method, apparatus, device, and storage medium that can dynamically switch transmission protocols to improve data transmission efficiency.
[0008] In a first aspect, embodiments of this application provide a data transmission method applied to a terminal, the method comprising: A data transmission request is sent to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. Receive the first total amount of data received within the target time window and the first total reception time returned by the message push service device; Based on the first total data volume and the first total reception time, determine the first average reception time for the target time window; Based on the first average reception time, the first data transmission protocol is dynamically updated so that the updated first data transmission protocol is used for data transmission.
[0009] In one feasible implementation, when the first average reception time is determined for the first time, the first data transmission protocol is dynamically updated based on the first average reception time, specifically including: If the first average reception time is greater than the preset initial average reception time threshold, then switch the first data transmission protocol; If the first average reception time is less than or equal to a preset initial average reception time threshold, then the first data transmission protocol will not be switched.
[0010] In one feasible implementation, when the first average reception time is not determined for the first time, the first data transmission protocol is dynamically updated based on the first average reception time, specifically including: Obtain the target average time threshold; If the first average reception time is less than the target average reception time threshold, then the first data transmission protocol will not be switched. If the first average reception time is greater than or equal to the target average reception time threshold, then the comprehensive transmission overhead parameter of the target time window is determined; When the first average reception time is equal to the target average reception time threshold, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window. When the first average reception time is greater than the target average reception time threshold, an efficiency improvement flag is determined, and the first data transmission protocol is dynamically updated based on the efficiency improvement flag and the comprehensive transmission overhead parameters.
[0011] In one feasible implementation, determining the comprehensive transmission overhead parameters of the target time window specifically includes: Determine the total amount of second data to be sent to the message push service device within the target time window; The data transmission failure rate is determined based on the second total data volume and the first total data volume; The parameter value of the failure rate identifier is determined based on the data transmission failure rate and the preset failure rate threshold. Obtain the CPU utilization rate within the target time window; The parameter value of the usage rate identifier is determined based on the central processing unit usage rate and the preset usage rate threshold. The comprehensive transmission overhead parameter is determined based on the parameter value of the failure rate identifier, the parameter value of the utilization rate identifier, the preset failure rate weight, and the preset utilization rate weight.
[0012] In one feasible implementation, determining the efficiency improvement indicator specifically includes: The message push service device receives the total amount of third data received in adjacent time windows and the total time spent receiving the second data. Based on the total amount of the third data and the total reception time of the second, the average reception time of the adjacent time window is determined; When the second average reception time, the first average reception time, the first total data volume, and the third total data volume meet any one of the preset conditions, the parameter value of the efficiency improvement identifier is determined as the first parameter value; otherwise, the parameter value of the efficiency improvement identifier is determined as the second parameter value. The preset conditions include: The total amount of the third data is less than the total amount of the first data, and the average reception time of the second data is greater than or equal to the average reception time of the first data. The third total data volume is less than the first total data volume, the second average reception time is less than the first average reception time, and the growth rate of the average reception time is less than or equal to the growth rate of the total data volume. The third total data volume is equal to the first total data volume, and the second average reception time is greater than or equal to the first average reception time; The third total data volume is greater than the first total data volume, and the second average reception time is greater than the first average reception time, and the rate of decrease of the average reception time is greater than the rate of decrease of the total data volume.
[0013] In one feasible implementation, the first data transmission protocol is dynamically updated based on the efficiency improvement identifier and the comprehensive transmission overhead parameters, specifically including: When the parameter value of the efficiency improvement indicator is the first parameter value, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, then the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window; When the parameter value of the efficiency improvement indicator is the second parameter value, if the first data transmission protocol and the second data transmission protocol are different, then the first data transmission protocol is switched.
[0014] In one feasible implementation, the method further includes: Determine the target number of windows that exceed the time threshold based on the preset initial number of windows that exceed the time threshold; When the number of windows exceeding the target time threshold is less than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the preset average time threshold sliding value, with the adjustment direction being to reduce the average time threshold to be adjusted. The average time threshold to be adjusted includes either the initial average time threshold or the target average time threshold. When the number of windows exceeding the target time threshold is greater than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the preset average time threshold sliding value, with the adjustment direction being to increase the average time threshold to be adjusted.
[0015] In one feasible implementation, the target time-consuming threshold window number is determined based on a preset initial time-consuming threshold window number, specifically including: When the first average reception time is less than the comprehensive average reception time threshold, if the number of time exceeding the threshold window to be modified is negative, the target number of time exceeding the threshold window is the number of time exceeding the threshold window to be modified minus 1; if the number of time exceeding the threshold window to be modified is positive, the target number of time exceeding the threshold window is negative 1. When the first average reception time is greater than the comprehensive average reception time threshold, if the number of time exceeding the threshold to be modified is negative, the number of target time exceeding the threshold is 1; if the number of time exceeding the threshold to be modified is positive, the number of target time exceeding the threshold is the number of time exceeding the threshold to be modified plus 1. Wherein, when the first average reception time is determined for the first time, the number of time exceeding the threshold window to be modified is the initial number of time exceeding the threshold window, and the comprehensive average time threshold is the initial average time threshold; when the average reception time is not determined for the first time, the number of time exceeding the threshold window to be modified is determined based on the initial number of time exceeding the threshold window and a number of the first average reception time being less than or greater than the comprehensive average time threshold, and the comprehensive average time threshold is the target average time threshold.
[0016] Secondly, embodiments of this application provide a data transmission method applied to a first service device in an intercom platform, the method comprising: Through the third data transmission protocol corresponding to the second data transmission connection, heartbeat information is sent to the message push service device in the intercom platform at a preset frequency and recorded. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. Receive the heartbeat response returned by the message push service device; Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period; The heartbeat success rate is determined based on the total number of heartbeats and the total number of heartbeat responses. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0017] In one feasible implementation, when the terminal and the message push service device establish a second data transmission connection for the first time, the second data transmission connection is a Fast User Datagram Protocol (FTP) network connection. If the third data transmission protocol is the data transmission protocol corresponding to the transmission control protocol connection, when switching the third data transmission protocol, the method further includes: Maintain Fast User Datagram Protocol (HTP) network connectivity.
[0018] In one feasible implementation, when the second data transmission connection is a Fast User Datagram Protocol (FTP) network connection, heartbeat information is sent to the message push service device in the intercom platform at a preset frequency via the third data transmission protocol corresponding to the second data transmission connection, specifically including: A stream for transmitting heartbeat information is created by connecting the Fast User Datagram Protocol (FAP) network to the corresponding data transmission protocol. Heartbeat information is sent to the message push service device through the stream at preset time intervals. The method further includes: The message push service device receives messages sent by the corresponding stream according to different message types. Each stream corresponds to a message buffer queue, and the streams are created by the message push service device through the data transmission protocol corresponding to the Fast User Datagram Protocol network connection.
[0019] Thirdly, embodiments of this application provide a data transmission method applied to a message push service device in an intercom platform, the method comprising: The system receives a data transmission request sent by a first service device through a first data transmission connection corresponding to a first data transmission protocol, and returns to the first service device the first total amount of data received in the target time window and the first total reception time, so that the first service device can determine the first average reception time in the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission. The receiving terminal sends heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and returns a heartbeat response to the terminal. This allows the terminal to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. Based on the total number of heartbeats and the total number of heartbeat responses, the heartbeat success rate is determined. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol is switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0020] Fourthly, embodiments of this application also provide a data transmission device applied to a first service device in an intercom platform, the device comprising: The data transmission request sending module is used to send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. The first receiving module is used to receive the first total amount of data received within the target time window and the first total receiving time returned by the message push service device. The first average reception time determination module is used to determine the first average reception time of the target time window based on the first total data volume and the first total reception time. The first update module is used to dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission.
[0021] Fifthly, embodiments of this application also provide a data transmission apparatus applied to a terminal, the apparatus comprising: The heartbeat information sending module is used to send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and to record it. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. The second receiving module is used to receive the heartbeat response returned by the message push service device; The parameter determination module is used to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. The heartbeat success rate determination module is used to determine the heartbeat success rate based on the total number of heartbeats and the total number of heartbeat responses. The second update module is used to switch the third data transmission protocol when the heartbeat success rate is less than a preset success rate threshold, so as to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0022] Sixthly, embodiments of this application also provide a data transmission apparatus for a message push service device in an intercom platform, the apparatus comprising: The third receiving module is used to receive a data transmission request sent by the first service device through the first data transmission protocol corresponding to the first data transmission connection, and return to the first service device the first total amount of data received in the target time window and the first total reception time, so that the first service device can determine the first average reception time of the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission. The fourth receiving module is used to receive heartbeat information sent by the terminal to the message push service device in the intercom platform at a preset frequency via the third data transmission protocol corresponding to the second data transmission connection, and to return heartbeat responses to the terminal. This allows the terminal to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. Based on the total number of heartbeats and the total number of heartbeat responses, a heartbeat success rate is determined. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0023] Seventhly, embodiments of this application also provide a data transmission system, the system including a terminal, a first service device in an intercom platform, and a message push service device, wherein: The first service device is used to send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. The message push service device is used to return to the first service device the first total amount of data received in the target time window and the first total reception time. The first service device is further configured to receive the first total amount of data received in the target time window and the first total reception time returned by the message push service device, determine the first average reception time in the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time so as to use the updated first data transmission protocol for data transmission. The terminal is used to send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and record it. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. The message push service device is also used to return a heartbeat response to the terminal; The terminal is also used to receive a heartbeat response returned by the message push service device; Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period; The heartbeat success rate is determined based on the total number of heartbeats and the total number of heartbeat responses. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0024] Eighthly, embodiments of this application also provide an electronic device, which includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement any of the above-described data transmission methods.
[0025] Ninthly, embodiments of this application also provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement any of the above-described data transmission methods.
[0026] The data transmission method, apparatus, device, and storage medium provided in this application embodiment send a data transmission request to a message push service device in an intercom platform via a first data transmission connection and a corresponding first data transmission protocol. The request is then received from the message push service device, along with the total amount of data received within a target time window and the total reception time. Based on the total amount of data and the total reception time, a first average reception time within the target time window is determined. The first data transmission protocol is then dynamically updated based on the first average reception time to use the updated protocol for data transmission. By switching data transmission protocols based on message parameters within the time window, a more efficient protocol is used for data transmission, thus improving data transmission efficiency. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A schematic diagram of a data transmission structure provided in an embodiment of this application; Figure 2 A flowchart illustrating a data transmission method provided in an embodiment of this application; Figure 3 A flowchart illustrating another data transmission method provided in an embodiment of this application; Figure 4 A flowchart illustrating another data transmission method provided in an embodiment of this application; Figure 5 A flowchart illustrating another data transmission method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0030] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0031] Furthermore, the acquisition, storage, use, and processing of data in this application's technical solution all comply with relevant national laws and regulations.
[0032] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0033] In the field of public network intercom, voice intercom mainly adopts a half-duplex mode, that is, the speaker needs to first seize the right to speak. Once the right to speak is obtained, the terminal will collect the speaker's voice content and transmit it to the other end; after receiving the voice data, the other end will parse and play it.
[0034] In public network intercoms, terminals exchange not only voice data but also other message data. This includes the terminal's online / offline status; the seizure and release of speaking rights within a channel or temporary session; the generation of instant messaging (IM) messages; the entry and exit of members within a channel; the initiation of temporary sessions and the answering and hanging up of members within those sessions; and various issued commands. All of this generated message data needs to be pushed to the corresponding terminal via the intercom platform. In scenarios with high immediacy requirements, such as law enforcement and emergency response, the lower the latency of these intercom-related messages and issued task messages reaching the terminal, the greater their value.
[0035] Existing data push methods require traversing numerous devices, resulting in long data transmission chains and consequently high latency, impacting the execution of real-time services. Furthermore, current technologies primarily rely on TCP for communication, which, due to its requirement for data transmission order, further increases latency.
[0036] To address the problems in related technologies, embodiments of this application provide a data transmission method, apparatus, device, and storage medium. A data transmission request is sent to a message push service device in an intercom platform via a first data transmission connection and a corresponding first data transmission protocol. The request is then received from the message push service device, along with the total amount of data received within a target time window and the total reception time. Based on the total amount of data and the total reception time, a first average reception time within the target time window is determined. The first data transmission protocol is then dynamically updated based on the first average reception time to use the updated protocol for data transmission. By switching data transmission protocols based on message parameters within the time window, a more efficient protocol is used for data transmission, thus improving data transmission efficiency.
[0037] Figure 1 This application provides a schematic diagram of a data transmission structure, as shown in the embodiment of the present application. Figure 1 As shown.
[0038] During data transmission, the entities involved include terminals, device gateways, media service devices, the first service device in the intercom platform, message push service devices, and signaling service devices. The first service device includes business service devices or signaling service devices.
[0039] The terminal can be any electronic device, which deploys an application or webpage (World Wide Web) that allows users to interact with the intercom platform. Understandably, users can log in and establish a connection through the terminal, specifically connecting with signaling service equipment and message push service equipment, connecting with media channels, and performing other business operations. The terminal can also perform voice acquisition, encoding / decoding, playback, acquisition of intercom-related data, and monitoring of data packet transmission and reception.
[0040] Signaling service equipment can be used to maintain WebSocket connections with terminals, forward uplink and downlink signaling data, establish communication connections with message push services, and forward IM message transmission requests, i.e., push message requests. Specifically, the signaling service equipment can store the data to be forwarded in a message queue service so that the business service equipment can retrieve it from the message queue service.
[0041] The message queue service device can be used to forward uplink asynchronous processing request messages and downlink asynchronous processing instruction messages.
[0042] Business service devices can be used to process various business requests, maintain relevant business data, establish connections with message push service devices for message push (i.e., push message requests), and record information interacting with message push service devices for connection protocol updates, etc. Messages pushed by business service devices to message push service devices can be business-related messages.
[0043] The message push service device can be in the form of a cluster or a single device. This application embodiment does not limit this. The message push service device can maintain connection with other devices to communicate with them. Other devices may include terminals, signaling service devices and service devices.
[0044] Media service equipment can establish and maintain media channels with terminals to exchange media data. It can also interact with business service equipment. Figure 1 (Not shown in the diagram), supporting related media control logic. The device gateway is used to forward and respond to the terminal's service data requests, specifically forwarding the service data requests to the service service device. The media service device and device gateway are not the focus of this application's embodiments and will not be described in detail here.
[0045] The embodiments of this application can be applied to scenarios with data transmission requirements, and the corresponding data can be any data such as messages.
[0046] The data transmission method provided in the embodiments of this application will be described below.
[0047] Figure 2 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 2 As shown, the data transmission method is applied to the first service device in the intercom platform and may include the following steps: S201~S204.
[0048] S201: Send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection.
[0049] The first data transmission connection includes a Transmission Control Protocol (TCP) long connection or a Quick User Datagram Protocol (QUIC) network connection, where the QUIC network connection can also be called a Quick UDP (User Datagram Protocol) network connection.
[0050] It should be noted that a TCP long connection is different from a TCP connection. A TCP connection can be closed after data transmission, while a TCP long connection can maintain the connection continuously.
[0051] In this embodiment of the application, the data transmission request includes specific data content and the time of data transmission, which can be specifically represented by a timestamp.
[0052] S202: Receive the first total amount of data received within the target time window and the first total reception time returned by the message push service device.
[0053] It is understood that the message push service device will send the total amount of data received within a certain time interval and the total time spent receiving that data to the first service device at regular intervals. In other words, the message push service device can receive data transmission requests sent by the first service device through the first data transmission protocol corresponding to the first data transmission connection, and return to the first service device the first total amount of data received within the target time window and the first total time spent receiving that data. Each time interval can be understood as a time window, and the duration of the time window can be set as needed; this embodiment does not impose any limitations on this.
[0054] The target time window can be any of the various time windows, and it can be either the initial time window or a non-initial time window. When the target time window is the initial time window, it indicates that the data transmission protocol dynamic update is being performed for the first time. However, in the data transmission method provided in this application, there are differences between the specific embodiments for the first and non-first execution of the data transmission protocol update. These differences will be described later and will not be repeated here.
[0055] To determine the first total reception time, the message push service device can, for each received data transmission request, determine the transmission duration of that data transmission request based on the data sending time included in the request and the receiving time of the data transmission request received by the message push service device. The total reception time for the first time window is obtained by summing the transmission durations of all data transmission requests within the target time window. The data can be any of the aforementioned message types.
[0056] S203: Determine the first average reception time of the target time window based on the first total data volume and the first total reception time.
[0057] Specifically, the average reception time for the first time window can be obtained by dividing the total reception time by the total amount of data received.
[0058] For example, if the total time for the first reception is 30 seconds and the total amount of data is 6, then the average time for the first reception within the target time window is 30 / 6 = 5 seconds.
[0059] S204: Based on the first average reception time, dynamically update the first data transmission protocol so as to use the updated first data transmission protocol for data transmission.
[0060] In this embodiment, since the first data transmission protocol is updated at certain time intervals, and if the average reception time within the target time window meets certain requirements, there is no need to switch the first data transmission protocol. Therefore, the updated first data transmission protocol is consistent with the original first data transmission protocol. Thus, it can be understood that the update in this application includes switching the data transmission protocol and maintaining the current data transmission protocol.
[0061] Furthermore, when switching data transmission protocols, the first data transmission protocol before and after the switch is different. If the first data transmission protocol before the switch is TCP, then the first data transmission protocol after the switch is QUIC. Conversely, if the first data transmission protocol before the switch is QUIC, then the first data transmission protocol after the switch is TCP.
[0062] In this embodiment, a data transmission request is sent to a message push service device in the intercom platform via a first data transmission protocol corresponding to the first data transmission connection. The request is then received from the message push service device, which returns the total amount of data received within the target time window and the total reception time. Based on the total amount of data and the total reception time, the average reception time within the target time window is determined. The first data transmission protocol is then dynamically updated based on the average reception time to use the updated protocol for data transmission. By switching data transmission protocols based on message parameters within the time window, a more efficient protocol is used for data transmission, thus improving data transmission efficiency.
[0063] Figure 3 A flowchart illustrating another data transmission method provided in this application embodiment is shown below. Figure 3 As shown.
[0064] In some embodiments, since data transmission requires the establishment of a communication connection first, a TCP long connection or a QUIC connection can be established before executing S201. Either the TCP long connection or the QUIC connection can be selected as the first data transmission connection, and then S201 can be executed, that is, the message is sent based on the TCP or QUIC protocol.
[0065] Of course, to improve data transmission efficiency, multiple long-lived TCP connections can be established, such as M connections, and data can be transmitted through the data transmission protocols corresponding to these multiple long-lived TCP connections. However, since data transmission can be performed in parallel through multiple streams in a QUIC connection, only one QUIC connection needs to be established.
[0066] In other words, the first service device can establish several long-lived Transmission Control Protocol (TCP) connections and one Fast User Datagram Protocol (HUDP) network connection with the message push service device; and select one of the TCP long-lived connections and the HUDP network connection as the first data transmission connection.
[0067] exist Figure 3 In this context, the message reception volume YCN is the aforementioned first total data volume, and the reception time YCT is the first total reception time. For Figure 3 Other parameters shown, such as the transmission volume YSN and the efficiency improvement flag CFL, will be explained later and will not be repeated here.
[0068] In the embodiments of this application, as described above, different data transmission protocol strategies can be executed by determining whether the target time window is the initial time window. Furthermore, determining whether the target time window is the initial time window can be done by judging whether the first average reception time is being determined for the first time.
[0069] Specifically, if the first average reception time is determined for the first time, then the target time window is the initial time window; if the first average reception time is not determined for the first time, then the target time window is not the initial time window. The first average reception time being determined for the first time indicates that the message push service device initially calculates the average time spent receiving data transmission requests within a certain time interval.
[0070] Furthermore, when executing S204, if the first average reception time is determined for the first time and the first average reception time is greater than the preset initial average reception time threshold, then the first data transmission protocol is switched. If the first average reception time is less than or equal to the preset initial average reception time threshold, the first data transmission protocol will not be switched.
[0071] The preset initial average time threshold can be set as needed, and this application embodiment does not impose any restrictions on it.
[0072] In this embodiment, the need to switch data transmission protocols is determined by comparing the first average reception time with a preset initial average reception time threshold. Generally, if the first average reception time is greater than the preset initial average reception time threshold, it indicates that the current first data transmission protocol has low data transmission efficiency. Therefore, a switch to another data transmission protocol is made to use a protocol with higher transmission efficiency for data transmission.
[0073] Furthermore, since there is no historical data when determining whether to switch data transmission protocols for the first time, a simple decision is made based on the first average reception time and a preset initial average reception time threshold to achieve a rapid response.
[0074] In some embodiments, when performing S204, if the first average reception time is not determined for the first time, a target average reception time threshold is obtained. If the first average reception time is less than the target average reception time threshold, the first data transmission protocol will not be switched. If the first average reception time is greater than or equal to the target average reception time threshold, then the comprehensive transmission overhead parameter of the target time window is determined. When the first average reception time is equal to the target average reception time threshold, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold and the first data transmission protocol is different from the second data transmission protocol, the first data transmission protocol is switched and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window. When the first average reception time is greater than the target average reception time threshold, an efficiency improvement flag is determined, and the first data transmission protocol is dynamically updated based on the efficiency improvement flag and the comprehensive transmission overhead parameters.
[0075] Since the target time window is not the initial time window, and the average time consumption threshold is dynamically changing, a target average time consumption threshold corresponding to the target time window can be obtained when determining the data transmission protocol switching based on the average time consumption threshold and the first average reception time. This target average time consumption threshold is obtained by adjusting the initial average time consumption threshold and a preset average time consumption threshold sliding value. Specifically, it can be obtained by repeatedly increasing, decreasing, or first increasing and then decreasing the preset average time consumption threshold sliding value. The specific adjustment method will be explained in detail later and will not be elaborated here.
[0076] It should be noted that the preset average time consumption threshold sliding value can be a fixed value, specifically meaning the duration, used to adjust the average time consumption threshold. When the target time window is determined, the previous time window has already undergone data transmission protocol switching judgment and the average time consumption threshold has been dynamically changed. Therefore, the target average time consumption threshold corresponding to the target time window has been determined, which is the average time consumption threshold after dynamic adjustment.
[0077] For non-initial time windows, if the average reception time of the first reception within that time window is less than the target average reception time threshold, it indicates that the current first data transmission protocol is highly efficient and meets user needs. Therefore, switching the data transmission protocol is not required.
[0078] If the first average reception time is greater than or equal to the target average reception time threshold, the comprehensive transmission overhead parameter for the target time window is determined, and then a data transmission protocol switching judgment is made based on the comprehensive transmission overhead parameter. This is because a protocol switch may have just been completed before this, and frequent protocol switches may lead to transmission instability. To ensure the stability of data transmission, a further judgment on the data transmission protocol switching can be made based on the comprehensive transmission overhead parameter.
[0079] The comprehensive transmission overhead parameter represents the overall data transmission overhead of the first serving device across various dimensions within the target time window. Therefore, by analyzing the relationship between the comprehensive transmission overhead parameter and the comprehensive transmission overhead threshold, the judgment result for data transmission protocol switching is more accurate.
[0080] Furthermore, a more detailed judgment can be made on whether the first average reception time is greater than or equal to the target average reception time threshold, that is, it can be further divided into two cases: the first average reception time is equal to the target average reception time threshold and the first average reception time is greater than the target average reception time threshold.
[0081] For the former, if the overall transmission overhead parameter is greater than the overall transmission overhead threshold, it indicates that the performance overhead of the target time window is still within the overhead capacity that the first serving device can bear. If the data transmission protocol of the previous time window of the target time window is inconsistent with the first data transmission protocol of the target time window, a data transmission protocol switch can be performed to reduce data transmission overhead and improve data transmission efficiency. The previous time window of the target time window is the adjacent time window, and the data transmission protocol of the previous time window is the second data transmission protocol. The end time of the adjacent time window is no later than the start time of the target time window.
[0082] It should be noted that if the overall transmission overhead parameter does not exceed the overall transmission overhead threshold, or if the first data transmission protocol is different from the second data transmission protocol, then there is no need to switch protocols.
[0083] For the latter, it is also necessary to determine whether cost considerations should be taken into account. Therefore, it is necessary to first determine the efficiency improvement indicator, and then dynamically update the first data transmission protocol based on the efficiency improvement indicator and the comprehensive transmission overhead parameters. The efficiency improvement indicator represents whether the cost of the first service device switching the data transmission protocol should be considered. The parameter values of the efficiency improvement indicator include a first parameter value and a second parameter value. When the parameter value of the efficiency improvement indicator is the first parameter value, cost needs to be considered; when the parameter value of the efficiency improvement indicator is the second parameter value, cost does not need to be considered.
[0084] In addition, the efficiency improvement indicator is... Figure 3 The efficiency improvement indicator CFL is shown.
[0085] In this embodiment, by meticulously considering each situation and applying different data transmission protocol switching judgment strategies, targeted data transmission protocol switching judgments are performed to ensure the accuracy of the switching results.
[0086] In some embodiments, when determining the comprehensive transmission overhead parameters of the target time window, the first service device may determine the total amount of second data to be sent to the message push service device within the target time window; The data transmission failure rate is determined based on the second total data volume and the first total data volume. The parameter value of the failure rate indicator is determined based on the data transmission failure rate and the preset failure rate threshold. Obtain the CPU utilization rate within the target time window; The parameter value of the usage rate indicator is determined based on the central processing unit usage rate and the preset usage rate threshold. The comprehensive transmission overhead parameters are determined based on the parameter values of the failure rate indicator, the parameter values of the utilization rate indicator, the preset failure rate weight, and the preset utilization rate weight.
[0087] Among them, Figure 3 The amount of data sent (YSN) is the second total data volume, the CPU consumption (CUR) is the central processing unit utilization rate, the transmission failure rate (SFR) is the data transmission failure rate, and the dynamic average time threshold (YVTF) is the initial average time threshold or the target average time threshold.
[0088] When determining the data transmission failure rate, the second total data volume can be subtracted from the first total data volume to obtain the total amount of data that the message push service device did not receive. The data transmission failure rate can then be obtained by dividing the total amount of data that the message push service device did not receive by the second total data volume.
[0089] For example, if the total amount of the second data is 40 and the total amount of the first data is 35, then the total amount of data that the message push service device did not receive is 40-35=5, and the data transmission failure rate is (5 / 40)*100%=12.5%.
[0090] When determining the parameter value for the failure rate indicator, if the data transmission failure rate is greater than or equal to the preset failure rate threshold, the parameter value for the failure rate indicator is 1. This indicates that the data transmission failure rate has a significant impact on the overall transmission overhead parameter, and data transmission failures incur substantial costs, thus requiring its use in determining the overall transmission overhead parameter. If the data transmission failure rate is less than the preset failure rate threshold and is not considered in the cost factors, the parameter value for the failure rate indicator is 0. This indicates that the data transmission failure rate has a minor impact on the overall transmission overhead parameter and does not need to be used in determining the overall transmission overhead parameter.
[0091] Similarly, when determining the parameter value of the utilization rate indicator, if the CPU utilization rate is greater than or equal to the preset utilization rate threshold, the parameter value of the utilization rate indicator is 1, and it needs to be used to determine the overall transmission overhead parameter. If the CPU utilization rate is less than the preset utilization rate threshold, the parameter value of the utilization rate indicator is 0, and it does not need to be used to determine the overall transmission overhead parameter, as the CPU utilization has a relatively small impact on cost.
[0092] The overall transmission overhead parameters can be determined using the following formula: SCW=(SFFL*PFTFWF)+(CUFL*PFTFWC) Wherein, SCW is the overall transmission overhead parameter, SFFL is the failure rate indicator, PFTFWF is the preset failure rate weight, CUFL is the utilization rate indicator, and PFTFWC is the preset utilization rate weight. The preset failure rate weight and preset utilization rate weight can be set as needed.
[0093] It should be noted that different data transmission protocols have corresponding PFTFWF and PFTFWC. For example, for TCP, PFTFWF can be PFTFWF1:TCP (protocol 1), and PFTFWC can be PFTFWC1:TCP (protocol 1). Similarly, for the QUIC protocol, PFTFWF can be PFTFWF1:QUIC (protocol 2), and PFTFWC can be PFTFWC1:QUIC (protocol 2).
[0094] In this embodiment, the reliability of data transmission can be represented by the data transmission failure rate; a higher failure rate results in greater overhead. The resource consumption of the first service device can be represented by the CPU utilization rate; a higher CPU utilization rate results in a greater load on the first service device, potentially impacting other services.
[0095] By weighting and combining these two factors, a comprehensive index is obtained to evaluate the overall effectiveness of the current primary data transmission protocol, thereby determining whether to switch protocols to achieve a balance between reliability and resource consumption.
[0096] Understandably, the overall transmission overhead parameter is a comprehensive indicator that balances transmission reliability and resource consumption, used to guide the switching of data transmission protocols.
[0097] Furthermore, the influencing factors of the comprehensive transmission overhead parameter can be expanded, and the aforementioned formula can then be extended as follows: SCW=(SFFL*PFTFWF)+(CUFL*PFTFWC)+(XFL*PFTFWX)+...
[0098] Where XFL is the parameter value of any influencing factor, PFTFWX is the influence weight of that influencing factor, and XFL can be 0 or 1.
[0099] In some embodiments, when determining the efficiency improvement identifier, the first service device may receive the total amount of third data received in adjacent time windows and the total reception time sent by the message push service device; Based on the total amount of data and the total reception time, determine the average reception time for adjacent time windows; When the second average reception time, the first average reception time, the first total data volume, and the third total data volume meet any of the preset conditions, the parameter value of the efficiency improvement indicator is determined as the first parameter value; otherwise, the parameter value of the efficiency improvement indicator is determined as the second parameter value. The preset conditions include: The total amount of the third data is less than the total amount of the first data, and the average reception time of the second data is greater than or equal to the average reception time of the first data. The third total data volume is less than the first total data volume, the second average reception time is less than the first average reception time, and the growth rate of the average reception time is less than or equal to the growth rate of the total data volume. The total amount of the third data is equal to the total amount of the first data, and the average reception time of the second data is greater than or equal to the average reception time of the first data. The total amount of the third data is greater than the total amount of the first data, and the average reception time of the second data is greater than the average reception time of the first data, and the rate of decrease of the average reception time is greater than the rate of decrease of the total amount of data.
[0100] The process of determining the second average reception time is similar to that of determining the first average reception time, and will not be described again in this embodiment. The first parameter value is 1, and the second parameter value is 0.
[0101] The third data volume is less than the first data volume, and the second average reception time is greater than or equal to the first average reception time, indicating that within the target time window, the amount of received messages is large and the average reception time is small.
[0102] The third condition is that the total amount of data is less than the total amount of data, the second condition is that the average reception time is less than the average reception time, and the growth rate of the average reception time is greater than or equal to the growth rate of the total amount of data. This indicates that within the target time window, although the amount of received messages is large and the average reception time is large, the growth rate of the average reception time is less than or equal to the growth rate of the message volume. Therefore, in the future, there may be a situation where less time is spent to transmit more data, thus improving efficiency.
[0103] It should be noted that the growth rate of the average time consumption and the growth rate of the total data volume are determined based on the second received average time consumption, the first received average time consumption, the first total data volume, and the third total data volume. Specifically, (YVT2 - YVT1) / YVT1 represents the growth rate of the average time consumption, and (YCN2 - YCN1) / YCN1 represents the growth rate of the total data volume. YVT2 and YVT1 are the first received average time consumption and the second received average time consumption respectively, and YCN2 and YCN1 are the first total data volume and the third total data volume respectively.
[0104] The third total data volume is equal to the first total data volume, and the second received average time consumption is greater than or equal to the first received average time consumption, which indicates that within the target time window, the received message volume is the same and the received average time consumption becomes less or remains unchanged.
[0105] The third total data volume is greater than the first total data volume, the second received average time consumption is greater than the first received average time consumption, and the reduction rate of the average time consumption is greater than the reduction rate of the total data volume, which indicates that within the target time window, the received message volume becomes less, the received average time consumption also becomes less, but the relative reduction amount of the average time consumption is greater than the relative reduction amount of the message volume, indicating that less time may be spent in the future to transmit more data.
[0106] It should be noted that the reduction rate of the average time consumption and the reduction rate of the total data volume are determined based on the second received average time consumption, the first received average time consumption, the first total data volume, and the third total data volume. Specifically, (YVT1 - YVT2) / YVT1 is the reduction rate of the average time consumption, and (YCN1 - YCN2) / YCN1 is the reduction rate of the total data volume.
[0107] For the cases of YCN1 = YCN2, YVT1 < YVT2, YCN1 > YCN2, YVT1 = YVT2, YCN1 > YCN2, YVT1 < YVT2, the efficiency is not improved, and the parameter value of the efficiency improvement flag is determined as the second parameter value.
[0108] In the embodiments of the present application, when determining the efficiency improvement flag, considering the relationship between the parameters within the target time window and the parameters of the previous time window of the target time window can enrich the information volume of the current data transmission protocol strategy by using historical data, avoid overreacting to instantaneous fluctuations, resulting in incorrect determination of the switching result, and improve the accuracy of the determined protocol switching result. This is because the network environment is dynamic, and the data at a single point may be instantaneous fluctuations. Without historical reference, only considering the average time consumption for data transmission protocol switching may overreact to temporary network jitters, while by comparing the parameters of adjacent time windows, it can be determined whether the parameters of the target time window are continuously deteriorating or temporarily fluctuating.
[0109] In some embodiments, after determining the efficiency improvement identifier, when dynamically updating the first data transmission protocol based on the efficiency improvement identifier and the comprehensive transmission overhead parameter, if the parameter value of the efficiency improvement identifier is the first parameter value, and the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, then the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window. When the parameter value of the efficiency improvement indicator is the second parameter value, if the first data transmission protocol and the second data transmission protocol are different, then the first data transmission protocol is switched.
[0110] When the first data transmission protocol in the target time window is either TCP or QUIC, this applies to the decision-making step for switching subsequent data transmission protocols when the parameter value of the efficiency improvement indicator is the first parameter value. That is, when CFL=1, PF=1, SCW1>SCWR, and PF!=LPF, switch the transmission protocol; when CFL=1, PF=2, SCW2>SCWR, and PF!=LPF, switch the transmission protocol. Here, PF=1 indicates that the first data transmission protocol is TCP, and PF=2 indicates that the first data transmission protocol is QUIC. SCW1 is the comprehensive transmission overhead parameter when the first data transmission protocol is TCP, and SCW2 is the comprehensive transmission overhead parameter when the first data transmission protocol is QUIC. SCWR is the comprehensive transmission overhead threshold, and LPF is the second data transmission protocol.
[0111] In this embodiment, when the parameter value of the efficiency improvement identifier is the second parameter value, the data transmission protocol switching does not need to consider the comprehensive transmission overhead parameter, thus improving the switching efficiency. When the parameter value of the efficiency improvement identifier is the first parameter value, both performance and cost are considered, improving the accuracy of the switching results.
[0112] In some embodiments, the first service device may also dynamically adjust the average time threshold.
[0113] Specifically, the target number of windows exceeding the time threshold is determined based on the preset initial number of windows exceeding the time threshold; When the number of windows exceeding the target time threshold is less than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the sliding value of the preset average time threshold, with the adjustment direction being to reduce the average time threshold to be adjusted. The average time threshold to be adjusted includes either the initial average time threshold or the target average time threshold. When the number of windows exceeding the target time threshold is greater than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the sliding value of the preset average time threshold, with the adjustment direction being to increase the average time threshold to be adjusted.
[0114] The preset initial time consumption exceeding the threshold window number can be set as needed. Specifically, it can be set to a non-zero number with an absolute value less than a preset absolute value, which can be a small value such as 1, 2, or 3. It's understandable that the initial time consumption exceeding the threshold window number can be set to a small absolute value. This is because the adjustment of the average time consumption threshold is related to the size of the initial time consumption exceeding the threshold window number. Therefore, setting the initial time consumption exceeding the threshold window number to a small absolute value can prevent the initial time consumption exceeding the threshold window number from having an excessive impact on subsequent adjustments to the average time consumption threshold.
[0115] The number of time-consuming windows exceeding the threshold represents the number of consecutive time windows in which the average reception time is greater than or less than the average time-consuming threshold. The average reception time may include the first average reception time of the target time window or the average reception time of other time windows. The average time-consuming threshold may include an initial average time-consuming threshold or a target average time-consuming threshold. The number of target time-consuming windows exceeding the threshold represents the number of consecutive time windows in which the average reception time is greater than or less than the average time-consuming threshold within the target time window and all time windows preceding it. This target time-consuming window exceeding the threshold can be the initial number of time-consuming windows exceeding the threshold, or it can be obtained by addition or subtraction based on the initial number of time-consuming windows exceeding the threshold.
[0116] Since the preset average time consumption threshold switching control parameter is compared with the target time consumption exceeding the threshold window number by comparing the absolute value of the time consumption exceeding the threshold window number with the preset average time consumption threshold switching control parameter, the preset average time consumption threshold switching control parameter can be set to a positive number.
[0117] In this embodiment, a target time consumption exceeding the threshold window number being less than 0 indicates that within multiple consecutive time windows, the average reception time is less than the corresponding average time consumption threshold to be adjusted, indicating that the performance of the first service device is consistently in a good state. A target time consumption exceeding the threshold window number being greater than the preset average time consumption threshold switching control parameter indicates that the number of consecutive time windows with good performance has exceeded the set control value for adjusting the average time consumption. That is, NC < 0, |NC| > NCP. NC is the target time consumption exceeding the threshold window number, and NCP is the preset average time consumption threshold switching control parameter.
[0118] Therefore, to further refine the control over data transmission protocol switching decisions, the threshold for adjusting the average latency can be reduced. Specifically, the threshold for adjusting the average latency can be subtracted from the preset average latency threshold sliding value to obtain the adjusted average latency threshold. That is, when NC < 0, |NC| > NCP, YVTF' = YVTF - VTFW. Here, YVTF' is the adjusted average latency threshold, YVTF is the threshold for adjusting the average latency, and VTFW is the preset average latency threshold sliding value. The preset average latency threshold sliding value can be set as needed, such as to 50 milliseconds or 100 milliseconds.
[0119] When the number of target latency exceeding the threshold window is greater than 0, it indicates that the average reception time exceeds the corresponding average latency threshold to be adjusted within multiple consecutive time windows, indicating that the performance of the first serving device is continuously in a poor state. When the absolute value of the number of target latency exceeding the threshold window is greater than the preset average latency threshold switching control parameter, it indicates that the number of consecutive time windows with poor performance has exceeded the set control value for adjusting the average latency. That is, NC > 0, |NC| > NCP.
[0120] Therefore, to make the average time threshold to be adjusted more closely reflect the actual performance of the first service device, the average time threshold to be adjusted can be increased. Specifically, the average time threshold to be adjusted can be added to the sliding value of the preset average time threshold to obtain the adjusted average time threshold. That is to say, when NC>0, |NC|>NCP, YVTF'=YVTF+VTFW.
[0121] It should be noted that the timing of the average time consumption threshold adjustment can be set as needed, and this application embodiment does not impose any restrictions on it. For example, the average time consumption threshold can be adjusted once each time it is determined whether to switch the data transmission protocol, or it can be adjusted once if it is determined that the data transmission protocol will not be switched.
[0122] In this embodiment, since the network environment and load are dynamically changing, using a fixed average time threshold for judgment may lead to unnecessary protocol switching or situations where the first service device becomes unresponsive due to substandard performance. Dynamic adjustment allows the first service device to adaptively adjust the judgment criteria for data transmission protocol switching based on parameters in each time window, thereby improving stability.
[0123] In some embodiments, when determining the target time-consuming threshold window number based on the preset initial time-consuming threshold window number, if the first average reception time is less than the comprehensive average time-consuming threshold, and the time-consuming threshold window number to be modified is negative, the target time-consuming threshold window number is the time-consuming threshold window number to be modified minus 1; if the time-consuming threshold window number to be modified is positive, the target time-consuming threshold window number is negative 1. When the average reception time of the first reception is greater than the comprehensive average reception time threshold, if the number of windows to be modified that exceed the threshold is negative, the target number of windows to be modified that exceed the threshold is 1; if the number of windows to be modified that exceed the threshold is positive, the target number of windows to be modified that exceed the threshold is the number of windows to be modified that exceed the threshold plus 1. Specifically, when the first average reception time is determined for the first time, the number of time exceeding the threshold window to be modified is the initial number of time exceeding the threshold window, and the comprehensive average reception time threshold is the initial average reception time threshold. When the average reception time is not determined for the first time, the number of time exceeding the threshold window to be modified is determined based on the initial number of time exceeding the threshold window and the number of first average reception times that are less than or greater than the comprehensive average reception time threshold. The comprehensive average reception time threshold is the target average reception time threshold.
[0124] As mentioned above, the target time-out threshold window number is determined based on a preset initial time-out threshold window number. This initial time-out threshold window number can be the preset number itself, or it can be obtained by adding or subtracting from the preset initial time-out threshold window number, or by assigning a fixed value. The specific determination strategy used depends on whether the target time window is the initial time window or a non-initial time window.
[0125] Specifically, the number of time-consuming windows exceeding the threshold to be modified is the number of time-consuming windows exceeding the threshold in the previous time window of the target time window. The target time-consuming window exceeding the threshold can be obtained by modifying the number of time-consuming windows exceeding the threshold in the previous time window of the target time window.
[0126] When the target time window is the initial time window, indicating that there is no previous time window before the target time window, the number of time windows exceeding the threshold to be modified is the target time exceeding the threshold number, which is also the initial time exceeding the threshold number, and no additional calculation is required. At this time, the comprehensive average time threshold is the initial average time threshold.
[0127] When the target time window is not the initial time window, the number of time-consuming windows exceeding the threshold to be modified is obtained by performing multiple additions and subtractions on the initial time-consuming window exceeding the threshold or by assigning a fixed value. Specifically, it is determined based on the number of first average reception times in several time windows preceding the target time window that are less than or greater than the comprehensive average time consumption threshold, and the initial time-consuming window exceeding the threshold. In this case, the comprehensive average time consumption threshold is the target average time consumption threshold.
[0128] When determining the target time-exceeding threshold window number based on the number of time-exceeding threshold windows to be modified, it can be determined according to the positive or negative value of the number of time-exceeding threshold windows to be modified and the relationship between the first average reception time and the comprehensive average reception time threshold.
[0129] Specifically, if the number of time windows with modification time consumption exceeding the threshold is negative, it indicates that the average reception time consumption of the previous time window of the target time window is less than the average time consumption threshold corresponding to the previous time window, and the average time consumption of multiple consecutive time windows before is the same as that of the previous time window or just changes from the average reception time consumption being greater than the corresponding average time consumption threshold to being less than the corresponding average time consumption threshold. This characterizes that the target time window may be in a trend where the average reception time consumption is less than the corresponding average time consumption threshold. Then, when the first reception average time consumption is less than the comprehensive average time consumption threshold, it characterizes that the target time window continues this trend where the average reception time consumption is less than the corresponding average time consumption threshold. Then, the number of time windows with modification time consumption exceeding the threshold minus 1 can be used as the target number of time windows with time consumption exceeding the threshold.
[0130] However, if the first reception average time consumption is greater than the comprehensive average time consumption threshold, it characterizes that the target time window is different from the aforementioned trend. In order to timely characterize this change in the trend, the target number of time windows with time consumption exceeding the threshold can be set to 1.
[0131] Similarly, if the number of time windows with modification time consumption exceeding the threshold is positive, but the first reception average time consumption is less than the comprehensive average time consumption threshold, it characterizes that the previous time window of the target time window has a trend where the average reception time consumption is greater than the corresponding average time consumption threshold, and the target time window is different from the aforementioned trend. In order to timely characterize this change in the trend, the target number of time windows with time consumption exceeding the threshold can be set to -1.
[0132] If the first reception average time consumption is greater than the comprehensive average time consumption threshold, it characterizes that the target time window continues the trend that the previous time window of the target time window has an average reception time consumption greater than the corresponding average time consumption threshold. Therefore, the number of time windows with modification time consumption exceeding the threshold plus 1 can be used as the target number of time windows with time consumption exceeding the threshold.
[0133] In addition, the timing for determining the target number of time windows with time consumption exceeding the threshold can be set as needed. For example, if the target time window is the initial time window, it can be determined when the first reception average time consumption is less than or equal to the corresponding average time consumption threshold, that is, when YVT3 ≤ YVTF, determine NC, where YVT3 is the reception average time consumption of the initial time window. If the target time window is a non-initial time window, it can be determined when the first reception average time consumption is less than the corresponding average time consumption threshold, that is, when YVT4 < YVTF, determine NC, where YVT4 is the reception average time consumption of the non-initial time window.
[0134] In the embodiments of the present application, by performing addition, subtraction operations or assigning a fixed value to the initial number of time windows with time consumption exceeding the threshold to obtain the target number of time windows with time consumption exceeding the threshold, the change in the performance trend of the first service device can be immediately detected, and the average time consumption threshold adjustment judgment process of another trend can be timely performed, ensuring the timeliness of the average time consumption threshold adjustment.
[0135] Furthermore, the aforementioned data transmission protocol switching strategy, combined with the dynamic change of the average latency threshold, can keep the message sending path as efficient and stable as possible in multiple scenarios, reducing message sending time while ensuring message sending stability, thus solving the problems of high latency, instability, and unsatisfactory success rate of message push in existing public network intercom applications.
[0136] It should be noted that the above technical solutions are applicable to protocol conversion between TCP and QUIC, as well as protocol conversion between other protocols used for message sending, such as Stream Control Transmission Protocol (SCTP) and Datagram Congestion Control Protocol (DCCP). Other non-public network intercom applications, such as instant messaging (IM) applications and applications involving message push modules or functions, can also use the aforementioned technical solutions to solve the message delay problem.
[0137] In this embodiment, protocol conversion improves the rate at which message data travels from the first service device to the message push service device, reducing the latency of message arrival at the message push service device. Taking the interaction between the signaling service device and the message push service device as an example, the signaling service device no longer needs to forward message data to a message queue before pushing it to the message push service device; therefore, the latency of message arrival at the message push service device is significantly reduced. This also ensures the controllability of service resource usage, reducing message sending latency while maintaining server stability.
[0138] This application also provides another data transmission method, which is applied to a terminal. Figure 4 A flowchart illustrating another data transmission method provided in this application embodiment is shown below. Figure 4 As shown. This may include the following steps: S401~S405.
[0139] S401: Send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and record it.
[0140] The second data transmission connection includes a Transmission Control Protocol (TCP) connection or a Fast User Datagram Protocol (HTP) network connection. The heartbeat information includes a timestamp of the transmission time, and the preset frequency can be in seconds per beat; the specific frequency can be set as needed. For more accurate perception of data interaction status, the frequency can be increased. Sending heartbeat information from the terminal to the message push service device in the intercom platform also keeps the terminal's egress network address active.
[0141] S402: Receive heartbeat response returned by the message push service device.
[0142] Generally, the message push service device receiving terminal sends heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and returns a heartbeat response to the terminal.
[0143] S403: Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period.
[0144] The preset time period can be longer than the frequency of sending heartbeat information. Therefore, at least one heartbeat will occur within the preset time period to collect sufficient heartbeat-related data, thereby determining the heartbeat success rate. Heartbeat-related data includes the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device.
[0145] The preset time period can be set as needed. If rapid detection of UDP network quality is required, the duration of the preset time period can be reduced.
[0146] S404: Determine the heartbeat success rate based on the total number of heartbeats and the total number of heartbeat responses.
[0147] Specifically, the heartbeat success rate (NCR) = total heartbeat responses (TNCF) / total heartbeats (TNC). Each preset time period can have a corresponding heartbeat success rate.
[0148] S405: When the heartbeat success rate is less than the preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0149] In other words, if the NCR is less than the NCRF, the third data transmission protocol will be switched. The preset success rate threshold can be set as needed.
[0150] In this embodiment, the heartbeat success rate is determined based on heartbeat information. Based on the relationship between the heartbeat success rate and a preset success rate threshold, the data transmission protocol is switched, allowing subsequent data transmission to use a more efficient protocol. This improves data transmission efficiency and reduces data transmission latency.
[0151] Figure 5 A flowchart illustrating another data transmission method provided in this application embodiment is shown below. Figure 5 As shown.
[0152] In some embodiments, when the terminal and the message push service device establish a second data transmission connection for the first time, the second data transmission connection is a Fast User Datagram Protocol (FAP) network connection. If the third data transmission protocol is the data transmission protocol corresponding to the Transmission Control Protocol connection, the Fast User Datagram Protocol network connection will be maintained when switching the third data transmission protocol.
[0153] After the terminal logs in and establishes a connection with the signaling service, it completes a QUIC connection with the push message service. That is, the initial establishment of the second data transmission connection is a QUIC connection. The push message service device can then send messages to the terminal via the QUIC protocol, and the terminal can process the messages normally. Furthermore, when switching protocols subsequently, a TCP connection is established, and heartbeats are sent via TCP to maintain the TCP connection and send messages via TCP.
[0154] It should be noted that the terminal establishes a TCP connection with the message push service device, not a persistent TCP connection. This is because maintaining a persistent TCP connection consumes significant computing resources, which may negatively impact user experience.
[0155] Additionally, when the QUIC connection is designated as the secondary data transmission connection, the TCP connection can be disconnected first. When the TCP connection is designated as the secondary data transmission connection, re-establishing the QUIC connection requires significant computational resources. Therefore, the QUIC connection can be maintained, but data transmission can be performed using the data transmission protocol corresponding to the TCP connection.
[0156] Therefore, in Figure 5 The process involves maintaining a QUIC heartbeat and obtaining a QUIC heartbeat response after sending a message via TCP.
[0157] In this embodiment, using QUIC for the initial connection can avoid head-of-line blocking and reduce the latency of messages arriving at the terminal. Therefore, when switching protocols for the first time, the QUIC protocol is switched to TCP while maintaining the QUIC connection to avoid consuming too many computing resources when switching protocols later.
[0158] It's important to note that head-of-line blocking occurs when multiple data packets are transmitted sequentially within a connection. If the first packet is lost or delayed, subsequent packets cannot be processed even if they arrive correctly, and must wait for the first packet to be retransmitted and arrive, thus causing head-of-line blocking. The QUIC protocol, however, uses multiplexed streams, where each stream transmits data independently, and each packet can contain data from multiple streams. Because each stream's data is independent, if a packet in one stream is lost, only that stream is affected; packets from other streams can still be processed. Therefore, it solves the head-of-line blocking problem.
[0159] also, Figure 5 The heart rate transmission (TNC) is the total number of heartbeats, and the response rate (TNFC) is the total number of heartbeat responses.
[0160] In other words, during message sending using the TCP protocol, the terminal's UDP heartbeat strategy continues. When the UDP heartbeat success rate (NCR) exceeds the preset success rate threshold (NCRF), the terminal again notifies the message push service device to switch the data transmission protocol via a heartbeat, so that the message push service device can push messages according to the protocol requested by the terminal.
[0161] In some embodiments, since multiple streams can be used to transmit data in parallel in the QUIC protocol, only one QUIC connection needs to be created. Therefore, a stream can be created to send heartbeat information to achieve keep-alive. That is, a stream for transmitting heartbeat information is created using the data transmission protocol corresponding to the Fast User Datagram Protocol (HUDP) network connection. Heartbeat information is sent to the message push service device via a stream at preset time intervals. In some embodiments, the receiving message push service device sends messages using corresponding streams according to different message types, wherein one stream corresponds to one message buffer queue, and several streams are created by the message push service device through the data transmission protocol corresponding to the Fast User Datagram Protocol network connection.
[0162] Understandably, push notification service devices can also create streams, specifically based on the message type to be transmitted. Message types can include heartbeat information, priority information, media information, etc. Messages of the same type use the same stream and correspond to a message buffer queue, being sent sequentially through the stream to ensure the order of message arrival.
[0163] In this embodiment, multiple dedicated streams are created to achieve parallel data transmission and improve data transmission efficiency. In other words, different message types use different streams, allowing for concurrent push to the terminal and reducing message arrival latency.
[0164] In this embodiment, the protocol type for message transmission can be controlled in real time throughout the entire message transmission chain. Specifically, for the interaction between the first service device and the message push service device, the first service device calculates the message transmission failure rate, average message latency, and, on the service side, combines factors such as CPU utilization, transmission failure rate, average latency threshold, and adaptive average latency threshold to dynamically switch between TCP and QUIC protocols, thereby reducing message transmission latency and success rate.
[0165] To address the interaction between the terminal and the push notification service device, the system uses heartbeat signals between the terminal and the push notification service device to promptly detect network changes on the terminal side, issues such as UDP penetration caused by operator network control, and request timeouts. The data transmission protocol is confirmed by the terminal based on monitoring data. This avoids message delays caused by service restarts, terminal network changes leading to reconnection, and UDP network interruptions. It significantly reduces message arrival latency and improves message delivery success rate. This reduces the latency of messages from the push notification service device to the terminal, improves the stability of push notifications, and increases the success rate of push notifications.
[0166] Figure 6 This application provides a schematic diagram of the structure of a data transmission device according to an embodiment. For example... Figure 6 As shown, the first service device applied in the intercom platform, the data transmission device 600 may include: The data transmission request sending module 601 is used to send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. The first receiving module 602 is used to receive the first total amount of data received in the target time window and the first total receiving time returned by the message push service device; The first average reception time determination module 603 is used to determine the first average reception time of the target time window based on the first total data volume and the first total reception time. The protocol first update module 604 is used to dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission.
[0167] In one embodiment, when the first average reception time is determined for the first time, the protocol first update module 604 is specifically used to switch the first data transmission protocol if the first average reception time is greater than a preset initial average reception time threshold. If the first average reception time is less than or equal to a preset initial average reception time threshold, then the first data transmission protocol will not be switched.
[0168] In one embodiment, when the first average reception time is not determined for the first time, the protocol first update module 604 is specifically used to obtain the target average reception time threshold. If the first average reception time is less than the target average reception time threshold, then the first data transmission protocol will not be switched. If the first average reception time is greater than or equal to the target average reception time threshold, then the comprehensive transmission overhead parameter of the target time window is determined; When the first average reception time is equal to the target average reception time threshold, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window. When the first average reception time is greater than the target average reception time threshold, an efficiency improvement flag is determined, and the first data transmission protocol is dynamically updated based on the efficiency improvement flag and the comprehensive transmission overhead parameters.
[0169] In one embodiment, the protocol first update module 604 is specifically used to determine the second total amount of data to be sent to the message push service device within the target time window; The data transmission failure rate is determined based on the second total data volume and the first total data volume; The parameter value of the failure rate identifier is determined based on the data transmission failure rate and the preset failure rate threshold. Obtain the CPU utilization rate within the target time window; The parameter value of the usage rate identifier is determined based on the central processing unit usage rate and the preset usage rate threshold. The comprehensive transmission overhead parameter is determined based on the parameter value of the failure rate identifier, the parameter value of the utilization rate identifier, the preset failure rate weight, and the preset utilization rate weight.
[0170] In one embodiment, the protocol first update module 604 is specifically used to receive the third total amount of data received in adjacent time windows and the second total reception time sent by the message push service device; Based on the total amount of the third data and the total reception time of the second, the average reception time of the adjacent time window is determined; When the second average reception time, the first average reception time, the first total data volume, and the third total data volume meet any one of the preset conditions, the parameter value of the efficiency improvement identifier is determined as the first parameter value; otherwise, the parameter value of the efficiency improvement identifier is determined as the second parameter value. The preset conditions include: The total amount of the third data is less than the total amount of the first data, and the average reception time of the second data is greater than or equal to the average reception time of the first data. The third total data volume is less than the first total data volume, the second average reception time is less than the first average reception time, and the growth rate of the average reception time is less than or equal to the growth rate of the total data volume. The third total data volume is equal to the first total data volume, and the second average reception time is greater than or equal to the first average reception time; The third total data volume is greater than the first total data volume, and the second average reception time is greater than the first average reception time, and the rate of decrease of the average reception time is greater than the rate of decrease of the total data volume.
[0171] In one embodiment, the protocol first update module 604 is specifically used to switch the first data transmission protocol when the parameter value of the efficiency improvement identifier is a first parameter value, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window; When the parameter value of the efficiency improvement indicator is the second parameter value, if the first data transmission protocol and the second data transmission protocol are different, then the first data transmission protocol is switched.
[0172] In one embodiment, the apparatus further includes: Determine the target number of windows that exceed the time threshold based on the preset initial number of windows that exceed the time threshold; The average time consumption threshold adjustment module is used to adjust the average time consumption threshold according to the preset average time consumption threshold sliding value when the number of target time consumption exceeding the threshold window is less than 0 and the absolute value of the number of target time consumption exceeding the threshold window is greater than the preset average time consumption threshold switching control parameter, with the adjustment direction being to reduce the average time consumption threshold to be adjusted. The average time consumption threshold to be adjusted includes either the initial average time consumption threshold or the target average time consumption threshold. When the number of windows exceeding the target time threshold is greater than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the preset average time threshold sliding value, with the adjustment direction being to increase the average time threshold to be adjusted.
[0173] In one embodiment, the average time consumption threshold adjustment module is specifically used to, when the first average reception time is less than the comprehensive average time consumption threshold, if the number of time consumption exceeding the threshold to be modified is negative, the target number of time consumption exceeding the threshold is the number of time consumption exceeding the threshold to be modified minus 1; if the number of time consumption exceeding the threshold to be modified is positive, the target number of time consumption exceeding the threshold is negative 1. When the first average reception time is greater than the comprehensive average reception time threshold, if the number of time exceeding the threshold to be modified is negative, the number of target time exceeding the threshold is 1; if the number of time exceeding the threshold to be modified is positive, the number of target time exceeding the threshold is the number of time exceeding the threshold to be modified plus 1. Wherein, when the first average reception time is determined for the first time, the number of time exceeding the threshold window to be modified is the initial number of time exceeding the threshold window, and the comprehensive average time threshold is the initial average time threshold; when the average reception time is not determined for the first time, the number of time exceeding the threshold window to be modified is determined based on the initial number of time exceeding the threshold window and a number of the first average reception time being less than or greater than the comprehensive average time threshold, and the comprehensive average time threshold is the target average time threshold.
[0174] This application embodiment also provides a data transmission device applied to a terminal, the device comprising: The heartbeat information sending module is used to send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and to record it. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. The second receiving module is used to receive the heartbeat response returned by the message push service device; The parameter determination module is used to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. The heartbeat success rate determination module is used to determine the heartbeat success rate based on the total number of heartbeats and the total number of heartbeat responses. The second update module is used to switch the third data transmission protocol when the heartbeat success rate is less than a preset success rate threshold, so as to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0175] In one embodiment, when the terminal and the message push service device establish a second data transmission connection for the first time, the second data transmission connection is a Fast User Datagram Protocol (FAP) network connection. The device further includes: The protocol maintenance module is used to maintain the Fast User Datagram Protocol (HTP) network connection when switching the third data transmission protocol to the transmission control protocol connection if the third data transmission protocol is the data transmission protocol corresponding to the transmission control protocol connection.
[0176] In one embodiment, the heartbeat information sending module is specifically used to create a stream for transmitting heartbeat information through the data transmission protocol corresponding to the Fast User Datagram Protocol network connection when the second data transmission connection is a Fast User Datagram Protocol network connection; Heartbeat information is sent to the message push service device through the stream at preset time intervals. The device further includes: The parallel data receiving module is used to receive messages sent by the message push service device according to different message types using corresponding streams. Each stream corresponds to a message buffer queue, and the streams are created by the message push service device through the data transmission protocol corresponding to the Fast User Datagram Protocol network connection.
[0177] This application embodiment also provides a data transmission device, applied to a message push service device in an intercom platform, the device comprising: The third receiving module is used to receive a data transmission request sent by the first service device through the first data transmission protocol corresponding to the first data transmission connection, and return to the first service device the first total amount of data received in the target time window and the first total reception time, so that the first service device can determine the first average reception time of the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission. The fourth receiving module is used to receive heartbeat information sent by the terminal to the message push service device in the intercom platform at a preset frequency via the third data transmission protocol corresponding to the second data transmission connection, and to return heartbeat responses to the terminal. This allows the terminal to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. Based on the total number of heartbeats and the total number of heartbeat responses, a heartbeat success rate is determined. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0178] This application embodiment also provides a data transmission system, the system including a terminal, a first service device in an intercom platform, and a message push service device, wherein: The first service device is used to send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. The message push service device is used to return to the first service device the first total amount of data received in the target time window and the first total reception time. The first service device is further configured to receive the first total amount of data received in the target time window and the first total reception time returned by the message push service device, determine the first average reception time in the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time so as to use the updated first data transmission protocol for data transmission. The terminal is used to send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and record it. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. The message push service device is also used to return a heartbeat response to the terminal; The terminal is also used to receive a heartbeat response returned by the message push service device; Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period; The heartbeat success rate is determined based on the total number of heartbeats and the total number of heartbeat responses. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
[0179] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application is shown.
[0180] An electronic device may include a processor 701 and a memory 702 storing computer program instructions.
[0181] Specifically, the processor 701 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0182] Memory 702 may include mass storage for data or instructions. For example, and not limitingly, memory 702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 702 may include removable or non-removable (or fixed) media, or memory 702 may be a non-volatile solid-state memory. Memory 702 may be internal or external to an electronic device.
[0183] In one example, memory 702 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0184] The processor 701 reads and executes computer program instructions stored in the memory 702 to achieve... Figures 1-5 The data transmission method in the illustrated embodiment.
[0185] In one example, the electronic device may also include a communication interface 703 and a bus 710. For example, Figure 7 As shown, the processor 701, memory 702, and communication interface 703 are connected through bus 710 and complete communication with each other.
[0186] The communication interface 703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0187] Bus 710 includes hardware, software, or both, that couples components of an online data flow metering device together. For example, and not limited to, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VESA Local Bus, VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 710 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.
[0188] Furthermore, in conjunction with the data transmission methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the data transmission methods described in the above embodiments.
[0189] This application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the data transmission methods described in the above embodiments.
[0190] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0191] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0192] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0193] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0194] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A data transmission method, characterized in that, The method, applied to a first service device in a walkie-talkie platform, includes: A data transmission request is sent to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. Receive the first total amount of data received within the target time window and the first total reception time returned by the message push service device; Based on the first total data volume and the first total reception time, determine the first average reception time for the target time window; Based on the first average reception time, the first data transmission protocol is dynamically updated so that the updated first data transmission protocol is used for data transmission.
2. The data transmission method according to claim 1, characterized in that, When the first average reception time is determined for the first time, the first data transmission protocol is dynamically updated based on the first average reception time, specifically including: If the first average reception time is greater than the preset initial average reception time threshold, then switch the first data transmission protocol; If the first average reception time is less than or equal to a preset initial average reception time threshold, then the first data transmission protocol will not be switched.
3. The data transmission method according to claim 1, characterized in that, When the first average reception time is not determined for the first time, the first data transmission protocol is dynamically updated based on the first average reception time, specifically including: Obtain the target average time threshold; If the first average reception time is less than the target average reception time threshold, then the first data transmission protocol will not be switched. If the first average reception time is greater than or equal to the target average reception time threshold, then the comprehensive transmission overhead parameter of the target time window is determined; When the first average reception time is equal to the target average reception time threshold, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window. When the first average reception time is greater than the target average reception time threshold, an efficiency improvement flag is determined, and the first data transmission protocol is dynamically updated based on the efficiency improvement flag and the comprehensive transmission overhead parameters.
4. The data transmission method according to claim 3, characterized in that, Determining the comprehensive transmission overhead parameters for the target time window specifically includes: Determine the total amount of second data to be sent to the message push service device within the target time window; The data transmission failure rate is determined based on the second total data volume and the first total data volume; The parameter value of the failure rate identifier is determined based on the data transmission failure rate and the preset failure rate threshold. Obtain the CPU utilization rate within the target time window; The parameter value of the usage rate identifier is determined based on the central processing unit usage rate and the preset usage rate threshold. The comprehensive transmission overhead parameter is determined based on the parameter value of the failure rate identifier, the parameter value of the utilization rate identifier, the preset failure rate weight, and the preset utilization rate weight.
5. The data transmission method according to claim 3, characterized in that, Identify indicators of efficiency improvement, specifically including: The message push service device receives the total amount of third data received in adjacent time windows and the total time spent receiving the second data. Based on the total amount of the third data and the total reception time of the second, the average reception time of the adjacent time window is determined; When the second average reception time, the first average reception time, the first total data volume, and the third total data volume meet any one of the preset conditions, the parameter value of the efficiency improvement identifier is determined as the first parameter value; otherwise, the parameter value of the efficiency improvement identifier is determined as the second parameter value. The preset conditions include: The total amount of the third data is less than the total amount of the first data, and the average reception time of the second data is greater than or equal to the average reception time of the first data. The third total data volume is less than the first total data volume, the second average reception time is less than the first average reception time, and the growth rate of the average reception time is less than or equal to the growth rate of the total data volume. The third total data volume is equal to the first total data volume, and the second average reception time is greater than or equal to the first average reception time; The third total data volume is greater than the first total data volume, and the second average reception time is greater than the first average reception time, and the rate of decrease of the average reception time is greater than the rate of decrease of the total data volume.
6. The data transmission method according to claim 3, characterized in that, Based on the efficiency improvement identifier and the comprehensive transmission overhead parameters, the first data transmission protocol is dynamically updated, specifically including: When the parameter value of the efficiency improvement indicator is the first parameter value, if the comprehensive transmission overhead parameter is greater than the comprehensive transmission overhead threshold, and the first data transmission protocol is different from the second data transmission protocol, then the first data transmission protocol is switched, and the second data transmission protocol is the data transmission protocol of the adjacent time window of the target time window; When the parameter value of the efficiency improvement indicator is the second parameter value, if the first data transmission protocol and the second data transmission protocol are different, then the first data transmission protocol is switched.
7. The data transmission method according to claim 2 or 3, characterized in that, The method further includes: Determine the target number of windows that exceed the time threshold based on the preset initial number of windows that exceed the time threshold; When the number of windows exceeding the target time threshold is less than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the preset average time threshold sliding value, with the adjustment direction being to reduce the average time threshold to be adjusted. The average time threshold to be adjusted includes either the initial average time threshold or the target average time threshold. When the number of windows exceeding the target time threshold is greater than 0, and the absolute value of the number of windows exceeding the target time threshold is greater than the preset average time threshold switching control parameter, the average time threshold to be adjusted is adjusted according to the preset average time threshold sliding value, with the adjustment direction being to increase the average time threshold to be adjusted.
8. The data transmission method according to claim 7, characterized in that, Based on the preset initial time-out threshold window number, determine the target time-out threshold window number, specifically including: When the first average reception time is less than the comprehensive average reception time threshold, if the number of time exceeding the threshold window to be modified is negative, the target number of time exceeding the threshold window is the number of time exceeding the threshold window to be modified minus 1; if the number of time exceeding the threshold window to be modified is positive, the target number of time exceeding the threshold window is negative 1. When the first average reception time is greater than the comprehensive average reception time threshold, if the number of time exceeding the threshold to be modified is negative, the number of target time exceeding the threshold is 1; if the number of time exceeding the threshold to be modified is positive, the number of target time exceeding the threshold is the number of time exceeding the threshold to be modified plus 1. Wherein, when the first average reception time is determined for the first time, the number of time exceeding the threshold window to be modified is the initial number of time exceeding the threshold window, and the comprehensive average time threshold is the initial average time threshold; when the average reception time is not determined for the first time, the number of time exceeding the threshold window to be modified is determined based on the initial number of time exceeding the threshold window and a number of the first average reception time being less than or greater than the comprehensive average time threshold, and the comprehensive average time threshold is the target average time threshold.
9. A data transmission method, characterized in that, Applied to a terminal, the method includes: Through the third data transmission protocol corresponding to the second data transmission connection, heartbeat information is sent to the message push service device in the intercom platform at a preset frequency and recorded. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. Receive the heartbeat response returned by the message push service device; Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period; The heartbeat success rate is determined based on the total number of heartbeats and the total number of heartbeat responses. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
10. The data transmission method according to claim 9, characterized in that, When the terminal and the message push service device establish a second data transmission connection for the first time, the second data transmission connection is a Fast User Datagram Protocol (FAP) network connection. If the third data transmission protocol is the data transmission protocol corresponding to the transmission control protocol connection, when switching the third data transmission protocol, the method further includes: Maintain Fast User Datagram Protocol (HTP) network connectivity.
11. The data transmission method according to claim 9, characterized in that, When the second data transmission connection is a Fast User Datagram Protocol (FTP) network connection, heartbeat information is sent to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, specifically including: A stream for transmitting heartbeat information is created by connecting the Fast User Datagram Protocol (FAP) network to the corresponding data transmission protocol. Heartbeat information is sent to the message push service device through the stream at preset time intervals. The method further includes: The message push service device receives messages sent by the corresponding stream according to different message types. Each stream corresponds to a message buffer queue, and the streams are created by the message push service device through the data transmission protocol corresponding to the Fast User Datagram Protocol network connection.
12. A data transmission method, characterized in that, The method, applied to a message push service device in an intercom platform, includes: The system receives a data transmission request sent by a first service device through a first data transmission connection corresponding to a first data transmission protocol, and returns to the first service device the first total amount of data received in the target time window and the first total reception time, so that the first service device can determine the first average reception time in the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time, so as to use the updated first data transmission protocol for data transmission. The receiving terminal sends heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and returns a heartbeat response to the terminal. This allows the terminal to determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period. Based on the total number of heartbeats and the total number of heartbeat responses, the heartbeat success rate is determined. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol is switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
13. A data transmission system, characterized in that, The system includes a terminal, a first service device in the intercom platform, and a message push service device, wherein: The first service device is used to send a data transmission request to the message push service device in the intercom platform through the first data transmission protocol corresponding to the first data transmission connection, wherein the first data transmission connection includes a Transmission Control Protocol long connection or a Fast User Datagram Protocol network connection. The message push service device is used to return to the first service device the first total amount of data received in the target time window and the first total reception time. The first service device is further configured to receive the first total amount of data received in the target time window and the first total reception time returned by the message push service device, determine the first average reception time in the target time window based on the first total amount of data and the first total reception time, and dynamically update the first data transmission protocol based on the first average reception time so as to use the updated first data transmission protocol for data transmission. The terminal is used to send heartbeat information to the message push service device in the intercom platform at a preset frequency through the third data transmission protocol corresponding to the second data transmission connection, and record it. The second data transmission connection includes a transmission control protocol connection or a fast user data packet protocol network connection. The message push service device is also used to return a heartbeat response to the terminal; The terminal is also used to receive a heartbeat response returned by the message push service device; Determine the total number of heartbeats sent to the message push service device and the total number of heartbeat responses returned by the message push service device within a preset time period; The heartbeat success rate is determined based on the total number of heartbeats and the total number of heartbeat responses. When the heartbeat success rate is less than a preset success rate threshold, the third data transmission protocol will be switched to send heartbeat information to the message push service device according to the switched data transmission protocol.
14. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the data transmission method as described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the data transmission method as described in any one of claims 1-12.