Time-out processing method and apparatus, electronic device readable medium, and computer program

CN122534128APending Publication Date: 2026-08-07BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510138302.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]本申请实施例的目的是提供超时处理方法、装置、电子设备可读介质及计算机程序,能够解决相关技术中无法满足不同状态的个性化需求的问题

Benefits of technology

[0011] In this embodiment, after the terminal initiates a network request, the terminal's status information is obtained. Based on the terminal's status information, the first probability of each candidate timeout processing method for the network request is determined. The candidate timeout processing method with the highest first probability is determined as the target timeout processing method for the network request. The network request is timed out according to the target timeout processing method. Thus, different timeout processing methods can be adopted according to different terminal status information to meet personalized needs and ensure adaptive adjustment under different states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122534128A_ABST
    Figure CN122534128A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a timeout processing method and device, an electronic equipment readable medium and a computer program. The method comprises: in response to a network request initiated by a terminal, obtaining state information of the terminal, the state information of the terminal comprising at least one of: a network state of the terminal, a device state of the terminal, a service scenario of the terminal and an operation state of the terminal; based on the state information of the terminal, obtaining a first probability of adopting each candidate timeout processing mode for the network request, wherein the candidate timeout processing mode comprises at least one of: ending waiting, increasing timeout, reducing timeout and reducing error code retry; determining that a candidate timeout processing mode corresponding to the maximum first probability is a target timeout processing mode corresponding to the network request; and based on the target timeout processing mode, performing timeout processing on the network request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to timeout handling methods, apparatus, electronic readable media, and computer programs. Background Technology

[0002] When users perform various services using a terminal, they can request various service data from the server through network requests. However, due to reasons such as the terminal's network status or device status, the network requests initiated by the terminal may time out. In order to prevent the terminal from waiting indefinitely in the event of a timeout, relevant technologies will configure a timeout handling method for the terminal, namely a timeout intervention mechanism.

[0003] The timeout handling methods configured in related technologies adopt a fixed timeout handling method with global granularity. That is, the timeout handling method used by the terminal is the same under different business scenarios, network conditions and device conditions. Therefore, it cannot meet the personalized needs of different states. Summary of the Invention

[0004] The purpose of this application is to provide a timeout handling method, apparatus, electronic device readable medium, and computer program that can solve the problem in the related art of failing to meet the personalized needs of different states.

[0005] To solve the above-mentioned technical problems, the embodiments of this application are implemented through the following aspects.

[0006] In a first aspect, embodiments of this application provide a timeout handling method, comprising: responding to a network request initiated by a terminal, obtaining the terminal's status information, the terminal's status information including at least one of the following: the terminal's network status, the terminal's device status, the terminal's service scenario, and the terminal's operation status; based on the terminal's status information, obtaining a first probability of adopting each candidate timeout handling method for the network request, wherein the candidate timeout handling method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the error code retry; determining the candidate timeout handling method with the highest first probability as the target timeout handling method corresponding to the network request; and performing timeout handling on the network request based on the target timeout handling method.

[0007] Secondly, embodiments of this application provide a timeout processing apparatus, comprising: a first acquisition module, configured to acquire the status information of the terminal in response to a network request initiated by a terminal, the status information of the terminal including at least one of the following: the network status of the terminal, the device status of the terminal, the service scenario of the terminal, and the operation status of the terminal; a second acquisition module, configured to acquire, based on the status information of the terminal, a first probability of adopting each candidate timeout processing method for the network request, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the retry of error codes; a determination module, configured to determine the candidate timeout processing method with the highest first probability as the target timeout processing method corresponding to the network request; and a processing module, configured to perform timeout processing on the network request based on the target timeout processing method.

[0008] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the timeout processing method described in the first aspect above.

[0009] Fourthly, embodiments of this application provide a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the timeout handling method described in the first aspect.

[0010] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the timeout handling method as described in the first aspect above.

