CN111510482A - Method and device for determining failed network request and computer storage medium - Google Patents
Method and device for determining failed network request and computer storage medium Download PDFInfo
- Publication number
- CN111510482A CN111510482A CN202010274852.5A CN202010274852A CN111510482A CN 111510482 A CN111510482 A CN 111510482A CN 202010274852 A CN202010274852 A CN 202010274852A CN 111510482 A CN111510482 A CN 111510482A
- Authority
- CN
- China
- Prior art keywords
- network request
- target
- client
- network
- determining
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000004044 response Effects 0.000 claims abstract description 73
- 230000006870 function Effects 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 239000000919 ceramic Substances 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The application discloses a method and a device for determining a failed network request and a computer storage medium, and belongs to the technical field of internet. In the application, a client sends a target network request, the target network request is used for indicating that target data are obtained from a server, the target data are searched from a cache of the client under the condition that a response message aiming at the target network request is not successfully received, and the target network request is determined as a failed network request under the condition that the target data are not searched. Therefore, in the present application, in a case that the response message for the target network request is not successfully received, the client does not directly determine the target network request as a failed target network request, but continues to determine whether the target network request is a failed network request based on the data in the cache, so that the response failure rate of the finally determined network request and the response failure rate perceived by the user can be consistent, that is, the accuracy of the response failure rate of the network request is improved.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for determining a failed network request, and a computer storage medium.
Background
Currently, a client may initiate a network request to a server to implement a certain network service based on the server. For example, the client may initiate a song search request to the server, and the server returns a response message to the client according to the song search request, so as to implement a song search service. The response failure rate of the network request for a certain network service network may reflect the operation condition of the network service to a certain extent, and therefore, the response failure rate of the network request is usually required to be determined. The response failure rate of the network request refers to a probability that the network request of the network service cannot be realized in the network requests initiated for the network service. For the sake of convenience in the following description, a network request that cannot implement network traffic is referred to as a failed network request, and therefore, in a scenario of determining a response failure rate, it is generally required to determine which network requests are failed network requests.
In the related art, after a client initiates a network request for a certain network service, if a response message returned by a server cannot be successfully received for the network request, the network request is marked as a failed network request. However, the response failure rate of the failed network request determined based on this method often deviates from the response failure rate of the network request actually felt by the user, resulting in lower accuracy of the finally determined response failure rate.
Disclosure of Invention
The embodiment of the application provides a method and a device for determining a failed network request and a computer storage medium, which can improve the accuracy of the finally determined response failure rate. The technical scheme is as follows:
in one aspect, a method for determining a failed network request is provided, and the method is applied to a client, and includes:
sending a target network request, wherein the target network request is used for indicating that target data are acquired from a server;
searching the target data from the cache of the client under the condition that the response message aiming at the target network request is not successfully received;
and under the condition that the target data is not found, determining the target network request as a failed network request.
Optionally, after the target data is searched from the cache of the client, the method further includes:
and under the condition that the target data are found, responding the target network request based on the target data in the cache.
Optionally, before determining that the target network request is a failed network request, the method further includes:
determining a current network link state between the client and the server;
and in the case that the network link state is in connection, performing the operation of determining the target network request as a failed network request.
Optionally, after determining the current network link state between the client and the server, the method further includes:
and under the condition that the network link state is disconnected, marking the network request as a first type network request, wherein the first type network request is a network request initiated under the condition that the network link state is disconnected.
Optionally, after the sending the target network request, the method further includes:
if the client is detected to be withdrawn in midway, the network request is marked as a second type of network request, and the second type of network request is the network request which is withdrawn in midway after the network request is initiated by the client.
In a second aspect, an apparatus for determining a network request failure is provided, the apparatus being deployed at a client, and the apparatus comprising:
the sending module is used for sending a target network request, and the target network request is used for indicating that target data are obtained from a server;
the searching module is used for searching the target data from the cache of the client under the condition that the response message aiming at the target network request is not successfully received;
and the first determining module is used for determining the target network request as a failed network request under the condition that the target data is not found.
Optionally, the apparatus further comprises:
and the response module is used for responding the target network request based on the target data in the cache under the condition that the target data is found.
Optionally, the apparatus further comprises:
a second determining module, configured to determine a current network link state between the client and the server;
the first determining module is configured to, if the network link status is in connection, perform an operation of determining the target network request as a failed network request.
Optionally, the apparatus further comprises:
a first marking module, configured to mark the network request as a first type network request when the network link state is disconnected, where the first type network request is a network request initiated when the network link state is disconnected.
Optionally, the apparatus further comprises:
and the second marking module is used for marking the network request as a second type of network request if the client is detected to quit in midway, wherein the second type of network request is the network request which is quitted in midway after the network request is initiated by the client.
In a third aspect, an apparatus for determining a failed network request is provided, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor executes executable instructions in the memory to perform any of the methods of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, having instructions stored thereon, which when executed by a processor, implement the steps of any of the methods of the first aspect described above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the embodiment of the application, a client sends a target network request, the target network request is used for indicating that target data are obtained from a server, the target data are searched from a cache of the client under the condition that a response message aiming at the target network request is not successfully received, and the target network request is determined as a failed network request under the condition that the target data are not searched. Therefore, in the embodiment of the present application, in a case that the response message for the target network request is not successfully received, the client does not directly determine the target network request as a failed target network request, but continues to determine whether the target network request is a failed network request based on the data in the cache, so that a response failure rate of the finally determined network request and a response failure rate perceived by the user can be consistent, that is, accuracy of the response failure rate of the network request is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system architecture diagram of a network system according to an embodiment of the present application;
fig. 2 is a flowchart of a method for determining a failed network request according to an embodiment of the present application;
fig. 3 is a flowchart of another method for determining a network request failure according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an apparatus for determining a network failure request according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal according to an 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.
Before explaining the embodiments of the present application in detail, an application scenario related to the embodiments of the present application will be described.
With the development of internet technology, more and more users can trigger network requests through clients to realize some network services such as song search. Since the client triggers the network request based on the interface, the failure rate of the network request is also referred to as the interface failure rate. The method for determining the failed network request provided by the embodiment of the application is applied to the scene of determining the interface failure rate. Optionally, the method provided by the embodiment of the present application is also applied to other scenarios that require determining a failed network request, which is not illustrated herein.
Next, a system configuration according to an embodiment of the present application will be described.
Fig. 1 is a schematic diagram of a network system according to an embodiment of the present application. As shown in fig. 1, the network system includes a client 101 and a server 102. Wherein the client 101 may communicate with the server 102.
The client 101 may trigger a network request based on a preset operation of a user and transmit the network request to the server 102. The server 102 returns a response message to the client 101 according to the network request, and the client 101 loads the information carried in the response message to implement the network service corresponding to the network request.
The client 101 may be a terminal such as a mobile phone, a tablet computer, a desktop computer, and an intelligent wearable device. The server 102 may be a stand-alone server or a clustered server.
Next, a method for determining a failed network request provided in the embodiment of the present application is described.
Fig. 2 is a method for determining a network request failure according to an embodiment of the present disclosure. The method can be applied to a client, for example, the client shown in fig. 1. As shown in fig. 2, the method comprises the steps of:
step 201: the client sends a target network request, and the target network request is used for indicating to acquire target data from the server.
When a user needs to implement a certain network service on a client, the user can trigger a target network request on the client through preset operation. The preset operation may be a click operation, a slide operation, a voice operation, or the like. When detecting a target network request triggered by a user, the client sends the target network request to the server so as to acquire target data required for realizing the network service from the server.
After receiving the target network request, the server may generate a response message based on the target network request, where the response message carries the target data. The server sends the response message to the client, and the client loads the target data after receiving the response message so as to realize the network service.
However, if a network or a server has a problem locally, the client cannot successfully receive a response message for the target network request under the conditions, and at this time, the client cannot successfully load target data, so that network service cannot be realized.
However, the current client is usually provided with a cache function, and in case that the client does not successfully receive the response message for the target network request, the client usually obtains the target data from the cache to ensure the implementation of the network service. Therefore, in the case that the client does not successfully receive the response message for the target network request, if the target data happens to be stored in the cache, the client will eventually implement the network service, so that it is blind to directly determine the target network request as the failed network request in the case that the client does not successfully receive the response message for the target network request. The most obvious problem is that the client determines the target network request as a failed network request, but the user side senses the successful implementation of the network service. Therefore, in the embodiment of the present application, in a case that the response message for the target network request is not successfully received, the client does not directly determine the target network request as a failed network request, but determines whether the target network request is a failed network request based on the following steps 202 and 203, so that the response failure rate of the finally determined network request and the response failure rate perceived by the user can be consistent, that is, the accuracy of the response failure rate of the network request is improved.
Step 202: and the client searches the target data from the cache of the client under the condition that the client does not successfully receive the response message aiming at the target network request.
Based on step 201, in the embodiment of the present application, in order to make the response failure rate of the finally determined network request and the response failure rate perceived by the user be consistent, the client needs to check the cache if the client does not successfully receive the response message for the target network request.
If the target data is found from the cache of the client, the client realizes the network service based on the target data in the cache. That is, when the target data is found, the client responds to the target network request based on the target data in the cache, and at this time, the user perceives that the network service is implemented. If the target data is found in the cache of the client, the client determines the target network request as a failed network request based on step 203.
It should be noted that there are two possible situations that the client does not successfully receive the response message for the target network request, and one situation is that the client receives the request failure message returned by the server, and the network status is good at this time, but the server cannot provide the network service, so the server will return the request failure message to the client based on the target network request. In another case, the client still does not receive any message returned by the server after sending the target network request repeatedly for the reference number of times. At this time, it may be that the network is interrupted, so that the server cannot respond to the target network request of the client. The reference times may be 3 times, 5 times, etc.
In addition, the above-mentioned determination of whether the client has successfully received the response message for the target network request may be implemented based on network library logic in the client. The web library logic may be a software module, and in one possible implementation, the functions to be implemented by the web library logic are: after the target network request is sent, timing is started, after the timing reaches a first reference time length, if any message which is returned by the server and aims at the target network request is not received, the target network request is sent again, the above process is repeated, and the cycle process is terminated until any one of the following three conditions occurs: (1) receiving a response message (ack message) returned by the server; (2) receiving a request failure message returned by the server; (3) the number of times of sending the target network request reaches the reference number of times.
And in the process of executing the operation, if the response message returned by the server is received, the network library logic indicates that the response message is successfully received. In other cases, the response message returned by the server may not be successfully received.
Step 203: and under the condition that the client does not find the target data, determining the target network request as a failed network request.
If the client does not find the target data in the cache, the client cannot realize the network service based on the data in the cache at present, and the target network request is determined to be a failed network request, so that the failed network request determined by the client is consistent with the failed network request sensed by the user side, and the accuracy of the subsequent determination of the response failure rate is further improved.
Further, in order to further facilitate determining a cause causing a network request failure when the target data is not found in the cache of the client, a network link state between the current client and the server may be determined before the target network request is determined to be a failed network request; in a case where the network link status is in connection, an operation of determining the target network request as a failed network request is performed. Accordingly, in the case that the network link state is disconnected, the network request is marked as a first type network request, and the first type network request is a network request initiated in the case that the network link state is disconnected.
In this implementation, the failed network request determined by the client is only used to indicate the network request that fails to implement the network service due to the problem occurring on the server side. The first type of network request is only used to indicate a network request that cannot implement network traffic due to a network outage. Therefore, network requests which cannot realize network services can be further classified in a detailed manner, and the flexibility of the method for determining the failed network requests provided by the embodiment of the application is improved.
In addition, after the client terminal has a network request, if the client terminal exits in the middle of the triggering operation of the user, the client terminal cannot realize the network service at this time. In this case, the network request may also be specially marked, and therefore, in a possible implementation manner, after the client sends the target network request, if the client detects that the client exits halfway, the network request is marked as a second type network request, where the second type network request is a network request for which the client exits halfway after the network request is initiated. Therefore, various network requests which can not realize the network service are refined and classified subsequently, and the client can perform other operations based on the network requests which can realize the network service.
In addition, in the process of determining whether the target network request is the failed network request through the above steps 201 to 203, if no result for the target network request is obtained for a long period of time, at this time, in order to avoid wasting the processing resources of the client, a bottom-of-the-way duration may be set for the network request. After the client sends the target network request, a timer is started. Before the timing duration reaches the bottom-of-pocket duration, determining response results of the target network request based on the above steps 201 to 203, where the response results include that the network service is successfully implemented, the network request is a failed network request, the network request is a first type network request, or the network request is a second type network request. If no response result for the target network request is obtained after the timing duration reaches the bottom-of-pocket duration, the target network request may be marked as a third type network request. The third type of network request refers to a network request that is overtime, that is, a network request that exceeds the latency without any response.
The method provided by the embodiments of the present application is further explained in detail by taking fig. 3 as an example.
Fig. 3 is a flowchart of another method for determining a network request failure according to an embodiment of the present application. As shown in fig. 3, the client may start a timing, which may also be referred to as a red fork timing, after initiating the network request. And before the timing duration reaches the bottom-of-pocket duration, determining whether a response message returned by the server can be successfully received based on the network library logic. The specific functions of the network library logic have been described above and will not be repeated here. And if the network base logic determines that the response message returned by the server is successfully received, marking the red fork result of the network request as non-red fork, wherein the red fork result is used for indicating the final response result of the network request, and the non-red fork result indicates that the server successfully responds to the network request. If the response message returned by the server is determined not to be successfully received based on the network library logic, whether cache data exists or not is judged, and whether data aiming at the network request exists in the cache or not is also judged in time. If there is cached data, the network request's red-fork result is also marked as non-red-fork. If the data is not cached, whether the current network has errors is continuously judged, namely whether the network link between the server and the client is normal is judged. If a network error occurs, the red cross result of the network request is marked as a network error. If no network error has occurred, the red-fork result of the network request is marked as red-fork.
In addition, as shown in fig. 3, if any of the above red cross results is not obtained after the timing length reaches the bottom-in length, the red cross result is marked as timeout.
Furthermore, before the above network library logic implements the relevant function, if the client logs out halfway, the red cross result of the network request is set as a halfway log-out.
Through the above process, a red cross result is finally obtained for any network request. When the result of the red cross is the red cross, the network request is indicated to be a failed network request, and the failure reason is caused by the fact that the server side cannot respond successfully locally. And when the red cross result is non-red cross, indicating that the client can successfully realize the network service based on the network request. When the red cross result is overtime, the network request is indicated as the third type network request. When the red cross result is a network error, the network request is indicated as the first type network request. When the red cross result is the midway exit, the network request is indicated to be the second type network request. The first type network request, the second type network request and the third type network request have been described in detail in the above steps 201 to 203, and the description thereof will not be repeated.
Furthermore, a red-fork result is finally obtained for any network request. Therefore, the red-cross result of each network request can be displayed by means of a red-cross diagram. Therefore, which network requests can successfully realize the network service and which network requests can not realize the network service can be intuitively seen through the red cross graph, and the reason why the network service can not be realized can be finely seen. Meanwhile, the problem that response failure rate cannot be bound with a user in the related technology can be solved, and application flexibility of the method provided by the embodiment of the application is improved. That is, when determining the response failure rate based on the failed network request determined in the present application, it is determined whether to fail from the perspective of whether the user sees the failure interface. For example, the user sees a failed pop window, a toast, an error map, and the like, which are all scenes that the network request cannot realize the network service due to the server, so that the network request can be determined as a failed network request, and the other situations can be further refined based on the classification of the network request. .
In the embodiment of the application, a client sends a target network request, the target network request is used for indicating that target data are obtained from a server, the target data are searched from a cache of the client under the condition that a response message aiming at the target network request is not successfully received, and the target network request is determined as a failed network request under the condition that the target data are not searched. Therefore, in the embodiment of the present application, in a case that the response message for the target network request is not successfully received, the client does not directly determine the target network request as a failed target network request, but continues to determine whether the target network request is a failed network request based on the data in the cache, so that a response failure rate of the finally determined network request and a response failure rate perceived by the user can be consistent, that is, accuracy of the response failure rate of the network request is improved.
Next, a device for determining a network request failure according to an embodiment of the present application will be described.
Referring to fig. 4, an embodiment of the present application provides an apparatus 400 for determining a failed network request, where the apparatus 400 includes:
a sending module 401, configured to send a target network request, where the target network request is used to instruct a server to obtain target data;
a searching module 402, configured to search the target data from the cache of the client if the response message to the target network request is not successfully received;
a first determining module 403, configured to determine the target network request as a failed network request if the target data is not found.
Optionally, the apparatus further comprises:
and the response module is used for responding the target network request based on the target data in the cache under the condition that the target data is found.
Optionally, the apparatus further comprises:
a second determining module, configured to determine a current network link state between the client and the server;
the first determining module is configured to perform an operation of determining the target network request as a failed network request if the network link status is in connection.
Optionally, the apparatus further comprises:
the first marking module is used for marking the network request as a first type network request under the condition that the network link state is disconnected, wherein the first type network request is a network request initiated under the condition that the network link state is disconnected.
Optionally, the apparatus further comprises:
and the second marking module is used for marking the network request as a second type of network request if the client is detected to quit in midway, wherein the second type of network request is the network request which is quitted in midway after the network request is initiated by the client.
In the embodiment of the application, a client sends a target network request, the target network request is used for indicating that target data are obtained from a server, the target data are searched from a cache of the client under the condition that a response message aiming at the target network request is not successfully received, and the target network request is determined as a failed network request under the condition that the target data are not searched. Therefore, in the embodiment of the present application, in a case that the response message for the target network request is not successfully received, the client does not directly determine the target network request as a failed target network request, but continues to determine whether the target network request is a failed network request based on the data in the cache, so that a response failure rate of the finally determined network request and a response failure rate perceived by the user can be consistent, that is, accuracy of the response failure rate of the network request is improved.
It should be noted that: the determining apparatus for determining a network request that fails according to the foregoing embodiments is only illustrated by the above-mentioned division of each functional module when determining a network request that fails, and in practical applications, the above-mentioned function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above-mentioned functions. In addition, the determining apparatus for a network request failure and the determining method for a network request failure provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a terminal 500 according to an embodiment of the present disclosure, and a client according to an embodiment of the present disclosure may be implemented by a structure of the terminal shown in fig. 5, where the terminal 500 may be a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio L layer III, motion Picture Experts Group Audio layer 3), an MP4 player (Moving Picture Experts Group Audio L layer IV, motion Picture Experts Group Audio layer 4), a notebook computer, or a desktop computer, and the terminal 500 may also be referred to as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.
In general, the terminal 500 includes: a processor 501 and a memory 502.
The processor 501 may include one or more Processing cores, such as a 4-core processor, an 8-core processor, etc., the processor 501 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a P L a (Programmable logic Array), the processor 501 may also include a main processor and a coprocessor, the main processor being a processor for Processing data in a wake-up state, also known as a CPU (Central Processing Unit), the coprocessor being a low-power processor for Processing data in a standby state, the processor 501 may be integrated with a GPU (Graphics Processing Unit) for rendering and rendering content desired for a display screen, in some embodiments, the processor 501 may also include an intelligent processor for learning about AI operations of the display screen.
In some embodiments, the terminal 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502 and peripheral interface 503 may be connected by a bus or signal lines. Each peripheral may be connected to the peripheral interface 503 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, touch screen display 505, camera 506, audio circuitry 507, positioning components 508, and power supply 509.
The peripheral interface 503 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or both of the processor 501, the memory 502, and the peripheral interface 503 may be implemented on separate chips or circuit boards, which are not limited in this application.
The Radio Frequency circuit 504 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 504 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 504 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, etc. The radio frequency circuitry 504 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 504 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The Display 505 may be configured to Display a UI (User Interface), which may include graphics, text, icons, video, and any combination thereof, when the Display 505 is a touch screen Display, the Display 505 may also have the capability to capture touch signals on or over a surface of the Display 505. the touch signals may be input to the processor 501 for processing as control signals, at which time the Display 505 may also be configured to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. in some embodiments, the Display 505 may be one, disposed on a front panel of the terminal 500. in other embodiments, the Display 505 may be at least two, disposed on different surfaces or in a folded design of the terminal 500. in still other embodiments, the Display 505 may be a flexible Display, disposed on a curved surface or on a folded surface of the terminal 500. even, the Display 505 may be configured with non-rectangular irregular graphics, the Display 505 may be configured with a Diode L CD (L id Crystal, Display 83), emissive Display, or the like.
The camera assembly 506 is used to capture images or video. Optionally, camera assembly 506 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 506 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The positioning component 508 is used to locate the current geographic location of the terminal 500 to implement navigation or L BS (L geographic based Service). the positioning component 508 can be a positioning component based on the united states GPS (global positioning System), the beidou System of china, the graves System of russia, or the galileo System of the european union.
In some embodiments, terminal 500 also includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: acceleration sensor 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, optical sensor 515, and proximity sensor 516.
The acceleration sensor 511 may detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the terminal 500. For example, the acceleration sensor 511 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 501 may control the touch screen 505 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 511. The acceleration sensor 511 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 512 may detect a body direction and a rotation angle of the terminal 500, and the gyro sensor 512 may cooperate with the acceleration sensor 511 to acquire a 3D motion of the user on the terminal 500. The processor 501 may implement the following functions according to the data collected by the gyro sensor 512: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 513 may be disposed on a side bezel of the terminal 500 and/or an underlying layer of the touch display screen 505. When the pressure sensor 513 is disposed on the side frame of the terminal 500, a user's holding signal of the terminal 500 may be detected, and the processor 501 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 513. When the pressure sensor 513 is disposed at the lower layer of the touch display screen 505, the processor 501 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 505. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 514 is used for collecting fingerprints of a user, the identity of the user is identified by the processor 501 according to the fingerprints collected by the fingerprint sensor 514, or the identity of the user is identified by the fingerprint sensor 514 according to the collected fingerprints, when the identity of the user is identified as a credible identity, the user is authorized to execute relevant sensitive operations by the processor 501, the sensitive operations comprise screen unlocking, encrypted information viewing, software downloading, payment, setting change and the like, the fingerprint sensor 514 can be arranged on the front side, the back side or the side of the terminal 500, when a physical key or a manufacturer L ogo is arranged on the terminal 500, the fingerprint sensor 514 can be integrated with the physical key or the manufacturer L ogo.
The optical sensor 515 is used to collect the ambient light intensity. In one embodiment, the processor 501 may control the display brightness of the touch display screen 505 based on the ambient light intensity collected by the optical sensor 515. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 505 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 505 is turned down. In another embodiment, processor 501 may also dynamically adjust the shooting parameters of camera head assembly 506 based on the ambient light intensity collected by optical sensor 515.
The proximity sensor 516, also referred to as a distance sensor, is generally disposed on a front panel of the terminal 500. The proximity sensor 516 is used to collect the distance between the user and the front surface of the terminal 500. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 gradually decreases, the processor 501 controls the touch display screen 505 to switch from the bright screen state to the dark screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 becomes gradually larger, the processor 501 controls the touch display screen 505 to switch from the screen-rest state to the screen-on state.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of terminal 500 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a server, enable the server to perform the method for determining a failed network request provided in the foregoing embodiments.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for determining a network request failure provided in the foregoing embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (12)
1. A method for determining a network request failure, applied to a client, the method comprising:
sending a target network request, wherein the target network request is used for indicating that target data are acquired from a server;
searching the target data from the cache of the client under the condition that the response message aiming at the target network request is not successfully received;
and under the condition that the target data is not found, determining the target network request as a failed network request.
2. The method of claim 1, wherein after searching the target data from the cache of the client, further comprising:
and under the condition that the target data are found, responding the target network request based on the target data in the cache.
3. The method of claim 1, wherein prior to determining the target network request as a failed network request, further comprising:
determining a current network link state between the client and the server;
and in the case that the network link state is in connection, performing the operation of determining the target network request as a failed network request.
4. The method of claim 3, wherein after determining the current network link state between the client and the server, further comprising:
and under the condition that the network link state is disconnected, marking the network request as a first type network request, wherein the first type network request is a network request initiated under the condition that the network link state is disconnected.
5. The method of any of claims 1 to 4, wherein after sending the target network request, further comprising:
if the client is detected to be withdrawn in midway, the network request is marked as a second type of network request, and the second type of network request is the network request which is withdrawn in midway after the network request is initiated by the client.
6. An apparatus for determining a failed network request, the apparatus being deployed at a client, the apparatus comprising:
the sending module is used for sending a target network request, and the target network request is used for indicating that target data are obtained from a server;
the searching module is used for searching the target data from the cache of the client under the condition that the response message aiming at the target network request is not successfully received;
and the first determining module is used for determining the target network request as a failed network request under the condition that the target data is not found.
7. The apparatus of claim 6, wherein the apparatus further comprises:
and the response module is used for responding the target network request based on the target data in the cache under the condition that the target data is found.
8. The apparatus of claim 6, wherein the apparatus further comprises:
a second determining module, configured to determine a current network link state between the client and the server;
the first determining module is configured to, if the network link status is in connection, perform an operation of determining the target network request as a failed network request.
9. The apparatus of claim 8, wherein the apparatus further comprises:
a first marking module, configured to mark the network request as a first type network request when the network link state is disconnected, where the first type network request is a network request initiated when the network link state is disconnected.
10. The apparatus of any of claims 6 to 9, wherein the apparatus further comprises:
and the second marking module is used for marking the network request as a second type of network request if the client is detected to quit in midway, wherein the second type of network request is the network request which is quitted in midway after the network request is initiated by the client.
11. An apparatus for determining a failed network request, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor executes the executable instructions in the memory to perform the steps of the method of any of the preceding claims 1-5.
12. A computer-readable storage medium, having stored thereon instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010274852.5A CN111510482B (en) | 2020-04-09 | 2020-04-09 | Method and device for determining failed network request and computer storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010274852.5A CN111510482B (en) | 2020-04-09 | 2020-04-09 | Method and device for determining failed network request and computer storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111510482A true CN111510482A (en) | 2020-08-07 |
| CN111510482B CN111510482B (en) | 2023-06-16 |
Family
ID=71876036
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010274852.5A Active CN111510482B (en) | 2020-04-09 | 2020-04-09 | Method and device for determining failed network request and computer storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111510482B (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112199281A (en) * | 2020-09-30 | 2021-01-08 | 中国平安财产保险股份有限公司 | Data processing method and device, terminal equipment and readable storage medium |
| CN112711597A (en) * | 2020-12-11 | 2021-04-27 | 京东方科技集团股份有限公司 | Resource state updating method and device and electronic equipment |
| CN112788781A (en) * | 2020-12-29 | 2021-05-11 | 飞依诺科技(苏州)有限公司 | Method, device and storage medium for network reconnection of wireless ultrasonic imaging system |
| CN113723061A (en) * | 2021-08-30 | 2021-11-30 | 上海幻电信息科技有限公司 | Data processing method and device based on multi-person collaboration framework |
| CN115914337A (en) * | 2022-10-10 | 2023-04-04 | 深圳优美创新科技有限公司 | A method for processing APP network connection failure |
| CN116074377A (en) * | 2021-11-03 | 2023-05-05 | 腾讯科技(深圳)有限公司 | Information processing method, device, and computer-readable storage medium |
Citations (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030031353A1 (en) * | 2001-01-31 | 2003-02-13 | General Electric Company | Communication of image data from image detector to host computer |
| US20110107184A1 (en) * | 2009-10-29 | 2011-05-05 | Cleversafe, Inc. | Data distribution utilizing unique read parameters in a dispersed storage system |
| CN104518926A (en) * | 2014-12-05 | 2015-04-15 | 深圳天珑无线科技有限公司 | Mobile terminal and network connection diagnosis method thereof |
| US9268651B1 (en) * | 2012-10-31 | 2016-02-23 | Amazon Technologies, Inc. | Efficient recovery of storage gateway cached volumes |
| CN108600320A (en) * | 2018-03-23 | 2018-09-28 | 阿里巴巴集团控股有限公司 | A kind of data cache method, apparatus and system |
| CN109714407A (en) * | 2018-12-19 | 2019-05-03 | 网易(杭州)网络有限公司 | Server resource adjusting method and device, electronic equipment and storage medium |
| CN110233881A (en) * | 2019-05-22 | 2019-09-13 | 平安科技(深圳)有限公司 | Service request processing method, device, equipment and storage medium |
| CN110334246A (en) * | 2019-07-08 | 2019-10-15 | 北京字节跳动网络技术有限公司 | A kind of data request processing method, apparatus, terminal device and storage medium |
| CN110460534A (en) * | 2019-07-26 | 2019-11-15 | 腾讯云计算(北京)有限责任公司 | A request message reporting method, device, equipment and storage medium |
| CN110516063A (en) * | 2019-07-11 | 2019-11-29 | 网宿科技股份有限公司 | Method for updating service system, electronic device and readable storage medium |
| CN110784518A (en) * | 2019-09-27 | 2020-02-11 | 苏州浪潮智能科技有限公司 | Method and device for obtaining static resources |
| CN110868333A (en) * | 2019-10-28 | 2020-03-06 | 云深互联(北京)科技有限公司 | Data caching method and system for gateway |
-
2020
- 2020-04-09 CN CN202010274852.5A patent/CN111510482B/en active Active
Patent Citations (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030031353A1 (en) * | 2001-01-31 | 2003-02-13 | General Electric Company | Communication of image data from image detector to host computer |
| US20110107184A1 (en) * | 2009-10-29 | 2011-05-05 | Cleversafe, Inc. | Data distribution utilizing unique read parameters in a dispersed storage system |
| US9268651B1 (en) * | 2012-10-31 | 2016-02-23 | Amazon Technologies, Inc. | Efficient recovery of storage gateway cached volumes |
| CN104518926A (en) * | 2014-12-05 | 2015-04-15 | 深圳天珑无线科技有限公司 | Mobile terminal and network connection diagnosis method thereof |
| CN108600320A (en) * | 2018-03-23 | 2018-09-28 | 阿里巴巴集团控股有限公司 | A kind of data cache method, apparatus and system |
| CN109714407A (en) * | 2018-12-19 | 2019-05-03 | 网易(杭州)网络有限公司 | Server resource adjusting method and device, electronic equipment and storage medium |
| CN110233881A (en) * | 2019-05-22 | 2019-09-13 | 平安科技(深圳)有限公司 | Service request processing method, device, equipment and storage medium |
| CN110334246A (en) * | 2019-07-08 | 2019-10-15 | 北京字节跳动网络技术有限公司 | A kind of data request processing method, apparatus, terminal device and storage medium |
| CN110516063A (en) * | 2019-07-11 | 2019-11-29 | 网宿科技股份有限公司 | Method for updating service system, electronic device and readable storage medium |
| CN110460534A (en) * | 2019-07-26 | 2019-11-15 | 腾讯云计算(北京)有限责任公司 | A request message reporting method, device, equipment and storage medium |
| CN110784518A (en) * | 2019-09-27 | 2020-02-11 | 苏州浪潮智能科技有限公司 | Method and device for obtaining static resources |
| CN110868333A (en) * | 2019-10-28 | 2020-03-06 | 云深互联(北京)科技有限公司 | Data caching method and system for gateway |
Non-Patent Citations (3)
| Title |
|---|
| NUR ZIADAH HARUN ET.AL.: "Enhancement on adaptive FEC mechanism for video transmission over burst error wireless network" * |
| 郝建民;: "对于流媒体代理服务器缓存的分析与研究" * |
| 钟雪冰: "远程教育网站数字媒体制播过程的研究" * |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112199281A (en) * | 2020-09-30 | 2021-01-08 | 中国平安财产保险股份有限公司 | Data processing method and device, terminal equipment and readable storage medium |
| CN112711597A (en) * | 2020-12-11 | 2021-04-27 | 京东方科技集团股份有限公司 | Resource state updating method and device and electronic equipment |
| CN112711597B (en) * | 2020-12-11 | 2025-03-11 | 京东方科技集团股份有限公司 | Resource status updating method, device and electronic device |
| CN112788781A (en) * | 2020-12-29 | 2021-05-11 | 飞依诺科技(苏州)有限公司 | Method, device and storage medium for network reconnection of wireless ultrasonic imaging system |
| CN112788781B (en) * | 2020-12-29 | 2022-08-02 | 飞依诺科技股份有限公司 | Method, device and storage medium for network reconnection of wireless ultrasonic imaging system |
| CN113723061A (en) * | 2021-08-30 | 2021-11-30 | 上海幻电信息科技有限公司 | Data processing method and device based on multi-person collaboration framework |
| CN116074377A (en) * | 2021-11-03 | 2023-05-05 | 腾讯科技(深圳)有限公司 | Information processing method, device, and computer-readable storage medium |
| CN115914337A (en) * | 2022-10-10 | 2023-04-04 | 深圳优美创新科技有限公司 | A method for processing APP network connection failure |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111510482B (en) | 2023-06-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110674022B (en) | Behavior data acquisition method and device and storage medium | |
| US11200022B2 (en) | Method and apparatus of playing audio data | |
| CN110308956B (en) | Application interface display method and device and mobile terminal | |
| CN111510482B (en) | Method and device for determining failed network request and computer storage medium | |
| CN110278464B (en) | Method and device for displaying list | |
| CN109327608B (en) | Song sharing method, terminal, server and system | |
| CN111327694B (en) | File uploading method and device, storage medium and electronic equipment | |
| CN109246123B (en) | Media stream acquisition method and device | |
| CN108897659B (en) | Method, device and storage medium for modifying log level | |
| CN110868642B (en) | Video playing method, device and storage medium | |
| CN111897465B (en) | Popup display method, device, equipment and storage medium | |
| CN113301422A (en) | Method, terminal and storage medium for acquiring video cover | |
| CN111092991B (en) | Lyric display method and device and computer storage medium | |
| CN109783176B (en) | Page switching method and device | |
| CN108401194B (en) | Time stamp determination method, apparatus and computer-readable storage medium | |
| CN114140105A (en) | Resource transfer method, device, equipment and computer readable storage medium | |
| CN112000576A (en) | Code data detection method, device, equipment and storage medium | |
| CN111258683A (en) | Detection method, detection device, computer equipment and storage medium | |
| CN111428080A (en) | Storage method, search method and device for video files | |
| CN112181915A (en) | Method, device, terminal and storage medium for executing service | |
| CN111464829B (en) | Method, device and equipment for switching media data and storage medium | |
| CN110971692B (en) | Method and device for opening service and computer storage medium | |
| CN111246147B (en) | Video caching method, device, terminal and storage medium | |
| CN109101158A (en) | Import the method, apparatus and storage medium of list of songs | |
| CN110941458B (en) | Method, device, equipment and storage medium for starting application program |
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 |