Mobile application anomaly analysis method and device, computer equipment and storage medium

By obtaining the page feedback information and routing stack information of the request to load the request, generate an exception data, solve the problem of low efficiency of the React Native mobile application abnormality, and achieve more accurate alarm and efficient anomalies.

CN119356913APending Publication Date: 2025-01-24SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310918239.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When developing mobile applications using React Native, when an abnormality of mobile application occurs, operation and maintenance personnel need to check all access trajectories of account information one by one, which is very labor-intensive and inefficient.

Method used

By obtaining the page feedback information and routing stack information of the page load request, and generating access exception data, the user operation path can be completely restored, thereby improving the accuracy and efficiency of exception analysis.

Benefits of technology

The more accuracy of the alarm was achieved, which greatly improved the efficiency of R & D and investigation, captured the abnormal data of access to access, and provided detailed information for the investigation of the problem, and improved the accuracy of the research and development problem investigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356913A_ABST
    Figure CN119356913A_ABST
Patent Text Reader

Abstract

The invention provides a mobile application exception analysis method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining page feedback information responding to a page loading request after the page loading request of a target page of a mobile application is sent; if it is determined that page access is abnormal based on the page feedback information, obtaining page information of the target page and routing stack information responding to the page loading request; and generating access abnormal data according to the page information and the routing stack information. By adopting the method, the user operation path can be completely recovered through the routing stack information, so that the alarm is more accurate, and the research and development troubleshooting efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer testing technology, and in particular to a method, apparatus, computer equipment and storage medium for analyzing abnormalities in a mobile application. Background Art

[0002] React Native is a cross-platform mobile application development framework that allows developers to build high-quality mobile applications using JavaScript and React. However, when an error occurs during mobile application development using React Native APP, the error location and the account information of the error will be reported, requiring operation and maintenance personnel to check all access traces of the account information one by one, which is a large workload and inefficient. Summary of the invention

[0003] Based on this, it is necessary to provide a mobile application anomaly analysis method, device, computer equipment and storage medium to address the above technical problems. The user operation path can be completely restored through routing stack information, which can make the alarm more accurate and greatly improve the efficiency of R&D and troubleshooting.

[0004] In a first aspect, the present application provides a method for analyzing abnormalities in a mobile application, comprising:

[0005] After a page loading request for a target page of a mobile application is issued, page feedback information in response to the page loading request is obtained;

[0006] If it is determined that the page access is abnormal based on the page feedback information, obtaining the page information of the target page and the routing stack information responding to the page loading request;

[0007] Access exception data is generated according to the page information and the routing stack information.

[0008] In some embodiments of the present application, the page access exception includes a JavaScript exception, the page feedback information is feedback information obtained by monitoring the target method of the underlying source code of the mobile application, and the JavaScript exception is determined when an event of the target method is triggered. If it is determined to be a page access exception based on the page feedback information, the page information of the target page and the routing stack information of the response to the page loading request are obtained, including:

[0009] If it is determined to be a JavaScript exception based on the page feedback information, intercepting the exception code in the target variable, the target variable being a variable called at the underlying source code of the mobile application when the JavaScript exception occurs;

[0010] Based on a preset mapping relationship between the code and the stack, determining the exception stack information as the page information according to the exception code;

[0011] The routing stack information for responding to the page loading request is determined according to the exception stack information through the preset first routing middleware.

[0012] In some embodiments of the present application, the page access exception includes a network connection exception, the page feedback information is a network status code in response to the page loading request obtained through a network monitoring point pre-set in the network middleware of the mobile application, and if it is determined that the page access is abnormal based on the page feedback information, the page information of the target page and the routing stack information in response to the page loading request are obtained, including:

[0013] If the page feedback information is a preset abnormal network status code, it is determined that the network connection is abnormal;

[0014] Determine, according to the page loading request, that the network request parameter is the page information of the target page;

[0015] The routing stack information responding to the page loading request is determined according to the page loading request through the preset second routing middleware.

[0016] In some embodiments of the present application, if the page feedback information is a preset abnormal network status code, determining that the network connection is abnormal includes:

[0017] Determine the device information of the target abnormal network terminal according to the correspondence between the preset status code and the abnormal network terminal and the abnormal network status code;

[0018] The generating access exception data according to the page information and the routing stack information includes:

[0019] Access exception data is generated according to the page information, the routing stack information, and the device information.

[0020] In some embodiments of the present application, after issuing a page loading request for a target page of a mobile application and before obtaining page feedback information in response to the page loading request, the process further includes:

[0021] After sending a login request for the mobile application, obtaining login feedback information in response to the login request;

[0022] If it is determined that the application login is abnormal based on the preset login alarm strategy and the login feedback information, the login abnormality data is generated according to the login request and the login feedback information.

[0023] In some embodiments of the present application, the application login exception includes a CAS login exception and a system login exception, the login feedback information includes CAS feedback information and system feedback information, and if it is determined to be an application login exception based on a preset login alarm policy and the login feedback information, then generating login exception data according to the login request and the login feedback information includes:

[0024] If it is determined that the CAS login is abnormal based on the CAS feedback information, generating the login abnormality data according to the login request and the CAS feedback information;

[0025] If it is determined based on the CAS feedback information that the CAS login is normal and the CAS feedback information includes a CAS authentication pass instruction, the account information is called according to the CAS authentication pass instruction, and the account information is matched and verified with the account information in the login request to obtain the system feedback information;

[0026] If it is determined that the system login is abnormal based on the system feedback information, the login abnormality data is generated according to the login request, the CAS feedback information and the system feedback information.

[0027] In some embodiments of the present application, after generating the access exception data according to the page information and the routing stack information, the method further includes:

[0028] Obtaining a statistical number of abnormal data of the mobile application, wherein the abnormal data is access abnormal data or login abnormal data;

[0029] If the statistical number is greater than or equal to a preset threshold, an alarm message is generated according to the abnormal data.

[0030] In a second aspect, the present application provides a mobile application anomaly analysis device, comprising:

[0031] An information acquisition module, used for acquiring page feedback information in response to a page loading request of a target page of a mobile application after the page loading request is issued;

[0032] an abnormality analysis module, which is in communication with the information acquisition module and is used to acquire page information of the target page and routing stack information responding to the page loading request if it is determined that the page access is abnormal based on the page feedback information;

[0033] The data generation module is in communication with the exception analysis module and is used to generate access exception data according to the page information and the routing stack information.

[0034] In some embodiments of the present application, the page access exception includes a JavaScript exception, and the page feedback information is feedback information obtained by monitoring the target method of the underlying source code of the mobile application. When the event of the target method is triggered, the JavaScript exception is determined, and the exception analysis module is also used to intercept the exception code in the target variable if it is determined to be a JavaScript exception based on the page feedback information, and the target variable is the variable called at the underlying source code of the mobile application when the JavaScript exception occurs; based on a preset mapping relationship between the code and the stack, the exception stack information is determined to be the page information according to the exception code; through a preset first routing middleware, the routing stack information that responds to the page loading request is determined according to the exception stack information.

[0035] In some embodiments of the present application, the page access exception includes a network connection exception, and the page feedback information is a network status code in response to the page loading request obtained through a network monitoring point pre-set in the network middleware of the mobile application. The exception analysis module is also used to determine that it is a network connection exception if the page feedback information is a preset abnormal network status code; determine that the network request parameter is the page information of the target page according to the page loading request; and determine the routing stack information in response to the page loading request according to the page loading request through a preset second routing middleware.

[0036] In some embodiments of the present application, the exception analysis module is also used to determine the device information of the target abnormal network terminal based on the correspondence between the preset status code and the abnormal network terminal and the abnormal network status code; the data generation module is also used to generate access exception data based on the page information, the routing stack information and the device information.

[0037] In some embodiments of the present application, the exception analysis module is also used to obtain login feedback information in response to the login request of the mobile application after the login request is issued; if it is determined that the application login is abnormal based on a preset login alarm strategy and the login feedback information, login exception data is generated according to the login request and the login feedback information.

[0038] In some embodiments of the present application, the application login exception includes a CAS login exception and a system login exception, the login feedback information includes CAS feedback information and system feedback information, and the exception analysis module is also used to generate the login exception data according to the login request and the CAS feedback information if it is determined that the CAS login exception is based on the CAS feedback information; if it is determined that the CAS login is normal based on the CAS feedback information and the CAS feedback information includes a CAS authentication pass instruction, the account information is called according to the CAS authentication pass instruction, and it is matched with the account information in the login request for verification to obtain the system feedback information; if it is determined that the system login exception is based on the system feedback information, the login exception data is generated according to the login request, the CAS feedback information and the system feedback information.

[0039] In some embodiments of the present application, the data generation module is also used to obtain the statistical number of abnormal data of the mobile application, and the abnormal data is access abnormal data or login abnormal data; if the statistical number is greater than or equal to a preset threshold, an alarm information is generated according to the abnormal data.

[0040] In a third aspect, the present application further provides a computer device, the computer device comprising:

[0041] one or more processors;

[0042] A memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the mobile application anomaly analysis method.

[0043] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in the mobile application anomaly analysis method.

[0044] The above-mentioned mobile application anomaly analysis method, device, computer equipment and storage medium, when determining that a page access anomaly occurs, obtains the routing stack information when the page with the anomaly responds to the page loading request. The operation path of the login account when the page access anomaly occurs can be completely restored through the routing stack information. The user does not need to check all access tracks of the login account one by one, which can make the alarm more accurate, greatly improve the efficiency of R&D investigation, capture all access anomaly data, provide detailed information data for problem investigation, and improve the accuracy of R&D problem investigation. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0046] Figure 1 It is a flowchart of a method for analyzing abnormalities of mobile applications in an embodiment of the present application;

[0047] Figure 2 is a flowchart of a login anomaly analysis method applied in another embodiment of the present application;

[0048] Figure 3 It is a flowchart of a JS exception analysis method in another embodiment of the present application;

[0049] Figure 4 is a flowchart of a method for analyzing network connection anomalies in another embodiment of the present application;

[0050] Figure 5 is a structural diagram of a mobile application anomaly analysis device in an embodiment of the present application;

[0051] Figure 6 It is a schematic diagram of the structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

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

[0053] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.

[0054] In the description of the present application, the word "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0055] See also Figure 1 The embodiment of the present application provides a method for analyzing abnormalities in a mobile application, the method comprising steps S101 to S103, which are as follows:

[0056] S101, after a page loading request of a target page of a mobile application is issued, page feedback information in response to the page loading request is obtained.

[0057] Specifically, this embodiment is applied to mobile applications, such as React Native APP, and users develop mobile applications through React Native APP. The user issues a page loading request for the target page of the mobile application through the human interaction interface of the mobile application. The page loading request is any allowed operation performed by the user on the target page of the mobile application, including but not limited to clicking to jump to another page or running to verify the edited code.

[0058] After issuing a page load request, the background of the mobile application responds to the page load request and returns page feedback information, which is the result information of the mobile application executing the page load request. If an error occurs during the execution of the page load request, the page feedback information will report an error. Based on the analysis of the page feedback information, the reason for the error in executing the page load request can be further determined.

[0059] In one embodiment, this step also includes: S201, after issuing a login request for the mobile application, obtaining login feedback information in response to the login request; S202, if it is determined that the application login is abnormal based on the preset login alarm strategy and the login feedback information, then generating login abnormality data according to the login request and the login feedback information.

[0060] Specifically, before a user enters a mobile application to access a page, the user needs to log in to the mobile application. The user sends a login request to the mobile application through the human interaction interface of the mobile application, and the login request includes but is not limited to the user's account information, device identification information for login, and requested address information.

[0061] After issuing a login request, the background of the mobile application responds to the login request, verifies various types of information contained in the login request, and returns login feedback information. The login feedback information is a successful login or a login exception. If it is a login exception, the login feedback information may also include the cause of the login exception or the object information where the exception occurred.

[0062] Login feedback information is used to characterize the login status. Login feedback information can directly return login success or login exception. However, due to the many reasons that lead to login exceptions and to facilitate signal transmission, login feedback information can also be in the form of information such as status code or string. Login feedback information is identified based on a preset login alarm strategy, which contains the correspondence between login feedback information and login status. For example, if the login feedback information has a status code of 401, the login alarm strategy determines that the application login exception is caused by a network error.

[0063] When it is determined that the login feedback information is an application login exception, login exception data is generated based on the login request and feedback information, and the person who handles the application login exception is notified immediately, exposing related problems as soon as possible, allowing R&D to actively monitor the problems rather than passively receive them. At the same time, the login exception data is uploaded to the cloud server, that is, all information related to the application login exception is captured and uploaded, providing detailed information data for problem troubleshooting, which can improve the accuracy of R&D problem troubleshooting.

[0064] In one embodiment, the application login anomaly includes a CAS login anomaly and a system login anomaly, and the login feedback information includes CAS feedback information and system feedback information. Step S202: if it is determined to be an application login anomaly based on a preset login alarm policy and the login feedback information, then login anomaly data is generated according to the login request and the login feedback information, including: S301: if it is determined to be a CAS login anomaly based on the CAS feedback information, then the login anomaly data is generated according to the login request and the CAS feedback information; S302: if it is determined to be a CAS login anomaly based on the CAS feedback information and the CAS authentication pass instruction is included, then the account information is called according to the CAS authentication pass instruction, and it is matched with the account information in the login request for verification to obtain the system feedback information; S303: if it is determined to be a system login anomaly based on the system feedback information, then the login anomaly data is generated according to the login request, the CAS feedback information and the system feedback information.

[0065] Specifically, the application login process consists of two links: CAS login (a unified login plug-in for the big network, connecting to the human resources database) and system login (mainly to pull basic user information and verify account information). Therefore, application login exceptions include CAS login exceptions and system login exceptions, and login feedback information includes CAS feedback information and system feedback information.

[0066] When a user logs in to a mobile application, they first perform CAS login and send a login request to the CAS server. If the CAS server fails authentication and the CAS feedback information is determined to be a CAS login exception, the login exception data is generated based on the login request and CAS feedback information, and the login exception data is uploaded to the cloud server. For example, if the CAS login plug-in returns an exception, a CAS exception report is performed, and the category is login error-CAS login exception.

[0067] If the fed-back CAS feedback information determines that the CAS login is normal, and the CAS feedback information includes a CAS authentication pass instruction, the account information is called according to the CAS authentication pass instruction. The account information includes but is not limited to the account name, password, login device identification information, network interface, etc. allowed to log in. The called account information is matched and verified with the account information in the login request, that is, the account information in the login request is compared with the called account information one by one to identify whether the account information in the login request is the information contained in the called account information, and obtain system feedback information.

[0068] The system feedback information is the process and result information of verifying the account information in the login request. For example, if the information interaction fails due to a network anomaly, the system feedback information is a system login anomaly. If the account information in the login request is incorrect and does not match the account information called, the system feedback information is a system login anomaly. The system feedback information includes normal system login and abnormal system login. If the system login is abnormal and the reason is clear, it may further include the reason for the abnormal system login. For example, if the CAS login is normal, the second link pulls the account information to call the interface of this system. If a network anomaly occurs and the account information cannot be pulled, the APP cannot be used. In this case, it will also be reported, and the reported category is: login error-system login anomaly. If it is determined to be a system login anomaly based on the system feedback information, the login anomaly data is generated according to the login request, CAS feedback information and system feedback information, and the login anomaly data is uploaded to the cloud server at the same time.

[0069] S102: If it is determined that the page access is abnormal based on the page feedback information, the page information of the target page and the routing stack information responding to the page loading request are obtained.

[0070] Specifically, a page loading request is any operation allowed by a user on the target page of a mobile application, including but not limited to clicking to jump to another page or running to verify edited code, etc. Page feedback information includes normal page access and abnormal page access, and abnormal page access includes JavaScript exceptions and network connection exceptions. If the page feedback information is that the page access is normal, the page loading request can be successfully executed. If the page feedback information is that the page access is abnormal, the page information of the target page and the routing stack information of the response to the page loading request are obtained. The page information of the target page is the identification information of the target page, which is used to determine the target page where the access exception occurs. The routing stack information is the link information when responding to the page loading request, so as to facilitate tracing when troubleshooting the access exception later.

[0071] In one embodiment, the page access exception includes a JavaScript exception, and the page feedback information is feedback information obtained by monitoring the target method of the underlying source code of the mobile application. When the event of the target method is triggered, the JavaScript exception is determined. This step includes: S401, if it is determined to be a JavaScript exception based on the page feedback information, intercept the exception code in the target variable, and the target variable is the variable called at the underlying source code of the mobile application when the JavaScript exception occurs; S402, based on the preset mapping relationship between the code and the stack, determine the exception stack information as the page information according to the exception code; S403, through the preset first routing middleware, determine the routing stack information that responds to the page loading request according to the exception stack information.

[0072] Specifically, a JavaScript exception means that the mobile application did not crash, but the entire content will be reloaded, affecting user usage. The page feedback information is the feedback information obtained by monitoring the target method of the underlying source code of the mobile application. When a JavaScript exception occurs, the event of the target method is triggered. That is, the monitoring framework injects a listener into the target method that will be triggered when the underlying source code JS (JavaScript) of the mobile application is abnormal. If the event corresponding to the target method is triggered, it means that the JavaScript exception is sent, the capture is completed, and the page feedback information is obtained. For example, the self-developed React-Natvie performance monitoring framework SASP-APM.

[0073] If it is determined to be a JavaScript exception based on the page feedback information, the exception code in the target variable is intercepted. The exception code is in the target variable at the underlying source code of the mobile application called when the JavaScript exception occurs. When a JavaScript exception occurs and triggers an event of the target method, the exception code is intercepted and obtained.

[0074] Combined with the preset mapping relationship between the code and the stack, the exception stack information is determined according to the exception code, and the exception stack information is determined as page information. The preset mapping relationship between the code and the stack is used to characterize the relative position of the elements of each code in the page. Therefore, based on the exception stack information, the location and cause of the exception can be located and analyzed.

[0075] The routing middleware is the location of the routing jump code that will be called when the data jumps through the route. Therefore, based on the routing middleware, the calling status of the routing jump code can be determined, and then the access track of the login account to access various data can be determined. The first routing middleware is the routing middleware set in the mobile application. Through the preset first routing middleware, the routing stack information that responds to the page loading request is determined according to the exception stack information. The routing stack information is obtained from the routing middleware of the project, and the corresponding stack is stored in the routerstack variable of the routing middleware during the routing jump process. The routing stack information is the link information when responding to the page loading request, so as to facilitate tracing when troubleshooting access exceptions later.

[0076] In one embodiment, the page access exception includes a network connection exception, and the page feedback information is a network status code in response to the page loading request obtained through a network monitoring point pre-set in the network middleware of the mobile application. Step S102, if it is determined to be a page access exception based on the page feedback information, then the page information of the target page and the routing stack information in response to the page loading request are obtained, including: S501, if the page feedback information is a preset abnormal network status code, it is determined to be a network connection exception; S502, according to the page loading request, determine that the network request parameter is the page information of the target page; S503, through a preset second routing middleware, determine the routing stack information in response to the page loading request according to the page loading request.

[0077] Specifically, the network layer is where all requests and responses are processed uniformly. All network requests flowing within the mobile application will pass through the network middleware. The capture of network anomalies is also monitored in the network middleware. Therefore, a network monitoring point is set in advance in the network middleware of the mobile application to obtain the network status code of the response to the page loading request as the page feedback information.

[0078] If the page feedback information is a preset abnormal network status code, it is determined that the network connection is abnormal. For example, when the returned network request network status code, that is, the page feedback information, is not within the range of 200-299 (normal network status code range), it is determined that the network connection is abnormal and the reporting mechanism is triggered.

[0079] The network request parameters are determined as page information based on the page loading request. The network request parameters include but are not limited to the data interface that initiates the page loading request, the target data interface of the request, the data to be transmitted, and other information. Based on the page information, the target page where the network connection abnormality occurs can be determined.

[0080] In addition, similar to the above embodiment, the routing stack information of the response page loading request is determined according to the page loading request by the preset second routing middleware, and the second routing middleware is the routing middleware set in the mobile application, and the second routing middleware and the first routing middleware can be the same routing middleware or different routing middleware. That is, when a page access exception occurs, the routing stack information of the response page loading request is obtained, and the routing stack information is the link information when responding to the page loading request, so as to facilitate the tracing when the access exception is checked later.

[0081] In one embodiment, step S501, if the page feedback information is a preset abnormal network status code, it is determined that the network connection is abnormal, including: S601 determining the device information of the target abnormal network end according to the corresponding relationship between the preset status code and the abnormal network end, and the abnormal network status code; S602, generating access exception data according to the page information and the routing stack information, including: S6032, generating access exception data according to the page information, the routing stack information and the device information.

[0082] Specifically, the correspondence between the preset status code and the abnormal network end is used to characterize the network status corresponding to each network status code and the specific network end where the abnormality occurs. For example, 200-299 is the normal network status code range, and the network status code starting with 5 is an abnormal network status code, and it is a server error. The network status code is 401, which is an abnormal network status code and it is a client error.

[0083] Therefore, based on the correspondence between the preset status code and the abnormal network terminal, matching the abnormal network status code can determine the device information of the target abnormal network terminal that causes the network abnormality. Different types of target abnormal network terminals have different operation and maintenance personnel. Therefore, when generating access abnormal data based on page information, routing stack information and device information, the corresponding operation and maintenance personnel are determined in time according to the device information of the target abnormal network terminal, thereby improving the efficiency of solving abnormal network status.

[0084] S103: Generate access exception data according to the page information and the routing stack information.

[0085] Specifically, access exception data is generated based on page information and routing stack information. Page information is used to characterize the location where the access exception occurs, and routing stack information is used to characterize that the access exception is the execution link of the system. The routing stack information can completely restore the user operation path, making the alarm more accurate and greatly improving the efficiency of R&D troubleshooting. The access exception data is fully captured and uploaded, providing detailed information data for problem troubleshooting, which can improve the accuracy of R&D problem troubleshooting.

[0086] In one embodiment, this step is followed by: S701, obtaining the statistical number of abnormal data of the mobile application, the abnormal data being access abnormal data or login abnormal data; S702, if the statistical number is greater than or equal to a preset threshold, generating an alarm message based on the abnormal data.

[0087] Specifically, the statistical number of abnormal data of the mobile application is obtained, and the abnormal data is access abnormal data or login abnormal data. Further, the access abnormal data includes access abnormal data caused by JavaScript abnormality and access abnormal data caused by network connection abnormality, and the login abnormal data includes login abnormal data caused by CAS login abnormality and login abnormal data caused by system login abnormality. The statistical number of different types of abnormal data can be counted separately, wherein the detection of abnormality and the generation of corresponding abnormal data reported to the cloud server are counted as one abnormal data.

[0088] Since the impact on the operation of the React Native APP is negligible when there are few exceptions, only when the statistical number is greater than or equal to the preset threshold, an alarm message is generated based on the abnormal data and passed to the operation and maintenance personnel who handle the abnormal data. Among them, the preset thresholds set for different types of abnormal data can be the same or different, and this embodiment does not make specific limitations.

[0089] This embodiment can completely restore the user operation path through the routing stack information, which can make the alarm more accurate, greatly improve the efficiency of R&D troubleshooting, fully capture and upload access exception data, provide detailed information data for problem troubleshooting, and improve the accuracy of R&D problem troubleshooting.

[0090] The embodiment of the present application provides a method for analyzing mobile application anomalies, including application login anomaly reporting, JS anomaly reporting, and network connection anomaly reporting.

[0091] 1. Application login exception reporting: React Native APP login process has two links: CAS login (Dawang unified login plug-in, connected to the human resources database) -> system login (mainly to pull basic user information and account information). Therefore, login exceptions are monitored in these two links. If the CAS login plug-in returns an exception, a CAS exception report is made, and the category is login error-CAS login exception. If the CAS login is normal, the second link pulls user information and calls the interface of this system. If a network exception occurs and the user information cannot be pulled, the React Native APP cannot be used, and the same report is made, and the reported category is: login error-login exception. Figure 2 As shown, the login feedback information in response to the login request is obtained; when it is determined that the application login is abnormal according to the login feedback information, the account information, the request address information, and the error parameters are determined according to the login request and the login feedback information; the login abnormality data is generated according to the account information, the request address information, and the error parameters; the login abnormality data is uploaded to the cloud server; the statistical number of application login abnormalities is obtained; if the statistical number exceeds the preset threshold set for the application login abnormality, an alarm message is pushed to the handler.

[0092] 2. JS exception reporting: JS exception means that the React Native APP did not crash, but the entire content will be reloaded, affecting user use. The monitoring plug-in used is the self-developed React-Natvie performance monitoring framework: SASP-APM. The monitoring framework injects a listener into the target method that will be triggered when the underlying JS exception of React Native occurs. If an exception occurs, the corresponding event will be triggered to complete the capture. After the JS error is captured, the error is reported, and the specified error type is JS exception (JS error-JS exception). Except for the alarms of application login exceptions, all routing stack information is uniformly returned, and the routing stack information is obtained from the routing middleware of the project. The corresponding stack is stored in the routerstack variable of the routing middleware during the routing jump process. The exception stack information is in a variable at the underlying source code called when a JS error occurs. When triggered, it is intercepted and obtained in the injected listening method and passed to the reporting code. Such as Figure 3 As shown, the page feedback information of the response page loading request is obtained; when it is determined to be a JS exception according to the page feedback information, the exception stack information and the routing stack information are obtained; the access exception data is generated according to the exception stack information and the routing stack information; the access exception data is uploaded to the cloud server; the statistical number of JS exceptions is obtained; if the statistical number exceeds the preset threshold set for the JS exception, an alarm message is pushed to the handler.

[0093] 3. Reporting of network connection exceptions: The network layer is where all requests and returns are processed uniformly. All network requests flowing within the React Native APP will pass through the network middleware. We monitor the capture of network exceptions at the network layer of our code. When the network status code of the returned network request is not in the range of 200-299 (normal network status code range), the reporting mechanism is triggered. If the network status code starts with 5 (for example: 501), the reporting category is network error-server error. If the network status code does not start with 5 or 2 (for example: 401), the reporting category is network error-client error. If no status code is returned, a network error-client error is reported. The network middleware has no absolute hierarchical relationship with other modules and can be understood as a middleware network distribution center. Such as Figure 4 As shown, the page feedback information of the response page loading request is obtained; when the network connection is determined to be abnormal according to the page feedback information, the target abnormal network end is determined to be a server error or a client error according to the abnormal network status code, and the operation and maintenance personnel of the corresponding target abnormal network end are notified; the network request parameters are determined according to the page loading request; the routing stack information is obtained; the access exception data is generated according to the network request parameters and the routing stack information; the access exception data is uploaded to the cloud server; the statistical number of network connection exceptions is obtained; if the statistical number exceeds the preset threshold set for the network connection exception, an alarm message is pushed to the handler.

[0094] Among them, the number of times each type of exception is counted is configured on the cloud server in the form of a web page. After receiving the reported abnormal data, the backend will write a log to it. Then, the abnormal type configured by the cloud server and the preset threshold of the cumulative number of statistical times are obtained for matching judgment (the matching abnormal type logic is whether the reported JSON string contains the abnormal type string). If it exceeds the set standard, the backend calls the preset API to push the corresponding warning message to the handler.

[0095] This embodiment uses the user operation route (route stack information) to completely restore the user operation path, which can make the alarm more accurate and greatly improve the efficiency of R&D troubleshooting; fully captures and uploads the specific information of related errors, provides detailed data for problem troubleshooting, and can improve the accuracy of R&D problem troubleshooting; instant notification can expose related problems in the first place, allowing R&D to actively monitor the problems rather than passively receive them.

[0096] like Figure 5 As shown, the embodiment of the present application provides a mobile application anomaly analysis device 900, including:

[0097] The information acquisition module 910 is used to acquire page feedback information in response to the page loading request after issuing a page loading request of a target page of a mobile application;

[0098] The abnormality analysis module 920 is in communication with the information acquisition module 910 and is used to acquire the page information of the target page and the routing stack information responding to the page loading request if it is determined that the page access is abnormal based on the page feedback information;

[0099] The data generation module 930 is in communication with the exception analysis module 920 and is used to generate access exception data according to the page information and the routing stack information.

[0100] In some embodiments of the present application, the page access exception includes a JavaScript exception, and the page feedback information is feedback information obtained by monitoring the underlying target method of React Native. When a JavaScript exception occurs, the event of the target method is triggered, and the exception analysis module 920 is also used to intercept the exception code in the target variable if it is determined to be a JavaScript exception based on the page feedback information. The target variable is the variable called at the underlying source code of the mobile application when a JavaScript exception occurs; based on a preset mapping relationship between the code and the stack, the exception stack information is determined to be the page information according to the exception code; through a preset routing middleware, the routing stack information that responds to the page loading request is determined according to the exception stack information.

[0101] In some embodiments of the present application, the page access exception includes a network connection exception, and the page feedback information is a network status code in response to the page loading request obtained through a network monitoring point pre-set in the network middleware of the mobile application. The exception analysis module 920 is also used to determine that it is a network connection exception if the page feedback information is a preset abnormal network status code; determine that the network request parameter is the page information of the target page according to the page loading request; and determine the routing stack information in response to the page loading request according to the page loading request through a preset routing middleware.

[0102] In some embodiments of the present application, the exception analysis module 920 is also used to determine the device information of the target abnormal network terminal based on the correspondence between the preset status code and the abnormal network terminal and the abnormal network status code; the data generation module is also used to generate access exception data based on the page information, the routing stack information and the device information.

[0103] In some embodiments of the present application, the exception analysis module 920 is also used to obtain login feedback information in response to the login request of the mobile application after the login request is issued; if it is determined that the application login is abnormal based on the preset login alarm strategy and the login feedback information, login exception data is generated according to the login request and the login feedback information.

[0104] In some embodiments of the present application, the application login exception includes a CAS login exception and a system login exception, the login feedback information includes CAS feedback information and system feedback information, and the exception analysis module 920 is also used to generate the login exception data according to the login request and the CAS feedback information if it is determined that the CAS login exception is based on the CAS feedback information; if it is determined that the CAS login is normal based on the CAS feedback information and the CAS feedback information includes a CAS authentication pass instruction, the account information is called according to the CAS authentication pass instruction, and it is matched with the account information in the login request for verification to obtain the system feedback information; if it is determined that the system login exception is based on the system feedback information, the login exception data is generated according to the login request, the CAS feedback information and the system feedback information.

[0105] In some embodiments of the present application, the data generation module 930 is also used to obtain the statistical number of abnormal data of the mobile application, and the abnormal data is access abnormal data or login abnormal data; if the statistical number is greater than or equal to a preset threshold, an alarm information is generated according to the abnormal data.

[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0107] For example, Figure 6 The computer device shown can be Figure 5 The information acquisition module 910 in the mobile application anomaly analysis device 900 shown executes step S101. The computer device can execute step S102 through the anomaly analysis module 920. The computer device can execute step S103 through the data generation module 930. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a mobile application anomaly analysis method is implemented.

[0108] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0109] In some embodiments of the present application, a computer device is provided, comprising one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor in the steps of the above-mentioned mobile application anomaly analysis method. The steps of the mobile application anomaly analysis method here may be the steps of the mobile application anomaly analysis method in the above-mentioned embodiments.