[0011] In this embodiment, after the terminal initiates a network request, the terminal's status information is obtained. Based on the terminal's status information, the first probability of each candidate timeout processing method for the network request is determined. The candidate timeout processing method with the highest first probability is determined as the target timeout processing method for the network request. The network request is timed out according to the target timeout processing method. Thus, different timeout processing methods can be adopted according to different terminal status information to meet personalized needs and ensure adaptive adjustment under different states. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This invention provides a schematic flowchart of a timeout handling method according to an embodiment of the present application. Figure 2 This illustration shows a flowchart of a timeout handling method provided in another embodiment of this application; Figure 3 This illustration shows a flowchart of a timeout handling method provided in yet another embodiment of this application. Figure 4 This diagram illustrates a prediction performed using a first prediction model according to an embodiment of this application. Figure 5 This diagram illustrates the system operation flow in one embodiment of the present application. Figure 6 This diagram illustrates the structure of a timeout processing device according to an embodiment of this application. Figure 7 A schematic diagram of the hardware structure of an electronic device for implementing a timeout handling method provided in the embodiments of this application. Detailed Implementation

[0014] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0015] Figure 1This diagram illustrates a flowchart of a timeout handling method provided in an embodiment of this application. This method can be executed by an electronic device, such as a terminal. The terminal can be a mobile phone, tablet computer, laptop computer, personal digital assistant (PDA), handheld computer, netbook, ultra-mobile personal computer (UMPC), mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, vehicle-mounted device (VUE), or other terminal-side device. In other words, the method can be executed by software or hardware installed on the terminal. Figure 1 As shown, the method may include the following steps: S110: In response to a network request initiated by the terminal, obtain the terminal's status information.

[0016] In this embodiment of the application, a user can initiate a network request by operating the client interface of an application. For example, a user can initiate a network request to obtain the video stream of a live stream by clicking the "Enter Live Room" button on the client interface. Alternatively, a user can initiate a network request to obtain on-demand video data by entering a video-on-demand command on the client interface, or a user can initiate a network request to obtain search results by entering a command to search for target content in the search box on the client interface.

[0017] In order to execute a network request initiated by the terminal, the terminal needs to obtain the corresponding content from the server via the network. However, due to factors such as the terminal's network status, device status, or server resources, the terminal may not be able to receive the server's response in a timely manner, resulting in a network request timeout. Therefore, it is necessary to configure an appropriate timeout handling method for the network request so that the network request can be timed out in the event of a timeout.

[0018] In S110, in order to subsequently obtain a timeout handling method matching the current state of the terminal, the terminal's state information can be obtained after the terminal initiates a network request. In an optional implementation of this application embodiment, the terminal's state information may include, but is not limited to, at least one of the following: 1) Terminal network status. The terminal's network status can include: network quality, the type of network used by the terminal (e.g., WiFi network, cellular network), network speed, and network stability. Different network statuses have a significant impact on the success rate and response time of network requests.

[0019] 2) Terminal device status, which can include: device dynamic performance, device temperature, battery level, and memory usage. Changes in device status can affect the processing speed and stability of network requests.

[0020] 3) Terminal business scenarios. Different business scenarios have different requirements for network requests. For example, in scenarios such as live streaming, video-on-demand, e-commerce, search, personal pages, and other users' pages, users' tolerance for network status, network smoothness, and waiting time may vary.

[0021] 4) Terminal operation status: After the terminal initiates a network request, different users can have different operation statuses. The operation status can include: the frequency of user swiping, the frequency of refreshing, the timeout waiting for response, etc. The user's operation will affect the frequency of network requests and the response time. Therefore, it is also used as a factor in determining the timeout handling method.

[0022] In one optional implementation of this application embodiment, the timeout handling method may include, but is not limited to, the following: 1) End waiting: Retry in a certain environment or switch networks in advance to reduce waiting time.

[0023] 2) Increase timeout: In cases of poor network or equipment conditions, appropriately increase the timeout period to improve the success rate of requests.

[0024] 3) Reduce timeout: When the network or equipment conditions are good, appropriately reduce the timeout time to improve the response speed of requests.

[0025] 4) Reduce error code retries: In poor network conditions, reduce the number of error code retries to alleviate bandwidth burden.

[0026] S120, based on the terminal's status information, obtain the first probability of adopting each candidate timeout processing method for the above network request, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and retrying with a reduced error code.

[0027] In this embodiment, the above-mentioned candidate timeout handling methods include at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the retry of error codes.

[0028] In this embodiment, the first probability of the network request adopting each candidate timeout handling method can be determined based on at least one of the terminal's network state, terminal's device state, terminal's service scenario, and terminal's operational state. It should be noted that in this embodiment, the first probability of the network request adopting each candidate timeout handling method can be determined based on all four factors: the terminal's network state, terminal's device state, terminal's service scenario, and terminal's operational state. Alternatively, it can be determined based on one or more of these factors. For example, in some cases, the terminal's device state is relatively stable, and the terminal's device state may not be considered when determining the target timeout handling method.

[0029] In S120, the first probability of each candidate timeout processing method for the above network request can be obtained based on at least one of the terminal's network status, terminal's device status, terminal's service scenario, and terminal's operation status.

[0030] For example, in situations where network or device conditions are poor, appropriately increasing the timeout can improve the success rate of requests. However, frequent retries or network switching may lead to greater latency. Therefore, in such cases, a lower first probability can be set for "End Waiting", a higher first probability for "Increase Timeout", and a lower first probability for "Reduce Retry of Error Codes".

[0031] For example, when the network or equipment is in good condition, the success rate of ending the retry or switching networks early may be relatively high, and the waiting time can be reduced. Therefore, in this case, a higher first probability can be set for "reduce timeout" and "end waiting", and a lower first probability can be set for "end waiting" and "reduce error code retry".

[0032] S130, determine the candidate timeout handling method with the highest probability as the target timeout handling method corresponding to the above network request.

[0033] In this embodiment of the application, the target timeout processing method can be any one of the timeout processing methods in 1) to 4) above.

[0034] After obtaining the first probability of each candidate timeout handling method, the candidate timeout handling method with the highest first probability can be selected.

[0035] In this embodiment, the target timeout handling method for the network request can be determined based on the terminal's state information. For example, if the terminal's current business scenario is browsing short videos, and the terminal sends a network request to obtain a video recommendation list, and if the current network state is poor (e.g., poor network quality or low network speed), the terminal's operation state is that the user's swiping frequency is high, and the terminal's device state is that the device's dynamic performance is good, then the target timeout handling method determined based on the terminal's state information can be: end the wait.

[0036] S140, Based on the target timeout handling method, perform timeout processing on the above network request.

[0037] In this embodiment of the application, after determining the target timeout handling method corresponding to the network request, the network request can be timed out according to the target timeout handling method.

[0038] For example, if the target timeout handling method is determined based on the terminal's status information, then the wait can be terminated. This means that the network request response can be stopped and the network can be retried or switched in advance to reduce the waiting time. For example, the request can be re-initiated from the upper layer of the service side at intervals, while increasing the timeout time for this type of network request.

[0039] The technical solution provided by the embodiments of this application can obtain the first probability of each candidate timeout processing method for a network request based on at least one of the terminal's network status, terminal's device status, terminal's business scenario, and terminal's operation status. The candidate timeout processing method with the highest first probability is taken as the target timeout processing method for the network request. This ensures that the target timeout processing method is the most reasonable timeout processing method that is most reasonable for the terminal's current network status, device status, business scenario, and operation status, thereby reducing unnecessary request waiting, saving user time, and improving user experience.

[0040] Figure 2 This invention provides a flowchart of a timeout handling method according to another embodiment of the present application, as shown below. Figure 2 As shown, the timeout handling method in this embodiment may include the following steps: S210, in response to a network request initiated by the terminal, obtain the status information of the terminal.

[0041] Among them, S210 can be with Figure 1 The same applies to S110 in the embodiments. For details, please refer to the above description of S110, which will not be repeated here.

[0042] S220, based on the terminal's status information, obtain the first probability of using each candidate timeout processing method for the above network request.

[0043] Among them, S220 can be with Figure 1 The same applies to S120 in the embodiments. For details, please refer to the above description of S120, which will not be repeated here.

[0044] S230, determine the candidate timeout handling method with the highest probability as the target timeout handling method corresponding to the above network request.

[0045] Among them, S230 can be with Figure 1 The same applies to S130 in the embodiments, and the details can be found in the above description of S130, which will not be repeated here.

[0046] S241, based on the terminal status information of multiple first time points prior to the second time point, obtain the second probability of timeout processing of the above network request at the second time point.

[0047] In this embodiment, the second time point can be the current time point. Specifically, in S240, the terminal status information of multiple first time points prior to the current time point is obtained. Based on the terminal status information of the multiple first time points, a second probability of timeout processing for the network request at the current time point is obtained. Through S240, it can be determined whether to time out the aforementioned network request.

[0048] In some embodiments, a second prediction model can be used to predict the timing of intervention for network requests. In these embodiments, obtaining a second probability of timeout processing for the network request at the second time point based on the terminal's state information at multiple first time points prior to the second time point may include the following steps: Step 1: Input the state information of at least one first time point prior to the second time point into the second prediction model; Step 2: Output the prediction result corresponding to the second time point through the second prediction model. The prediction result is used to indicate the second probability of timeout processing of the above network request at the second time point.

[0049] In the above embodiments, the probability of a given time period can be characterized from the perspectives of business scenarios, network status, device status, and operational status, based on the device's most recent historical state. By weighted summation of the input sequence, long-term dependencies are captured, generating a context vector containing information from all time steps in the input sequence. This context vector is then used for prediction. Leveraging the monotonicity of time, the weight of each time step depends on the previous time step, thus enabling long-term historical modeling.

[0050] S242, if the second probability is greater than the threshold, the above network request is timed out based on the target timeout processing method.

[0051] In this embodiment of the application, after the terminal initiates the above network request, the above S241 to S242 can be executed multiple times to determine whether timeout processing should be performed at the current time. If the determination result is yes, the network request is timed out according to the target timeout processing method determined above.

[0052] For example, suppose the input sequence of the second prediction model is ,in Indicates the first The input at the nth time step, i.e., the nth time step If the terminal status information corresponds to a time step, then the description weight of that time step is:

[0053] in, Is the input sequence at the th The hidden state at each time step , It is a learnable parameter matrix. It is the hidden state of the previous time step. Context vector It is the hidden state for all time steps. The result is obtained by weighted summation, where the weights are... Indicate the importance of each time step. Then generate prediction results. , This is a learnable function used to generate the final prediction result, which can be implemented using a multilayer perceptron (MLP) or other neural network architectures, such as a recurrent neural network (RNN). In this embodiment, the hidden state... and You can initialize it with a random vector, and then update the hidden state. , For at any time The second probability of the execution target timeout handling method, for time t. Whether to implement intervention, by With threshold When comparing, Intervention is performed only when the time is right; otherwise, it is not. The threshold value is... It can be preset, for example, .

[0054] The technical solution provided by the embodiments of this application can determine the timing of timeout processing through a second prediction model, thereby determining the appropriate timing of timeout processing based on the most recent historical state and meeting personalized needs.

[0055] Figure 3 This invention provides a flowchart of a timeout handling method according to another embodiment of the present application, as shown below. Figure 3 As shown, the timeout handling method in this embodiment may include the following steps: S310 responds to a network request initiated by the terminal and obtains the terminal's status information.

[0056] S310 can be with Figure 1 The same applies to S110 in the embodiments. For details, please refer to the above description of S110, which will not be repeated here.

[0057] S321, input at least one of the terminal's network status, terminal's device status, terminal's service scenario, and terminal's operation status into the first prediction model.

[0058] In the embodiments of this application, the first prediction model is used to predict the probability of adopting each candidate timeout processing method based on at least one of the terminal's network status, terminal's device status, terminal's service scenario, and terminal's operation status.

