Application program testing exception analysis method and device

By analyzing and analyzing the application's service call information and automatically identifying and pushing test exceptions, the problems of code invasiveness and low analysis efficiency caused by logging methods in the existing technology are solved, and efficient test exception analysis is achieved.

CN113094269BActive Publication Date: 2025-03-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110386813.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-12
Publication Date
2025-03-07
Estimated Expiration
2041-04-12

AI Technical Summary

Technical Problem

Existing application testing methods rely on logging, resulting in strong code invasiveness and low error analysis efficiency, especially in the event of occasional errors, which are difficult to reproduce and analyze.

Method used

By obtaining the original data input and output by the application through the network port, the service call information is obtained and exception analysis is performed. If there is an exception, alarm information is formed and transmitted to the developer terminal.

Benefits of technology

It realizes automatic identification and data push of application test exceptions, improves testing efficiency, reduces developer analysis costs and manual intervention, and can quickly locate the causes of errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113094269B_ABST
    Figure CN113094269B_ABST
Patent Text Reader

Abstract

The present invention provides an application test exception analysis method and device, which can be used in the field of artificial intelligence technology. The method comprises: obtaining original data input and output by the application through a network port; parsing the original data to obtain service call information of the application; performing exception analysis on the service call information, and if an exception exists, forming an alarm message according to the service call information, and transmitting the alarm message to a developer terminal. The present invention automatically identifies application test exceptions and pushes data, thereby improving test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application testing technology, in particular to the field of artificial intelligence technology, and more particularly to an application testing anomaly analysis method and device. Background Art

[0002] In the current application testing process, when a business case error occurs during the test, log data is mainly generated by recording logs, and the log data is pushed to the log collection server, and then the developer goes to the log collection server to obtain the corresponding log data to analyze the test exception. Therefore, when the developer develops the application code, it is necessary to set the function of logging the input and output data of the software in the program, and then push the log data to the server of the log collection server through the log collection and push software. Then, when an error occurs when the developer executes the case during the application testing process, it is necessary to notify the corresponding developer so that the developer can find the relevant log data on the log collection server, analyze the input and output data, configuration files and relevant business data of the database at the time of the error to determine the cause of the test exception. This way of recording logs to files requires developers to merge the logging code with the required functional code, which has high development costs and mainly relies on the developer to record relevant logs when coding. When an application error occurs and the cause needs to be analyzed, the developer needs to go to the log collection server to check the relevant logs, and the overall troubleshooting process is inefficient. When the error is caused by the function of other developers called, it is particularly difficult to track and analyze the error. Therefore, if developers encounter some occasional errors when performing case testing, it will often lead to low R&D efficiency and leakage of occasional errors due to difficulty in reproducing the errors. Summary of the invention

[0003] In order to solve at least one of the above problems, one object of the present invention is to provide an application test exception analysis method, which automatically identifies application test exceptions and pushes data to improve test efficiency. Another object of the present invention is to provide an application test exception analysis device. Another object of the present invention is to provide a computer device. Another object of the present invention is to provide a readable medium.

[0004] In order to achieve the above objectives, the present invention discloses, on one hand, a method for analyzing application program test anomalies, comprising:

[0005] Get the raw data input and output of the application through the network port;

[0006] Parsing the original data to obtain service call information of the application program;

[0007] The service call information is analyzed for abnormalities, and if an abnormality exists, an alarm message is generated according to the service call information, and the alarm message is transmitted to the developer terminal.

[0008] Preferably, the obtaining of the original data input and output by the application through the network port specifically includes:

[0009] The Sidecar mode is used to obtain the raw data input and output by the application through the network port.

[0010] Preferably, obtaining the original data input and output by the application through the network port through the Sidecar mode specifically includes:

[0011] Determine the network port of the application according to the port configuration information of the application;

[0012] The input and output data on the network card corresponding to the network port are collected to obtain the original data of the application program.

[0013] Preferably, the parsing of the original data to obtain the application service call information specifically includes:

[0014] Parsing the original data according to a preset remote procedure call protocol to obtain all service call information;

[0015] The application program service calling information is obtained by filtering all the service calling information according to the configured program service information.

