Network request transmitting and receiving method, storage medium and equipment

The method determines the target network channel by measuring WiFi, UDP, and TCP channel delays to ensure stable network communication in unstable WiFi environments, enhancing user experience and communication quality.

CN119629245APending Publication Date: 2025-03-14TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411905103.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing network communication technologies face challenges in providing stable network services in WiFi environments due to unstable wireless network signals, leading to accumulated requests and poor user experience, especially when users are in different locations or time segments.

Method used

A method that determines the target network channel by measuring the round-trip delays of WiFi, UDP, and TCP channels, and selects the optimal channel for network requests based on these delays to ensure timely and stable communication, even in weak network conditions.

Benefits of technology

This approach optimizes communication quality and user experience by selecting the most suitable network channel, avoiding connection instability and ensuring timely data transmission, even in weak network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629245A_ABST
    Figure CN119629245A_ABST
Patent Text Reader

Abstract

The invention provides a network request transmitting and receiving method, a storage medium and equipment, and relates to the field of network communication, and the method comprises the steps: obtaining a first round-trip delay of a wireless network transmission control protocol channel; if the first round-trip delay does not meet the set timeout time of the network request, respectively obtaining a second round-trip delay corresponding to a wireless network user datagram protocol channel and a third round-trip delay corresponding to a cellular network transmission control protocol channel; and determining a target network channel according to the first round-trip time delay, the second round-trip time delay and the third round-trip time delay, and executing receiving and transmitting operation of the network request by applying the target network channel. According to the method and the device, network communication can be prevented from being influenced when a single wireless network transmission control protocol channel is unstable in connection due to reasons such as a user position, the communication quality of the electronic communication equipment in a weak network environment is optimized, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communications, and in particular to a method, storage medium and device for sending and receiving network requests. Background Art

[0002] In the prior art, most of the default network cards are used to establish a Transmission Control Protocol (TCP) connection to communicate with the server, and most requests can get a response packet within the specified timeout period. However, if the user is in different locations and time periods, the signal status of the wireless network, namely WiFi (Wireless Fidelity), may not be stable, and a large number of requests may be accumulated and not completed, and good service cannot be provided. Therefore, how to provide users with good network services is a technical problem that technicians in this field need to solve urgently. Summary of the invention

[0003] The purpose of this application is to provide a method for sending and receiving network requests, a storage medium and an electronic communication device, which can ensure the network stability of the electronic communication device in a wireless network WiFi scenario.

[0004] In order to solve the above technical problems, the present application provides a method for sending and receiving network requests, and the specific technical solution is as follows:

[0005] Obtaining a first round trip delay of a wireless network transmission control protocol channel;

[0006] If the first round-trip delay does not meet the set timeout period of the network request, respectively obtain a second round-trip delay corresponding to a wireless network user datagram protocol channel and a third round-trip delay corresponding to a cellular network transmission control protocol channel;

[0007] A target network channel is determined according to the first round-trip delay, the second round-trip delay, and the third round-trip delay, and the target network channel is used to perform the sending and receiving operations of the network request.

[0008] Optionally, if the first round-trip delay does not meet the set timeout period of the network request, before respectively acquiring the second round-trip delay corresponding to the wireless network user datagram protocol channel and the third round-trip delay corresponding to the cellular network transmission control protocol channel, the method further includes:

[0009] Define a local user datagram protocol port and a remote port, bind a user datagram protocol socket to the local user datagram protocol port, send first test data to the remote port, and generate the wireless network user datagram protocol channel when the first test data is tested successfully;

[0010] Define a local transmission control protocol port and a server port, import a transmission control protocol library and create a transmission control protocol socket; bind the transmission control protocol socket to the local transmission control protocol port, send second test data to the server port, and generate the cellular network transmission control protocol channel when the second test data test is successful.

[0011] Optionally, before respectively acquiring the second round trip delay corresponding to the wireless network user datagram protocol channel and the third round trip delay corresponding to the cellular network transmission control protocol channel, the method further includes:

[0012] Calculating the network load of each of the wireless network user datagram protocol channels and each of the cellular network transmission control protocol channels;

[0013] Correspondingly, respectively obtaining a second round trip delay corresponding to a wireless network user datagram protocol channel and a third round trip delay corresponding to a cellular network transmission control protocol channel includes:

[0014] Screening a target wireless network user datagram protocol channel and a target cellular network transmission control protocol channel whose network load satisfies the sending and receiving operations of the network request;

[0015] A second round trip delay corresponding to the target wireless network user datagram protocol channel and a third round trip delay corresponding to the target cellular network transmission control protocol channel are respectively obtained.

[0016] Optionally, determining the target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay includes:

[0017] Parsing the network request to determine a request priority of the network request; the request priority is defined by an initiator of the network request;

[0018] If the request priority of the network request is high priority, determining the target network channel according to the minimum value of the first round-trip delay, the second round-trip delay and the third round-trip delay;

[0019] If the request priority of the network request is low priority, the target network channel is determined according to a maximum value among the first round-trip delay, the second round-trip delay, and the third round-trip delay.

[0020] Optionally, if the target network channel is the wireless network user datagram protocol channel or the cellular network transmission control protocol channel, and a network timeout occurs when the target network channel is used to perform the sending and receiving operation of the network request, the method further includes:

[0021] A target wireless network transmission control protocol channel with the smallest first round-trip delay is selected, and the target wireless network transmission control protocol channel is used to perform the sending and receiving operations of the network request.

[0022] Optionally, after the target network channel is used to successfully perform the sending and receiving operation of the network request, the method further includes:

[0023] If the target network channel is the wireless network transmission control protocol channel, the wireless network user datagram protocol channel and the cellular network transmission control protocol channel are interrupted.

[0024] Optionally, if the target round trip delay of the target network channel is greater than the set timeout period of the network request, the method further includes:

[0025] Calculate an optimal timeout period according to the target round trip delay of the target network channel;

[0026] The optimal timeout period is applied to replace the set timeout period.

[0027] Optionally, when applying the target network channel to perform the sending and receiving operation of the network request, the method further includes:

[0028] When the sending time of the network request meets a preset ratio of the set timeout period and no reply packet of the network request is received, the target network channel is reselected or the network request is resent.

[0029] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.

[0030] The present application also provides an electronic communication device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.

[0031] The present application provides a method for sending and receiving a network request, comprising: obtaining a first round-trip delay of a wireless network transmission control protocol channel; if the first round-trip delay does not meet a set timeout period of the network request, respectively obtaining a second round-trip delay corresponding to a wireless network user datagram protocol channel and a third round-trip delay corresponding to a cellular network transmission control protocol channel; determining a target network channel according to the first round-trip delay, the second round-trip delay and the third round-trip delay, and applying the target network channel to perform the sending and receiving operation of the network request.

[0032] When executing the sending and receiving of network requests, the present application obtains the round-trip delays of different types of network channels if the round-trip delay of the wireless network transmission control protocol channel exceeds the set timeout period, namely, the second round-trip delay of the wireless network user datagram protocol channel and the third round-trip delay of the cellular network transmission control protocol channel, thereby determining the target network channel used for sending and receiving network requests based on the maximum round-trip delays of the three network types, thereby avoiding the impact of unstable connection of a single wireless network transmission control protocol channel due to user location and other reasons, thereby optimizing the communication quality of electronic communication equipment in a weak network environment and improving the user experience.

[0033] The present application also provides a computer-readable storage medium and an electronic communication device, which have the above-mentioned beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0035] Figure 1 A flowchart of a first method for sending and receiving a network request provided in an embodiment of the present application;

[0036] Figure 2 A flowchart of a second method for sending and receiving network requests provided in an embodiment of the present application;

[0037] Figure 3 A flowchart of a third method for sending and receiving network requests provided in an embodiment of the present application;

[0038] Figure 4 A flowchart of a fourth method for sending and receiving a network request provided in an embodiment of the present application;

[0039] Figure 5 A structural diagram of an electronic communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] The object information involved in this application, including but not limited to the object device information, object personal information, etc., and data, including but not limited to data used for analysis, stored data, displayed data, etc., are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the laws, regulations and standards of relevant countries and regions.

[0042] See also Figure 1 , Figure 1 A flowchart of a method for sending and receiving a network request provided in an embodiment of the present application, the method comprising:

[0043] S101: Obtaining a first round trip delay of a wireless network transmission control protocol channel;

[0044] S102: If the first round-trip delay does not meet the set timeout period of the network request, respectively obtain a second round-trip delay corresponding to a wireless network user datagram protocol channel and a third round-trip delay corresponding to a cellular network transmission control protocol channel;