[0059] In some embodiments, the information input to the first prediction model can be features of the terminal's state information. For example, one-hot encoding can be used to encode the terminal's service scenario to obtain the features corresponding to the terminal's service scenario. The terminal's network state, device state, and operational state can be represented by data features. These features are concatenated into a long vector and input into the first prediction model, which then predicts the corresponding timeout handling method.

[0060] S322, outputs the first probability of each candidate timeout handling method through the first prediction model.

[0061] like Figure 4 As shown, the terminal's network status, device status, service scenario, and operation status can be used as inputs to the input layer of the first prediction model. After the input information passes through the intermediate N layers of the first prediction model, the prediction results are output through the output layer. The output prediction results include: the first probability of ending the wait with the timeout handling method, the first probability of increasing the timeout with the timeout handling method, the first probability of decreasing the timeout with the timeout handling method, and the first probability of ending the error code retry with the timeout handling method.

[0062] The first probability values ​​of each candidate timeout handling method output by the first prediction model may be the same or different, and this application does not limit the specific implementation.

[0063] In some embodiments, prior to S321, the method may further include: training a first prediction model using multiple sample data and a preset loss function, wherein the preset loss function includes parameters for controlling the attention given to easy and difficult samples, and a sample data set includes: a set of network status sample data of terminals, a set of device status sample data of terminals, a set of business scenario sample data of terminals, and a set of operational status sample data of terminals.

[0064] In some embodiments, the true label of each sample data can be obtained by acquiring different sample data from a large amount of historical data and labeling each sample data.

[0065] In some embodiments, the FocalLoss function can be used during the training of the first prediction model. ,in, It is the model's predicted probability of the correct category. These are category weight coefficients, used to balance the influence of different categories. These are adjustment parameters used to control the level of attention given to samples of varying difficulty. Two adjustment parameters are introduced. and An improvement on the standard cross-entropy loss function was made, increasing attention to hard-to-classify samples and decreasing attention to easy-to-classify samples. Besides Focal Loss, the hinge loss function can also be used to evaluate the model's prediction score. , These are the true labels of the samples, with values ​​ranging from 1 to 2. , It is the model's response to the input By constraining the product of the predicted value and the true label, the model's predicted value is made as close as possible to the true label, thereby improving classification performance.

[0066] For each sample The first prediction model outputs for each category. Predicted probability Choose the correct category Predicted probability Based on the predicted probability of the correct category Calculate Focal Loss For each sample Take its real label and the model's predicted values .

[0067] Since there are four candidate timeout handling methods in this embodiment, i.e., a classification problem, it is possible to handle each category. Calculate Hinge Loss separately. ,in, It is a sample In type The real label, with a value of , It is the model on the sample In category The predicted value for each sample. By combining these, we can obtain the preset loss function:

[0068] in, It is the total number of samples. and These are adjustment parameters used to balance the effects of Focal Loss and Hinge Loss. It is the type weight coefficient. It is used to control the correlation between easy and difficult samples. It is a sample The predicted probability, In category The real label, with a value of , It is the model on the sample In category The predicted value.

[0069] In some embodiments, there can be multiple first prediction models, which can be trained using task learning methods. These first prediction models are used to predict the probability of a timeout handling method based on state information; therefore, they can also be called state-intervention mechanism prediction models. In these embodiments, the terminal's state information includes state information at multiple first time points. Therefore, in these embodiments, obtaining the first probability corresponding to a network request through the first prediction model may include the following steps: Step 1: For the state information at each first time point, output the state information at the first time point to the first prediction model corresponding to that time point; Step 2: Using each of the first prediction models, output the second probability of each candidate timeout handling method at each first time point; Step 3: Based on the weight of each first prediction model and the second probability output by each first prediction model, obtain the first probability of each candidate timeout processing method.

[0070] For example, in some embodiments, each first prediction model predicts the most appropriate timeout handling method for the current state based on the input features. In these embodiments, multiple trained first prediction models can be integrated into a strong model.