[0016] Preferably, the abnormality analysis of the service call information specifically includes:

[0017] The service call information is matched with preset service keywords and expected result information to determine whether the application program has an abnormality.

[0018] Preferably, if there is an abnormality, generating alarm information according to the service call information specifically includes:

[0019] If there is an abnormality, collect relevant service call information on the call link according to the service call information and the preset service call link;

[0020] Acquire log data of the application program according to the service call information of the application program and the related service call information;

[0021] The service call information of the application, the related service call information, the log data and the service configuration information are transmitted to the developer terminal.

[0022] Preferably, the service call information includes the service name of the service called by the application, the service method, the data type, whether a service error occurs, the request parameters and response data, the service call time, the service caller address and the service callee address.

[0023] The present invention also discloses an application program test abnormality analysis device, comprising:

[0024] A data acquisition module is used to acquire the raw data input and output by the application through the network port;

[0025] A data analysis module, used to parse the original data to obtain service call information of the application program;

[0026] The anomaly detection module is used to perform an anomaly analysis on the service call information. If an anomaly exists, an alarm message is generated according to the service call information, and the alarm message is transmitted to the developer terminal.

[0027] The present invention also discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.

[0028] When the processor executes the program, the method described above is implemented.

[0029] The present invention also discloses a computer readable medium having a computer program stored thereon.

[0030] When the program is executed by a processor, the method described above is implemented.

[0031] When the application is tested for a case, the present invention collects the raw data input and output by the application through the network port when providing services, and parses the raw data to determine the service call information of the application in the raw data. Then, the service call information automatically collected and analyzed is analyzed for exceptions to determine whether the application has an exception when calling the service. If there is an exception, an alarm message is formed based on the service call information and sent to the developer terminal, so that the developer can analyze the test exception of the application based on the alarm message. The present invention can automatically identify application execution exceptions, and automatically push data for application test exceptions, thereby improving test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0033] Figure 1 A flowchart showing a specific embodiment of the method for analyzing application program test anomalies of the present invention;

[0034] Figure 2 A flowchart showing a specific embodiment S110 of the application program test exception analysis method of the present invention;

[0035] Figure 3 A flowchart showing a specific embodiment S200 of the method for analyzing anomaly in application testing of the present invention;

[0036] Figure 4 A flowchart showing a specific embodiment S300 of the method for analyzing anomaly in application testing of the present invention;

[0037] Figure 5 A structural diagram showing a specific embodiment of the application program test abnormality analysis device of the present invention;

[0038] Figure 6 A schematic diagram showing the structure of a computer device suitable for implementing an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] It should be noted that the application test anomaly analysis method and device disclosed in the present application can be used in the field of artificial intelligence technology, and can also be used in any field outside the field of artificial intelligence technology. The application field of the application test anomaly analysis method and device disclosed in the present application is not limited.

[0041] In order to facilitate understanding of the technical solution provided by the present application, the relevant contents of the technical solution of the present application are first described below. The application test exception analysis method provided by the embodiment of the present invention aims at the shortcomings of the existing application test based on the log recording method, solves the problems of the strong intrusion of the log recording method to the code and the low efficiency of error analysis, and provides an application test exception analysis method, which is simple to implement and low in cost, and can greatly improve the efficiency of developers in analyzing program errors.

[0042] The application test exception analysis system provided by the embodiment of the present invention may include an application device, a test exception analysis apparatus, and a developer terminal.

[0043] The application device is provided with an application, which is configured to respond to a service call instruction of an external caller device and provide a service corresponding to the application to the external caller. When testing the application, the test case can be sent to the application device through the service call instruction by the external caller device for processing, and then passed through the test abnormality analysis device.

[0044] The test exception analysis device can obtain the original data input and output by the application through the network port; parse the original data to obtain the service call information of the application; perform exception analysis on the service call information, and if there is an exception, form an alarm information based on the service call information, and transmit the alarm information to the developer terminal. It should be noted that the test exception analysis device can be integrated on the application device that sets the application, or it can be set separately from the application device to achieve data interaction through a local area network or the Internet.

[0045] The developer terminal can receive the alarm information transmitted by the application test abnormality analysis device, and feed back the alarm information to the developer, so that the developer can analyze the abnormality of the application according to the alarm information and repair it.

[0046] The following takes the application test anomaly analysis device as an example to illustrate the implementation process of the application test anomaly analysis method provided by the embodiment of the present invention. It can be understood that the execution subject of the application test anomaly analysis method provided by the embodiment of the present invention includes but is not limited to the application test anomaly analysis device.

[0047] According to one aspect of the present invention, this embodiment discloses a method for analyzing application program test anomalies. Figure 1 As shown, in this embodiment, the method includes:

[0048] S100: Acquire original data input and output by the application through the network port.

[0049] S200: Parse the original data to obtain service call information of the application program.

[0050] S300: Performing an abnormality analysis on the service call information, if an abnormality exists, generating an alarm message according to the service call information, and transmitting the alarm message to a developer terminal.

[0051] When the application is tested for a case, the present invention collects the raw data input and output by the application through the network port when providing services, and parses the raw data to determine the service call information of the application in the raw data. Then, the service call information automatically collected and analyzed is analyzed for exceptions to determine whether the application has an exception when calling the service. If there is an exception, an alarm message is formed based on the service call information and sent to the developer terminal, so that the developer can analyze the test exception of the application based on the alarm message. The present invention can automatically identify application execution exceptions, and automatically push data for application test exceptions, thereby improving test efficiency.

[0052] In a preferred embodiment, the step S100 of obtaining the original data input and output by the application through the network port specifically includes:

[0053] S110: Obtain the raw data input and output by the application through the network port through the Sidecar mode.

[0054] Specifically, the Sidecar mode is a way to separate the application function from the application itself as a separate process. This mode allows the application to be added with multiple functions without intrusion, avoiding the need to add additional configuration code to the application to meet the needs of third-party components. In the software architecture, the sidecar is attached to the main application, that is, the application of the present application, or the parent application, to expand or enhance the functional characteristics, and the Sidecar is loosely coupled with the main application. In order to solve the problem that the existing application test is highly invasive to the application code by recording exceptions through logging, and also to solve the problem that the error analysis efficiency is low when the application test is abnormal due to the need to manually go to the log collection server to obtain log data. In this preferred embodiment, the status of the application when providing services to the outside during the case test is monitored through the Sidecar mode. Specifically, during the case test, the application will exchange data with the device of the external service caller through the network port on the device setting the application to provide the application service to the external service caller. Thus, the data exchange process between the application and the external service caller device through the network port can be recorded by a program written according to the Sidecar mode, that is, the data input and output of the application through the network port is obtained by the Sidecar mode to obtain the original data. Therefore, data analysis of the original data can determine whether there is an abnormality when the application provides services to the outside during the case test. Therefore, in this preferred embodiment, the abnormality analysis device can automatically detect whether there is an abnormality in the application during the case test, without the need for manual intervention by the developer, which can greatly improve the efficiency of the developer in analyzing application errors.

[0055] In a preferred embodiment, Figure 2 As shown, the S110 obtains the raw data input and output by the application through the network port through the Sidecar mode, which may specifically include:

[0056] S111: Determine the network port of the application according to the port configuration information of the application.

[0057] S112: Collecting the input and output data on the network card corresponding to the network port to obtain the original data of the application program.

[0058] Specifically, the normal operation of the application depends on the operating system on the application device. The operating system (operating system, referred to as OS) is a computer program that manages computer hardware and software resources. The operating system needs to handle basic tasks such as managing and configuring memory, determining the priority of system resource supply and demand, controlling input devices and output devices, operating networks and managing file systems. The application receives input data and outputs data to external devices through the network port of the operating system. Therefore, in this preferred embodiment, the network port for input and output data of the application can be obtained through the port configuration information of the application. According to the port information of the network port, the data input and output of the network port on the network card are collected to obtain the original data when the application is tested. In a specific example, the port configuration information includes the network port that provides or calls the service. For example, the port configuration information can be set to: dubbo.protocols.dubboprotocol.port=28080. Among them, the port number of the network port is 28080.

[0059] A network card is a piece of computer hardware that allows computers to communicate on a computer network. A network card is not an independent autonomous unit, but is controlled by a computer device and can be considered a semi-autonomous unit. When a network card receives an erroneous frame, it discards the frame without notifying the computer to which it is connected. When a network card receives a correct frame, it uses an interrupt to notify the computer and delivers it to the network layer in the protocol stack. When a computer wants to send an IP data packet, it is handed down by the protocol stack to the network card to be assembled into a frame and then sent to the local area network. For an application on an application device, the application receives data input from the network port corresponding to the application through the network card or sends data to the network port corresponding to the application. Usually, a network card corresponds to a network address (IP), and an IP corresponds to multiple network ports. Therefore, a network card has multiple network ports, so an application uses one or more network ports on the network card for data transmission. In order to obtain the input and output data of a specific application in a targeted manner, it is necessary to first determine the network port configured by the application, and filter the input and output data of the network port used by the application on the network card to obtain the original data of the application during case testing.

[0060] In a specific example, an application and an external device exchange data through the Transmission Control Protocol (TCP protocol). The TCP protocol is a connection-oriented, reliable, and byte-stream-based transport layer communication protocol. The TCP protocol is used for communication between applications. When an application wants to communicate with another application through the TCP protocol, it sends a communication request. This request must be sent to a specific address. After the two parties "handshake", that is, after the two applications establish communication, TCP will establish a full-duplex communication between the two applications. This full-duplex communication will occupy the communication line between the two computers until it is closed by one or both parties. According to the network port of the application, the input and output data related to the network port on the network card are obtained to obtain the original TCP data packet of the network port, that is, the original data.

[0061] In a preferred embodiment, Figure 3 As shown, the S200 parses the original data to obtain the application service call information, which specifically includes:

[0062] S210: Parsing the original data according to a preset remote procedure call protocol to obtain all service call information.

[0063] S220: Filter all the service call information according to the configured program service information to obtain the application program service call information.

[0064] Specifically, Remote Procedure Call (RPC) is simply a technology for solving remote call services, making it as convenient and transparent for service callers as calling local services. Currently popular open source RPC frameworks such as Alibaba's Dubbo, Facebook's Thrift, Google's gRPC, and Twitter's Finagle all have their own corresponding RPC protocols for interaction between various services. Thus, the captured raw data (e.g., TCP data packets) can be parsed according to the configured RPC protocol to obtain service call information. In a specific example, the service name, service method, data type, whether the service has an error, request parameters and response data, service call time, service caller address, and service callee address of the service called by the application can be obtained by parsing the raw data through a preset RPC protocol. Service call information such as information.

[0065] Furthermore, all service call information can be filtered according to the pre-configured program service information to obtain service call information related to the application program. For example, the service call information obtained by parsing can be filtered according to the configured service name and other program service information, and the service call information that needs to be processed configured by the program service information can be filtered out, so that the service call information required by the developer can be automatically obtained and filtered according to the developer configuration, thereby improving the application flexibility of the test exception analysis device and improving the development and testing efficiency of the developer.

[0066] In a preferred embodiment, the abnormality analysis of the service call information in S300 specifically includes:

[0067] S310: Match the service call information with preset service keywords and expected result information to determine whether the application has an abnormality.

[0068] Specifically, for service call information that needs to be judged as abnormal, the service call information can be matched according to preset service keywords and expected result information. For example, service keywords corresponding to process information formed during the application service process and expected result information corresponding to various result information that can be obtained after the application service is completed can be preset. Thus, by matching the analyzed service call information with service keywords and expected result information, the process information during the application test process and the result information obtained by the final operation can be determined. Thus, based on the matched process information and result information, it can be determined whether the application case test process is abnormal. Developers can further determine the abnormal situation of the application based on the matched process information and result information, and carry out targeted program repairs.

[0069] In a preferred embodiment, Figure 4 As shown, if there is an abnormality in S300, generating alarm information according to the service call information specifically includes:

[0070] S321: If there is an exception, collect relevant service calling information on the calling link according to the service calling information and the preset service calling link.

[0071] S322: Obtain log data of the application program according to the service call information of the application program and the related service call information.