[0045] S103: Determine a target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay, and use the target network channel to perform the sending and receiving operations of the network request.

[0046] The wireless network transmission control protocol channel, wireless network user datagram protocol channel and cellular network transmission control protocol channel described in this embodiment are all network channels. Among them, the transmission control protocol refers to TDP (Transmission Control Protocol), which is a transport layer communication protocol, and the user datagram protocol refers to UDP (User Datagram Protocol). The wireless network transmission control protocol channel, wireless network user datagram protocol channel and cellular network transmission control protocol channel described in the embodiments of this application are all network channels. The network channel is an information transmission carrier used to connect the physical layer and the transport layer of a computer network to realize data transmission between nodes.

[0047] This embodiment assumes that the electronic communication device used has the communication capability to establish the above three network channels, and does not limit the specific type of the electronic communication device used. The above network channels can be realized by a device network card, which is a hardware component used to communicate in a computer network, and an electronic communication device such as a mobile phone or a mobile terminal can include multiple device network cards, which are used to realize network connection using different network channels, such as a device network card that communicates with a WiFi router, a device network card that uses the traffic of a communication operator, etc.

[0048] The embodiment of the present application assumes that the electronic communication device can connect to WiFi, that is, a wireless network transmission control protocol channel can be established. First, the first round-trip delay of the wireless network transmission control protocol channel is obtained, so as to determine the size relationship between the first round-trip delay and the set timeout time of the network request. The set timeout time can be set by the initiator of the network request, such as the initiator application software of the network request, which can be a fixed value, or different set timeout times can be used according to the type of network request.

[0049] Here, there is no limitation on how to determine whether the first round-trip delay meets the set timeout period. Generally, if the first round-trip delay is less than or equal to the set timeout period, it can be regarded as meeting the set timeout period, otherwise it is regarded as not meeting the set timeout period. If the first round-trip delay cannot meet the set timeout period of the network request, a second round-trip delay corresponding to the wireless network user datagram protocol channel and a third round-trip delay corresponding to the cellular network transmission control protocol channel are obtained respectively.

[0050] It should be noted that, in this embodiment, it is assumed that the wireless network user datagram protocol channel and the cellular network transmission control protocol channel have been established before obtaining the second round-trip delay and the third round-trip delay. There is no limitation on how to construct the above two channels.

[0051] It should also be emphasized that the wireless network transmission control protocol channel, wireless network user datagram protocol channel and cellular network transmission control protocol channel described in the embodiments of the present application all refer to channel types. Each channel type may include several channels. The corresponding first round-trip delay, second round-trip delay and third round-trip delay refer to the round-trip delays of all network channels under each channel type.

[0052] In a feasible implementation, the wireless network user datagram protocol channel can first define a local user datagram protocol port and a remote port, bind a user datagram protocol socket to the local user datagram protocol port, send test data to the remote port, and generate a wireless network user datagram protocol channel when the test is successful.

[0053] The cellular network TCP channel can define the local TCP port and server port, import the TCP library and create a TCP socket, bind the TCP socket to the local TCP port, send test data to the server port, and generate a cellular network TCP channel when the test is successful.

[0054] After respectively obtaining the second round-trip delay corresponding to the wireless network user datagram protocol channel and the third round-trip delay corresponding to the cellular network transmission control protocol channel, the target network channel can be determined according to the first round-trip delay, the second round-trip delay and the third round-trip delay, and the target network channel can be applied to perform the sending and receiving operations of the network request.

[0055] In a feasible implementation, the target network channel may be determined according to the maximum value among the first round-trip delay, the second round-trip delay, and the third round-trip delay. The maximum value refers to the maximum value or the minimum value. For example, the target network channel may be determined according to the minimum value among the first round-trip delay, the second round-trip delay, and the third round-trip delay. The maximum values ​​may be obtained by applying a comparator to compare two by two.

[0056] In a feasible implementation of the present application, for different network requests, the target network channel can also be determined according to the maximum value of the first round-trip delay, the second round-trip delay, and the third round-trip delay. At this time, the network request can be parsed to determine the request priority of the network request. The request priority is defined by the initiator of the network request.