[0071] in, It is a weighted combination of multiple first-order prediction models. This indicates four types of timeout handling methods. This indicates the category that maximizes the expression within the parentheses. , middle, It is the sum of the contributions of all first-order prediction models. Indicates the first The weights of the first prediction model. , It is the first The prediction error of the first prediction model is considered. The smaller the error, the larger the weight, indicating that the first prediction model is more reliable. It is the first The first prediction model's timeout handling method The confidence level. A strong model is formed by weighted combination of the outputs of multiple first prediction models. The weight of each first prediction model is adjusted according to its prediction performance. The first prediction model with higher weight has a greater impact on the final decision. The final strong model converts the comprehensive result into a clear prediction probability, i.e., the first probability, by finding the maximum value.

[0072] Through the above embodiments, a first probability can be determined by multiple first prediction models, thereby improving the accuracy of the determined first probability.

[0073] In some embodiments, when the first probability corresponding to a network request is obtained through multiple first prediction models, the first probability of each candidate timeout processing method can be obtained based on the weight of each first prediction model and the third probability output by each first prediction model, combined with the second probability of adopting the target timeout processing method at the first time point corresponding to each first prediction model.

[0074] For example, in these embodiments, the integrated decision model can be expressed as:

[0075] in, Indicates the first The second probability of executing the target timeout handling method at a given time point.

[0076] Through the above embodiments, the first probability can be determined by combining multiple first prediction models with the probability of executing timeout processing methods at each time point, thereby further improving the accuracy of the determined first probability.

[0077] It should be noted that the above training process can be performed on the terminal. However, since the model described above is applicable to all terminals, the model training can also be completed on the server and then downloaded to the client, such as... Figure 5 As shown, the client can collect various feature sources, input these features into a cache, and then report them to the server. The server trains a model in the same way and then sends the trained model to the client. The client uses the trained model; when it receives a network request, it inputs the features into the prediction model to obtain the first probability of each candidate timeout handling method. Based on the urgency estimate, it obtains the first probability of each candidate timeout handling method and determines the target timeout handling method. The network software development kit (SDK) then performs timeout handling based on this target timeout handling method.

[0078] S323, determine the target timeout handling method corresponding to the above network request as the candidate timeout handling method with the highest probability.

[0079] S323 can be with Figure 1 The same applies to S130 in the embodiments, and the details can be found in the above description of S130, which will not be repeated here.

[0080] S330, based on the target timeout handling method, performs timeout handling on the above network request.

[0081] S330 can be with Figure 1 S140 in the embodiments is the same, and the details can be found in the above description of S140, which will not be repeated here.

[0082] The technical solution provided by the embodiments of this application can obtain the first probability of adopting each candidate timeout processing method for the network request through the first prediction model, and improve the prediction accuracy by learning the prediction from the state to the timeout processing method through multi-task learning.

[0083] Figure 6 The diagram shows a timeout processing device provided in an embodiment of this application. The device 600 includes: an acquisition module 610, a determination module 620, and a processing module 630.

[0084] In this embodiment, the first acquisition module 610 is used to acquire the terminal's status information in response to a network request initiated by the terminal. The terminal's status information includes at least one of the following: the terminal's network status, the terminal's device status, the terminal's service scenario, and the terminal's operation status. The second acquisition module 620 is used to acquire, based on the terminal's status information, a first probability of adopting each candidate timeout processing method for the network request. The candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the error code retry. The determination module 630 is used to determine the candidate timeout processing method with the highest first probability as the target timeout processing method corresponding to the network request. The processing module 640 is used to perform timeout processing on the network request based on the target timeout processing method.

[0085] In one possible implementation, the processing module 640 performs timeout processing on the network request based on the target timeout processing method, including: Based on the terminal's status information at multiple first time points prior to the second time point, a second probability is obtained for processing the network request at the second time point that will result in a timeout. If the second probability is greater than the threshold, the network request is timed out based on the target timeout processing method.

[0086] In one possible implementation, the second acquisition module 620, based on the state information of the terminal, acquires a first probability of the network request adopting each candidate timeout processing method, including: The status information of the terminal is input into the first prediction model; The first probability of each of the candidate timeout handling methods is output through the first prediction model.