[0072] S323: Transmitting the service call information of the application, the related service call information, the log data and the service configuration data to the developer terminal.

[0073] Specifically, when an application has an exception in the case test, it is necessary to feed back the relevant information during the application test to the developer, so that the developer can determine the program error of the application and correct it according to the test related information. In this preferred embodiment, the call link pre-configured by the application is obtained, and the call link is a service dependency link, including the service name, service upstream and downstream information and service corresponding developers of the services with mutual dependency on the link. In a specific example, service A depends on service B, service B depends on service C, and service C depends on service D. When the application calls service A, service A will call service B, service B will call service C, service C will call service D, and services A to service D will form a service call link. If a service in the call link has a problem, for example, service C has an exception during the test, the call link of the above services A to service D can be queried through the preset call link, and the service call information of the related services of service A, service B and service D on the call link is collected to collect all other related service call information on the call link.

[0074] Further, the relevant log data can be obtained from the log collection server according to the service call information and related service call information of the application, and more case test error field data can be obtained. Then, other relevant information of the application is sent to the developer terminal together with the service call information and log data, so that the developer terminal feeds back all relevant information of the application test to the developer for further analysis and judgment. It should be noted that the application usually logs the key steps of the service call and transmits them to the log collection server for storage, so that the relevant log data can be obtained from the log collection server. The application test exception of the present invention does not invade the application too much, and auxiliary and reference log data can be obtained through the conventional log recording function of the application itself. When the application itself does not log, log data may not be collected. That is, forming an alarm information according to the service call information may include the following steps: if there is an exception, collect the relevant service call information on the call link according to the service call information and the preset service call link. The service call information, related service call information and service configuration data of the application are transmitted to the developer terminal.

[0075] The service configuration information may include the application configuration file and service basic data. The application configuration file may include database configuration, service registration center configuration, and service call configuration of service name, version number, and number of parallel executions. Service basic data is the data required by the application to provide service runtime, that is, the preset application number and other application parameters.

[0076] In summary, the present invention provides an application test exception analysis method, which captures, analyzes and processes the service call data of the preset call link through multiple processes of data capture, data parsing, data filtering, data collation, data analysis and data push, realizes automatic identification and data push of application test exceptions, improves test efficiency, avoids the intrusion of captured error codes on related function codes, reduces the labor cost of capturing business case error sites, and allows developers to locate the cause of errors more quickly. The on-site information when the program runs abnormally is retained to a great extent, helping R&D personnel to identify and locate problems (especially occasional problems) in advance, which can help the project team improve the R&D quality of the project, try to locate and discover problems in the early stage, and reduce the risks brought by later program changes.

[0077] Based on the same principle, this embodiment also discloses an application test exception analysis device. Figure 5 As shown, in this embodiment, the device includes a data acquisition module 11, a data analysis module 12 and an abnormality detection module 13.

[0078] The data acquisition module 11 is used to acquire the original data input and output by the application program through the network port.

[0079] The data analysis module 12 is used to parse the original data to obtain the service call information of the application program.

[0080] The anomaly detection module 13 is used to perform an anomaly analysis on the service call information. If an anomaly exists, an alarm message is generated according to the service call information, and the alarm message is transmitted to the developer terminal.

[0081] When the application is tested for a case, the present invention collects the raw data input and output by the application through the network port when providing services, and parses the raw data to determine the service call information of the application in the raw data. Then, the service call information automatically collected and analyzed is analyzed for exceptions to determine whether the application has an exception when calling the service. If there is an exception, an alarm message is formed based on the service call information and sent to the developer terminal, so that the developer can analyze the test exception of the application based on the alarm message. The present invention can automatically identify application execution exceptions, and automatically push data for application test exceptions, thereby improving test efficiency.

[0082] In a preferred embodiment, the data acquisition module 11 is specifically used to acquire the original data input and output by the application through the network port through the Sidecar mode.