[0057] If the network request is a high priority request, the target network channel is determined according to the minimum value of the first round-trip delay, the second round-trip delay and the third round-trip delay. If the network request is a low priority request, the target network channel is determined according to the maximum value of the first round-trip delay, the second round-trip delay and the third round-trip delay.

[0058] That is, the target network channel of the application can be determined according to the priority of the network request. On this basis, in another execution method of the present application, if there are different levels of network requests, such as different priorities or different importance levels, the first round-trip delay, the second round-trip delay and the third round-trip delay can be sorted to obtain the round-trip delay order, so as to select the adapted target network channel in turn according to the order of the request priorities of the network requests and the order of the round-trip delay sizes.

[0059] When executing the sending and receiving of network requests, the present application obtains the round-trip delays of different types of network channels if the round-trip delay of the wireless network transmission control protocol channel exceeds the set timeout period, namely, the second round-trip delay of the wireless network user datagram protocol channel and the third round-trip delay of the cellular network transmission control protocol channel, thereby determining the target network channel used for sending and receiving network requests based on the maximum round-trip delays of the three network types, thereby avoiding the impact of unstable connection of a single wireless network transmission control protocol channel due to user location and other reasons, thereby optimizing the communication quality of electronic communication equipment in a weak network environment and improving the user experience.

[0060] In a feasible implementation, before respectively obtaining the second round-trip delay corresponding to the wireless network user datagram protocol channel and the third round-trip delay corresponding to the cellular network transmission control protocol channel, the network load of each of the wireless network user datagram protocol channels and each of the cellular network transmission control protocol channels can be calculated, so as to comprehensively determine the network channel by combining the network load and round-trip delay of the network channel. The corresponding complete implementation process is as follows: Figure 2 As shown, Figure 2 A flowchart of a second method for sending and receiving a network request provided in an embodiment of the present application, wherein the process includes:

[0061] S201: Obtaining a first round trip delay of a wireless network transmission control protocol channel;

[0062] S202: If the first round-trip delay does not satisfy the set timeout period of the network request, calculate the network load of each of the wireless network user datagram protocol channels and each of the cellular network transmission control protocol channels;

[0063] S203: Filtering the target wireless network user datagram protocol channel and the target cellular network transmission control protocol channel whose network loads satisfy the sending and receiving operations of the network request;

[0064] S204: respectively obtaining a second round trip delay corresponding to the target wireless network user datagram protocol channel and a third round trip delay corresponding to the target cellular network transmission control protocol channel;

[0065] S205: Determine a target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay, and use the target network channel to perform the sending and receiving operations of the network request.

[0066] Compared with the previous embodiment, this embodiment can first determine the target wireless network user datagram protocol channel and the target cellular network transmission control protocol channel that can meet the corresponding load of the network request before obtaining the second round-trip delay and the third round-trip delay, thereby eliminating the need to obtain unqualified network channels whose network load cannot meet the network request, thereby combining the round-trip delay and the network load to determine the target network channel, thereby improving the success rate of sending and receiving network requests.

[0067] In addition, based on the present embodiment, the second round-trip delay and the third round-trip delay corresponding to the wireless network user datagram protocol channel and the cellular network transmission control protocol channel can be obtained first, and then the target wireless network user datagram protocol channel and the target cellular network transmission control protocol channel that can meet the network load can be determined, which can produce the same technical effect as the present embodiment.

[0068] In a feasible implementation, after determining the target network channel, if the target round-trip delay of the target network channel is greater than the set timeout time of the network request, the optimal timeout time can also be calculated based on the target round-trip delay of the target network channel, so that the optimal timeout time is applied to replace the set timeout time.

[0069] At this time, in combination with the above embodiment, see Figure 3 , Figure 3 This is a flowchart of a third method for sending and receiving a network request provided in an embodiment of the present application. The process may include:

[0070] S301: Obtaining a first round trip delay of a wireless network transmission control protocol channel;

[0071] S302: If the first round-trip delay cannot meet the set timeout period of the network request, respectively obtain a second round-trip delay corresponding to the wireless network user datagram protocol channel and a third round-trip delay corresponding to the cellular network transmission control protocol channel;

[0072] S303: Determine a target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay;

[0073] S304: If the target round trip delay of the target network channel is greater than the set timeout period of the network request, calculate the optimal timeout period according to the target round trip delay of the target network channel;