[0087] In one possible implementation, such as Figure 6 As shown, the device may further include: a training module 650, used to train the first prediction model using multiple sample data and a preset loss function, wherein the preset loss function includes parameters for controlling the attention of easy and difficult samples, and one set of sample data includes: a set of network status sample data of terminals, a set of device status sample data of terminals, a set of business scenario sample data of terminals, and a set of operation status sample data of terminals.

[0088] In one possible implementation, there are multiple first prediction models, and the terminal's state information includes state information at multiple first time points. The second acquisition module 620, based on the terminal's state information, acquires the first probability of the network request using each candidate timeout processing method, including: For the state information at each first time point, the state information at the first time point is output to the first prediction model corresponding to that time point; Through each of the first prediction models, output the third probability of each of the candidate timeout processing methods at each of the first time points; Based on the weight of each of the first prediction models and the third probability output by each of the first prediction models, the first probability of each of the candidate timeout processing methods is obtained.

[0089] In one possible implementation, the processing module 640 obtains a second probability of timeout processing for the network request at the current time point based on the terminal's state information at multiple first time points prior to the second time point, including: Input the state information of at least one first time point before the second time point into the second prediction model; The prediction model outputs the prediction result corresponding to the second time point, and the prediction result is used to indicate the second probability of timeout processing of the network request at the second time point.

[0090] In one possible implementation, the second acquisition module 620 acquires a first probability of each of the candidate timeout processing methods based on the weights of each of the first prediction models and the second probability output by each of the first prediction models, including: Based on the weight of each of the first prediction models and the third probability output by each of the first prediction models, and combined with the second probability of adopting the target timeout processing method at the first time point corresponding to each of the first prediction models, the first probability of each of the candidate timeout processing methods is obtained.

[0091] The device 600 provided in this application embodiment can execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0092] Figure 7 This diagram illustrates the hardware structure of an electronic device 700 executing the timeout handling method provided in this application. Referring to the diagram, at the hardware level, the electronic device includes a processor 710, and optionally includes an internal bus 720, a network interface 730, and a memory. The memory may include main memory 740, such as high-speed random-access memory (RAM), and may also include non-volatile memory 750, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other tasks.

[0093] The processor 710, network interface 730, and memory can be interconnected via an internal bus 720. This internal bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus.

[0094] The memory is used to store programs. Specifically, the program may include program code, which includes computer operation instructions. The memory may include main memory 740 and non-volatile memory 750, and provides instructions and data to the processor 710.

[0095] The processor 710 reads the corresponding computer program from the non-volatile memory 750 into the main memory 740 and then runs it, forming a device for locating the target user at the logical level. The processor 710 executes the program stored in the memory and specifically performs... Figure 1-5 The method described in the embodiments achieves the same or corresponding technical effects.

[0096] The above is as stated in this application. Figure 1-5The methods disclosed in the illustrated embodiments can be applied to a processor or implemented by processor 710. Processor 710 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware of processor 710 or by instructions in software form. The processor 710 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in the memory, and the processor 710 reads the information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0097] The electronic device can also execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0098] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0099] This application also proposes a computer-readable storage medium storing one or more programs. When executed by an electronic device including multiple applications, the one or more programs cause the electronic device to perform the following operations: in response to a network request initiated by a terminal, obtaining the terminal's state information, which includes at least one of the following: the terminal's network state, the terminal's device state, the terminal's service scenario, and the terminal's operational state; based on the terminal's state information, obtaining a first probability of adopting each candidate timeout processing method for the network request, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the error code retry; determining the candidate timeout processing method with the highest first probability as the target timeout processing method corresponding to the network request; and performing timeout processing on the network request based on the target timeout processing method.

[0100] The electronic device can also execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0101] The computer-readable storage medium mentioned above includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0102] Furthermore, this application embodiment also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the following process is implemented: in response to a network request initiated by a terminal, obtaining the status information of the terminal, the status information of the terminal including at least one of the following: the network status of the terminal, the device status of the terminal, the service scenario of the terminal, and the operation status of the terminal; based on the status information of the terminal, obtaining a first probability of adopting each candidate timeout processing method for the network request, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the retry of error codes; determining the candidate timeout processing method with the highest first probability as the target timeout processing method corresponding to the network request; and performing timeout processing on the network request based on the target timeout processing method.