[0083] Specifically, the Sidecar mode is a way to separate the application function from the application itself as a separate process. This mode allows the application to be added with multiple functions without intrusion, avoiding the need to add additional configuration code to the application to meet the needs of third-party components. In the software architecture, the sidecar is attached to the main application, that is, the application of the present application, or the parent application, to expand or enhance the functional characteristics, and the Sidecar is loosely coupled with the main application. In order to solve the problem that the existing application test is highly invasive to the application code by recording exceptions through logging, and also to solve the problem that the error analysis efficiency is low when the application test is abnormal due to the need to manually go to the log collection server to obtain log data. In this preferred embodiment, the status of the application when providing services to the outside during the case test is monitored through the Sidecar mode. Specifically, during the case test, the application will exchange data with the device of the external service caller through the network port on the device setting the application to provide the application service to the external service caller. Thus, the data exchange process between the application and the external service caller device through the network port can be recorded by a program written according to the Sidecar mode, that is, the data input and output of the application through the network port is obtained by the Sidecar mode to obtain the original data. Therefore, data analysis of the original data can determine whether there is an abnormality when the application provides services to the outside during the case test. Therefore, in this preferred embodiment, the abnormality analysis device can automatically detect whether there is an abnormality in the application during the case test, without the need for manual intervention by the developer, which can greatly improve the efficiency of the developer in analyzing application errors.

[0084] In a preferred embodiment, the data acquisition module 11 can be further used to determine the network port of the application according to the port configuration information of the application, and collect the input and output data on the network card corresponding to the network port to obtain the original data of the application.

[0085] Specifically, the normal operation of the application depends on the operating system on the application device. The operating system (operating system, referred to as OS) is a computer program that manages computer hardware and software resources. The operating system needs to handle basic tasks such as managing and configuring memory, determining the priority of system resource supply and demand, controlling input devices and output devices, operating networks and managing file systems. The application receives input data and outputs data to external devices through the network port of the operating system. Therefore, in this preferred embodiment, the network port for input and output data of the application can be obtained through the port configuration information of the application. According to the port information of the network port, the data input and output of the network port on the network card are collected to obtain the original data when the application is tested. In a specific example, the port configuration information includes the network port that provides or calls the service. For example, the port configuration information can be set to: dubbo.protocols.dubboprotocol.port=28080. Among them, the port number of the network port is 28080.

[0086] A network card is a piece of computer hardware that allows computers to communicate on a computer network. A network card is not an independent autonomous unit, but is controlled by a computer device and can be considered a semi-autonomous unit. When a network card receives an erroneous frame, it discards the frame without notifying the computer to which it is connected. When a network card receives a correct frame, it uses an interrupt to notify the computer and delivers it to the network layer in the protocol stack. When a computer wants to send an IP data packet, it is handed down by the protocol stack to the network card to be assembled into a frame and then sent to the local area network. For an application on an application device, the application receives data input from the network port corresponding to the application through the network card or sends data to the network port corresponding to the application. Usually, a network card corresponds to a network address (IP), and an IP corresponds to multiple network ports. Therefore, a network card has multiple network ports, so an application uses one or more network ports on the network card for data transmission. In order to obtain the input and output data of a specific application in a targeted manner, it is necessary to first determine the network port configured by the application, and filter the input and output data of the network port used by the application on the network card to obtain the original data of the application during case testing.

[0087] In a specific example, an application and an external device exchange data through the Transmission Control Protocol (TCP protocol). The TCP protocol is a connection-oriented, reliable, and byte-stream-based transport layer communication protocol. The TCP protocol is used for communication between applications. When an application wants to communicate with another application through the TCP protocol, it sends a communication request. This request must be sent to a specific address. After the two parties "handshake", that is, after the two applications establish communication, TCP will establish a full-duplex communication between the two applications. This full-duplex communication will occupy the communication line between the two computers until it is closed by one or both parties. According to the network port of the application, the input and output data related to the network port on the network card are obtained to obtain the original TCP data packet of the network port, that is, the original data.

[0088] In a preferred embodiment, the data analysis module 12 is specifically used to parse the original data according to a preset remote procedure call protocol to obtain all service call information, and filter all service call information according to the configured program service information to obtain the application program service call information.

