Application program fault location method, device, equipment and storage medium
By obtaining the web running log of the application in real time, counting the service module list and calling relationship, and drawing the service function path diagram, it solves the problem of relying on developers for fault location in the existing technology, achieves efficient and accurate fault location, and reduces costs. and improves application security.
Patent Information
- Application Number
- CN202311439909.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-11-01
AI Technical Summary
The existing technology relies on developers' in-depth research and code implantation in application fault location, resulting in heavy workload and high cost, and the inability to accurately derive the list of all service modules and dependencies, resulting in inaccurate fault location results.
By obtaining the web running log of the application in real time, counting the service module list of the target page and historical page, determining the calling relationship between service modules, and drawing the service function path map to locate faults, reducing the reliance on developers for fault location.
Efficient and accurate fault location is achieved, the cost of fault location is reduced, and the security of the application is improved.
Smart Images

Figure CN117407204B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an application fault locating method, device, equipment and storage medium. Background Art
[0002] At present, software and applications are usually composed of a series of functional modules, each of which provides services to the outside world through a series of World Wide Web (Web) pages and Application Programming Interface (API). Due to the requirement of high availability, the existing technology usually uses a distributed cluster to deploy each functional module in multiple virtual machines or containers, resulting in unavailability and poor user access to services. Among them, the service module list of the software and the dependency hierarchy between each service module are important factors in locating user access failures.
[0003] In the prior art, code is usually implanted at each "function entrance" provided by the software and application. Since each access to a service module is equivalent to calling an implanted code, the service module list and the dependency hierarchy between the service modules can be obtained through the implanted code.
[0004] However, due to the method of implanting code at each function entrance, it is necessary to rely on program developers to conduct in-depth research on the location of each function entrance and the method of code implantation, and to carry out a series of code development work, resulting in excessive reliance on developers, heavy workload, and high cost. Secondly, since the "performance monitoring" code is executed once each time a user accesses a service module, the processing time and the risk points of failure increase, and the performance risk is high. Finally, due to the high risk of global code implantation in a system that is already online, only local code implantation can be performed, resulting in the inability to derive the entire service module list and dependency relationships, making the fault location results inaccurate. Summary of the invention
[0005] The present invention provides an application fault locating method, device, equipment and storage medium, which can efficiently and accurately locate faults in the application, reduce the cost of locating faults in the application and improve the security of the application.
[0006] In a first aspect, an embodiment of the present invention provides an application fault location method, including:
[0007] Obtain the web operation log corresponding to the application in real time, and obtain the target page URL triggered by the user for the application and the historical page URL before the target page according to the web operation log;
[0008] According to the number of visits corresponding to each field in the target page URL and the historical page URL, a list of service modules at each level corresponding to the target page and the historical page is counted;
[0009] Determine the calling relationship between service modules in the application program according to the service module lists of each level corresponding to the target page and the history page;
[0010] The service function path map corresponding to the application is determined according to the calling relationship, and the fault in the application is located according to the service function path map.
[0011] Optionally, the URL of the target page triggered by the user for the application and the URL of the historical page before the target page are obtained according to the Web operation log, including:
[0012] According to the Web operation log, obtain the original path of the target page triggered by the user for the application, as well as the original path of the historical page;
[0013] Encode and identify the original path of the target page and the original path of the historical page respectively;
[0014] According to the encoding recognition result, the original path of the target page and the original path of the historical page are converted according to the standard resource locator URL format to obtain the target page URL and the historical page URL.
[0015] Optionally, before counting the service module lists of each level corresponding to the target page and the historical page respectively according to the number of visits corresponding to each field in the target page URL and the historical page URL, the method further includes:
[0016] According to the preset separator, the target page URL and the historical page URL are segmented;
[0017] The processed target page URL and historical page URL are obtained, and invalid fields in the target page URL and historical page URL are filtered according to the field formats of each field in the target page URL and historical page URL.
[0018] Optionally, invalid fields in the target page URL and the history page URL are filtered according to the field format of each field in the target page URL and the history page URL, including:
[0019] Get the first-level field and subsequent-level fields in the target page URL and the history page URL respectively;
[0020] Determine whether the first-level field value is a domain name structure or an IP address; if so, filter the first-level field as an invalid field;
[0021] Determine whether the character length corresponding to each subsequent level field is greater than a preset length, or whether each subsequent level field includes a file name feature and / or preset invalid characters;
[0022] If so, the subsequent level fields are filtered as invalid fields.
[0023] Optionally, according to the service module lists of each level corresponding to the target page and the history page, respectively, the calling relationship between the service modules in the application is determined, including:
[0024] Obtain the first-level service module lists corresponding to the target page and the history page, and the number of visits corresponding to each service module in each first-level service module list;
[0025] According to the access quantity corresponding to each service module in each first-level service module list, the calling relationship between the first-level service modules corresponding to the application program is determined.
[0026] Optionally, according to the service module lists of each level corresponding to the target page and the history page, respectively, the calling relationship between the service modules in the application is determined, including:
[0027] Obtaining the subsequent-level service module lists corresponding to the target page and the historical page respectively; obtaining one level in the subsequent levels in turn as the current level, and determining the first call relationship between the service modules in the current level corresponding to the target page according to the current-level service module list corresponding to the target page and the previous-level service module list before the current level;
[0028] Determine a second calling relationship between service modules in the current level corresponding to the history page according to the service module list of the current level corresponding to the history page and the service module list of the previous level before the current level;
[0029] The first calling relationship and the second calling relationship are superimposed to obtain the calling relationship between the current level service modules corresponding to the application program;
[0030] Returns the operation of obtaining one level in the subsequent levels as the current level in turn until all levels are processed.
[0031] Optionally, locate the fault in the application according to the service function path diagram, including:
[0032] Obtain the user access mode corresponding to each service module in the application, and determine the module service attributes corresponding to each service module according to the user access mode;
[0033] The service function path map is updated according to the service attributes of each module to obtain a service module topology map, and the fault in the application is located according to the service module topology map.
[0034] In a second aspect, an embodiment of the present invention further provides an application fault location device, including:
[0035] The page URL acquisition module is used to obtain the Web operation log corresponding to the application in real time, and obtain the target page URL triggered by the user for the application and the historical page URL before the target page according to the Web operation log;
[0036] The service list acquisition module is used to count the service module lists of each level corresponding to the target page and the historical page according to the number of visits corresponding to each field in the target page URL and the historical page URL;
[0037] A call relationship determination module is used to determine the call relationship between service modules in the application program according to the service module lists of each level corresponding to the target page and the historical page;
[0038] The fault location module is used to determine the service function path diagram corresponding to the application program according to the calling relationship, and locate the fault in the application program according to the service function path diagram.
[0039] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0040] at least one processor; and
[0041] a memory communicatively connected to at least one processor; wherein,
[0042] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the application fault locating method provided by any embodiment of the present invention.
[0043] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the application fault locating method provided by any embodiment of the present invention when executed.
[0044] The technical solution provided by the embodiment of the present invention obtains the Web operation log corresponding to the application in real time, obtains the target page URL triggered by the user for the application, and the historical page URL located before the target page according to the Web operation log; counts the service module lists of each level corresponding to the target page and the historical page according to the number of visits corresponding to each field in the target page URL and the historical page URL; determines the calling relationship between the service modules in the application according to the service module lists of each level corresponding to the target page and the historical page; determines the service function path map corresponding to the application according to the calling relationship, and locates the fault in the application according to the service function path map. The technical means can realize efficient and accurate positioning of the fault in the application, reduce the cost of locating the fault in the application, and improve the security of the application.
[0045] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0047] Figure 1 is a flowchart of an application fault locating method provided according to Embodiment 1 of the present invention;
[0048] Figure 2 is a flowchart of another application fault locating method provided according to Embodiment 2 of the present invention;
[0049] Figure 3 is a flowchart of another application fault locating method provided according to Embodiment 3 of the present invention;
[0050] Figure 4 is a service module topology diagram provided according to an embodiment of the present invention;
[0051] Figure 5 is a structural diagram of an application fault locating device provided according to a fourth embodiment of the present invention;
[0052] Figure 6 It is a schematic diagram of the structure of an electronic device provided by Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0053] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0054] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0055] Embodiment 1
[0056] Figure 1 This is a flowchart of an application fault locating method provided according to Example 1 of the present invention. This embodiment is applicable to the situation of locating the cause of an application fault. The method can be executed by an application fault locating device. The application fault locating device can be implemented in the form of hardware and / or software. The application fault locating device can be configured in an electronic device such as a computer.
[0057] like Figure 1 As shown, a method for locating an application fault disclosed in this embodiment includes:
[0058] S110, obtaining the Web operation log corresponding to the application in real time, and obtaining the target page URL triggered by the user for the application and the historical page URLs before the target page according to the Web operation log.
[0059] In this embodiment, the target page URL can be used to obtain the target page. The target page can be a page that the user wants to visit. The target page URL and the history page URL can have the same format as the Uniform Resource Locator (URL).
[0060] In this step, specifically, since the Web operation log may include Internet Protocol (IP) address, access date, user access method (i.e., request type), target page URL and historical page URL, etc., the Web operation log may be structurally parsed to obtain the target page URL and historical page URL. The historical page may be a page that the user visited before visiting the target page.
[0061] S120 , according to the number of visits corresponding to each field in the target page URL and the history page URL, count the service module lists of each level corresponding to the target page and the history page respectively.
[0062] In this embodiment, the service module list may be a list of service module names corresponding to each level.
[0063] In this step, optionally, the level corresponding to each field in the target page URL and the history page URL can be determined. Then, the number of visits corresponding to each field can be ranked according to the level to obtain a ranking result. Finally, the service module list corresponding to each level can be determined based on the ranking result and the preset ratio. Alternatively, the service module list corresponding to each level can be determined based on the number of visits corresponding to each field and the preset threshold.
[0064] For example, it can be determined whether the number of visits corresponding to the current field is lower than a preset threshold. If so, the current field can be considered a false positive field. If not, the current field can be used as a service module name and added to the service module list corresponding to the current level.
[0065] S130 , determining the calling relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the history page.
[0066] In this step, specifically, the calling relationship between the service modules can be determined according to the service module lists at each level and the access quantity corresponding to each service module in the application program.
[0067] In a specific implementation, the calling relationship between the service modules corresponding to the current level can be determined based on the service module list corresponding to the current level. Then, the calling relationship between the service modules corresponding to two adjacent levels can be determined based on the service module lists corresponding to the two adjacent levels. Finally, the above calling relationships can be combined to obtain the calling relationship between the service modules in the application.
[0068] S140. Determine a service function path map corresponding to the application program according to the calling relationship, and locate the fault in the application program according to the service function path map.
[0069] In this embodiment, the application failure may be manifested as the failure of the access request to a certain service module. The causes of the failure in the application may include client failure, service module failure, and operating environment (such as virtual machine and container) failure. The service function path map may be a topological map containing the call relationship between each service module. The service function path map can be used to assist in determining the location and path of the failure.
[0070] In this step, specifically, the response time of each service module to the user access request can be determined according to the service function path diagram, and the fault in the application program can be located according to the response time.
[0071] The advantage of this setting is that, compared with the existing technology of implementing fault location by implanting code at each function entrance, the technical solution of this embodiment determines the service module list corresponding to each level and the calling relationship between each service module through the Web operation log, and locates the fault according to the above calling relationship, avoiding the increase of fault risk points and processing time, and realizing efficient and accurate fault location in the application, reducing the cost of fault location in the application. Secondly, by efficiently and accurately locating the fault in the application, it is convenient to handle the fault in time, and improve the security of the application.
[0072] The technical solution of this embodiment obtains the Web operation log corresponding to the application in real time, obtains the target page URL triggered by the user for the application, and the historical page URL before the target page according to the Web operation log; counts the service module lists of each level corresponding to the target page and the historical page according to the number of visits corresponding to each field in the target page URL and the historical page URL; determines the calling relationship between the service modules in the application according to the service module lists of each level corresponding to the target page and the historical page; determines the service function path map corresponding to the application according to the calling relationship, and locates the fault in the application according to the service function path map. This technical means solves the problem of over-reliance on developers in the way of implanting code at each function entrance, resulting in a large workload for developers and a high cost of fault locating, and can achieve efficient and accurate fault locating in the application, reduce the cost of locating faults in the application, and improve the security of the application.
[0073] Embodiment 2
[0074] Figure 2 It is a flowchart of another application fault locating method provided according to the second embodiment of the present invention. This embodiment is a further optimization and expansion based on the above embodiments, and can be combined with various optional technical solutions in the above implementation methods.
[0075] like Figure 2 As shown, a method for locating an application fault disclosed in this embodiment includes:
[0076] S210: Obtain the Web operation log corresponding to the application in real time.
[0077] S220: According to the Web operation log, the original path of the target page triggered by the user for the application program and the original path of the historical page are obtained.
[0078] In this embodiment, the encoding formats corresponding to the original path of the target page and the original path of the historical page may include Base64, URL encoding, standard URL, and the like.
[0079] S230: Encode and identify the original path of the target page and the original path of the historical page respectively.
[0080] In this embodiment, the encoding recognition can be achieved by judging whether there is a preset structure in the original path of the target page and the original path of the historical page. Alternatively, the encoding recognition can be achieved by judging whether there are only preset characters in the original path of the target page and the original path of the historical page.
[0081] In this step, specifically, it can be determined whether each original path contains a " / string" or ". string" structure. If so, it can be considered that the original path is a path encoded in the standard URL format. Determine whether a "%2 string" structure exists in each original path. If so, it can be considered that the original path corresponds to the URL encoding format. Determine whether each original path contains only AZ, az, 0-9, "+" and " / ". If so, it can be considered that the original path is a path encoded in the Base64 format.
[0082] S240. According to the encoding recognition result, the original path of the target page and the original path of the historical page are converted according to the standard URL format to obtain the target page URL and the historical page URL.
[0083] In this step, optionally, if the encoding format corresponding to the original path is a standard URL format, the original path of the target page can be directly used as the target page URL, and the original path of the historical page can be used as the historical page URL. If the encoding format corresponding to the original path is URL encoding, the original path of the target page and the original path of the historical page can be converted according to the standard URL format using a URL decoding function. If the encoding format corresponding to the original path is Base64, the original path of the target page and the original path of the historical page can be converted according to the standard URL format using a Base64 function.
[0084] S250: Segment the target page URL and the history page URL according to the preset separator.
[0085] In this embodiment, the preset separator may be “ / ”.
[0086] Specifically, after the target page URL and the historical page URL are segmented, the level corresponding to each segmented word can be marked with a word sequence number.
[0087] For example, assuming that the target page URL is " / static / assets / bootstrap / newcs s / bootstrap.css", the target page URL can be segmented according to " / ". The segmentation results include static, assets, bootstrap, newcss, and bootstrap.css. Then, the corresponding level can be marked for each segmentation. For example, static can be marked as the first level, assets as the second level, bootstrap as the third level, newcss as the fourth level, and bootstrap.css as the fifth level.
[0088] S260: Obtain the processed target page URL and historical page URL, and filter invalid fields in the target page URL and historical page URL according to the field format of each field in the target page URL and historical page URL.
[0089] In this embodiment, the invalid field may be a field that is irrelevant to the determination of the calling relationship between the service modules.
[0090] In a specific implementation, it is possible to determine whether each field is a service name, parameter, or file name provided to the outside according to the field format of each field. If so, it can be considered that the above field cannot represent a service module in the application. At this time, the above field can be filtered.
[0091] In an optional implementation of the embodiment of the present invention, invalid fields in the target page URL and the historical page URL are filtered according to the field format of each field in the target page URL and the historical page URL, including: respectively obtaining the first-level field and the subsequent-level field in the target page URL and the historical page URL; determining whether the first-level field value is a domain name structure or an IP address; if so, filtering the first-level field as an invalid field; determining whether the character length corresponding to each subsequent-level field is greater than a preset length, or whether each subsequent-level field includes file name features and / or preset invalid characters; if so, filtering the subsequent-level field as an invalid field.
[0092] In this embodiment, the domain name structure (such as "*.com" and "*.net") and the IP address can be used to represent the service name provided to the outside. The file name feature can be ".*". The preset invalid characters can include "?", "=", "%" and "&".
[0093] In a specific implementation, if the first-level field is an invalid field, each level in the target page URL and the historical page URL can be updated. For example, the second level can be updated to the first level, the third level can be updated to the second level, and the fourth level can be updated to the third level until all levels are updated. If the subsequent level field contains a structure composed of characters such as "?", "=", "%" and "&", the field can be considered as a leaf node and filtered.
[0094] For example, if the first-level field value is liuxiaodo.u.rizhiyi.com, the first level can be considered as the root service layer, and the first-level field can be filtered as an invalid field. Assuming the preset length is 50, if there is a field with a character length greater than 50 characters in the subsequent level fields, the field can be considered as a leaf node, and the field can be filtered.
[0095] The advantage of such a setting is that by filtering invalid fields, it is possible to avoid subsequent determination of call relationships based on invalid fields, thereby saving resources, improving the efficiency of determining call relationships, and further improving the efficiency of fault location.
[0096] S270. According to the number of visits corresponding to each field in the target page URL and the history page URL, count the service module lists of each level corresponding to the target page and the history page respectively.
[0097] Among them, each field in the target page URL and the history page URL has been filtered for invalid fields.
[0098] S280. Determine the calling relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the history page.
[0099] S290. Determine a service function path map corresponding to the application program according to the calling relationship, and locate the fault in the application program according to the service function path map.
[0100] The technical solution of this embodiment is to obtain the Web operation log corresponding to the application in real time; obtain the original path of the target page triggered by the user for the application and the original path of the historical page according to the Web operation log; respectively perform encoding and recognition on the original path of the target page and the original path of the historical page; according to the encoding and recognition result, respectively convert the original path of the target page and the original path of the historical page according to the standard resource locator URL format to obtain the target page URL and the historical page URL; perform word segmentation processing on the target page URL and the historical page URL according to the preset separator; obtain the processed target page URL and the historical page URL, and according to the field format of each field in the target page URL and the historical page URL, perform word segmentation processing on the target page URL and the historical page URL The invalid fields in the URLs of the target pages and historical pages are filtered; according to the number of visits corresponding to each field, the lists of service modules at each level corresponding to the target pages and historical pages are counted; according to the lists of service modules at each level, the calling relationship between the service modules in the application is determined; according to the calling relationship, the service function path map corresponding to the application is determined, and the technical means for locating faults in the application according to the service function path map solves the problem that the method of implanting code at each function entrance is overly dependent on developers, resulting in a large workload for developers and a high cost of fault locating. It can realize efficient and accurate fault locating in the application, reduce the cost of locating faults in the application, and improve the security of the application.
[0101] Embodiment 3
[0102] Figure 3 It is a flowchart of another application fault locating method provided according to the third embodiment of the present invention. This embodiment is a further optimization and expansion based on the above embodiments, and can be combined with various optional technical solutions in the above implementation methods.
[0103] like Figure 3 As shown, a method for locating an application fault disclosed in this embodiment includes:
[0104] S310. Obtain the Web operation log corresponding to the application in real time, and obtain the target page URL triggered by the user for the application and the historical page URL before the target page based on the Web operation log; and count the service module lists of each level corresponding to the target page and the historical page based on the number of visits corresponding to each field in the target page URL and the historical page URL.
[0105] S320: Obtain the first-level service module lists corresponding to the target page and the history page, respectively, and the number of visits corresponding to each service module in each first-level service module list.
[0106] In this embodiment, the first-level service module list may be obtained from the first-level fields of the target page URL and the history page URL.
[0107] In this step, specifically, the first-level fields in the target page URL and the history page URL can be obtained respectively. Then, the first-level service module list can be determined according to the number of visits corresponding to each first-level field.
[0108] For example, the target page URL and the historical page URL may be obtained from the web operation log generated by each user access, and then an access record table may be constructed based on the fields, wherein each row represents an access record.
[0109] Table 1 is an access record table provided according to an embodiment of the present invention. As shown in Table 1, refer_L1 is the first-level field in the historical page URL, refer_L2 is the second-level field in the historical page URL, req_L1 is the first-level field in the target page URL, req_L2 is the second-level field in the target page URL, and req_L3 is the third-level field in the target page URL. Taking the first line as an example, search in the first line is the first-level field value in the historical page URL, api is the first-level field value in the target page URL, v0 is the second-level field value in the target page URL, and notice is the third-level field value in the target page URL.
[0110] Table 1
[0111] Serial number refer_L1 refer_L2 req_L1 req_L2 req_L3 1 search API V0 notice 2 search API V0 notice 3 search static scripts search 4 search API V0 notice 5 search static assets popover 6 static css static img login 7 search API V0 notice 8 dashboard 27022 API V0 dashboard 9 search static assets no-table 10 search static assets no-table 11 search API V0 sources 12 search API V0 notice 13 dashboard static assets highcharts 14 dashboard 27022 static img dashboard 15 search API V0 search 16 dashboard API V0 notice
[0112] The advantage of this setting is that by accessing the record table, the field values corresponding to each level can be intuitively obtained, thereby improving the efficiency of obtaining the calling relationship between each service module.
[0113] S330: Determine the calling relationship between the first-level service modules corresponding to the application program according to the access quantity corresponding to each service module in each first-level service module list.
[0114] In a specific implementation, the names of the first-level service modules corresponding to the target page and the history page can be obtained from the first-level service module list. Then, the number of visits corresponding to each first-level service module can be obtained, and each number of visits can be ranked. Finally, the calling relationship between the first-level service modules can be determined based on the ranking results. Optionally, the service module with a large number of visits can be used as the caller, and the service module with a small number of visits can be used as the callee.
[0115] Since the target page and the history page are in a previous and next visit relationship, that is, the history page URL calls the target page URL, the number of visits corresponding to each first-level service module is different, so the call relationship can be determined based on the number of visits.
[0116] For example, the refer_L1 value and the req_L1 value, as well as the number of visits corresponding to the refer_L1 value and the req_L1 value, respectively, may be obtained. Then, the number of visits may be ranked to obtain the calling relationship between the first-level service modules.
[0117] S340, obtaining lists of subsequent-level service modules corresponding to the target page and the historical pages respectively.
[0118] S350. Obtain one level in the subsequent levels as the current level in turn, and determine the first calling relationship between the service modules in the current level corresponding to the target page according to the service module list of the current level corresponding to the target page and the service module list of the previous level before the current level.
[0119] In this step, specifically, the name of the current service module can be obtained from the current level service module list, and the name of the previous service module can be obtained from the previous level service module list. Then, the number of visits corresponding to the current service module and the previous service module can be obtained. Finally, the above number of visits can be sorted, and the first call relationship can be determined according to the sorting result.
[0120] Exemplarily, assuming that the current level is the second level, the first-level service module list and the second-level service module list corresponding to the target page can be obtained. Then, the first-level service module can be obtained according to the first-level service module list, and the second-level service module can be obtained according to the second-level service module list. Finally, the number of visits corresponding to the first-level service module and the second-level service module can be obtained respectively, and the first call relationship can be determined according to the number of visits.
[0121] In another exemplary embodiment, the refer_L1 value (such as dashboard) and the refer_L2 value (such as 27022) and the access numbers corresponding to the refer_L1 value and the refer_L2 value can be obtained. Then, the access numbers can be ranked to obtain the first call relationship.
[0122] S360: Determine a second calling relationship between service modules in the current level corresponding to the historical page according to the service module list of the current level corresponding to the historical page and the service module list of the previous level before the current level.
[0123] Exemplarily, assuming that the current level is the second level, the first-level service module list and the second-level service module list corresponding to the historical page can be obtained. Then, the first-level service module and the second-level service module corresponding to the historical page can be obtained according to the first-level service module list and the second-level service module list corresponding to the historical page. Finally, the number of visits to the first-level service module and the second-level service module corresponding to the historical page can be obtained respectively, and the second call relationship can be determined according to the number of visits.
[0124] In another exemplary embodiment, the req_L1 value and the req_L2 value, as well as the access numbers corresponding to the req_L1 value and the req_L2 value, respectively, may be obtained. Then, the access numbers may be ranked to obtain the second call relationship.
[0125] S370: Superimpose the first calling relationship and the second calling relationship to obtain the calling relationship between the current-level service modules corresponding to the application program.
[0126] After obtaining the calling relationship between the service modules of the current level corresponding to the application program, the process returns to S350 until obtaining the calling relationship between the service modules of each level.
[0127] S380. Determine the service function path map corresponding to the application program according to the calling relationship between service modules at each level.
[0128] S390. Obtain the user access method corresponding to each service module in the application, and determine the module service attributes corresponding to each service module based on the user access method; update the service function path map based on the service attributes of each module to obtain the service module topology map, and locate the fault in the application based on the service module topology map.
[0129] In this embodiment, the user access mode can be used to reflect the mode in which each service module provides services to the outside. The service module topology map can be used to reflect the calling relationship between each service module and the module service attributes corresponding to each service module. The module service attributes can be used to assist in determining the location where the fault occurs.
[0130] Exemplarily, Table 2 is a user access mode table provided according to an embodiment of the present invention. As shown in Table 2, the user access mode may include GET, HEAD, CONNECT, OPINIONS, TRACE, POST, DELETE or PUT. If the user access mode corresponding to the service module is GET, HEAD, CONNECT, OPINIONS, TRACE or POST, it can be considered that the service module can only output data, that is, the out feature appears. If the user access mode is POST, DELETE or PUT, it can be considered that the service module can only receive data, that is, the in feature appears. If the user access mode corresponding to a service module includes POST and PUT, it can be considered that the service module can both output data and receive data, that is, it includes both in features and out features.
[0131] Table 2
[0132] User access mode Assignment GET out HEAD out CONNECT out OPINIONS out TRACE out POST in DELETE in PUT in
[0133] Furthermore, the distribution results of each user's access method can be cumulatively calculated, and the module service attributes corresponding to each service module can be determined based on the distribution results. Specifically, if only the out feature (such as GET) appears in all access behaviors corresponding to the service module, the module service attribute of the service module is assigned to out. If only the in feature (such as POST) appears in all access behaviors corresponding to the service module, the module service attribute of the service module is assigned to in. If both the in feature and the out feature appear in all access behaviors corresponding to the service module, the module service attribute of the service module is assigned to in / out. Then, the service function path diagram can be updated according to the module service attributes corresponding to each service module, and the updated result is used as the service module topology diagram.
[0134] A service module topology diagram can be constructed based on Table 1. Figure 4 is a service module topology diagram provided according to an embodiment of the present invention. Figure 4 As shown in the figure, the module service attribute values corresponding to dashboard, search, 27022, css, and assets are out. The module service attribute values corresponding to scripts and languages are in. The module service attribute values corresponding to static, api, img, and v0 are in / out.
[0135] The calling relationship between the first-level service modules is that dashboard calls static and api, and search calls static and api. Optionally, dashboard calls search. Among them, the history page corresponds to the first-level service module list including dashboard, search and static. The target page corresponds to the first-level service module list including api and static. The target page corresponds to the second-level service module list including v0, scripts, assets and img. The first calling relationship is that api calls v0, and static calls scripts, assets and img. The history page corresponds to the second-level service module list including css and 27022. The second calling relationship is that dashboard calls 27022, and static calls css.
[0136] The advantage of this setting is that in and out can be used to indicate the way in which the service module provides services to the outside world. Among them, in means that the client can upload data. Out means that the client can only browse data and cannot modify, upload or delete data. Therefore, if the module service attribute value corresponding to the service module is in, the service module can be considered as a failure point below the Web layer. If the module service attribute value corresponding to the service module is out, the service module can be considered as a server-side failure point. If the module service attribute value corresponding to the service module is in / out, it can be considered that the application has an overall failure. Secondly, since the risk level corresponding to the service module with the module service attribute value in is higher than that of the service module with the module service attribute value out, by assigning module service attribute values to each service module, it is possible to increase the attention paid to the service module assigned with the value in in in the subsequent fault location and performance analysis scenarios, thereby improving the efficiency of fault location in the application.
[0137] The technical solution of this embodiment is to obtain the Web operation log, target page URL and history page URL corresponding to the application; count the service module lists of each level according to the number of visits to each field in the target page URL and the history page URL; obtain the first-level service module lists corresponding to the target page and the history page respectively, and the number of visits corresponding to each service module in each first-level service module list; determine the calling relationship between the first-level service modules corresponding to the application according to the number of visits corresponding to each service module in each first-level service module list; obtain the subsequent-level service module lists corresponding to the target page and the history page respectively; obtain one level in the subsequent levels as the current level, and determine the first calling relationship between the service modules in the current level corresponding to the target page according to the current-level service module list corresponding to the target page and the list of service modules of the previous level before the current level; determine the current-level service module list corresponding to the history page and the list of service modules of the previous level before the current level. The second calling relationship between each service module in the current level corresponding to the history page; superimpose the first calling relationship and the second calling relationship to obtain the calling relationship between the service modules in the current level corresponding to the application; return to execute the operation of obtaining one level as the current level in the subsequent levels in turn until the processing of all levels is completed; obtain the user access method corresponding to each service module in the application; determine the module service attributes corresponding to each service module according to the calling relationship and the user access method corresponding to each service module, and according to the user access method; update the service function path map according to the service attributes of each module to obtain the service module topology map, and locate the fault in the application according to the service module topology map. The technical means solves the problem of over-reliance on developers in the way of implanting code at each function entrance, resulting in a large workload for developers and high fault location cost. It can realize efficient and accurate fault location in the application, reduce the cost of fault location in the application, and improve the security of the application.
[0138] Embodiment 4
[0139] Figure 5 A structural diagram of an application fault locating device provided for embodiment 4 of the present invention. This embodiment can be applied to the situation of locating the root cause of an application fault. The application fault locating device can be implemented in the form of hardware and / or software and can be configured in an electronic device such as a computer.
[0140] like Figure 5 As shown, the application fault locating device disclosed in this embodiment includes:
[0141] The page URL acquisition module 51 is used to acquire the Web operation log corresponding to the application in real time, and acquire the target page URL triggered by the user for the application and the URL of the historical page before the target page according to the Web operation log;
[0142] The service list acquisition module 52 is used to count the service module lists of each level corresponding to the target page and the historical page according to the number of visits corresponding to each field in the target page URL and the historical page URL;
[0143] A call relationship determination module 53, used to determine the call relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the historical page;
[0144] The fault location module 54 is used to determine the service function path diagram corresponding to the application program according to the calling relationship, and locate the fault in the application program according to the service function path diagram.
[0145] The technical solution in this embodiment solves the problem of over-reliance on developers in the way of implanting code at each function entrance, resulting in heavy workload for developers and high fault location costs, through the mutual cooperation of the page URL acquisition module, the service list acquisition module, the call relationship determination module and the fault location module. It can efficiently and accurately locate faults in the application, reduce the cost of locating faults in the application, and improve the security of the application.
[0146] Optionally, the page URL acquisition module 51 includes:
[0147] The original path acquisition unit is used to acquire the original path of the target page triggered by the user for the application and the original path of the historical page according to the Web operation log;
[0148] A code recognition unit, used for respectively performing code recognition on the original path of the target page and the original path of the historical page;
[0149] The page URL acquisition unit is used to convert the original path of the target page and the original path of the historical page according to the standard resource locator URL format according to the encoding recognition result to obtain the target page URL and the historical page URL.
[0150] Optionally, the device further includes a field filtering module, which includes:
[0151] A word segmentation processing unit, used to perform word segmentation processing on the target page URL and the history page URL according to a preset separator;
[0152] An invalid field filtering unit is used to obtain the processed target page URL and historical page URL, and filter the invalid fields in the target page URL and historical page URL according to the field format of each field in the target page URL and historical page URL;
[0153] A hierarchical field acquisition unit, used to respectively acquire the first hierarchical field and the subsequent hierarchical fields in the target page URL and the historical page URL;
[0154] The root service layer filtering unit is used to determine whether the first-level field value is a domain name structure or an IP address; if so, the first-level field is filtered as an invalid field;
[0155] The leaf service layer judgment unit is used to judge whether the character length corresponding to each subsequent level field is greater than a preset length, or whether each subsequent level field includes a file name feature and / or a preset invalid character;
[0156] The leaf service layer filtering unit is used to filter the subsequent level fields as invalid fields if the character length corresponding to the subsequent level fields is greater than a preset length, or each subsequent level field includes file name features and / or preset invalid characters.
[0157] Optionally, the calling relationship determination module 53 includes:
[0158] A visit number acquisition unit, used to acquire the first-level service module lists corresponding to the target page and the history page, and the visit number corresponding to each service module in each first-level service module list;
[0159] A call relationship determination unit, configured to determine the call relationship between the first-level service modules corresponding to the application program according to the access quantity corresponding to each service module in each first-level service module list;
[0160] The first call relationship determination unit is used to obtain a list of subsequent-level service modules corresponding to the target page and the historical page respectively; sequentially obtain a level in the subsequent levels as the current level, and determine a first call relationship between the service modules in the current level corresponding to the target page according to the list of service modules in the current level corresponding to the target page and the list of service modules in the previous level before the current level;
[0161] A second call relationship determination unit, configured to determine a second call relationship between service modules in the current level corresponding to the historical page according to the current level service module list corresponding to the historical page and the previous level service module list before the current level;
[0162] A current call relationship determination unit, used to superimpose the first call relationship and the second call relationship to obtain a call relationship between current-level service modules corresponding to the application program;
[0163] The call relationship loop determination unit is used to return to execute the operation of sequentially acquiring one level in the subsequent levels as the current level until the processing of all levels is completed.
[0164] Optionally, the fault location module 54 includes:
[0165] The module attribute determination unit is used to obtain the user access mode corresponding to each service module in the application program, and determine the module service attribute corresponding to each service module according to the user access mode;
[0166] The fault location unit is used to update the service function path map according to the service attributes of each module, obtain the service module topology map, and locate the fault in the application according to the service module topology map.
[0167] The application fault location device provided in the embodiment of the present invention can execute the application fault location method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in this embodiment, reference can be made to the description in any method embodiment of the present application.
[0168] Embodiment 5
[0169] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0170] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0171] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0172] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an application fault location method.
[0173] In some embodiments, the application fault location method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the application fault location method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the application fault location method in any other appropriate manner (e.g., by means of firmware).
[0174] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0175] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0176] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0177] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0178] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0179] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0180] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0181] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for locating an application fault, characterized in that: include: Acquire the web operation log corresponding to the application in real time, and acquire the target page URL triggered by the user for the application and the historical page URL before the target page according to the web operation log; According to the number of visits corresponding to each field in the target page URL and the history page URL, a list of service modules at each level corresponding to the target page and the history page is counted; Determine the calling relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the history page; Determine a service function path map corresponding to the application program according to the calling relationship, and locate a fault in the application program according to the service function path map; The method of counting service module lists of each level corresponding to the target page and the historical page, based on the number of visits corresponding to each field in the target page URL and the historical page URL, includes: Determine whether the number of visits corresponding to the current field is lower than the preset threshold; if so, the current field is considered to be a false positive field; if not, the current field is used as the service module name and added to the service module list corresponding to the current level; The step of determining the calling relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the history page respectively includes: Obtain a list of subsequent-level service modules corresponding to the target page and the historical page respectively; In the subsequent levels, a level is sequentially obtained as the current level, and a first calling relationship between service modules in the current level corresponding to the target page is determined according to the service module list of the current level corresponding to the target page and the service module list of the previous level before the current level; Determine a second calling relationship between service modules in the current level corresponding to the history page according to the service module list of the current level corresponding to the history page and the service module list of the previous level before the current level; The first calling relationship and the second calling relationship are superimposed to obtain a calling relationship between current-level service modules corresponding to the application program; Returns the operation of obtaining one level in the subsequent levels as the current level in turn until all levels are processed.
2. The method according to claim 1, characterized in that: Acquiring the URL of the target page triggered by the user for the application program and the URL of the historical page before the target page according to the Web operation log, including: According to the Web operation log, the original path of the target page triggered by the user for the application and the original path of the historical page are obtained; Encoding and identifying the original path of the target page and the original path of the historical page respectively; According to the encoding recognition result, the original path of the target page and the original path of the historical page are converted according to the standard resource locator URL format to obtain the target page URL and the historical page URL.
3. The method according to claim 1, characterized in that Before counting the service module lists of each level corresponding to the target page and the historical page respectively according to the number of visits corresponding to each field in the target page URL and the historical page URL, the method further includes: According to the preset separator, the target page URL and the historical page URL are segmented; The processed target page URL and historical page URL are obtained, and invalid fields in the target page URL and historical page URL are filtered according to the field format of each field in the target page URL and historical page URL.
4. The method according to claim 3, characterized in that According to the field format of each field in the target page URL and the history page URL, invalid fields in the target page URL and the history page URL are filtered, including: Get the first-level field and subsequent-level fields in the target page URL and the history page URL respectively; Determine whether the first-level field value is a domain name structure or an IP address; if so, filter the first-level field as an invalid field; Determine whether the character length corresponding to each subsequent level field is greater than a preset length, or whether each subsequent level field includes a file name feature and / or preset invalid characters; If so, the subsequent level fields are filtered as invalid fields.
5. The method according to claim 1, characterized in that According to the service module lists of each level corresponding to the target page and the history page, the calling relationship between the service modules in the application is determined, including: Obtaining first-level service module lists corresponding to the target page and the history page, respectively, and the number of visits corresponding to each service module in each of the first-level service module lists; According to the access quantity corresponding to each service module in each of the first-level service module lists, the calling relationship between the first-level service modules corresponding to the application program is determined.
6. The method according to claim 1, characterized in that Locating the fault in the application program according to the service function path diagram includes: Obtaining the user access mode corresponding to each service module in the application, and determining the module service attribute corresponding to each service module according to the user access mode; The service function path map is updated according to the service attributes of each module to obtain a service module topology map, and the fault in the application is located according to the service module topology map.
7. An application fault location device, characterized in that: The device comprises: A page URL acquisition module is used to acquire the Web operation log corresponding to the application in real time, and acquire the target page URL triggered by the user for the application and the URL of the historical page before the target page according to the Web operation log; A service list acquisition module is used to count service module lists of each level corresponding to the target page and the historical page according to the number of visits corresponding to each field in the target page URL and the historical page URL; A calling relationship determination module, used to determine the calling relationship between the service modules in the application program according to the service module lists of each level corresponding to the target page and the historical page; A fault location module, used to determine a service function path map corresponding to the application program according to the calling relationship, and locate the fault in the application program according to the service function path map; The service list acquisition module is further used to determine whether the number of visits corresponding to the current field is lower than a preset threshold; if so, the current field is considered to be a false positive field; if not, the current field is used as the service module name and added to the service module list corresponding to the current level; Wherein, the calling relationship determination module includes: The first call relationship determination unit is used to obtain a list of subsequent-level service modules corresponding to the target page and the historical page respectively; sequentially obtain a level in the subsequent levels as the current level, and determine a first call relationship between the service modules in the current level corresponding to the target page according to the list of current-level service modules corresponding to the target page and the list of previous-level service modules before the current level; A second call relationship determination unit, configured to determine a second call relationship between service modules in the current level corresponding to the historical page according to the current level service module list corresponding to the historical page and the previous level service module list before the current level; A current call relationship determination unit, configured to superimpose the first call relationship and the second call relationship to obtain a call relationship between current-level service modules corresponding to the application program; The call relationship loop determination unit is used to return to execute the operation of sequentially acquiring one level in the subsequent levels as the current level until the processing of all levels is completed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the application fault locating method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the application fault locating method according to any one of claims 1 to 6 when executed.