[0074] S305: Apply the optimal timeout time to replace the set timeout time, and apply the target network channel to perform the sending and receiving operations of the network request.

[0075] Since the network connection status when the network quality is poor is usually not taken into account when setting the timeout time, if the first round-trip delay of the wireless network transmission control protocol channel cannot meet the set timeout time of the network request, the target network channel determined by the above embodiment may also not meet the set timeout time when performing the actual sending and receiving of the network request. In order to avoid frequent switching of network channels or frequent retransmission of network requests due to a small set timeout time when the network quality is poor, the optimal timeout time can be calculated according to the target round-trip delay of the target network channel, and the optimal timeout time can be used to replace the set timeout time, thereby extending the set timeout time, which can effectively avoid the scenario where the round-trip delay is just greater than the timeout time, and can effectively improve the success rate of sending and receiving network requests.

[0076] There is no limitation on how to calculate the optimal timeout based on the target round-trip delay of the target network channel. The target round-trip delay is usually used as a reference value for the optimal timeout. For example, the set duration can be added to the target round-trip delay as the optimal timeout, or it can be multiplied by a set coefficient to obtain the optimal timeout.

[0077] The target round-trip delay refers to the real-time round-trip delay of the determined target network channel. After the target network channel is determined, its round-trip delay can be obtained again as the target round-trip delay.

[0078] In combination with the above embodiments, see Figure 4 , Figure 4 This is a flowchart of a fourth method for sending and receiving network requests provided in an embodiment of the present application, and the process is as follows:

[0079] S401: Obtaining a first round trip delay of a wireless network transmission control protocol channel;

[0080] S402: If the first round-trip delay cannot satisfy the set timeout period of the network request, calculate the network loads of the wireless network user datagram protocol channel and the cellular network transmission control protocol channel respectively;

[0081] S403: Filtering the target wireless network user datagram protocol channel and the target cellular network transmission control protocol channel whose network load satisfies the sending and receiving operations requested by the network;

[0082] S404: Obtaining a second round trip delay and a third round trip delay corresponding to a target wireless network user datagram protocol channel and a target cellular network transmission control protocol channel respectively;

[0083] S405: Determine a target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay;

[0084] S406: If the target round trip delay of the target network channel is greater than the set timeout period of the network request, calculate the optimal timeout period according to the target round trip delay of the target network channel;

[0085] S407: Apply the optimal timeout time to replace the set timeout time, and apply the target network channel to perform the sending and receiving operations of the network request.

[0086] Compared with the above embodiment, this embodiment comprehensively considers the round-trip delay and network load of the network channel to select the target network channel, and optimizes the timeout time, further ensuring the success rate of sending and receiving network requests, optimizing the network communication function of electronic communication equipment in a weak network environment, and ensuring that users have a good network usage experience.

[0087] In a feasible implementation, if the target network channel is a wireless network user datagram protocol channel or a cellular network transmission control protocol channel, and there is a network timeout when applying the target network channel to perform the sending and receiving operations of the network request, the target wireless network transmission control protocol channel with the smallest first round-trip delay is selected, and the target wireless network transmission control protocol channel is applied to perform the sending and receiving operations of the network request.

[0088] Once a network timeout occurs when executing the sending and receiving operations of a network request, the target wireless network transmission control protocol channel with the smallest first round-trip delay can be selected to perform the sending and receiving operations of the network request, thereby realizing switching of different types of network channels and avoiding high load on a single type of network channel while other types of network channels are idle.

[0089] In addition, after the target network channel is applied to successfully perform the sending and receiving operation of the network request, if the target network channel is a wireless network transmission control protocol channel, the wireless network user datagram protocol channel and the cellular network transmission control protocol channel are interrupted. If the target network channel is a wireless network transmission control protocol channel and successfully sends and receives, the wireless network user datagram protocol channel and the cellular network transmission control protocol channel can be interrupted in time to reduce network traffic loss and communication power consumption of electronic communication equipment.

[0090] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0091] The present application also provides an electronic communication device, see Figure 5 , a structural diagram of an electronic communication device provided in an embodiment of the present application, such as Figure 5 As shown, a processor 1410 and a memory 1420 may be included.

[0092] Among them, the processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0093] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic communication device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.

[0094] In some embodiments, the electronic communication device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power source 1470 , and a communication bus 1480 .