[0089] Specifically, Remote Procedure Call (RPC) is simply a technology for solving remote call services, making the service caller as convenient and transparent as calling local services. Currently popular open source RPC frameworks such as Alibaba's Dubbo, Facebook's Thrift, Google's gRPC, and Twitter's Finagle all have their own corresponding RPC protocols for interaction between various services. Thus, the captured raw data (for example, TCP data packets) can be parsed according to the configured RPC protocol to obtain service call information. By parsing the raw data through the preset RPC protocol, service call information including the service name, service method, data type, whether the service has an error, request parameters and response data, service call time, service caller address, and service callee address of the service called by the application can be obtained.

[0090] Furthermore, all service call information can be filtered according to the pre-configured program service information to obtain service call information related to the application program. For example, the service call information obtained by parsing can be filtered according to the configured service name and other program service information, and the service call information that needs to be processed configured by the program service information can be filtered out, so that the service call information required by the developer can be automatically obtained and filtered according to the developer configuration, thereby improving the application flexibility of the test exception analysis device and improving the development and testing efficiency of the developer.

[0091] In a preferred embodiment, the anomaly detection module 13 is specifically used to match the service call information with preset service keywords and expected result information to determine whether there is an anomaly in the application.

[0092] Specifically, for service call information that needs to be judged as abnormal, the service call information can be matched according to preset service keywords and expected result information. For example, service keywords corresponding to process information formed during the application service process and expected result information corresponding to various result information that can be obtained after the application service is completed can be preset. Thus, by matching the analyzed service call information with service keywords and expected result information, the process information during the application test process and the result information obtained by the final operation can be determined. Thus, based on the matched process information and result information, it can be determined whether the application case test process is abnormal. Developers can further determine the abnormal situation of the application based on the matched process information and result information, and carry out targeted program repairs.

[0093] In a preferred embodiment, the anomaly detection module 13 is further used to collect relevant service call information on the call link according to the service call information and the preset service call link if an anomaly exists. Obtain log data of the application according to the service call information of the application and the relevant service call information. Transmit the service call information of the application, the relevant service call information, the log data and the service configuration data to the developer terminal.

[0094] Specifically, when an application has an exception in the case test, it is necessary to feed back the relevant information during the application test to the developer, so that the developer can determine the program error of the application and correct it according to the test related information. In this preferred embodiment, the call link pre-configured by the application is obtained, and the call link is a service dependency link, including the service name, service upstream and downstream information and service corresponding developers of the services with mutual dependency on the link. In a specific example, service A depends on service B, service B depends on service C, and service C depends on service D. When the application calls service A, service A will call service B, service B will call service C, service C will call service D, and services A to service D will form a service call link. If a service in the call link has a problem, for example, service C has an exception during the test, the call link of the above services A to service D can be queried through the preset call link, and the service call information of the related services of service A, service B and service D on the call link is collected to collect all other related service call information on the call link.

[0095] Further, the relevant log data can be obtained from the log collection server according to the service call information and related service call information of the application, and more case test error field data can be obtained. Then, other relevant information of the application is sent to the developer terminal together with the service call information and log data, so that the developer terminal feeds back all relevant information of the application test to the developer for further analysis and judgment. It should be noted that the application usually logs the key steps of the service call and transmits them to the log collection server for storage, so that the relevant log data can be obtained from the log collection server. The application test exception of the present invention does not invade the application too much, and auxiliary and reference log data can be obtained through the conventional log recording function of the application itself. When the application itself does not log, log data may not be collected. That is, forming an alarm information according to the service call information may include the following steps: if there is an exception, collect the relevant service call information on the call link according to the service call information and the preset service call link. The service call information, related service call information and service configuration data of the application are transmitted to the developer terminal.

[0096] The service configuration information may include the application configuration file and service basic data. The application configuration file may include database configuration, service registration center configuration, and service call configuration of service name, version number, and number of parallel executions. Service basic data is the data required by the application to provide service runtime, that is, the preset application number and other application parameters.

[0097] Since the principle of solving the problem by the device is similar to that of the above method, the implementation of the device can refer to the implementation of the method and will not be repeated here.

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

[0099] In a typical example, the computer device specifically includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method executed by the client as described above is implemented; or, when the processor executes the program, the method executed by the server as described above is implemented.

[0100] Reference below Figure 6, which shows a schematic diagram of the structure of a computer device 600 suitable for implementing an embodiment of the present application.

