CN108901079B - Timeout time determination method, device, equipment and storage medium - Google Patents

Timeout time determination method, device, equipment and storage medium Download PDF

Info

Publication number
CN108901079B
CN108901079B CN201810635830.XA CN201810635830A CN108901079B CN 108901079 B CN108901079 B CN 108901079B CN 201810635830 A CN201810635830 A CN 201810635830A CN 108901079 B CN108901079 B CN 108901079B
Authority
CN
China
Prior art keywords
network
mobile communication
timeout
connection
timeout time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810635830.XA
Other languages
Chinese (zh)
Other versions
CN108901079A (en
Inventor
任超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201810635830.XA priority Critical patent/CN108901079B/en
Publication of CN108901079A publication Critical patent/CN108901079A/en
Application granted granted Critical
Publication of CN108901079B publication Critical patent/CN108901079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/18Management of setup rejection or failure

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for determining timeout time. The method comprises the following steps: determining the type of the current network connection; determining a target time length corresponding to the type of the current network connection; and setting the target duration as the timeout time of the data connection established based on the current network connection, wherein the data connection refers to the connection which is established between the local terminal equipment and the opposite terminal equipment based on the current network connection and is used for transmitting the service data, and the timeout time is used for representing a time threshold for judging whether the service data is successfully received. In the embodiment of the application, the timeout time of the data connection is dynamically set according to the type of the network connection currently established by the local device, the method for determining the timeout time is more flexible, the determined timeout time is more reasonable, and the service requirements under the types of different network connections can be met.

Description

Timeout time determination method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a method, a device, equipment and a storage medium for determining timeout time.
Background
Currently, when a terminal sends a data acquisition request to an opposite terminal device through a HyperText Transfer Protocol (HTTP) connection and does not receive a response message corresponding to the data acquisition request within a set time, the terminal determines that the data acquisition request is overtime, and a subsequent terminal performs corresponding processing for the overtime, for example, the HTTP connection is disconnected, the data acquisition request is retransmitted, and the like. The set time is also the timeout time of the HTTP connection.
In the related art, when a terminal and an opposite terminal device create an HTTP connection, the terminal sets a timeout time of the HTTP connection to a certain preset value.
Disclosure of Invention
The embodiment of the application provides a timeout time determination method, a timeout time determination device, timeout equipment and a storage medium. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a timeout time determining method, where the method includes:
determining a type of a current network connection, wherein the type of the current network connection is a mobile communication network or a Wireless Local Area Network (WLAN);
determining a target time length corresponding to the type of the current network connection;
and setting the target duration as the timeout time of the data connection established based on the current network connection, wherein the data connection is the connection established between the local terminal device and the opposite terminal device based on the current network connection and used for transmitting the service data, and the timeout time is used for representing a time threshold for judging whether the service data is successfully received.
In another aspect, an embodiment of the present application provides an apparatus for determining a timeout period, where the apparatus includes:
the type determining module is used for determining the type of the current network connection, wherein the type of the current network connection is a mobile communication network or a WLAN;
the time length determining module is used for determining the target time length corresponding to the type of the current network connection;
and the time setting module is used for setting the target time length as the timeout time of the data connection established based on the current network connection, wherein the data connection is the connection which is established between the local terminal equipment and the opposite terminal equipment based on the current network connection and is used for transmitting the service data, and the timeout time is used for representing the time threshold for judging whether the service data is successfully received.
In yet another aspect, an embodiment of the present application provides a computer device, where the computer device includes a processor and a memory, where the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the timeout time determination method in the foregoing aspect.
In yet another aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is loaded and executed by a processor to implement the timeout time determination method of the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the timeout time of the data connection is dynamically set according to the type of the network connection currently established by the local terminal equipment, the determination method of the timeout time is more flexible, the determined timeout time is more reasonable, and the business requirements under the types of different network connections can be met.
Drawings
FIG. 1 is a schematic illustration of an implementation environment provided by one embodiment of the present application;
FIG. 2 is a schematic illustration of an implementation environment provided by another embodiment of the present application;
FIG. 3 is a flow diagram of a timeout period determination method provided by one embodiment of the present application;
FIG. 4 is a flowchart of a timeout period determination method provided by an exemplary embodiment of the present application;
fig. 5 is a flowchart of a timeout period determination method according to another embodiment of the present application;
fig. 6 is a block diagram of a timeout period determination apparatus provided in an embodiment of the present application;
FIG. 7 is a block diagram of a computer device provided in an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a schematic diagram of an implementation environment shown in one embodiment of the present application is shown. The implementation environment includes: home terminal equipment 11, opposite terminal equipment 12 and access network equipment 13.
The local terminal device 11 has a service data interaction function. The home device 11 may be a mobile phone, a tablet computer, an e-book reader, a multimedia playing device, a wearable device, a laptop, etc.
The local terminal device 11 establishes a communication connection with the access network device 13 through the mobile communication network. The access network device 13 is deployed in a radio access network to provide a wireless access function for the local terminal device. The access network device 13 may be a Base Station (BS). The access network device 13 may communicate wirelessly with the home device via one or more antennas. The access network device may provide communication coverage for the geographic area in which it is located. The base stations may include different types such as macro base stations, micro base stations, relay stations, access points, and the like. In some embodiments, a base station may be referred to by those skilled in the art as a base transceiver station, a radio base station, an access point, a radio transceiver, a Basic Service Set (BSS), an Extended Service Set (ESS), a node B (NodeB), an evolved node B (eNB or eNodeB), or some other suitable terminology. Exemplarily, in a 5G system, a base station is referred to as a gNB. For convenience of description, in the embodiments of the present application, the above-mentioned apparatus for providing a wireless communication function for a local device is collectively referred to as an access network device.
The opposite terminal equipment 12 also has a service data interaction function. The peer device 12 may also be a cell phone, a tablet, an e-book reader, a multimedia playing device, a wearable device, a laptop, etc.
A communication connection is established between the local terminal device 11 and the opposite terminal device 12, and the communication connection can be established based on a mobile communication network. Optionally, the local device 11 establishes a Transmission Control Protocol (TCP) connection with the peer device 13 through the communication connection, and performs service data interaction with the peer device 12 based on the TCP connection. Further, the local device 11 establishes a data connection with the peer device 12 through the TCP connection, and implements interaction of service data through the data connection. The data connection may be an HTTP connection, a Socket connection, or the like.
Referring to fig. 2, a schematic diagram of an implementation environment according to another embodiment of the present application is shown. The implementation environment includes a local device 11, a peer device 12, and an Access Point (AP) 21.
For related introduction of the local device 11 and the peer device 12, reference may be made to the embodiment described in fig. 1, which is not described herein again. A communication connection is established between the local terminal device 11 and the opposite terminal device 12, and the communication connection can be established based on a wireless local area network.
The local terminal device 11 establishes a communication connection with the AP21 through the wireless lan. The AP21 is also referred to as a wireless access point or a hot spot, and is used for the local device 11 to access the WLAN. The AP21 may be a router, a mobile phone with wireless access function, a tablet computer, etc. The AP21 and the local device 11 communicate with each other via a Wireless network, such as a Wireless Fidelity (Wi-Fi) network.
Referring to fig. 3, a flowchart of a timeout period determination method according to an embodiment of the present application is shown. The method can be applied to the local terminal device in the embodiment of fig. 1 or the embodiment of fig. 2, and the method can include the following steps.
Step 301, determine the type of the current network connection.
The current network connection refers to a network connection currently established by the home device, and the home device may be the computer device described above, such as a mobile phone. The type to which the current network connection belongs is a mobile communication network or a WLAN.
A mobile communication network refers to a radio communication network for communication between a mobile device and a mobile device, or a mobile device and a fixed device. Networks where communication between users and fixed point users or between mobile users is enabled. The mobile communication network may also be referred to by those skilled in the art as a mobile network, a cellular network or some other suitable terminology. When the current network connection is established between the home terminal equipment and the access network equipment erected by the operator, the type of the current network connection is the mobile communication network.
A WLAN is a local area network using a wireless communication method as a transmission method, and generally uses radio waves such as microwaves, laser light, and infrared rays as a transmission medium. When the current network connection is the network connection established between the local terminal device and the AP, the type to which the current network connection belongs is WLAN.
Optionally, a first switch and a second switch are displayed in the function bar of the home device. The switch state of the first switch is used for indicating the state of the WLAN function, and when the first switch is in the open state, the WLAN function is enabled; when the first switch is in the off state, the WLAN function is not enabled. The switch state of the second switch is used for indicating the state of the mobile communication network function, and when the second switch is in the open state, the mobile communication network function is enabled; when the second switch is in the off state, the mobile communication network function is not enabled. The local terminal equipment can acquire the type of the current network connection according to the state of the first switch and/or the second switch. If the first switch is in an open state and an identifier (e.g., name) of a wireless local area network is displayed on the peripheral side (e.g., the lower side) of the first switch, the type to which the current network connection belongs is WLAN; and if the second switch is in an open state and the first switch is in a closed state, the type of the current network connection is the mobile communication network.
In the embodiment of the present application, the timing for acquiring the type to which the current network connection belongs is not limited. For example, the home device may obtain a type to which the current network connection belongs when sending a data connection establishment request to the peer device through the current network connection, may also obtain a type to which the current network connection belongs when the home device and the peer device successfully establish the data connection, may also obtain a type to which the current network connection belongs when the home device establishes the current network connection, and the like. The data connection establishment request is used for requesting the establishment of data connection between the local terminal equipment and the opposite terminal equipment.
Step 302, determining a target duration corresponding to the type to which the current network connection belongs.
In the embodiment of the present application, the target duration corresponding to the mobile communication network is different from the target duration corresponding to the WLAN, and the following explains the determination manners of the target durations corresponding to the types to which the two types of network connections belong respectively.
When the type of the current network connection is a mobile communication network, step 302 includes the following two substeps:
step 302a, network speed characteristic information of the mobile communication network is obtained.
The network speed characteristic information is used to indicate a network transmission rate of the mobile communication network, which refers to a binary number of bits transmitted per second, generally in units of bit rates (bps).
In one possible implementation, the wire speed characteristic information is a type of the mobile communication network. The type of the mobile communication network may be divided according to a version of the mobile communication network, and the type of the mobile communication network may include 2G, 3G, 4G, 5G, and a mobile communication network provided by a next generation mobile communication system, and the like. Different types of mobile communication networks have different network transmission rates. Taking the types of mobile communication networks including 2G, 3G and 4G as an example, the network transmission rate of 2G is smaller than that of 3G, and the network transmission rate of 3G is smaller than that of 4G.
In another possible implementation manner, the network speed characteristic information is a network transmission rate of the mobile communication network obtained through actual measurement. Optionally, the local device sends a test message to the peer device, and obtains the network transmission rate of the current network connection according to the data volume of the test message and a time interval between sending the test message and receiving a response message corresponding to the test message.
In the embodiment of the present application, the local device may obtain the network speed characteristic information when the opposite device sends the data connection establishment request, or may obtain the network speed characteristic information when the data connection between the local device and the opposite device is successfully established.
Step 302b, determining the target duration according to the network speed characteristic information of the mobile communication network.
Alternatively, step 302b may comprise the following two substeps:
step 302b1, determining a target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network;
the weighting factor may be determined according to a network transmission rate of the mobile communication network. Optionally, the weighting factor has a negative correlation with the network transmission rate of the mobile communication network. That is, the larger the network transmission rate of the mobile communication network is, the smaller the weighting coefficient is; the smaller the network transmission rate of the mobile communication network, the larger the weighting coefficient.
When the network speed characteristic information is the type of the mobile communication network, step 303a may be implemented as: and acquiring a weighting coefficient corresponding to the type of the mobile communication network from the first corresponding relation, and determining the acquired weighting coefficient as a target weighting coefficient. The first correspondence includes correspondence between different types and different weighting coefficients of the mobile communication network. With combined reference to Table-1, a first correspondence is illustratively shown.
TABLE-1
Type of mobile communication network 2G 3G 4G
Weighting coefficient 1 0.8 0.5
In table-1, when the mobile communication network established between the local device and the access network device is 2G, the corresponding weighting coefficient is 1; when the mobile communication network established between the local terminal equipment and the access network equipment is 3G, the corresponding weighting coefficient is 0.8; when the mobile communication network established between the local terminal device and the access network device is 4G, the corresponding weighting coefficient is 0.5.
When the network speed characteristic information is the network transmission rate of the mobile communication network obtained by actual measurement, two implementation modes can be provided for determining the target weighting coefficient corresponding to the network speed characteristic information.
In a first possible implementation manner, the local device calculates the target weighting coefficient according to the network transmission rate of the mobile communication network by using a preset calculation formula. The preset calculation formula can be obtained by the following method, a developer obtains multiple groups of data through experiments, each group of data comprises a network transmission rate and an overtime coefficient corresponding to the network transmission rate, and then the multiple groups of data are subjected to fitting processing to obtain a functional relation between the network transmission rate and the overtime coefficient, wherein the functional relation is also the preset calculation formula. And after the subsequent home terminal equipment measures the network transmission rate, substituting the network transmission rate into the preset calculation formula to obtain the timeout coefficient corresponding to the network transmission rate.
In another possible implementation manner, a weighting coefficient corresponding to the network transmission rate of the mobile communication network is obtained from the second correspondence, and the obtained weighting coefficient is determined as the target weighting coefficient. The second corresponding relation comprises the corresponding relation between the network transmission rate and the weighting coefficients, and the weighting coefficient corresponding to at least one network transmission rate is different from the weighting coefficients corresponding to other network transmission rates. Referring to Table-2 in combination, a second correspondence is illustrated.
TABLE-2
Figure BDA0001701521000000061
Figure BDA0001701521000000071
In table-2, when the network transmission rate of the mobile communication network established between the local device and the access network device is 20 to 200bps, the corresponding weighting coefficient is 1; when the network transmission rate of a mobile communication network established between the local terminal equipment and the access network equipment is 200-1000 bps, the corresponding weighting coefficient is 0.8; when the network transmission rate of the mobile communication network established between the local terminal equipment and the access network equipment is 1000-2000 bps, the corresponding weighting coefficient is 0.5.
Step 302b2, determining the target duration as the product of the target weighting factor and the preset reference timeout.
The preset reference timeout period may be set empirically, which is not set in the embodiment of the present application. Illustratively, the preset reference timeout time is 10 seconds.
In the embodiment of the present application, the home terminal device directly determines a product between the target weighting coefficient and the preset reference timeout time as the target duration. Illustratively, the preset reference timeout time is 10 seconds, the target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network is 0.8, and the target duration is 10 × 0.8-8 seconds.
In a specific example, with reference to fig. 4 in combination, a flowchart of a data connection determining method shown in an embodiment of the present application is shown, where when a local device initiates a data connection to an opposite device, a timeout time T is set, then the local device determines whether a current network connection belongs to a mobile communication network, if so, obtains a type of the mobile communication network, then obtains a timeout coefficient a corresponding to the type, then determines that an actual timeout time T1 of the data connection is T a, if not, determines that an actual timeout time T1 of the data connection is T, and then the subsequent local device sets the actual timeout time of the data connection to a bottom TCP.
In other possible implementations, step 302 may also be implemented as: and processing the network speed characteristic information of the mobile communication network through the overtime model to obtain the target duration.
The timeout model is obtained by training a Convolutional Neural Network (CNN) by using a plurality of sets of training samples, wherein each set of training samples in the plurality of sets of training samples comprises sample wire speed characteristic information and timeout time of data connection corresponding to the sample wire speed characteristic information.
Alternatively, CNN may use alexNet network, VGG-16 network, google network, etc., which is not limited in this embodiment of the present invention. In addition, the algorithm used when the CNN is trained to obtain the timeout time model may be a Back-Propagation (BP) algorithm, a fast Convolutional Neural Network (RCNN) algorithm of a faster regional Convolutional Neural Network, or the like, which is not limited in the embodiment of the present invention.
Optionally, the timeout time model comprises: an input layer, at least one hidden layer, and an output layer. The input data of the input layer is the network speed characteristic information, and the output result of the output layer is the overtime time of the data connection corresponding to the network speed characteristic information. The timeout determination process is as follows: inputting the network speed characteristic information into an input layer of the overtime time model, extracting the characteristics of the network speed characteristic information by a hidden layer of the overtime time model, combining and abstracting the extracted characteristics, and finally outputting the target duration corresponding to the network speed characteristic information by an output layer. In addition, in the embodiment of the present invention, the specific structure of the hidden layer is not limited. Generally, the more layers of the convolutional neural network, the better the effect is, but the longer the calculation time is, and in practical application, the convolutional neural network with an appropriate number of layers can be designed according to the requirement on the timeout rate of the timeout time.
The training process of the timeout model is as follows: inputting the sample network speed characteristic information into an initial overtime model to obtain the overtime of data connection, comparing the overtime of the data connection with the overtime of the data connection corresponding to the network speed characteristic information to obtain calculation loss, if the calculation loss is greater than a preset value, adjusting parameters of all hidden layers according to the calculation loss, subsequently repeating the steps until the calculation loss is less than or equal to the preset value, and finally generating the overtime model. The preset value may be actually set according to a requirement on a timeout rate of the timeout time, which is not limited in the embodiment of the present application.
In addition, in the embodiment of the present application, if the type to which the current network connection belongs is a WLAN, the preset reference timeout time is determined as the target duration. In other possible implementation manners, if the type of the current network connection is WLAN, the local device may also obtain the actually measured network transmission rate of the mobile communication network, determine a target weighting coefficient corresponding to the network transmission rate, and then determine the product of the target weighting coefficient and the preset reference timeout time as the timeout time of the data connection.
Step 303, set the target duration to the timeout time of the data connection established based on the current network connection.
The data connection refers to a connection which is established between the local terminal device and the opposite terminal device based on the current network connection and is used for transmitting service data. In the embodiment of the present application, the service refers to a service provided by each internet vendor to a user through a network connection. The service may include a video service, a game service, a search service, and the like, which is not limited in this embodiment of the present application. The service data refers to data required to be interacted when the service is acquired through network connection. The service data may be text data, picture data, voice data, video data, and the like, and the embodiment of the present application does not limit the type of the service data.
The timeout time of the data connection is used to indicate a time threshold for determining whether the service data is successfully received. If the receiving confirmation information corresponding to the service data is not received within the timeout period after the service data is sent, the service data is judged to be unsuccessfully received, and if the receiving confirmation information corresponding to the service data is received within the timeout period after the service data is sent, the service data is judged to be successfully received. The function of the timeout time may be actually determined according to a processing manner of the local device for the timeout condition under the data connection.
In a first implementation, the timeout time for the data connection is used to indicate the opportunity to trigger the disconnection of the data connection. That is, when the local device sends a service data to the peer device through the data connection, if the local device does not receive a response message corresponding to the service data within a time period starting from a sending timestamp for sending the service data and having a duration of the timeout time of the data connection, the data connection is disconnected.
In a second implementation manner, the timeout time of the data connection is further used to indicate an opportunity to trigger retransmission of service data, that is, when the local device sends a service data to the peer device through the data connection, if the local device does not receive a response message corresponding to the service data within a time period starting from a sending timestamp for sending the service data and having a duration of the timeout time of the data connection, the local device resends the service data through the data connection.
In a third implementation manner, the timeout time of the data connection is further used to indicate an opportunity to trigger sending of another service data, that is, when the local device sends a service data to the peer device through the data connection, if the local device does not receive a response message corresponding to the service data within a time period starting from a sending timestamp for sending the service data and having a duration of the timeout time of the data connection, the local device sends the other service data through the data connection.
In the embodiment of the present application, the timeout time of the data connection has a negative correlation with the network transmission rate of the mobile communication network. That is, the larger the network transmission rate of the mobile communication network is, the smaller the timeout time of the data connection is; the smaller the network transmission rate of the mobile communication network, the larger the timeout time of the data connection. In the embodiment of the application, the timeout time of the data connection can be dynamically set according to the network speed transmission rate, so that the timeout time can be determined more flexibly and reasonably, and the service requirements under different network transmission rates can be met.
To sum up, according to the technical scheme provided by the embodiment of the present application, the timeout time of the data connection is dynamically set according to the type to which the network connection currently established by the home terminal device belongs, the method for determining the timeout time is more flexible, the determined timeout time is more reasonable, and the service requirements under the types to which different network connections belong can be met.
In addition, when the type of the current network is a mobile communication network, the timeout time of the data connection is dynamically set according to the network transmission rate of the network connection currently established by the local terminal equipment. For example, when the network transmission rate indicated by the network speed characteristic information is high, the timeout time of the data connection is set to be short, and if the local terminal device does not receive a response message corresponding to certain service data, the data connection can be disconnected in time and other service data can be interacted, so that the interaction efficiency of the service data is improved; for another example, when the network transmission rate indicated by the network speed characteristic information is small, the timeout time of the data connection is set to be large, so as to avoid the occurrence of the situation that the local terminal device disconnects the data connection when the service data interaction is not completed.
Referring to fig. 5, a flowchart of a timeout period determination method according to an embodiment of the present application is shown. The method can be applied to the local terminal device in the embodiment of fig. 1 or the embodiment of fig. 2, and the method can include the following steps.
Step 501, determine the type of the current network connection.
The type to which the current network connection belongs is a mobile communication network or a WLAN. If the type of the current network connection is the mobile communication network, execute step 502; if the type of the current network connection is WLAN, step 504 is executed.
Step 502, obtaining the network speed characteristic information of the mobile communication network.
The network speed characteristic information is used for indicating the network transmission rate of the mobile communication network.
Step 503, determining the target duration according to the network speed characteristic information of the mobile communication network.
The data connection refers to a connection which is established between the local terminal device and the opposite terminal device based on the current network connection and is used for transmitting service data.
Step 504, determining a preset reference timeout time as a target duration.
Step 505, the target duration is set as the timeout time of the data connection established based on the current network connection.
Step 506, after the timeout period of the data connection is set, counting the timeout rate of the transmission of the service data through the data connection within the first period.
The duration of the first period may be set according to actual requirements, which is not limited in the embodiment of the present application. In addition, the first period may be a continuous period or a discontinuous period, and the embodiment of the present application is not limited again. The timeout rate is a ratio between the number of times of timeout occurring when transmitting the traffic data and the total number of times of transmitting the traffic data. Illustratively, if the number of times of timeout occurring when transmitting the service data is 3, and the total number of times of transmitting the service data is 30, the timeout rate is 10%.
And step 507, adjusting the timeout time of the data connection according to the timeout rate.
In the embodiment of the present application, the timeout time of the data connection may be dynamically adjusted according to the timeout rate. Specifically, if the timeout rate is greater than a first threshold, the timeout time of the data connection is increased; and if the timeout rate is smaller than the second threshold value, reducing the timeout time of the data connection. Wherein the first threshold value is greater than or equal to the second threshold value. The first threshold and the second threshold may be set according to practical experience, and the embodiment of the present application is not limited thereto.
If the timeout rate is greater than the first threshold, it indicates that the timeout time of the data connection is set to be smaller, which results in that the local device has already disconnected the data connection when the interaction of the service data is not completed. The increment of the timeout time of the data connection may be preset, or may be actually set according to the timeout rate, which is not limited in the embodiment of the present application. When the increment of the timeout time of the data connection is actually set according to the timeout rate, the increment and the timeout rate are in positive correlation, namely, the larger the timeout rate is, the larger the increment of the timeout time of the data connection is; the smaller the timeout rate, the smaller the amount of increase in the timeout time of the data connection.
If the timeout rate is smaller than the second threshold, it indicates that the timeout time of the data connection is set to be longer, which results in that the local device needs longer time to disconnect the data connection, thereby reducing the service data interaction efficiency of the local device. To avoid this, the timeout time of the data connection may be reduced. The reduction amount of the timeout time of the data connection may be preset, or may be actually set according to the timeout rate, which is not limited in the embodiment of the present application. When the reduction of the timeout time of the data connection is actually set according to the timeout rate, the reduction and the timeout rate are in a negative correlation relationship, that is, the larger the timeout rate is, the smaller the reduction of the timeout time of the data connection is; the smaller the timeout rate, the greater the amount of decrease in the timeout time of the data connection.
According to the technical scheme provided by the embodiment of the application, after the timeout time of the data connection is set, the timeout time of the data connection is dynamically adjusted according to the timeout rate, so that the relevance between the process of determining the timeout time of the data connection and the actual business data interaction process is larger, the timeout time of the data connection is more reasonable, and the business requirements in the actual business data interaction process can be met.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 6, a block diagram of a timeout period determining apparatus according to an embodiment of the present application is shown. The functions of the above method examples can be realized by hardware, and the functions can also be realized by hardware executing corresponding software. The apparatus may include: a type determination module 601, a duration determination module 602, and a time setting module 603.
The type determining module 601 is configured to determine a type of a current network connection, where the type of the current network connection is a mobile communication network or a wireless local area network WLAN.
A duration determining module 602, configured to determine a target duration corresponding to a type to which the current network connection belongs.
A time setting module 603, configured to set the target duration as an timeout time of a data connection established based on the current network connection, where the data connection is a connection established between the local device and the peer device based on the current network connection and used for transmitting service data, and the timeout time is used to indicate a time threshold for determining whether the service data is successfully received.
To sum up, according to the technical scheme provided by the embodiment of the present application, the timeout time of the data connection is dynamically set according to the type to which the network connection currently established by the home terminal device belongs, the method for determining the timeout time is more flexible, the determined timeout time is more reasonable, and the service requirements under the types to which different network connections belong can be met.
In an optional embodiment provided based on the embodiment shown in fig. 6, when the type to which the current network connection belongs is the mobile communication network, the duration determining module 602 is configured to:
acquiring network speed characteristic information of the mobile communication network, wherein the network speed characteristic information is used for indicating the network transmission rate of the mobile communication network;
and determining the target duration according to the network speed characteristic information of the mobile communication network.
Optionally, the duration determining module 602 is configured to:
determining a target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network;
and determining the product of the target weighting coefficient and preset reference overtime as the target duration.
Optionally, the network speed characteristic information is a type of the mobile communication network, and different types of mobile communication networks have different network transmission rates;
the duration determining module 602 is configured to obtain a weighting coefficient corresponding to the type of the mobile communication network from the first corresponding relationship, and determine the obtained weighting coefficient as the target weighting coefficient; wherein the first correspondence comprises a correspondence between different types and different weighting coefficients of the mobile communication network.
Optionally, the network speed characteristic information is a network transmission rate of the mobile communication network obtained through actual measurement;
the duration determination module 602 is configured to:
calculating to obtain the target weighting coefficient according to the network transmission rate of the mobile communication network by adopting a preset calculation formula;
alternatively, the first and second electrodes may be,
acquiring a weighting coefficient corresponding to the network transmission rate of the mobile communication network from the second corresponding relation, and determining the acquired weighting coefficient as the target weighting coefficient; wherein the second correspondence includes correspondence between different network transmission rates and different weighting coefficients.
Optionally, the duration determining module 602 is configured to process the network speed feature information of the mobile communication network through an overtime model to obtain the target duration, where the overtime model is obtained by training the convolutional neural network CNN with multiple sets of training samples, and each set of training samples in the multiple sets of training samples includes the sample network speed feature information and an overtime of a data connection corresponding to the sample network speed feature information.
In another alternative embodiment provided on the basis of the embodiment shown in fig. 6, the timeout time of the data connection is inversely related to the network transmission rate of the mobile communication network.
In another optional embodiment provided based on the embodiment shown in fig. 6, when the type of the current network connection is the WLAN, the duration determining module 602 is configured to determine a preset reference timeout period as the target duration.
In another optional embodiment provided based on the embodiment shown in fig. 6, the apparatus further comprises: a timeout rate statistics module and a time adjustment module (not shown).
And the timeout rate counting module is used for counting the timeout rate of the service data transmitted through the data connection in a first period after the timeout time of the data connection is set.
And the time adjusting module is used for adjusting the timeout time of the data connection according to the timeout rate.
Optionally, the time adjustment module is configured to:
if the timeout rate is larger than a first threshold value, increasing the timeout time of the data connection;
if the timeout rate is smaller than a second threshold value, reducing the timeout time of the data connection;
wherein the first threshold value is greater than or equal to the second threshold value.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
Referring to fig. 7, a block diagram of a computer device according to an exemplary embodiment of the present application is shown. The computer device in the present application may comprise one or more of the following components: a processor 710 and a memory 720.
Processor 710 may include one or more processing cores. The processor 710 interfaces with various components throughout the computer device using various interfaces and lines to perform various functions of the computer device and process data by executing or performing instructions, programs, code sets, or instruction sets stored in the memory 720 and invoking data stored in the memory 720. Alternatively, the processor 710 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 710 may integrate one or more of a Central Processing Unit (CPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, an application program and the like; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 710, but may be implemented by a single chip.
Optionally, the processor 710, when executing the program instructions in the memory 720, implements the timeout determining method provided by the various method embodiments described above.
The Memory 720 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 720 includes a non-transitory computer-readable medium. The memory 720 may be used to store instructions, programs, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the various method embodiments described above, and the like; the storage data area may store data created according to use of the computer device, and the like.
The structure of the computer device described above is merely illustrative, and in actual implementation, the computer device may include more or less components, such as: a display screen, etc., which are not limited in this embodiment.
Those skilled in the art will appreciate that the configuration illustrated in FIG. 7 is not intended to be limiting of the computer device 700 and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components may be employed.
In an exemplary embodiment, a computer readable storage medium is also provided, in which a computer program is stored, which is loaded and executed by a processor of a terminal to implement the respective steps in the above-described method embodiments.
In an exemplary embodiment, a computer program product is also provided for implementing the functions of the individual steps in the above-described method embodiments when the computer program product is executed.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A timeout time determination method, the method comprising:
determining the type of the current network connection, wherein the type of the current network connection is a mobile communication network or a Wireless Local Area Network (WLAN);
when the type of the current network connection is the mobile communication network, acquiring network speed characteristic information of the mobile communication network;
determining a target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network;
determining the product of the target weighting coefficient and preset reference overtime as a target duration;
setting the target duration as timeout time of a data connection established based on the current network connection, wherein the data connection is a connection established between the local terminal device and the opposite terminal device based on the current network connection and used for transmitting service data, and the timeout time is used for representing a time threshold for judging whether the service data is successfully received;
after the timeout time of the data connection is set, counting the timeout rate of the service data transmitted through the data connection in a first period;
if the timeout rate is larger than a first threshold value, increasing the timeout time of the data connection, wherein the increase amount of the timeout time of the data connection and the timeout rate are in positive correlation;
if the timeout rate is smaller than a second threshold value, reducing the timeout time of the data connection, wherein the reduction rate of the timeout time of the data connection and the timeout rate are in a negative correlation relationship; the first threshold value is greater than or equal to the second threshold value;
when the network speed characteristic information is the network transmission rate of the mobile communication network obtained by actual measurement, the determining the target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network includes: and calculating to obtain the target weighting coefficient according to the network transmission rate of the mobile communication network by adopting a preset calculation formula, wherein the preset calculation formula is a functional relation formula which is obtained by fitting multiple groups of data and is used for expressing the relation between the network transmission rate and the weighting coefficient.
2. The method according to claim 1, wherein when the wire speed characteristic information is the type of the mobile communication network;
the determining a target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network further comprises:
acquiring a weighting coefficient corresponding to the type of the mobile communication network from the first corresponding relation, and determining the acquired weighting coefficient as the target weighting coefficient;
wherein different types of mobile communication networks have different network transmission rates, and the first correspondence includes a correspondence between different types of the mobile communication networks and different weighting coefficients.
3. The method according to claim 1, wherein when the wire speed characteristic information is the measured network transmission rate of the mobile communication network,
the determining a target weighting coefficient corresponding to the network speed characteristic information of the mobile communication network further comprises:
acquiring a weighting coefficient corresponding to the network transmission rate of the mobile communication network from the second corresponding relation, and determining the acquired weighting coefficient as the target weighting coefficient; wherein the second correspondence includes a correspondence between a network transmission rate and a weighting coefficient.
4. The method of claim 1, wherein the determining the target duration according to the wire speed characteristic information of the mobile communication network comprises:
and processing the network speed characteristic information of the mobile communication network through an overtime model to obtain the target duration, wherein the overtime model is obtained by adopting a plurality of groups of training samples to train a Convolutional Neural Network (CNN), and each group of training samples in the plurality of groups of training samples comprises the network speed characteristic information of the sample and the overtime of the data connection corresponding to the network speed characteristic information of the sample.
5. The method according to any of claims 1 to 4, wherein the timeout time of the data connection is inversely related to the network transmission rate of the mobile communication network.
6. The method according to any one of claims 1 to 4, further comprising:
and when the type of the current network connection is the WLAN, determining preset reference timeout time as the target duration.
7. An apparatus for timeout determination, the apparatus comprising:
the type determining module is used for determining the type of the current network connection, wherein the type of the current network connection is a mobile communication network or a Wireless Local Area Network (WLAN);
a duration determining module, configured to, when the type of the current network connection is the mobile communication network, obtain network speed feature information of the mobile communication network, determine a target weighting coefficient corresponding to the network speed feature information of the mobile communication network, and determine a product of the target weighting coefficient and a preset reference timeout time as a target duration;
a time setting module, configured to set the target duration as an timeout time of a data connection established based on the current network connection, where the data connection is a connection established between a local device and an opposite device based on the current network connection and used for transmitting service data, and the timeout time is used to indicate a time threshold for determining whether the service data is successfully received;
the timeout rate counting module is used for counting the timeout rate of the service data transmitted through the data connection in a first period after the timeout time of the data connection is set;
a time adjustment module to: if the timeout rate is larger than a first threshold value, increasing the timeout time of the data connection; if the timeout rate is smaller than a second threshold value, reducing the timeout time of the data connection; the increasing amount of the timeout time of the data connection and the timeout rate are in positive correlation, the decreasing rate of the timeout time of the data connection and the timeout rate are in negative correlation, and the first threshold is larger than or equal to the second threshold;
and when the network speed characteristic information is the network transmission rate of the mobile communication network obtained through actual measurement, the duration determining module is used for calculating the target weighting coefficient according to the network transmission rate of the mobile communication network by adopting a preset calculation formula, and the preset calculation formula is a functional relation formula which is obtained by fitting multiple groups of data and is used for expressing the relation between the network transmission rate and the weighting coefficient.
8. A computer device, characterized in that the computer device comprises a processor and a memory, the memory storing a computer program which is loaded and executed by the processor to implement the timeout time determination method of any of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored, which is loaded and executed by a processor to implement the timeout time determination method according to any one of claims 1 to 6.
CN201810635830.XA 2018-06-20 2018-06-20 Timeout time determination method, device, equipment and storage medium Active CN108901079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810635830.XA CN108901079B (en) 2018-06-20 2018-06-20 Timeout time determination method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810635830.XA CN108901079B (en) 2018-06-20 2018-06-20 Timeout time determination method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108901079A CN108901079A (en) 2018-11-27
CN108901079B true CN108901079B (en) 2021-03-09

Family

ID=64345074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810635830.XA Active CN108901079B (en) 2018-06-20 2018-06-20 Timeout time determination method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108901079B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905208A (en) * 2019-03-14 2019-06-18 闪联信息技术工程中心有限公司 A method of obtaining terminal control message response
CN110166572A (en) * 2019-06-06 2019-08-23 北京达佳互联信息技术有限公司 Network processing method, device, electronic equipment and storage medium
CN110620681B (en) * 2019-08-22 2022-09-23 中国平安财产保险股份有限公司 Network connection timeout time setting method, device, equipment and medium
CN110768861B (en) * 2019-09-20 2021-07-06 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for obtaining overtime threshold
CN111598487B (en) * 2020-06-22 2024-03-15 拉扎斯网络科技(上海)有限公司 Data processing and model training method, device, electronic equipment and storage medium
CN113743628A (en) * 2021-09-18 2021-12-03 重庆允成互联网科技有限公司 Maintenance response timeliness rate calculation method, device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1151551A (en) * 1995-10-10 1997-06-11 国际商业机器公司 System and method for dynamically varying low level file system operation timeout parameters in network systems of variable bandwidth
CN101009659A (en) * 2006-01-26 2007-08-01 索尼株式会社 Reception apparatus and method and program
CN101707612A (en) * 2009-12-04 2010-05-12 北京星网锐捷网络技术有限公司 Message authentication processing method and device, as well as authentication server
CN102668456A (en) * 2009-11-05 2012-09-12 阿玛得斯两合公司 Method and system for adapting a session timeout period
CN103139931A (en) * 2011-12-02 2013-06-05 株式会社Ntt都科摩 Method, device and base station for controlling connection status of radio resource control
CN105024872A (en) * 2014-04-25 2015-11-04 腾讯科技(北京)有限公司 Network performance test method and device
CN105554085A (en) * 2015-12-10 2016-05-04 北京奇虎科技有限公司 Server connection-based dynamic timeout processing method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6052751A (en) * 1997-02-14 2000-04-18 Advanced Micro Devices, I Nc. Method and apparatus for changing the number of access slots into a memory
CN101645883A (en) * 2008-08-08 2010-02-10 比亚迪股份有限公司 Data transmitting method, a data sending method and a data receiving method
CN101345663B (en) * 2008-08-22 2010-12-08 杭州华三通信技术有限公司 Heartbeat detection method and heartbeat detection apparatus
CN102355327B (en) * 2011-08-26 2015-05-13 百度在线网络技术(北京)有限公司 Method, device and equipment for determining data transmission timeout duration
US9930592B2 (en) * 2013-02-19 2018-03-27 Mimosa Networks, Inc. Systems and methods for directing mobile device connectivity
US10038968B2 (en) * 2013-07-17 2018-07-31 PlaceIQ, Inc. Branching mobile-device to system-namespace identifier mappings
CN106452977A (en) * 2016-11-24 2017-02-22 武汉斗鱼网络科技有限公司 Dynamic adaptive heartbeat sending method and system
CN107104763B (en) * 2016-12-22 2020-06-02 腾讯科技(深圳)有限公司 Method and device for setting timeout retransmission duration
CN108183833B (en) * 2017-11-29 2021-08-10 努比亚技术有限公司 Response processing method and device and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1151551A (en) * 1995-10-10 1997-06-11 国际商业机器公司 System and method for dynamically varying low level file system operation timeout parameters in network systems of variable bandwidth
CN101009659A (en) * 2006-01-26 2007-08-01 索尼株式会社 Reception apparatus and method and program
CN102668456A (en) * 2009-11-05 2012-09-12 阿玛得斯两合公司 Method and system for adapting a session timeout period
CN101707612A (en) * 2009-12-04 2010-05-12 北京星网锐捷网络技术有限公司 Message authentication processing method and device, as well as authentication server
CN103139931A (en) * 2011-12-02 2013-06-05 株式会社Ntt都科摩 Method, device and base station for controlling connection status of radio resource control
CN105024872A (en) * 2014-04-25 2015-11-04 腾讯科技(北京)有限公司 Network performance test method and device
CN105554085A (en) * 2015-12-10 2016-05-04 北京奇虎科技有限公司 Server connection-based dynamic timeout processing method and device

Also Published As

Publication number Publication date
CN108901079A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN108901079B (en) Timeout time determination method, device, equipment and storage medium
CN104471987B (en) For the system and method that the AP of FILS beacons is used to find
US11765680B2 (en) Data analytics for multi-access edge computation
US20220030469A1 (en) Method for data transmission, electronic device, and storage medium
CN104584490A (en) Data transmitting method and device
WO2018145313A1 (en) Wireless communication method, terminal device and network device
JP2021513762A (en) Data transmission method, terminal device and network device
CN110115095A (en) Accidental access method, device and storage medium
CN105407531A (en) Communication method and communication device in wireless local area network, access point and site
US20230345536A1 (en) Channel access method and apparatus
US11121802B2 (en) CSI obtaining method, server, terminal, and AP
CN104955119B (en) A kind of method for switching network based on flow, device and terminal
CN108521632B (en) Wi-Fi (wireless fidelity) -based real-time social relationship discovery system and implementation method
CN108834107A (en) Method and apparatus for by-link discovery
WO2009115991A1 (en) System and method of providing network status information of a basic service set for selective access point association
CN109803283B (en) Wireless communication method and communication equipment
CN104272827B (en) Distribute Internet resources method, access network in target device method, base station and terminal device
WO2023273258A1 (en) Network searching method and device, computer-readable storage medium, and terminal
US11689995B2 (en) Information transmission method and apparatus
CN107615814A (en) Method, base station and the terminal of transmitting uplink data
CN106341889B (en) A kind of method and apparatus for handling paging message
CN111479294B (en) Congestion control data connection establishment method, terminal and storage medium
CN114885424A (en) Cell configuration method, device, equipment and storage medium
CN106231656B (en) High bandwidth license request technology in RRC
CN114258058A (en) Measuring method, measuring device, terminal and network equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant