CN113810249B - Callback detection method and device, computer equipment and storage medium - Google Patents

Callback detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113810249B
CN113810249B CN202111093040.1A CN202111093040A CN113810249B CN 113810249 B CN113810249 B CN 113810249B CN 202111093040 A CN202111093040 A CN 202111093040A CN 113810249 B CN113810249 B CN 113810249B
Authority
CN
China
Prior art keywords
method channel
callback
channel
request message
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111093040.1A
Other languages
Chinese (zh)
Other versions
CN113810249A (en
Inventor
李花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tencent Domain Computer Network Co Ltd
Original Assignee
Shenzhen Tencent Domain Computer Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Tencent Domain Computer Network Co Ltd filed Critical Shenzhen Tencent Domain Computer Network Co Ltd
Priority to CN202111093040.1A priority Critical patent/CN113810249B/en
Publication of CN113810249A publication Critical patent/CN113810249A/en
Application granted granted Critical
Publication of CN113810249B publication Critical patent/CN113810249B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a callback detection method and device, computer equipment and a storage medium, wherein the callback detection method comprises the following steps: sending a first request message through a first method channel; determining a first moment when a first method channel sends a first request message; if the first packet data is not received through the first method channel within a time length exceeding a first time threshold after the first moment, determining a first method channel identifier from the first request message; determining that callback exception occurs in the first method channel uniquely indicated by the first method channel identifier; reporting callback abnormity of the first method channel to the developer terminal equipment, so that the developer terminal equipment prompts the callback abnormity of the first method channel. By the method, whether callback abnormity occurs or not is judged through the time threshold, the method channel with callback abnormity is determined based on the method channel identification, and the method channel with callback abnormity is reported, so that the callback accuracy of the detection method channel is ensured, and the efficiency of processing the callback abnormity is improved.

Description

Callback detection method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a callback detection method and apparatus, a computer device, and a storage medium.
Background
The Flutter technology is an extremely popular cross-platform technical scheme, and more development and products use the Flutter technology to realize development of Applications (APPs). Although Flutter is a very efficient cross-platform technology, the implementation of part of functions still needs to depend on the capability of a platform, so that communication between Flutter and a client is inevitable, the communication between Flutter and the client is usually implemented through a Method Channel (Method Channel), methods called by the Method Channel are all asynchronous, if a communication result is relied on in a certain Method and the client is not correctly returned, a program exception is caused, and the abnormal callback of the asynchronous Method causes that the Method Channel cannot be normally released, so that memory leakage is caused. Therefore, the Method Channel can be more accurately detected whether to make a correct callback or not, and the problem of callback exception can be solved.
Disclosure of Invention
The embodiment of the application provides a callback detection method and device, computer equipment and a storage medium, whether callback data corresponding to a request message is received or not is judged through a time threshold, and a method channel with callback abnormity is determined based on a method channel identifier, so that the accuracy of whether the detection method channel is normal or not is guaranteed, and the efficiency of processing callback abnormity can be improved by reporting the method channel with callback abnormity.
In view of the above, a first aspect of the present application provides a callback detection method, including:
the method comprises the steps that a first request message is sent through a first method channel, wherein the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates the source of the first request message, the first method channel and a first message processor have a correlation relationship, and the first message processor is used for processing the request message transmitted by the first method channel;
determining a first moment when a first method channel sends a first request message;
if the first method channel identifier is not received through the first method channel within a time length exceeding a first time threshold value after a first moment, determining a first method channel identifier from a first request message, wherein the first method channel identifier is obtained after the first message processor processes the first request message;
determining that callback exception occurs in the first method channel uniquely indicated by the first method channel identifier;
and sending the callback abnormity of the first method channel to the developer terminal equipment, so that the developer terminal equipment prompts the callback abnormity of the first method channel.
The second aspect of the present application provides a callback detection device, including:
the receiving and sending module is used for sending a first request message through a first method channel, wherein the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier only indicates the first method channel, the first platform identifier indicates the source of the first request message, the first method channel and a first message processor have a relationship, and the first message processor is used for processing the request message transmitted by the first method channel;
the processing module is used for determining a first moment when the first method channel sends the first request message;
the processing module is further configured to determine a first method channel identifier from the first request message if the first packet data is not received through the first method channel within a time period exceeding a first time threshold after the first time, where the first packet data is obtained after the first message processor processes the first request message;
the processing module is further used for determining that callback exception occurs in the first method channel uniquely indicated by the first method channel identifier;
the transceiver module is further configured to send the callback exception to the developer terminal device in the first method channel, so that the developer terminal device prompts the callback exception to the first method channel.
In one possible embodiment, the first request message further comprises a first method identification, the first method identification uniquely indicating the first method;
the first message processor is used for processing the request message transmitted by the first method channel by using a first method;
the first packet reply data is obtained after the first message processor processes the first request message by using the first method.
In one possible embodiment, the first time threshold corresponds to one to the first method channel;
the processing module is further configured to count N first moments when N first request messages are sent within a first time period through a first method channel, where N is an integer greater than or equal to 1;
the processing module is further used for counting N second moments when the N first packet data are received in the first time period through the first method channel;
the processing module is further used for determining N first time intervals based on the N first moments and the N second moments;
the processing module is further used for calculating the N first time intervals and determining a first time threshold;
the processing module is specifically configured to determine the first method channel identifier from the first request message if the first packet data is not received through the first method channel within a time duration exceeding a first time threshold corresponding to the first method channel after the first time.
In a possible embodiment, the transceiver module is further configured to send a second request message through a second method channel, where the second request message carries a second method channel identifier, the second method channel identifier uniquely indicates the second method channel, and the second method channel has an association relationship with a second message processor, and the second message processor is configured to process the request message transmitted by the second method channel;
the processing module is further configured to determine a third time when the second method channel sends the second request message;
the processing module is further configured to determine a second method channel identifier from the second request message if a second repackage data is not received through the second method channel within a time length exceeding a second time threshold after the third time, wherein the second repackage data is obtained after the second message processor processes the second request message;
and the processing module is also used for determining that callback exception occurs in the second method channel uniquely indicated by the second method channel identifier.
In a possible implementation manner, the processing module is further configured to count M fourth time instants at which M request messages are sent within a second time period, where the M request messages include the first request message and the second request message, the M fourth time instants include the first time instant and the third time instant, and M is an integer greater than 1;
the processing module is further used for counting M fifth moments of receiving the N echo data in a second time period, wherein the M echo data comprise first echo data and second echo data;
the processing module is further configured to determine M second time intervals based on the M fourth moments and the M fifth moments;
the processing module is further configured to calculate the M second time intervals, and determine a first time threshold and a second time threshold.
In a possible embodiment, the transceiver module is specifically configured to interrupt message transmission through the first method channel, and send a callback exception to the first method channel to the developer terminal device, so that the developer terminal device prompts the first method channel that the callback exception occurs;
or the like, or a combination thereof,
sending callback abnormity of the first method channel to developer terminal equipment, so that the developer terminal equipment prominently prompts that the callback abnormity of the first method channel occurs, wherein the prominence prompts comprise at least one of sound prompt, terminal equipment brightness, highlight display, bold display and enlarge display;
or the like, or, alternatively,
the method comprises the steps of generating a first exception log, and sending the first exception log to a developer terminal device, so that the developer terminal device prompts the first method channel that callback exception occurs through the first exception log, wherein the first exception log is used for indicating that callback exception occurs in the first method channel.
In a possible embodiment, the transceiver module is further configured to, after the processing module determines that the callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, send the first request message again through the first method channel;
the processing module is further configured to determine a sixth time at which the first method channel retransmits the first request message;
and the processing module is further configured to determine that the reason for the callback abnormality of the first method channel is a packet loss situation, if the first callback data is received through the first method channel within the duration of the first time threshold after the sixth time.
A third aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
A fourth aspect of the application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the steps of the method provided by the above aspects.
According to the technical scheme, the embodiment of the application has the following advantages:
in the embodiment of the application, a method for callback detection is provided, where a first request message is sent through a first method channel, where the first request message carries a first method channel identifier, the first method channel identifier uniquely indicates the first method channel, and the first method channel has a relationship with a first message processor, where the first message processor is configured to process a request message transmitted by the first method channel, and then determine a first time at which the first method channel sends the first request message, and when first callback data is not received through the first method channel within a time period exceeding a first time threshold after the first time, determine a first method channel identifier from the first request message, where the first callback data is obtained after the first message processor processes the first request message, thereby determining that a callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, and send the first method channel abnormality to a developer terminal device, so that the developer terminal device prompts that the first method channel has a callback abnormality. By the method, whether the callback data corresponding to the request message is received or not can be judged through the time threshold, and the method channel with callback abnormity is determined based on the method channel identifier, so that the accuracy of whether the callback is normal or not of the detection method channel is ensured, and the method channel with callback abnormity is reported, and the efficiency of processing the callback abnormity can be improved.
Drawings
FIG. 1 is a schematic diagram of an architecture of a callback detection system in an embodiment of the present application;
fig. 2 is a schematic structural diagram of generation of loopback data according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a callback detection method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating an embodiment of a callback detection method according to an embodiment of the present application;
fig. 5 is an interface schematic diagram for prominently prompting a callback exception of a first method channel according to the embodiment of the present application;
fig. 6 is a schematic structural diagram of a callback detection device according to an embodiment of the present application;
fig. 7 is a schematic frame diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a callback detection method and device, computer equipment and a storage medium, whether callback data corresponding to a request message is received or not is judged through a time threshold, and a method channel with callback abnormity is determined based on a method channel identifier, so that the accuracy of whether the detection method channel is normal or not is guaranteed, and the efficiency of processing callback abnormity can be improved by reporting the method channel with callback abnormity.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The Flutter technology is an extremely popular cross-platform technical scheme, and more development and products use the Flutter technology to realize development of Applications (APPs). Although Flutter is a very efficient cross-platform technology, implementation of part of functions still needs to depend on different capabilities of different platforms, for example, when device information is acquired, device information of Android (Android) devices and iOS devices have different defined device information, so communication between Flutter and a client is inevitable, communication between Flutter and the client is usually implemented through a Method Channel (Method Channel), methods called by the Method Channel are asynchronous, if a communication result is relied on in a certain Method, and a client implementation does not return correctly, a program is abnormal, and an incorrect callback of the asynchronous Method causes a Method Channel to be unable to release normally, thereby causing memory leakage, and therefore, how to detect whether the Method Channel makes a correct callback more accurately, and how to handle the problem of a callback abnormality.
Based on this, the embodiment of the application provides a callback detection method, which judges whether callback data corresponding to a request message is received or not through a time threshold, and determines a method channel with callback abnormality based on a method channel identifier, so as to ensure the accuracy of whether the callback is normal or not in the detection method channel, thereby improving the efficiency of processing the callback abnormality. The method and the device for detecting whether the callback is normal in the method channel are completed based on the Flutter technology, and therefore the problem that the program execution is abnormal due to the fact that the program is not executed according to the specified code flow caused by the fact that the communication method is not correctly wrapped can be effectively avoided. By processing the return packet in time, the method channel can be effectively released, and program memory leakage is avoided. Secondly, the method and the device can be applied to scenes in a program development stage, and can be used for informing a developer of possible problems of a program being developed by determining a method channel with callback exception, so that a plurality of exception errors can be effectively avoided before the product is online, and the reliability of the program product can be improved.
To facilitate understanding, some terms or concepts related to the embodiments of the present application are explained.
1. Flutter
The cross-platform mobile Interface (UI) framework of Flutter can quickly construct a high-quality native User Interface on a client (e.g., android or iOS).
2. Method Channel (Method Channel)
As can be seen from the foregoing explanation, flutterer provides a channel for communicating with the client, i.e., a method channel, for passing method calls. Then mutually appointing a Channel name and a specified Method name when using the Method Channel, thereby calling corresponding methods of different clients.
3. Back bag
The back packet refers to whether a return (return) statement exists in a corresponding method implementation of the client when the Flutter communicates with the client.
The callback detection system in the embodiment of the present application is described below. It is understood that the callback detection method is performed by the terminal device. Referring to fig. 1, fig. 1 is a schematic diagram of an architecture of a callback detection system in an embodiment of the present invention, and as shown in fig. 1, the callback detection system includes terminal devices and a server, and the terminal devices communicate with each other by scheduling of the server. Specifically, the terminal device sends a first request message through the first method channel, determines a first time when the first request message is sent by the first method channel, and does not receive first callback data through the first method channel within a time period exceeding a first time threshold after the first time, and determines a first method channel identifier from the first request message because the first callback data is obtained after processing the first request message, and thereby determines that callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, and sends the callback abnormality in the first method channel to the developer terminal device, so that the developer terminal device prompts that callback abnormality occurs in the first method channel.
The server related to the application can be an independent physical server, can also be a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, safety service, content Delivery Network (CDN), big data and an artificial intelligence platform. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, a smart television, and the like. And the terminal device and the server can communicate with each other through a wireless network, a wired network or a removable storage medium. Wherein the wireless network described above uses standard communication techniques and/or protocols. The wireless Network is typically the internet, but can be any Network including, but not limited to, bluetooth, local Area Network (LAN), metropolitan Area Network (MAN), wide Area Network (WAN), mobile, private, or any combination of virtual private networks. In some embodiments, custom or dedicated data communication techniques may be used in place of or in addition to the data communication techniques described above. The removable storage medium may be a Universal Serial Bus (USB) flash drive, a removable hard drive or other removable storage medium, and the like.
Although only five terminal devices and one server are shown in fig. 1, it should be understood that the example in fig. 1 is only used for understanding the present solution, and the number of the specific terminal devices and servers should be flexibly determined according to actual situations.
Since the present solution needs to transmit the request message and the packet data based on the method channel, a method for the client to process the request message to generate the packet data will be described below. Referring to fig. 2, fig. 2 is a schematic structural diagram of generating loopback data according to an embodiment of the present application, and fig. 2 is referred to. As shown in fig. 2 (a), the run (Dart) layer includes a method identifier of a run method, generated data and received callback data when callback is correct, and after the run of the method is completed, platform information including a channel identifier and a Native method (Native) layer is transmitted, so that the Native layer can obtain a view of the platform through a run time controller based on the platform information, wherein the platform includes android and iOS.
Based on this, there may be multiple method channels in one Flutter application, in this embodiment, taking one method channel of the android platform as an example, as shown in fig. 2 (B), each method channel may specify a uniquely corresponding method channel name when being created, each method channel has a different calling method, and each method channel has a uniquely corresponding message processor, and in this scheme, the method channel name is defined as a method channel identifier. Based on this, the different method channels are distinguished by the method channel identifier (i.e. the method channel name), and when the request message is sent from the Flutter side to the platform side through the method channel, the platform side finds the corresponding method channel and the message processor corresponding to the method channel according to the method channel identifier carried by the request message.
Second, a message Messenger (Binary Messenger) is introduced, which is a tool for the platform side to communicate with Flutter. When a method channel is initialized, a message handler for handling a request message transmitted through the method channel, which is a binary message handler, is registered in a message messenger in which a primary key of the message handler is a method channel identifier (method channel name). Therefore, when the Flutter end sends a request message to the client, the Flutter end transmits the request message to the message messenger, and the message messenger finds the corresponding message processor according to the method channel identifier carried by the request message to process the request message. Specifically, in the android client, the message messenger is specifically an interface. Whereas in an iOS client, the message messenger is a protocol. Secondly, since the message format of the received request message is usually binary data, the request message needs to be decoded into an identifiable request message by a message codec, and then the decoded request message is transmitted to a message processor for processing. And after the message processor finishes processing, returning a callback result to the request message through a callback function, encoding the callback result into binary format data through a coder-decoder to obtain the loopback data corresponding to the request message, and sending the loopback data to the Flutter end through a message messenger.
Further, the message codec is specifically a method codec (MethodCodec) used for codec between the data type and the binary for method invocation and result return. And the method handler (methodHandler) is used for method call, receiving the message of the call type, calling the corresponding method for processing the message once, and then returning the corresponding callback result. Secondly, based on the Flutter source code, the calling of the method channel is realized through a message messenger, so that the acquisition of parameters, results and time-consuming information of the calling of the method channel can be realized by performing interception processing at the starting position of the calling of the method and the packet returning processing position. By rewriting the message messenger class, the message communication information structure data is added, and the request data and the callback data are stored in the structure at the place of method calling and result processing, so as to complete callback detection in the embodiment.
For easy understanding, please refer to fig. 3, fig. 3 is a schematic flowchart of a method for callback detection according to an embodiment of the present application, and referring to fig. 3, a flow of the method for callback detection includes determining a method for processing a request message, determining whether callback data is received within a time threshold, encapsulating the callback data, storing the callback data in a cache, determining a method channel in which a callback exception occurs, and reporting the callback exception. The following will describe functions and flows of the respective parts, specifically:
in step A1, after the program is started, if there is a need to send a request message, a method for processing the request message, that is, a method for processing a message messenger introduced by the foregoing implementation principle, needs to be determined first. Based on this, the request message is sent to the client, and at this time, the request message includes a method identifier which uniquely indicates a method capable of processing the request message. Secondly, the request message also carries a method channel identifier, the method channel identifier uniquely indicates a method channel for transmitting the request message, the method channel has a correlation with the message processor, and the message processor is used for processing the request message transmitted by the method channel.
In step A2, it is determined whether the packet data corresponding to the request message is received within the time threshold. If yes, executing the step A3, otherwise, if no, executing the step A4.
In step A3, since the packet data corresponding to the request message can be received within the time threshold, which indicates that the method channel for transmitting the request message completes correct callback, the packet data corresponding to the request message is encapsulated at this time, and the encapsulated packet data is stored in a cache, specifically a disk cache.
It should be understood that, in practical applications, the detection of the packet data may be performed by using a multi-stage threshold, for example, when it is determined that the packet data that has not been received at the first time threshold is not determined to have a callback exception, but continues to wait, and when it is determined that the packet data that has not been received at the second time threshold is determined to have a callback exception, the second time threshold is greater than the first time threshold, so as to avoid that the packet data is transmitted too slowly due to channel blockage, and it is determined that the callback exception is mistaken.
In step A4, since the callback data corresponding to the request message can be received within the time threshold, which indicates that the method for transmitting the request message is abnormal in callback, the method channel for determining the callback abnormality is determined based on the method channel identifier carried in the request message.
In step A5, the method channel with callback exception is reported. The reporting mode can be that the message transmission through the method channel is directly interrupted, and then the reported method channel has callback exception. Or the callback exception occurs in the channel of the sending method to the developer terminal device, so that the callback exception occurs in the channel of the prominent prompt method of the developer terminal device, at this time, the prominent prompt includes at least one of a sound prompt, a terminal device bright light, a highlight display, a bold display and an enlarge display, so that a program developer can know which method channel has the callback exception in time based on the prominent prompt, and debugging is facilitated. Or, an exception log is generated and used for indicating that callback exception occurs in the method channel and reporting the exception log, at the moment, a developer can analyze the reason of the callback exception based on the reported exception log, further avoid the problem of exception occurrence and improve the reliability of the on-line program product.
With reference to the above description, a method for callback detection in the present application is described, please refer to fig. 4, where fig. 4 is a schematic diagram of an embodiment of a method for callback detection provided in the embodiment of the present application, and as shown in fig. 4, the method includes:
101. the method comprises the steps of sending a first request message through a first method channel, wherein the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates the source of the first request message, the first method channel and a first message processor have a correlation relationship, and the first message processor is used for processing the request message transmitted by the first method channel.
In this embodiment, the terminal device sends the first request message to the client side through the first method channel, where the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates a source of the first request message, the first method channel has a relationship with the first message processor, and the first message processor is configured to process the request message transmitted by the first method channel.
Specifically, as can be seen from the foregoing description, each method channel will specify a unique corresponding method channel name when being created, and each method channel has a unique corresponding message processor, but in this embodiment, the method channel name is defined as a method channel identifier, and different method channels are distinguished by the method channel identifier, for example, the method channel a is used for transmitting the request message a, and the method channel B is used for transmitting the request message B, then the transmission request message a may carry the method channel a (name), the transmission request message B may carry the method channel B (name), and the message processor a is used for processing the request message a transmitted by the method channel a, and the message processor B is used for processing the request message B transmitted by the method channel B.
In addition, the source of the first request message indicated by the first platform identifier in this embodiment specifically indicates whether the first request message is from an android platform or an iOS platform, and thus, it can also indicate whether the first method channel is a method channel of the android platform or a method channel of the iOS platform.
It should be understood that, in practical applications, the method channel identifier may also be other information, such as a unique letter, a unique number, or a combination of letters and numbers, as long as the method channel identifier can uniquely indicate one method channel, for example, the method channel identifier of the method channel a is "1", the method channel identifier of the method channel B is "2", then the request message a transmitted through the method channel a will carry the method channel identifier "1", and the request message B transmitted through the method channel B will carry the method channel identifier "2". The foregoing examples are only used for understanding the present solution, and the specific method channel identification and association relationship between the method channel and the message processor are not limited herein.
102. A first time at which the first method channel sends the first request message is determined.
In this embodiment, the terminal device determines a first time when the first method channel sends the first request message. Specifically, after the terminal device sends the first request message based on step 101, a timeout detection timer corresponding to the first method channel is started, and at this time, the initial time (0 s) of the timeout detection timer is the first time when the first request message is sent through the first method channel. Based on this, the terminal device will determine whether the first callback data obtained after processing the first request message is received through the first method channel within a time length exceeding the first time threshold after the first time, and if so, the specification has no callback problem. If not, go to step 103.
103. If the first method channel identifier is not received through the first method channel within a time length exceeding a first time threshold after the first time, determining a first method channel identifier from the first request message, wherein the first echo data is obtained after the first message processor processes the first request message.
In this embodiment, since the first packet data is not received through the first method channel within a time period exceeding the first time threshold after the first time, and the first packet data is obtained after the first message processor processes the first request message, a method for how to process the request message by the message processing to obtain the packet data is similar to that described above, and is not described here again. Based on step 101, the first method channel identifier carried in the first request message is known, so that the terminal device can determine the first method channel identifier from the first request message.
For example, the first time threshold is 10 seconds(s), and after the terminal device sends the first request message, the callback exception may be considered to occur if the first callback data is not received for more than 10s, so as to determine the first method channel identifier. It should be understood that the aforementioned first time threshold is determined experimentally and/or based on statistics of a large amount of data, and the value of the first time threshold is not specifically limited herein.
104. And determining that callback exception occurs in the first method channel uniquely indicated by the first method channel identifier.
In this embodiment, since the method channel identifier can uniquely indicate one method channel, the terminal device can determine that the callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier. Secondly, because the first request message further includes the first platform identifier, the first platform identifier may be specifically indicated to indicate that the source of the first request message has a callback exception, that is, specifically, the first method channel of the android platform has a callback exception, or the first method channel of the iOS platform has a callback exception.
105. And sending callback exception of the first method channel to the developer terminal equipment, so that the developer terminal equipment prompts the callback exception of the first method channel.
In this embodiment, the terminal device sends the callback exception to the developer terminal device in the first method channel, so that the developer terminal device prompts the callback exception in the first method channel. Specifically, when the terminal device is in a troubleshooting (debug) mode, the program developer is prompted by the developer terminal device to process the problem that the callback is abnormal in the first method channel through the developer terminal device, or when the program operated by the terminal device is an outgoing formal version, the developer can analyze the reason that the callback is abnormal based on the reported abnormal log, further avoid the abnormal problem, and improve the reliability of the on-line program product.
In the embodiment of the application, a callback detection method is provided, and by adopting the above manner, whether callback data corresponding to a request message is received or not is judged through a time threshold, and a method channel with callback abnormality is determined based on a method channel identifier, so that the accuracy of whether the callback is normal or not of the detection method channel is ensured, and then the method channel with callback abnormality is reported, so that the efficiency of processing the callback abnormality can be improved.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the callback detection method provided in the embodiment of the present application, the first request message further includes a first method identifier, and the first method identifier uniquely indicates the first method;
the first message processor is used for processing the request message transmitted by the first method channel by using a first method;
the first packet reply data is obtained after the first message processor processes the first request message by using the first method.
In this embodiment, the first request message sent by the terminal device further includes a first method identifier, where the first method identifier uniquely indicates a first method, and the first method is a method for processing the first request message. Based on this, when receiving the first request message, the client can determine the first method through the carried first method identifier, so that the first message processor can process the request message transmitted by the first method channel by using the first method to obtain the first packet data.
In the embodiment of the application, a callback detection method is provided, so that a message processor in a client can process a request message by adopting an accurate method through a method identifier carried in the request message, and the reliability of message processing and the accuracy of generated callback data are ensured.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the callback detection method provided in the embodiment of the present application, the first time threshold corresponds to the first method channel one to one;
the callback detection method further comprises the following steps:
counting N first moments when N first request messages are sent in a first time period through a first method channel, wherein N is an integer greater than or equal to 1;
counting N second moments when N first packet data are received in a first time period through a first method channel;
determining N first time intervals based on the N first moments and the N second moments;
calculating N first time intervals to determine a first time threshold;
if the first packet data is not received through the first method channel within a time length exceeding a first time threshold after the first time, determining a first method channel identifier from the first request message, specifically including:
if the first packet data is not received through the first method channel within a time length exceeding a first time threshold corresponding to the first method channel after the first time, determining the first method channel identifier from the first request message.
In this embodiment, the first time threshold corresponds to the first method channel one to one, that is, each method channel has a corresponding time threshold, and the time thresholds corresponding to different method channels may be the same or different. Based on this, how to determine the time threshold corresponding to the method channel will be described below, first, the terminal device counts N first time instants at which N first request messages are sent within a first time period through the first method channel, where N is an integer greater than or equal to 1, and counts N second time instants at which N first packet reply data are received within the first time period through the first method channel, and at this time, each first request message can be normally recalled for processing, then, N first time intervals can be determined based on the N first time instants and the N second time instants, and then, N first time intervals are determined based on the N first time instants and the N second time instants.
Exemplarily, taking the first time period as 1 minute as an example, if the terminal device counts 3 first time instants corresponding to the 3 first request messages sent in 1 minute, specifically, the first time instant a corresponding to the first request message a, the first time instant B corresponding to the first request message B, and the first time instant C corresponding to the first request message C. And then counting 3 second moments corresponding to the 3 first packet data received within 1 minute, wherein the first packet data A is obtained after processing the first request message A, the first packet data B is obtained after processing the first request message B, and the first packet data C is obtained after processing the first request message C, so that the second moment A corresponding to the first packet data A, the second moment B corresponding to the first packet data B and the second moment C corresponding to the first packet data C are counted. Based on this, based on the 3 first times and the 3 second times, the time interval a between the sending of the first request message a and the receiving of the first packet data a (i.e. the second time a — the first time a) can be determined, and similarly, the time interval B between the sending of the first request message B and the receiving of the first packet data B (i.e. the second time B — the first time B) and the time interval C between the sending of the first request message C and the receiving of the first packet data C (i.e. the second time C — the first time C) can also be determined. It should be understood that the aforementioned first time period is determined experimentally and/or based on statistics of a large amount of data, and the value of the first time period is not specifically limited herein.
Further, N first time intervals are calculated, and a first time threshold is determined. The calculation method may be an average value of the N first time intervals, or a median or other mathematical calculation, and is not limited herein. Therefore, when the terminal device does not receive the first callback data through the first method channel within a time length exceeding the first time threshold corresponding to the first method channel after the first time, the first method channel identifier can be determined from the first request message based on the similar manner, and the first method channel with callback abnormality is further determined.
In the embodiment of the application, a method for determining a first time threshold is provided, and an interval between a sending message and a receiving data is determined by counting the time when a method channel sends a request message and receives a packet data corresponding to the request message in a time period, so that the time threshold corresponding to the method channel can be determined, and the reliability of the scheme is improved.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the method for callback detection provided in the embodiment of the present application, the method for callback detection further includes:
sending a second request message through a second method channel, wherein the second request message carries a second method channel identifier, the second method channel identifier uniquely indicates the second method channel, the second method channel and a second message processor have a relationship, and the second message processor is used for processing the request message transmitted by the second method channel;
determining a third moment when the second method channel sends the second request message;
if the second repackaging data is not received through the second method channel within a time length exceeding a second time threshold value after the third time, determining a second method channel identifier from the second request message, wherein the second repackaging data is obtained after the second message processor processes the second request message;
and determining that callback exception occurs in the second method channel uniquely indicated by the second method channel identifier.
In this embodiment, the terminal device may further send a second request message to the client side through the second method channel, where the second request message carries a second method channel identifier, the second method channel identifier uniquely indicates the second method channel, the second method channel has a relationship with the second message processor, the second message processor is configured to process the request message transmitted by the second method channel, the second request message is similar to the first request message, and the second method channel identifier is similar to the first method channel identifier, which is not described herein again.
Further, the terminal device may further determine a third time when the second method channel sends the second request message. Specifically, after the terminal device sends the second request message, a timeout detection timer corresponding to the second method channel is started, and at this time, an initial time (0 s) of the timeout detection timer is a third time when the second request message is sent through the second method channel. Based on this, the terminal device will determine whether the second repackaging data obtained after processing the second request message is received through the second method channel within a time length exceeding the second time threshold after the third time, and if so, the specification has no callback problem. If not, the second method channel identifier carried by the second request message can be known based on the foregoing steps, so that the terminal device can determine the second method channel identifier from the second request message. And because the method channel identifier can uniquely indicate one method channel, the terminal device can determine that callback exception occurs in the second method channel uniquely indicated by the second method channel identifier.
Illustratively, the second time threshold is 10 seconds(s), and after the terminal device sends the second request message, the callback exception may be considered to occur if the second callback data is not received for more than 10s, so as to determine the second method channel identifier. It should be understood that the aforementioned second time threshold may be the same as or different from the first time threshold, and the second time threshold also needs to be determined by experiment and/or statistics based on a large amount of data, and the value of the second time threshold is not specifically limited herein.
It should be understood that, in practical application, there may also be a plurality of other method channels, such as a third method channel and a fourth method channel, and the way of performing callback detection on each method channel is similar to that in the foregoing embodiments, and therefore, details are not described here again.
In the embodiment of the application, a callback detection method is provided, and whether a channel of another method receives callback data corresponding to a request message is judged through another time threshold value by adopting the above mode, so that the accuracy and flexibility of whether the channel of the detection method is normal callback are further ensured, and the efficiency of processing callback exception is improved.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the method for callback detection provided in the embodiment of the present application, the method for callback detection further includes:
counting M fourth moments when the M request messages are sent in a second time period, wherein the M request messages comprise a first request message and a second request message, the M fourth moments comprise a first moment and a third moment, and M is an integer greater than 1;
counting M fifth moments when the N echo data are received in a second time period, wherein the M echo data comprise first echo data and second echo data;
determining M second time intervals based on the M fourth moments and the M fifth moments;
and calculating the M second time intervals, and determining a first time threshold and a second time threshold.
In this embodiment, it can be known from the foregoing embodiment that the terminal device can record the corresponding time for sending the request message to different method channels. Based on this, the terminal device counts M fourth moments when the M request messages are sent in the second time period, where the M request messages include the first request message and the second request message, the M fourth moments include the first moment and the third moment, and M is an integer greater than 1, that is, the sending moments when the first method channel and the second method channel send the request messages in the second time period are counted. And the terminal device also counts M fifth moments when the N pieces of packet data are received in the second time period, wherein the M pieces of packet data comprise the first packet data and the second packet data, namely counts the receiving moments when the first method channel and the second method channel receive the packet data corresponding to each request message in the second time period.
Exemplarily, taking the second time period as 5 minutes as an example, if the terminal device counts 3 first time instants corresponding to the 3 first request messages sent through the first method channel within 5 minutes, specifically, a first time instant a corresponding to the first request message a, a first time instant B corresponding to the first request message B, and a first time instant C corresponding to the first request message C, and sends 2 third time instants corresponding to the 2 second request messages through the second method channel within 5 minutes, specifically, a third time instant a corresponding to the second request message a, and a third time instant B corresponding to the second request message B. As can be seen, the 5 fourth times include the first time a, the first time B, the first time C, the third time a, and the third time B.
Then, the second time a corresponding to the first packet data a, the second time B corresponding to the first packet data B, and the second time C corresponding to the first packet data C are counted, wherein the second time a corresponding to the first packet data a, the second time B corresponding to the first packet data B, and the second time C corresponding to the first packet data C are counted, and the first packet data a is obtained by processing the first request message a, the first packet data B, and the first packet data C are received within 5 minutes. And 2 receiving times corresponding to 2 second packet data received within 5 minutes are counted, wherein the second packet data A is obtained after the second request message A is processed, and the second packet data B is obtained after the second request message B is processed, so that the receiving time A corresponding to the second packet data A and the receiving time B corresponding to the second packet data B are counted. As can be seen, the 5 fifth times include the second time a, the second time B, the second time C, the reception time a, and the reception time B.
Further, the terminal device determines M second time intervals based on M fourth time instants and M fifth time instants. Illustratively, further to the above example, based on the 5 fourth times and the 5 fifth times, the time interval a between the sending of the first request message a and the receiving of the first packet data a (i.e., the second time a — the first time a) can be determined, and similarly, the time interval B between the sending of the first request message B and the receiving of the first packet data B (i.e., the second time B — the first time B) can be determined, the time interval C between the sending of the first request message C and the receiving of the first packet data C (i.e., the second time C — the first time C) can be determined, the time interval D between the sending of the second request message a and the receiving of the second packet data a (i.e., the receiving time a — the third time a) can be determined, and the time interval E between the sending of the second request message B and the receiving of the second packet data B (i.e., the receiving time B — the third time B) can be determined. It should be understood that the aforementioned second time period is determined experimentally and/or based on statistics of a large amount of data, and the value of the second time period is not specifically limited herein.
Still further, the terminal device calculates M second time intervals, and determines a first time threshold and a second time threshold, where the first time threshold and the second time threshold may be the same or different. The calculation method may be to obtain an average value, or a median, or other mathematical calculations of the M second time intervals to obtain the same time threshold value, and allocate the same time threshold value to the first method channel and the second method channel, or perform corresponding mathematical calculations on different method channels after obtaining the average value or the median of the M second time intervals, and the specific manner is not limited herein.
It should be understood that, in practical applications, since there may also be a plurality of other method channels, such as a third method channel and a fourth method channel, etc., the time when each method channel sends the request message and receives the packet data may be counted to complete the determination of the corresponding time threshold of the different method channels.
In the embodiment of the application, a method for determining a first time threshold and a second time threshold is provided, and the time of sending a request message and the time of receiving packet data corresponding to the request message in a time period are counted by different method channels to determine the interval between the sent message and the received data, so that the time thresholds corresponding to the different method channels can be determined, and the reliability and the flexibility of the scheme are improved.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the method for callback detection provided in the embodiment of the present application, the method for callback detection, which sends a callback exception to the first method channel to the developer terminal device, so that the developer terminal device prompts the first method channel that the callback exception occurs, specifically includes:
interrupting message transmission through the first method channel, and sending callback abnormity of the first method channel to the developer terminal equipment, so that the developer terminal equipment prompts the callback abnormity of the first method channel;
or the like, or a combination thereof,
sending callback abnormity of the first method channel to developer terminal equipment, so that the developer terminal equipment prominently prompts that the callback abnormity of the first method channel occurs, wherein the prominence prompts comprise at least one of sound prompt, terminal equipment brightness, highlight display, bold display and enlarge display;
or the like, or a combination thereof,
and generating a first exception log, and sending the first exception log to the developer terminal device, so that the developer terminal device prompts the first method channel to have callback exception through the first exception log, wherein the first exception log is used for indicating that the first method channel has callback exception.
In this embodiment, after determining that the callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, the terminal device sends the callback abnormality occurring in the first method channel to the developer terminal device, so that the developer terminal device prompts that the callback abnormality occurs in the first method channel. Specifically, if the terminal device is in a troubleshooting (debug) mode, after determining that a callback abnormality occurs in a first Method channel uniquely indicated by a first Method channel identifier, the terminal device interrupts message transmission through the first Method channel, collects the first Method channel identifier, the first Method identifier, a Method Name and platform (platform) information (platform information is specifically android or iOs), and sends the callback abnormality in the first Method channel to the developer terminal device, so that the developer terminal device prompts the callback abnormality in the first Method channel.
Or after determining that the callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, the terminal device sends the callback abnormality occurring in the first method channel to the developer terminal device, so that the developer terminal device prominently prompts that the callback abnormality occurs in the first method channel. Specifically, if the program run by the terminal device is a non-outgoing version, the information of the method channel with the callback exception is prominently prompted on the developer terminal device, so that a program developer can know which method channel has the callback exception in time based on the prominence prompt, and debugging is facilitated. For easy understanding, please refer to fig. 5, where fig. 5 is an interface schematic diagram of the first method channel for highlighting and prompting the callback abnormality, provided in the embodiment of the present application, and as shown in fig. 5, B1 indicates that the callback abnormality occurs in the first method channel. Based on this, fig. 5 (a) shows an interface diagram showing the callback exception B1 occurring in the first method channel in an enlarged manner for the terminal device, fig. 5 (B) shows an interface diagram showing the callback exception B1 occurring in the first method channel in a highlighted manner for the terminal device, and fig. 5 (C) shows an interface diagram showing the callback exception B1 occurring in the first method channel in an enlarged manner for the terminal device. It should be understood that the example in fig. 5 is only used for understanding the present solution, and the purpose of highlighting the callback abnormality of the first method channel is to enable a manager to determine that the callback abnormality of the first method channel occurs more quickly, so in practical applications, the highlighting prompt may also be a sound prompt, a terminal device is bright, a special effect display, an oblique display, and the like, so that a program developer can know which method channel has the callback abnormality based on the highlighting prompt in time, and the description is not exhaustive here.
Or after determining that the callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, the terminal device sends the callback abnormality occurring in the first method channel to the developer terminal device, so that the developer terminal device prompts that the callback abnormality occurs in the first method channel. Specifically, if the program run by the terminal device is an outgoing formal version, a first abnormal log capable of indicating that the callback abnormality occurs in the first method channel needs to be generated and reported, and at this time, a developer can analyze the reason of the callback abnormality based on the reported abnormal log, so that the abnormal problem is further avoided, and the reliability of the program product on line can be improved.
In the embodiment of the application, a method for reporting callback exceptions is provided, and flexibility of the scheme can be improved by reporting callback exceptions in various modes. Secondly, a program developer can know which method channel has callback abnormity in time based on the prominent prompt so as to debug the program, and can analyze the reason of the callback abnormity based on the reported abnormity log so as to further avoid the abnormity problem and improve the reliability of the on-line program product.
Optionally, on the basis of the embodiment corresponding to fig. 4, in an optional embodiment of the method for callback detection provided in the embodiment of the present application, after it is determined that a callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, the method for callback detection further includes:
resending the first request message through the first method channel;
determining a sixth moment when the first method channel sends the first request message again;
and if the first callback data is received through the first method channel within the time length of the first time threshold after the sixth moment, determining that the reason of callback abnormity of the first method channel is a packet loss situation.
In this embodiment, after determining that the callback abnormality occurs in the first method channel uniquely indicated by the first method channel identifier, the terminal device may be a packet loss situation occurring in the process of sending the first request message, or an abnormal callback occurs, so that the terminal device may also send the first request message again through the first method channel, and determine a sixth time when the first method channel sends the first request message again, and if the first callback data is received through the first method channel within the duration of the first time threshold after the sixth time, determine that the reason why the callback abnormality occurs in the first method channel is the packet loss situation at this time. If the first callback data is not received through the first method channel after the sixth time within the duration of the first time threshold, it is determined that the reason why the callback abnormality occurs in the first method channel is that the callback is not normal, and reporting is performed based on a similar manner of the foregoing embodiment.
In the embodiment of the application, a callback detection method is provided, and the reason causing the return packet exception is determined by retransmitting the request message again, so that the efficiency of processing the return packet exception is further improved on the basis of ensuring the accuracy of whether the callback is normal in a channel of the detection method.
Fig. 6 is a schematic structural diagram of a callback detection device provided in an embodiment of the present application, and as shown in fig. 6, the callback detection device 500 includes:
the transceiver module 501 is configured to send a first request message through a first method channel, where the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates a source of the first request message, the first method channel has an association relationship with a first message processor, and the first message processor is configured to process the request message transmitted by the first method channel;
a processing module 502, configured to determine a first time at which the first method channel sends the first request message;
the processing module 502 is further configured to determine a first method channel identifier from the first request message if the first packet data is not received through the first method channel within a time period exceeding a first time threshold after the first time, where the first packet data is obtained after the first message processor processes the first request message;
the processing module 502 is further configured to determine that a callback exception occurs in the first method channel uniquely indicated by the first method channel identifier.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in this embodiment of the application, the first request message further includes a first method identifier, and the first method identifier uniquely indicates the first method;
the first message processor is used for processing the request message transmitted by the first method channel by using a first method;
the first packet reply data is obtained after the first message processor processes the first request message by using the first method.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in the embodiment of the present application, the first time threshold corresponds to the first method channels one to one;
the processing module 502 is further configured to count N first time instants at which N first request messages are sent within a first time period through a first method channel, where N is an integer greater than or equal to 1;
the processing module 502 is further configured to count N second moments when the N first packet data are received in the first time period through the first method channel;
the processing module 502 is further configured to determine N first time intervals based on the N first time instants and the N second time instants;
the processing module 502 is further configured to calculate N first time intervals, and determine a first time threshold;
the processing module 502 is specifically configured to determine the first method channel identifier from the first request message if the first packet data is not received through the first method channel within a time period after the first time exceeds a first time threshold corresponding to the first method channel.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in this embodiment of the present application, the transceiver module 501 is further configured to send a second request message through a second method channel, where the second request message carries a second method channel identifier, the second method channel identifier uniquely indicates the second method channel, and the second method channel and the second message processor have an association relationship, and the second message processor is configured to process the request message transmitted by the second method channel;
the processing module 502 is further configured to determine a third time when the second method channel sends the second request message;
the processing module 502 is further configured to determine a second method channel identifier from the second request message if the second repackaging data is not received through the second method channel within a time duration exceeding the second time threshold after the third time, where the second repackaging data is obtained after the second message processor processes the second request message;
the processing module 502 is further configured to determine that a callback exception occurs in the second method channel uniquely indicated by the second method channel identifier.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in this embodiment of the present application, the processing module 502 is further configured to count M fourth time instants at which M request messages are sent within a second time period, where the M request messages include the first request message and the second request message, the M fourth time instants include the first time instant and the third time instant, and M is an integer greater than 1;
the processing module 502 is further configured to count M fifth moments when the N pieces of packet data are received in the second time period, where the M pieces of packet data include the first packet data and the second packet data;
the processing module 502 is further configured to determine M second time intervals based on the M fourth time instants and the M fifth time instants;
the processing module 502 is further configured to calculate M second time intervals, and determine a first time threshold and a second time threshold.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in this embodiment of the present application, the transceiver module 501 is further configured to, after the processing module 502 determines that a callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, interrupt message transmission through the first method channel, and report that a callback exception occurs in the first method channel;
or the like, or a combination thereof,
the transceiver module 501 is further configured to send the callback exception occurring in the first method channel to the developer terminal device after the processing module 502 determines that the callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, so that the developer terminal device prominently prompts that the callback exception occurs in the first method channel, where the prominence prompts include at least one of a sound prompt, a terminal device bright light, a highlight display, a bold display, and a highlight display;
or the like, or, alternatively,
the transceiver module 501 is further configured to generate a first exception log after the processing module 502 determines that the callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, and report the first exception log, where the first exception log is used to indicate that the callback exception occurs in the first method channel.
Optionally, on the basis of the embodiment corresponding to fig. 6, in another embodiment of the callback detection apparatus 500 provided in this embodiment of the present application, the transceiver module 501 is further configured to, after the processing module 502 determines that a callback exception occurs in the first method channel uniquely indicated by the first method channel identifier, send the first request message again through the first method channel;
the processing module 502 is further configured to determine a sixth time at which the first method channel retransmits the first request message;
the processing module 502 is further configured to determine that the reason that the callback abnormality occurs in the first method channel is a packet loss situation, if the first callback data is received through the first method channel within the duration of the first time threshold after the sixth time.
An embodiment of the present application further provides another loopback detection device, where the loopback detection device is deployed in a terminal device, and fig. 7 is a block diagram illustrating a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Referring to fig. 7, the handset includes: radio Frequency (RF) circuitry 1110, memory 1120, input unit 1130, display unit 1140, sensors 1150, audio circuitry 1160, wireless fidelity (WiFi) module 1170, processor 1180, and power supply 1190. Those skilled in the art will appreciate that the handset configuration shown in fig. 7 is not intended to be limiting and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 7:
RF circuit 1110 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink messages from a base station and then processing the received downlink messages to processor 1180; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuit 1110 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 1110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), long Term Evolution (LTE), email, short Messaging Service (SMS), etc.
The memory 1120 may be used to store software programs and modules, and the processor 1180 may execute various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1120. The memory 1120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, etc. Further, the memory 1120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1130 may be used to receive input numeric or character information and generate key signal inputs related to object settings and function control of the cellular phone. Specifically, the input unit 1130 may include a touch panel 1131 and other input devices 1132. Touch panel 1131, also referred to as a touch screen, can collect touch operations of an object on or near the touch panel 1131 (e.g., operations of the object on or near touch panel 1131 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 1131 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of an object, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1180, and receives and executes commands sent by the processor 1180. In addition, the touch panel 1131 can be implemented by using various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1130 may include other input devices 1132 in addition to the touch panel 1131. In particular, other input devices 1132 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1140 may be used to display information input by or provided to the object and various menus of the cellular phone. The Display unit 1140 may include a Display panel 1141, and optionally, the Display panel 1141 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, touch panel 1131 may cover display panel 1141, and when touch operation is detected on or near touch panel 1131, the touch operation is transmitted to processor 1180 to determine the type of touch event, and then processor 1180 provides corresponding visual output on display panel 1141 according to the type of touch event. Although in fig. 7, touch panel 1131 and display panel 1141 are shown as two separate components to implement the input and output functions of the mobile phone, in some embodiments, touch panel 1131 and display panel 1141 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1141 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1141 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 1160, speakers 1161, and microphone 1162 may provide an audio interface between the subject and the handset. The audio circuit 1160 may transmit the electrical signal converted from the received audio data to the speaker 1161, and convert the electrical signal into a sound signal for output by the speaker 1161; on the other hand, the microphone 1162 converts the collected sound signals into electrical signals, which are received by the audio circuit 1160 and converted into audio data, which are then processed by the audio data output processor 1180, and then transmitted to, for example, another cellular phone via the RF circuit 1110, or output to the memory 1120 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the cell phone can help the object to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 1170, and provides wireless broadband internet access for the object. Although fig. 7 shows a WiFi module 1170, it is understood that it does not belong to a necessary component of the handset.
The processor 1180 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1120 and calling data stored in the memory 1120. Optionally, processor 1180 may include one or more processing units; preferably, the processor 1180 may integrate an application processor, which mainly handles operating systems, object interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated within processor 1180.
The phone also includes a power supply 1190 (e.g., a battery) for powering the various components, and preferably, the power supply may be logically connected to the processor 1180 via a power management system, so that the power management system may manage charging, discharging, and power consumption management functions.
Although not shown, the mobile phone may further include a camera, a bluetooth module, and the like, which are not described herein.
In the embodiment of the present application, the processor 1180 included in the terminal is configured to execute the embodiment shown in fig. 4 and the respective embodiments corresponding to fig. 4.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the steps performed by the terminal device in the method described in the foregoing embodiment shown in fig. 4.
An embodiment of the present application further provides a computer program product including a program, which, when running on a computer, causes the computer to execute the steps performed by the terminal device in the method described in the foregoing embodiment shown in fig. 4.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, at least two units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on at least two network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for callback detection, comprising:
intercepting processing is carried out at a method calling starting position and a packet returning processing position corresponding to the first method channel based on the Flutter source code;
sending a first request message through a first method channel, wherein the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates a source of the first request message, the first method channel has an association relationship with a first message processor, and the first message processor is configured to process the request message transmitted by the first method channel;
determining a first moment when the first method channel sends the first request message through the interception processing;
acquiring first packet data received by the first method channel through the interception processing, and if the first packet data is not received by the first method channel within a time length exceeding a first time threshold after the first time, determining a first method channel identifier from the first request message, wherein the first packet data is obtained after the first message processor processes the first request message;
determining that callback exception occurs in the first method channel uniquely indicated by the first method channel identifier;
and sending the callback abnormity of the first method channel to developer terminal equipment, so that the developer terminal equipment prompts the callback abnormity of the first method channel.
2. The method of claim 1, wherein the first request message further comprises a first method identification, and wherein the first method identification uniquely indicates the first method;
the first message processor is used for processing the request message transmitted by the first method channel by using the first method;
the first packet reply data is obtained after the first message processor processes the first request message by using the first method.
3. The method of claim 2, wherein the first time threshold corresponds to the first method channel one-to-one;
the method further comprises the following steps:
counting N first moments when N first request messages are sent in a first time period through the first method channel, wherein N is an integer greater than or equal to 1;
counting N second moments when N first packet data are received in a first time period through the first method channel;
determining N first time intervals based on the N first moments and the N second moments;
calculating the N first time intervals, and determining the first time threshold;
if the first packet data is not received through the first method channel within a time period exceeding a first time threshold after the first time, determining the first method channel identifier from the first request message, including:
if the first echo data is not received through the first method channel within a time length exceeding a first time threshold corresponding to the first method channel after the first time, determining the first method channel identifier from the first request message.
4. The method of claim 1, further comprising:
sending a second request message through a second method channel, wherein the second request message carries a second method channel identifier, the second method channel identifier uniquely indicates the second method channel, the second method channel has an association relationship with a second message processor, and the second message processor is configured to process the request message transmitted by the second method channel;
determining a third moment when the second method channel sends the second request message;
if a second repackaging data is not received through the second method channel within a time length exceeding a second time threshold after the third time, determining a second method channel identifier from the second request message, wherein the second repackaging data is obtained after the second message processor processes the second request message;
and determining that the callback exception occurs in the second method channel uniquely indicated by the second method channel identifier.
5. The method of claim 4, further comprising:
counting M fourth moments when M request messages are sent in a second time period, wherein the M request messages comprise the first request message and the second request message, the M fourth moments comprise the first moment and the third moment, and M is an integer greater than 1;
counting M fifth moments when N loopback data are received in a second time period, wherein the M loopback data comprise the first loopback data and the second loopback data;
determining M second time intervals based on the M fourth moments and the M fifth moments;
and calculating the M second time intervals, and determining the first time threshold and the second time threshold.
6. The method of claim 1, wherein the sending the callback exception to the first method channel to the developer terminal device, so that the developer terminal device prompts the first method channel for the callback exception comprises:
interrupting the message transmission through the first method channel, and sending the callback exception of the first method channel to the developer terminal equipment, so that the developer terminal equipment prompts the callback exception of the first method channel;
or the like, or, alternatively,
sending the callback abnormity of the first method channel to developer terminal equipment, so that the developer terminal equipment prominently prompts the callback abnormity of the first method channel, wherein the prominence prompts comprise at least one of sound prompt, terminal equipment brightness, highlight display, bold display and enlarge display;
or the like, or, alternatively,
generating a first exception log, and sending the first exception log to the developer terminal device, so that the developer terminal device prompts the first method channel that the callback exception occurs through the first exception log, wherein the first exception log is used for indicating that the callback exception occurs in the first method channel.
7. The method of claim 1, wherein after said determining that a callback exception occurred to said first method channel uniquely indicated by said first method channel identification, said method further comprises:
resending the first request message through the first method channel;
determining a sixth moment when the first method channel sends the first request message again;
and if the first callback data is received through the first method channel within the time length of the first time threshold after the sixth moment, determining that the reason of the callback abnormality of the first method channel is a packet loss condition.
8. The callback detection device is characterized in that the callback detection device is used for carrying out interception processing at a method calling starting position and a packet returning processing position corresponding to a first method channel based on a Flutter source code; the callback detection device comprises:
the receiving and sending module is configured to send a first request message through a first method channel, where the first request message carries a first method channel identifier and a first platform identifier, the first method channel identifier uniquely indicates the first method channel, the first platform identifier indicates a source of the first request message, and the first method channel and a first message processor have an association relationship, and the first message processor is configured to process a request message transmitted by the first method channel;
the processing module is used for determining a first moment when the first method channel sends the first request message through the interception processing;
the processing module is further configured to obtain, through the interception processing, first packet reply data received by the first method channel, and determine, if the first packet reply data is not received through the first method channel within a duration exceeding a first time threshold after the first time, the first method channel identifier from the first request message, where the first packet reply data is obtained after the first message processor processes the first request message;
the processing module is further configured to determine that a callback exception occurs in the first method channel uniquely indicated by the first method channel identifier;
the transceiver module is further configured to send the callback exception to the developer terminal device in the first method channel, so that the developer terminal device prompts the callback exception in the first method channel.
9. A computer device, comprising: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is configured to execute a program in the memory to implement the method of any one of claims 1 to 7;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 7.
CN202111093040.1A 2021-09-17 2021-09-17 Callback detection method and device, computer equipment and storage medium Active CN113810249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111093040.1A CN113810249B (en) 2021-09-17 2021-09-17 Callback detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111093040.1A CN113810249B (en) 2021-09-17 2021-09-17 Callback detection method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113810249A CN113810249A (en) 2021-12-17
CN113810249B true CN113810249B (en) 2022-10-21

Family

ID=78939770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111093040.1A Active CN113810249B (en) 2021-09-17 2021-09-17 Callback detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113810249B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117239937B (en) * 2023-11-10 2024-01-30 深圳海辰储能科技有限公司 Data interaction method and device of battery management system and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108541009A (en) * 2018-06-28 2018-09-14 维沃移动通信有限公司 A kind of detection method and terminal device of communications status
CN110691136B (en) * 2019-09-29 2022-01-21 广州华多网络科技有限公司 Data interaction method and device, electronic equipment and storage medium
CN110717128B (en) * 2019-10-18 2021-02-09 腾讯科技(深圳)有限公司 Method, device, terminal and storage medium for processing in-application webpage
CN111309606B (en) * 2020-02-10 2024-01-19 广州虎牙科技有限公司 Page exception handling method and device, computer equipment and storage medium
CN113076209B (en) * 2021-06-08 2021-08-17 贝壳技术有限公司 Communication method, communication device, electronic device and storage medium

Also Published As

Publication number Publication date
CN113810249A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN106557407B (en) Method and device for monitoring equipment load
CN108268366B (en) Test case execution method and device
CN106302938B (en) Communication event processing method and device
CN106649126B (en) Method and device for testing application program
CN107465841B (en) Fault information reporting method and terminal
CN108446211B (en) Browser exception collection method and device, mobile terminal and storage medium
WO2016082109A1 (en) User equipment power management method and power management device
CN107888550B (en) Performance index data acquisition method and device and strategy sending method and device
CN111340587B (en) Virtual commodity management method and related device
CN106294108B (en) Application program testing method and device
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
CN107104763B (en) Method and device for setting timeout retransmission duration
CN107360179B (en) Risk information sharing method, terminal and computer readable storage medium
CN111273955B (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN111104180B (en) Application program optimization method and device, storage medium and electronic equipment
CN113810249B (en) Callback detection method and device, computer equipment and storage medium
CN110413497B (en) Abnormality monitoring method, abnormality monitoring device, terminal device and computer-readable storage medium
CN107066374B (en) Data processing method and mobile terminal
CN111475359A (en) System testing method, device and storage medium under multi-message interaction scene
CN106294087B (en) Statistical method and device for operation frequency of business execution operation
CN106970859B (en) Method and device for backing up and recovering offline mail
CN116468382A (en) RPA robot flow management method, device, equipment and storage medium
CN110908586A (en) Keyboard display method and device and terminal equipment
WO2019071611A1 (en) Fault processing method for terminal device and terminal device
CN115118636A (en) Method and device for determining network jitter state, electronic equipment and storage medium

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