[0101] like Figure 6 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate operations and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0102] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal feedback device (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed as needed as the storage section 608.

[0103] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer application. For example, an embodiment of the present invention includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 609, and / or installed from the removable medium 611.

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

[0105] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0109] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0111] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0112] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0113] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for analyzing application program test anomalies, characterized in that: include: Acquire raw data input and output by an application through a network port, wherein the application is set on an application device, and the application is configured to respond to a service call instruction of an external caller device and provide a service corresponding to the application to an external caller; when testing the application, send a test case to the application device through the service call instruction through the external caller device for processing; Parsing the original data to obtain service call information of the application program; Performing an abnormality analysis on the service call information, if there is an abnormality, generating an alarm message according to the service call information, and transmitting the alarm message to the developer terminal; The acquisition of the original data input and output by the application through the network port specifically includes: Use the Sidecar mode to obtain the raw data input and output of the application through the network port; The method of obtaining the raw data input and output by the application through the network port through the Sidecar mode specifically includes: Determine the network port of the application according to the port configuration information of the application; Collecting data input and output on the network card corresponding to the network port to obtain original data of the application program; Among them, when the application logs the key steps of the service call, if there is an exception, the alarm information is generated according to the service call information, specifically including: If there is an abnormality, collect relevant service call information on the call link according to the service call information and the preset service call link; obtain the log data of the application according to the service call information of the application and the related service call information; transmit the service call information of the application, the related service call information, the log data and the service configuration information to the developer terminal; Wherein, when the application does not log the key steps of the service call, if there is an exception, the alarm information is generated according to the service call information and specifically includes: If there is an abnormality, relevant service call information on the call link is collected according to the service call information and the preset service call link; the service call information, relevant service call information and service configuration information of the application are transmitted to the developer terminal.

2. The application testing anomaly analysis method according to claim 1, characterized in that: The parsing of the original data to obtain the application service call information specifically includes: Parsing the original data according to a preset remote procedure call protocol to obtain all service call information; The application program service calling information is obtained by filtering all the service calling information according to the configured program service information.

3. The application testing anomaly analysis method according to claim 1, characterized in that: The abnormal analysis of the service call information specifically includes: The service call information is matched with preset service keywords and expected result information to determine whether the application program has an abnormality.

4. The application testing anomaly analysis method according to claim 1, characterized in that: The service call information includes the service name of the service called by the application, the service method, the data type, whether an error occurs in the service, the request parameters and the response data, the service call time, the service caller address and the service callee address.

5. An application testing anomaly analysis device, characterized in that: include: A data acquisition module is used to acquire raw data input and output by an application through a network port, wherein the application is set on an application device, and the application is configured to respond to a service call instruction of an external caller device and provide a service corresponding to the application to an external caller; when testing the application, the test case is sent to the application device through the service call instruction by the external caller device for processing; A data analysis module, used to parse the original data to obtain service call information of the application program; An anomaly detection module is used to perform an anomaly analysis on the service call information. If an anomaly exists, an alarm message is generated according to the service call information, and the alarm message is transmitted to the developer terminal; The acquisition of the original data input and output by the application through the network port specifically includes: Use the Sidecar mode to obtain the raw data input and output of the application through the network port; The method of obtaining the raw data input and output by the application through the network port through the Sidecar mode specifically includes: Determine the network port of the application according to the port configuration information of the application; Collecting data input and output on the network card corresponding to the network port to obtain original data of the application program; When the application program logs the key steps of the service call, the abnormality monitoring module is further used to: If there is an abnormality, collect relevant service call information on the call link according to the service call information and the preset service call link; obtain the log data of the application according to the service call information of the application and the related service call information; transmit the service call information of the application, the related service call information, the log data and the service configuration information to the developer terminal; Wherein, when the application does not log the key steps of the service call, the anomaly detection module is further used to: If there is an abnormality, relevant service call information on the call link is collected according to the service call information and the preset service call link; the service call information, relevant service call information and service configuration information of the application are transmitted to the developer terminal.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Service monitoring method, platform and storage medium

    CN108509313A

  • Log file processing method, device and system

    CN109684280A