[0110] In some embodiments of the present application, a computer-readable storage medium is provided, which stores a computer program, and the computer program is loaded by a processor, so that the processor executes the steps of the above-mentioned mobile application anomaly analysis method. The steps of the mobile application anomaly analysis method here can be the steps of the mobile application anomaly analysis method in each of the above-mentioned embodiments.

[0111] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0112] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0113] The above is a detailed introduction to a mobile application anomaly analysis method, device, computer equipment and storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for analyzing abnormality of a mobile application, characterized in that: include: After a page loading request for a target page of a mobile application is issued, page feedback information in response to the page loading request is obtained; If it is determined that the page access is abnormal based on the page feedback information, obtaining the page information of the target page and the routing stack information responding to the page loading request; Access exception data is generated according to the page information and the routing stack information.

2. The mobile application anomaly analysis method according to claim 1, characterized in that: The page access exception includes a JavaScript exception, the page feedback information is feedback information obtained by monitoring a target method of the underlying source code of the mobile application, and a JavaScript exception is determined when an event of the target method is triggered. If it is determined to be a page access exception based on the page feedback information, the page information of the target page and the routing stack information responding to the page loading request are obtained, including: If it is determined to be a JavaScript exception based on the page feedback information, intercepting the exception code in the target variable, the target variable being a variable called at the underlying source code of the mobile application when the JavaScript exception occurs; Based on a preset mapping relationship between the code and the stack, determining the exception stack information as the page information according to the exception code; The routing stack information for responding to the page loading request is determined according to the exception stack information through the preset first routing middleware.

3. The mobile application anomaly analysis method according to claim 1, characterized in that: The page access exception includes a network connection exception, the page feedback information is a network status code in response to the page loading request obtained through a network monitoring point pre-set in the network middleware of the mobile application, and if it is determined to be a page access exception based on the page feedback information, the page information of the target page and the routing stack information in response to the page loading request are obtained, including: If the page feedback information is a preset abnormal network status code, it is determined that the network connection is abnormal; Determine, according to the page loading request, that the network request parameter is the page information of the target page; The routing stack information responding to the page loading request is determined according to the page loading request through the preset second routing middleware.

4. The mobile application anomaly analysis method according to claim 3, characterized in that: If the page feedback information is a preset abnormal network status code, determining that the network connection is abnormal includes: Determine the device information of the target abnormal network terminal according to the correspondence between the preset status code and the abnormal network terminal and the abnormal network status code; The generating access exception data according to the page information and the routing stack information includes: Access exception data is generated according to the page information, the routing stack information, and the device information.

5. The mobile application anomaly analysis method according to claim 1, characterized in that: After issuing a page loading request for a target page of a mobile application and before obtaining page feedback information in response to the page loading request, the method further includes: After sending a login request for the mobile application, obtaining login feedback information in response to the login request; If it is determined that the application login is abnormal based on the preset login alarm strategy and the login feedback information, the login abnormality data is generated according to the login request and the login feedback information.

6. The method for analyzing abnormality of a mobile application according to claim 5, characterized in that: The application login exception includes a CAS login exception and a system login exception, the login feedback information includes CAS feedback information and system feedback information, and if it is determined to be an application login exception based on a preset login alarm policy and the login feedback information, generating login exception data according to the login request and the login feedback information, including: If it is determined that the CAS login is abnormal based on the CAS feedback information, generating the login abnormality data according to the login request and the CAS feedback information; If it is determined based on the CAS feedback information that the CAS login is normal and the CAS feedback information includes a CAS authentication pass instruction, the account information is called according to the CAS authentication pass instruction, and the account information is matched and verified with the account information in the login request to obtain the system feedback information; If it is determined that the system login is abnormal based on the system feedback information, the login abnormality data is generated according to the login request, the CAS feedback information and the system feedback information.

7. The mobile application anomaly analysis method according to claim 5, characterized in that: After generating access exception data according to the page information and the routing stack information, the method further includes: Obtaining a statistical number of abnormal data of the mobile application, wherein the abnormal data is access abnormal data or login abnormal data; If the statistical number is greater than or equal to a preset threshold, an alarm message is generated according to the abnormal data.

8. A mobile application anomaly analysis device, characterized in that: include: An information acquisition module, used for acquiring page feedback information in response to a page loading request of a target page of a mobile application after the page loading request is issued; an abnormality analysis module, which is in communication with the information acquisition module and is used to acquire page information of the target page and routing stack information responding to the page loading request if it is determined that the page access is abnormal based on the page feedback information; The data generation module is in communication with the exception analysis module and is used to generate access exception data according to the page information and the routing stack information.

9. A computer device, characterized in that: The computer device comprises: one or more processors; A memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the mobile application anomaly analysis method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the mobile application anomaly analysis method according to any one of claims 1 to 7.