[0095] certainly, Figure 5 The structure of the electronic communication device shown does not constitute a limitation on the electronic communication device in the embodiment of the present application. In actual applications, the electronic communication device may include Figure 5 More or fewer components than shown, or combinations of certain components.

[0096] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0097] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

[0098] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for sending and receiving a network request, characterized in that: include: Obtaining a first round trip delay of a wireless network transmission control protocol channel; If the first round-trip delay does not meet the set timeout period of the network request, respectively obtain a second round-trip delay corresponding to a wireless network user datagram protocol channel and a third round-trip delay corresponding to a cellular network transmission control protocol channel; A target network channel is determined according to the first round-trip delay, the second round-trip delay, and the third round-trip delay, and the target network channel is used to perform the sending and receiving operations of the network request.

2. The method for sending and receiving according to claim 1, characterized in that: Determining the target network channel according to the first round-trip delay, the second round-trip delay, and the third round-trip delay includes: Parsing the network request to determine a request priority of the network request; the request priority is defined by an initiator of the network request; If the request priority of the network request is high priority, determining the target network channel according to the minimum value of the first round-trip delay, the second round-trip delay and the third round-trip delay; If the request priority of the network request is low priority, the target network channel is determined according to a maximum value among the first round-trip delay, the second round-trip delay, and the third round-trip delay.

3. The method for sending and receiving according to claim 1, characterized in that: Before respectively acquiring the second round trip delay corresponding to the wireless network user datagram protocol channel and the third round trip delay corresponding to the cellular network transmission control protocol channel, the method further includes: Calculating the network load of each of the wireless network user datagram protocol channels and each of the cellular network transmission control protocol channels; Correspondingly, respectively obtaining a second round trip delay corresponding to a wireless network user datagram protocol channel and a third round trip delay corresponding to a cellular network transmission control protocol channel includes: Screening a target wireless network user datagram protocol channel and a target cellular network transmission control protocol channel whose network load satisfies the sending and receiving operations of the network request; A second round trip delay corresponding to the target wireless network user datagram protocol channel and a third round trip delay corresponding to the target cellular network transmission control protocol channel are respectively obtained.

4. The method for sending and receiving according to claim 1, characterized in that: If the first round-trip delay does not satisfy the set timeout period of the network request, before respectively obtaining the second round-trip delay corresponding to the wireless network user datagram protocol channel and the third round-trip delay corresponding to the cellular network transmission control protocol channel, the method further includes: Define a local user datagram protocol port and a remote port, bind a user datagram protocol socket to the local user datagram protocol port, send first test data to the remote port, and generate the wireless network user datagram protocol channel when the first test data is tested successfully; Define a local transmission control protocol port and a server port, import a transmission control protocol library and create a transmission control protocol socket; bind the transmission control protocol socket to the local transmission control protocol port, send second test data to the server port, and generate the cellular network transmission control protocol channel when the second test data test is successful.

5. The method for sending and receiving according to claim 1, characterized in that: If the target network channel is the wireless network user datagram protocol channel or the cellular network transmission control protocol channel, and a network timeout occurs when the target network channel is used to perform the sending and receiving operation of the network request, the method further includes: A target wireless network transmission control protocol channel with the smallest first round-trip delay is selected, and the target wireless network transmission control protocol channel is used to perform the sending and receiving operations of the network request.

6. The method for sending and receiving according to claim 2, characterized in that: After the target network channel is used to execute the sending and receiving operation of the network request successfully, the method further includes: If the target network channel is the wireless network transmission control protocol channel, the wireless network user datagram protocol channel and the cellular network transmission control protocol channel are interrupted.

7. The sending and receiving method according to any one of claims 1 to 6, characterized in that: If the target round trip delay of the target network channel is greater than the set timeout period of the network request, the method further includes: Calculate an optimal timeout period according to the target round trip delay of the target network channel; The optimal timeout period is applied to replace the set timeout period.

8. The method for sending and receiving according to claim 7, characterized in that: When the target network channel is used to perform the sending and receiving operation of the network request, it also includes: When the sending time of the network request meets a preset ratio of the set timeout period and no reply packet of the network request is received, the target network channel is reselected or the network request is resent.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for sending and receiving a network request as claimed in any one of claims 1 to 8 are implemented.

10. An electronic communication device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the method for sending and receiving network requests as described in any one of claims 1 to 8 are implemented.