[0103] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0104] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0105] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0106] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0107] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A timeout handling method, comprising: In response to a network request initiated by the terminal, the status information of the terminal is obtained, and the status information of the terminal includes at least one of the following: the network status of the terminal, the device status of the terminal, the service scenario of the terminal, and the operation status of the terminal; Based on the terminal's status information, a first probability of using each candidate timeout processing method for the network request is obtained, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the error code retry; The candidate timeout handling method with the highest probability is determined as the target timeout handling method corresponding to the network request. Based on the target timeout handling method, the network request is timed out.

2. The method according to claim 1, wherein, The timeout processing of the network request based on the target timeout processing method includes: Based on the terminal's status information at multiple first time points prior to the second time point, a second probability is obtained for processing the network request at the second time point that will result in a timeout. If the second probability is greater than the threshold, the network request is timed out based on the target timeout processing method.

3. The method according to claim 2, wherein, The step of obtaining the first probability of using each candidate timeout processing method for the network request based on the terminal's state information includes: The status information of the terminal is input into the first prediction model; The first probability of each of the candidate timeout handling methods is output through the first prediction model.

4. The method according to claim 3, wherein, Before inputting the terminal's state information into the first prediction model, the method further includes: The first prediction model is trained using multiple sample data and a preset loss function. The preset loss function includes a parameter for controlling the attention given to easy and difficult samples. Each set of sample data includes: a set of network status sample data of terminals, a set of device status sample data of terminals, a set of business scenario sample data of terminals, and a set of operation status sample data of terminals.

5. The method according to claim 3, wherein, The first prediction model is multiple, and the terminal's state information includes the terminal's state information at multiple first time points; the step of obtaining the first probability of the network request adopting each candidate timeout processing method based on the terminal's state information includes: For the state information at each first time point, the state information at the first time point is output to the first prediction model corresponding to that time point; Through each of the first prediction models, output the third probability of each of the candidate timeout processing methods at each of the first time points; Based on the weight of each of the first prediction models and the third probability output by each of the first prediction models, the first probability of each of the candidate timeout processing methods is obtained.

6. The method according to claim 5, wherein, The method of obtaining a second probability of timeout processing for the network request at the current time point based on the terminal's status information at multiple first time points prior to the second time point includes: Input the state information of at least one first time point before the second time point into the second prediction model; The prediction model outputs the prediction result corresponding to the second time point, and the prediction result is used to indicate the second probability of timeout processing of the network request at the second time point.

7. The method according to claim 5, wherein, The step of obtaining the first probability of each candidate timeout processing method based on the weight of each first prediction model and the third probability output by each first prediction model includes: Based on the weight of each of the first prediction models and the third probability output by each of the first prediction models, and combined with the second probability of timeout processing of the network request at the first time point corresponding to each of the first prediction models, the first probability of each of the candidate timeout processing methods is obtained.

8. A timeout processing device, comprising: The first acquisition module is used to acquire the status information of the terminal in response to a network request initiated by the terminal. The status information of the terminal includes at least one of the following: the network status of the terminal, the device status of the terminal, the service scenario of the terminal, and the operation status of the terminal. The second acquisition module is used to acquire, based on the state information of the terminal, the first probability of adopting each candidate timeout processing method for the network request, wherein the candidate timeout processing method includes at least one of the following: ending the wait, increasing the timeout, decreasing the timeout, and reducing the retry of the error code; The determining module is used to determine the candidate timeout handling method with the highest probability as the target timeout handling method corresponding to the network request; The processing module is used to perform timeout processing on the network request based on the target timeout processing method.

9. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, use the processor to perform the timeout handling method according to any one of claims 1-7.

10. A computer-readable medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the timeout processing method according to any one of claims 1-7.

11. A computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the timeout processing method as described in any one of claims 1-7.