Abnormal component identification method, device, equipment, storage medium and program product
By constructing a mapping relationship between exception log information and symbolized information, and combining preset configuration information, abnormal components are automatically identified, the problem of low recognition efficiency of abnormal components in the modular development mode is solved, development and maintenance efficiency is improved, and costs are reduced.
Patent Information
- Application Number
- CN202210395564.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-04-14
AI Technical Summary
In the modular development mode, the recognition efficiency of abnormal components is low, resulting in high manual participation and increased cost. As the business complexity of the application increases, the recognition efficiency of abnormal modules becomes low.
By obtaining the exception log information of the target application, the mapping relationship between address information and symbolized information is constructed based on the exception address information and the preset symbol table, the exception component is further determined based on the mapping relationship between index information and compilation path, and the preset configuration information is automatically used to determine the exception component. Identify exception components.
It realizes automatic identification of abnormal components, improves the efficiency of abnormal information allocation, improves development and maintenance efficiency, and reduces labor costs.
Smart Images

Figure CN114840400B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for identifying abnormal components. Background Art
[0002] As applications become more and more complex, their development process is usually based on modular division of labor. Each developer is responsible for the development of the corresponding module, and then the codes of each module are unified and integrated into a data package and released. This collaborative model greatly improves development efficiency. However, when an abnormal situation occurs during the use of the application, such as a crash, the corresponding code needs to be checked and modified if necessary. At present, under this modular development model, after an abnormal situation is discovered, the abnormal information is generally manually assigned to the corresponding developer for inspection / modification. This manual allocation method of abnormal information has a high degree of manual participation, and as the business complexity of the application increases, the labor cost further increases, and the recognition efficiency of the abnormal module becomes low. Summary of the invention
[0003] The present disclosure proposes an abnormal component identification method, device, equipment, storage medium and program product to solve the technical problems of low efficiency and high cost of abnormal component identification to a certain extent.
[0004] In a first aspect, the present disclosure provides a method for identifying an abnormal component, comprising:
[0005] Get exception log information for the target application;
[0006] Obtaining symbolic information of the abnormal address information based on the abnormal address information in the abnormal log information and a first mapping relationship; wherein the symbolic information includes index information, and the first mapping relationship includes a mapping relationship between the address information and the symbolic information obtained based on the preset symbol table;
[0007] Obtaining a compilation path of the abnormal log information based on the index information and a second mapping relationship; wherein the second mapping relationship includes a mapping relationship between the index information and the compilation path obtained based on the preset symbol table;
[0008] The abnormal component is determined based on the compilation path and preset configuration information for indicating a location of component information in the compilation path.
[0009] In a second aspect of the present disclosure, a device for identifying an abnormal component is provided, comprising:
[0010] An acquisition module is used to obtain abnormal log information for a target application;
[0011] A first mapping module, configured to obtain symbolic information of the abnormal address information based on the abnormal address information in the abnormal log information and a first mapping relationship; wherein the symbolic information includes index information, and the first mapping relationship includes a mapping relationship between the address information and the symbolic information obtained based on the preset symbol table;
[0012] A second mapping module, configured to obtain a compilation path of the abnormal log information based on the index information and a second mapping relationship; wherein the second mapping relationship includes a mapping relationship between the index information and the compilation path obtained based on the preset symbol table;
[0013] The component determination module is used to determine the abnormal component based on the compilation path and preset configuration information about the compilation path and component information.
[0014] According to a third aspect of the present disclosure, an electronic device is provided, characterized in that it includes one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the program includes instructions for executing the method described in the first aspect.
[0015] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect.
[0016] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect.
[0017] From the above, it can be seen that the present disclosure provides a method, device, equipment, storage medium and program product for identifying abnormal components, which builds corresponding mapping relationships between address information and symbolized information and mapping relationships between index information and compilation paths based on a preset symbol table, and determines the compilation path corresponding to the abnormal log information accordingly, and then determines the component where the abnormality occurs based on the compilation path and preset configuration information. It can realize automatic identification of abnormal components, which helps to distribute the abnormal information related to the abnormal components efficiently, and further improves the development and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A schematic diagram of an abnormal component identification architecture according to an embodiment of the present disclosure.
[0020] Figure 2 The figure is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.
[0021] Figure 3 The figure is a flowchart of a method for identifying abnormal components according to an embodiment of the present disclosure.
[0022] Figure 4 The figure is a schematic diagram of the principle of the method for identifying abnormal components according to an embodiment of the present disclosure.
[0023] Figure 5 A schematic diagram of an interface for component configuration information according to an embodiment of the present disclosure.
[0024] Figure 6 A schematic diagram of an abnormal component identification device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0026] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0027] During the operation of the application, there may be logical errors, such as call errors, array out of bounds, null pointers, etc., which may cause the application to run abnormally, such as program crashes. When an abnormal situation occurs in the application, the relevant information of the abnormal situation will be automatically recorded in the abnormal log, providing the developer of the application with a data basis for solving the abnormal problem. However, the existing method of allocating abnormal information is to manually allocate it by designated personnel. When an abnormal situation occurs in the application, the corresponding abnormal log information will be recorded in the abnormal log. The designated personnel will manually judge the component / module where the abnormal situation occurs based on the call stack information of the abnormal log information, and allocate the relevant abnormal information to the corresponding open personnel of the module where the abnormal situation occurs for inspection. This manual judgment and allocation method greatly restricts the allocation efficiency of abnormal information, reduces the recognition efficiency of abnormal components, and leads to a decrease in the development and maintenance efficiency of the application, and an increase in labor costs. Therefore, how to realize the automatic identification of abnormal components to improve the recognition efficiency of abnormal components, thereby improving the development and maintenance efficiency of the application and reducing costs is a technical problem that needs to be solved urgently.
[0028] In view of this, the embodiments of the present disclosure provide a method, device, equipment, storage medium and program product for identifying abnormal components. Based on the preset symbol table, the corresponding mapping relationship between address information and symbolized information, and the mapping relationship between index information and compilation path are constructed, and the compilation path corresponding to the abnormal log information is determined accordingly, and then the component where the abnormality occurs is determined based on the compilation path and preset configuration information. It can realize automatic identification of abnormal components, which helps to distribute the abnormal information related to the abnormal components and further improve development efficiency.
[0029] Figure 1 FIG. 1 is a schematic diagram showing an abnormal component identification architecture of an embodiment of the present disclosure. Figure 1 , the identification architecture 100 of the abnormal component may include a server 110, a terminal 120, and a network 130 providing a communication link. The server 110 and the terminal 120 may be connected via a wired or wireless network 130. The server 110 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0030] The terminal 120 may be implemented in hardware or software. For example, when the terminal 120 is implemented in hardware, it may be various electronic devices having a display screen and supporting page display, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, and desktop computers, etc. When the terminal 120 device is implemented in software, it may be installed in the electronic devices listed above; it may be implemented as multiple software or software modules (such as software or software modules used to provide distributed services), or it may be implemented as a single software or software module, which is not specifically limited here.
[0031] It should be noted that the method for identifying abnormal components provided in the embodiment of the present application can be executed by the terminal 120 or by the server 110. It should be understood that Figure 1 The number of terminals, networks and servers in the embodiment is only for illustration and is not intended to limit the number of terminals, networks and servers. Any number of terminals, networks and servers may be provided as required.
[0032] Figure 2 FIG. 2 shows a schematic diagram of the hardware structure of an exemplary electronic device 200 provided in an embodiment of the present disclosure. Figure 2 As shown, the electronic device 200 may include: a processor 202, a memory 204, a network module 206, a peripheral interface 208 and a bus 210. The processor 202, the memory 204, the network module 206 and the peripheral interface 208 are connected to each other in communication within the electronic device 200 through the bus 210.
[0033] Processor 202 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 202 may be used to perform functions related to the technology described in this disclosure. In some embodiments, processor 202 may also include multiple processors integrated into a single logical component. For example, Figure 2 As shown, processor 202 may include a plurality of processors 202a, 202b, and 202c.
[0034] The memory 204 may be configured to store data (eg, instructions, computer code, etc.). Figure 2As shown, the data stored in the memory 204 may include program instructions (e.g., program instructions for implementing the method for identifying abnormal components of the embodiment of the present disclosure) and data to be processed (e.g., the memory may store configuration files of other modules, etc.). The processor 202 may also access the program instructions and data stored in the memory 204, and execute the program instructions to operate on the data to be processed. The memory 204 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 204 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0035] The network module 206 can be configured to provide communication with other external devices to the electronic device 200 via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC) etc.), a cellular network, the Internet or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network module 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
[0036] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0037] The bus 210 can be configured to transmit information between various components of the electronic device 200 (e.g., the processor 202, the memory 204, the network module 206, and the peripheral interface 208), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0038] It should be noted that, although the architecture of the electronic device 200 only shows the processor 202, the memory 204, the network module 206, the peripheral interface 208 and the bus 210, in the specific implementation process, the architecture of the electronic device 200 may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the architecture of the electronic device 200 may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0039] The dSYM file is a product of the native compilation tool chain of the operating system (such as the IOS system) and can be used to record debugging information, including the compilation path of the source file. For example, based on the method tag (such as DW_TAG_subprogram DIE) in the debug information debug_info recorded in the dSYM file, the corresponding source file compilation path attribute DW_AT_decl_file can be indexed to obtain the compilation path. According to the compilation path, the corresponding class library (pod) name can be directly determined, and thus the component corresponding to the class library name can be determined according to the preset symbol table. For example, a dSYM file can include:
[0040] DW_AT_decl_file(" / Code1 / Code2 / Code3 / Pods / Code4 / Code5 / Code6.m") indicates that the compilation path is " / Code1 / Code2 / Code3 / Pods / Code4 / Code5 / Code6.m", from which we can directly determine that the corresponding class library (pod) name is Code4 after "Pods". Based on the class library (pod) name Code4 and the preset configuration information indicating the location of the component information in the compilation path, we can determine the component information in the compilation path, and thus determine the corresponding component.
[0041] The exception log file can save the function memory address where each application has an exception, and these function memory addresses can find the specific file name, function name and line number information in the dSYM file. Accordingly, the corresponding compilation path can be determined in the dSYM file according to the function memory address, and then the corresponding class library name can be determined according to the compilation path, and then the component where the exception occurs can be determined to achieve automatic identification of the abnormal component. Since the dSYM file is hosted in the monitoring background of the application, the compilation path of its source file is independent of the source code form or the binary integrated form. Even for a binary integrated software development kit (SDK), as long as there is debugging information debugging info, the complete compilation path of the source file can be parsed. Therefore, the solution of the embodiment of the present disclosure only needs to rely on the dSYM file, and dSYM is a standardized file, so the solution of the embodiment of the present disclosure can be applied to all applications and has good universality.
[0042] See also Figure 3 , Figure 3 A schematic flow chart of a method for identifying abnormal components according to an embodiment of the present disclosure is shown. Figure 3 In the method 300 for identifying abnormal components, the method 300 may include the following steps.
[0043] In step S301, abnormal log information for a target application is obtained.
[0044] Whenever an application crashes or other abnormal situations occur, an exception log will be generated and stored on the device. The exception log will record the stack of all execution threads in the current process, as well as the cause of the exception, so as to quickly locate the cause of the exception.
[0045] In some embodiments, the exception log information may include process information, basic information, exception information, thread backtrace, exception address information, and dynamic library information. The exception address information includes binary address information where the exception occurs, which needs to be symbolically parsed to obtain code function information readable by developers.
[0046] In step S302, symbolized information of the exception address information is obtained based on the exception address information in the exception log information and a first mapping relationship; wherein the symbolized information includes index information, and the first mapping relationship includes a mapping relationship between address information and symbolized information obtained based on the preset symbol table.
[0047] Among them, for exception log information, a preset symbol table is needed to map raw information such as binary addresses to method names and code lines at the source code level so that it is readable by developers. The preset symbol table refers to the dSYM file with the same name generated in the same directory as the compiled binary file app after the source code is compiled. The dSYM file contains hexadecimal-based function address mapping information. All debugging symbols are in the dSYM file, including file name, function name, line number, etc. Since a new dSYM file is generated each time the source code is compiled. Therefore, each released version of the application will back up a corresponding dSYM file to debug and locate problems.
[0048] When symbol parsing is performed on each line of the abnormal log information, the compile path of the current source file can be directly returned. However, when the monitoring background of the application performs symbol parsing, it is a complete parsing of all symbol tables. Returning the compile path together with the parsing result will increase the storage burden and bring great challenges to computing resources and storage resources. Then, based on the preset symbol table, a mapping relationship map_adress_path from the offset address of the source file in the preset symbol table to the compile path is established, and index information I is set in each offset address adress and its corresponding compile path path in the mapping relationship. At the same time, the corresponding index information I can be set in the symbolized information corresponding to the address range of each abnormal address information, and the index information I is returned as part of the symbolized information. Then, the corresponding compile path path can be directly determined in the mapping relationship map_adress_path according to the index information I in the symbolized information. Compared with returning the compile path path directly in the symbolized information, determining the compile path based on the mapping relationship map_adress_path can reduce the amount of data and save computing resources and storage resources.
[0049] In some embodiments, the method 300 may further include: performing symbol table pre-parsing based on a preset symbol table to obtain the first mapping relationship between address information and symbolized information; wherein the symbolized information includes index information. Figure 4 , Figure 4 A schematic diagram of the principle of the method for identifying abnormal components according to an embodiment of the present disclosure is shown. After compilation, the developer can upload the corresponding preset symbol table (e.g., .dSYM file) to the database TBS for storage, for example, via the symbol table upload module 410. After the storage is successful, the database TBS returns an instruction of success information to the symbol table upload module 410. When the first mapping relationship is constructed by the symbol table pre-resolution module 420, the storage address of the preset symbol table can be obtained from the symbol table upload module 410; the symbol table upload module 410 can send the storage address of the preset symbol table to the symbol table pre-resolution module 420 through the rocktmq message. The symbol table pre-resolution module 420 synchronizes the preset symbol table from TBS according to the storage address, and performs pre-resolution based on the obtained preset symbol table to obtain a mapping relationship between address information and symbolized information as the first mapping relationship. For example, the first mapping relationship map1 includes address information adress1: symbolized information symbol1_index1 (index information); the exception log information may include exception address information, for example, the exception address information is adress1, then based on the exception address information adress1 and the first mapping relationship map1, the symbolized information and index information of the exception address information adress1 can be determined to be symbol1_index1.
[0050] In step S303, a compilation path of the abnormal log information is obtained based on the index information in the symbolized information and a second mapping relationship; wherein the second mapping relationship includes a mapping relationship between index information and a compilation path obtained based on the preset symbol table.
[0051] In some embodiments, method 300 may further include: performing symbol table pre-parsing based on a preset symbol table to obtain the second mapping relationship between index information and compilation path. For example, in the first mapping relationship, address information adress1 may correspond to index information index1, and in the preset symbol table (dSYM file), the corresponding compilation path path1 may be determined according to address information adress1, and then a second mapping relationship map2 from index information index1 to compilation path path1 may be established. In this way, after obtaining the exception address information in the exception log information, the symbolized information_index information may be determined to be symbol1_index1 from the first mapping relationship map1; and then the corresponding compilation path path1 may be determined from the second mapping relationship map2 according to index information index1.
[0052] In some embodiments, the index information in the second mapping relationship corresponds to the compilation path one by one.
[0053] Furthermore, in some embodiments, the second mapping relationship may adopt a key-value data structure. For example, the second mapping relationship may include K:V, where the key K represents index information and the value V represents a compilation path.
[0054] In some embodiments, performing symbol table pre-parsing based on a preset symbol table to obtain the second mapping relationship between index information and compilation path may further include: filtering the compilation path of the system file in the preset symbol table to obtain a filtered preset symbol table; and generating the second mapping relationship based on the filtered preset symbol table.
[0055] Among them, the system file is not related to the abnormal situation, so the compilation path of the system file does not participate in the identification of abnormal components. The compilation path of the system file can include the compilation path related to the system library, for example, the compilation path starting with " / Applications / Xcode"; it can also include the compilation path of the file automatically generated by the compiler, for example, the file named " <compiler-generated>" file path. The second mapping relationship established after removing the compilation path of the system file can further compress the data volume, reduce the storage scale, and save storage space.
[0056] In step S304, the abnormal component is determined based on the compilation path and preset configuration information for indicating the location of component information in the compilation path.
[0057] In some embodiments, determining the abnormal component based on the compilation path and preset configuration information for indicating the location of component information in the compilation path includes:
[0058] Determine the class library name of the abnormal log information based on the compilation path;
[0059] Determine component information in the compilation path based on the class library name and the preset configuration information;
[0060] The abnormal component is determined based on the component information.
[0061] In some embodiments, determining the class library name of the exception log information based on the compilation path includes:
[0062] Determining whether the compilation path includes a first preset character string;
[0063] In response to the compilation path including a first preset character string, a first character string in the compilation path that is located after the preset character string is determined as the class library name.
[0064] The first character string after the preset character string may refer to a character string after the first preset character string and the separator adjacent to the first preset character string in the compilation path, that is, a character string between Pods / and next / in the compilation path.
[0065] In some embodiments, the first preset string may include Pods or __main__ / external. Specifically, for SDKs integrated in a cocoapods multi-warehouse manner, whether it is source code or bits binary, it is characterized in that the Pods keyword is included in the complete compilation path of the source file, such as / Users / code1 / code2 / code3 / code4 / Pods / code5 / code6 / code7.m, so the class library name of the exception log information is the string code5 between Pods / and the next / . For SDKs integrated in a bazel monorepo multi-warehouse manner, the compilation path in source code form contains the __main__ / external keyword, such as / code1 / code2 / code3 / code4 / __main__ / external / code5 / code6 / code7 / code8.m, so the class library name of the exception log information is the string code5 between __main__ / external / and the next / .
[0066] In some embodiments, determining the class library name of the exception log information based on the compilation path includes:
[0067] Determining whether the compilation path includes a first preset character string;
[0068] In response to the compilation path not including the first preset character string, a second character string located at the first position in the compilation path is determined as the class library name.
[0069] The second string at the first position can refer to the first string of the compilation path. For SDKs integrated in bazelmonorepo mode, there are no obvious features in the binary compilation path, for example, code1 / code2 / Classes / code3.m, then the string code1 at the first position can be used as the class library name.
[0070] In some embodiments, determining the class library name of the exception log information based on the compilation path includes:
[0071] Determining whether the compilation path includes a second preset character string;
[0072] In response to the compilation path including a second preset character string, a preset class library name corresponding to the second preset character string in a third mapping relationship is determined as the class library name of the exception log information.
[0073] The second preset string may refer to keyword information related to the component, for example, the second preset string has a mapping relationship with the component. For SDKs integrated in a closed source or binary dependency manner, SDK developers can configure the mapping relationship between keyword information in the compilation path of the source file and the class library name in the monitoring background of the target application. If the keyword information exists in the compilation path, the corresponding class library name can be determined based on the mapping relationship. For example:
[0074] / var / code1 / code2 / ttmp / code3 / code4.mm For the code in the player, developers can configure the mapping relationship between the ttmp keyword information and TTPlayerSDK. In this way, as long as the ttmp keyword is found in the compilation path of the source file, it can be determined that the information of the abnormal component should be assigned to the class library name of TTPlayerSDK.
[0075] In some embodiments, determining the component information in the compilation path based on the class library name and the preset configuration information includes:
[0076] Determine the offset of the key information in the preset configuration information based on the class library name as the key information;
[0077] Component information in the compilation path is determined based on the offset of the key information.
[0078] The preset configuration information may be data describing the relationship between the compilation path and the component information. The component information, such as the component name, may be determined according to the preset configuration information, so that the corresponding component may be located according to the component information. The component information may be a keyword in the compilation path, or may be information of the location after the keyword is moved by a corresponding fixed offset.
[0079] In some embodiments, the preset configuration information may include at least one preset rule, each preset rule including key information and an offset of the key information. For example, the preset configuration information may be in the form of a list. The preset rule ruler may include key information anchor + offset shift, where the offset shift is greater than 0, indicating a right shift, the offset shift is less than 0, indicating a left shift, and the offset shift is equal to 0, indicating that the key information itself is component information. For example, for compilation address 1:
[0080] / Users / code1 / code2 / ttmp / code3 / code4 / code5.mm
[0081] Among them, the key information anchor=ttmp, the offset shift=0, and ttmp is recorded as component information.
[0082] For compile address 2:
[0083] / Users / code1 / code2 / Pods / code3 / code4 / code5.mm
[0084] Among them, the key information anchor = / Pods / , and the offset shift = 1. In the compilation address 2, the key information anchor (i.e. / Pods / ) divides the entire compilation address 2 into two parts: the part before the key information anchor / Users / code1 / code2; and the part after the key information anchor code3 / code4 / code5.mm, and then the two parts are split by the / keyword, and the first data [Users, code1, code2] and the second data [code3, code4, code5.mm] arrays can be obtained. It is agreed that when the offset is 0, the component information is the key information itself. The positive number represents the subscript index in the second array (starting from 1 and increasing), that is, moving to the right from the key information; the negative number represents the subscript index in the first array (starting from -1 and decreasing), that is, moving to the left from the key information. The key information in the compilation address 2 is / Pods / , and the offset is 1, so the component information is code3.
[0085] For compile address 3:
[0086] / BD / code1 / code2 / Classes / code3.m
[0087] Among them, the key information is anchor = / Classes / , and the offset shift = -1. The component information in the compilation address 3 is code2.
[0088] Furthermore, the preset rules have priorities. The compilation paths can be matched in order of priority until the compilation path includes the corresponding preset rule, and the component information is determined accordingly. The higher the priority, the higher the universality of the preset rule, and the greater the probability that the compilation path matches the preset rule to obtain the component information.
[0089] In actual applications, for components of object-oriented code (i.e., OC code), the component information determined from the compilation path may be the component name itself. However, for some underlying libraries, the component information may not be exactly the same as the component name. Therefore, business configuration information can also be set to facilitate the subsequent splitting / allocation of various stability issues to different businesses from the host's perspective, which is conducive to guiding the specification of indicators for optimization of each business. For example, business configuration information may include: component information Info and the corresponding business line business, and based on the business line business, it can be determined that the component that executes the business line is the component corresponding to the component information Info.
[0090] In some embodiments, the abnormal log information includes the name of the abnormal dynamic library, and the method further includes:
[0091] Obtain the component dynamic library name corresponding to the component in the target application;
[0092] Determine whether the component dynamic library name matches the abnormal dynamic library name;
[0093] In response to the component dynamic library name matching the abnormal dynamic library name, it is determined that the component corresponding to the component dynamic library name is the abnormal component.
[0094] Specifically, for the SDK integrated in the form of a dynamic library, the monitoring platform of the target application supports the dynamic library allocation rules, that is, the SDK can register the dynamic library name on the monitoring platform, and when the exception call stack matches the dynamic library name, it is allocated to the target developer who registered the dynamic library name. For example, if the exception log includes a dynamic library named RTC, the component corresponding to the dynamic library name can be directly determined as the abnormal component, and the information of the abnormal component can also be allocated to the RTC SDK.
[0095] In some embodiments, method 300 further includes:
[0096] Get component configuration information determined by the developer;
[0097] Determining whether the abnormal component matches the component configuration information;
[0098] In response to whether the abnormal component matches the component configuration information, information of the abnormal component is sent to the target developer.
[0099] Specifically, developers can configure component configuration information according to their own needs, including SDK name, matching strategy, component name, dynamic library name, etc. Among them, the matching strategy can refer to whether the information of the returned abnormal component is the full stack information of the component or the partial stack information, and the component name can refer to the static library component name. After the abnormal component is determined in step S304, it is compared with the component configuration information. If the abnormal component is included in the component configuration information, it means that the information of the abnormal component is checked and optimized by the developer, and the same abnormal component information is sent to the developer. Figure 5 As shown, Figure 5 A schematic diagram of the interface of component configuration information according to an embodiment of the present disclosure is shown. The SDK name set by developer X is SDK1, the matching strategy is full-stack matching, the component names are component 1 and component 2, and the dynamic library names are ABC, D, and EFGHI. Then, according to the method of the embodiment of the present disclosure, when an exception such as a crash occurs in the target application corresponding to SDK1, the exception log information records the exception address information where the exception occurs, and determines the comparison compilation path through the first mapping relationship and the second mapping relationship, and determines the abnormal component where the exception occurs in combination with the preset configuration information. If the component name or dynamic library name of the abnormal component is consistent with the preset configuration information, that is, the component name is component 1 or component 2, or the dynamic library name is ABC, D, or EFGHI, then all the information of the abnormal component is sent to developer X. Figure 4 As shown in , after identifying the name of the component where the exception occurs (e.g., step S304), the abnormal component is searched from the SDK space (e.g., SDK1) where the component name has been registered, and is allocated to the corresponding SDK space. This realizes the automatic identification of abnormal components, improves the efficiency of allocating abnormal information related to abnormal components, and improves the efficiency of SDK development and maintenance.
[0100] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0101] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0102] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a device for identifying abnormal components.
[0103] refer to Figure 6 , the abnormal component identification device comprises:
[0104] An acquisition module is used to obtain abnormal log information for a target application;
[0105] A first mapping module, configured to obtain symbolic information of the abnormal address information based on the abnormal address information in the abnormal log information and a first mapping relationship; wherein the symbolic information includes index information, and the first mapping relationship includes a mapping relationship between the address information and the symbolic information obtained based on the preset symbol table;
[0106] A second mapping module, configured to obtain a compilation path of the abnormal log information based on the index information and a second mapping relationship; wherein the second mapping relationship includes a mapping relationship between the index information and the compilation path obtained based on the preset symbol table;
[0107] The component determination module is used to determine the abnormal component based on the compilation path and preset configuration information about the compilation path and component information.
[0108] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0109] The device of the above embodiment is used to implement the corresponding abnormal component identification method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0110] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the abnormal component identification method as described in any of the above embodiments.
[0111] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0112] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the abnormal component identification method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0113] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0114] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0115] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0116] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A method for identifying abnormal components, It is characterized in that include: Get exception log information for the target application; Obtaining symbolic information of the abnormal address information based on the abnormal address information in the abnormal log information and a first mapping relationship; wherein the symbolic information includes index information, and the first mapping relationship includes a mapping relationship between the address information and the symbolic information obtained based on a preset symbol table; Obtaining a compilation path of the abnormal log information based on the index information and a second mapping relationship in the symbolized information; wherein the second mapping relationship includes a mapping relationship between the index information and the compilation path obtained based on the preset symbol table, and the index information corresponds to the compilation path one by one; The abnormal component is determined based on the compilation path and preset configuration information for indicating the location of component information in the compilation path.
2. The method according to claim 1, It is characterized in that Determining the abnormal component based on the compilation path and preset configuration information for indicating the location of component information in the compilation path includes: Determine the class library name of the abnormal log information based on the compilation path; Determine component information in the compilation path based on the class library name and the preset configuration information; The abnormal component is determined based on the component information.
3. The method according to claim 2, It is characterized in that Determining the class library name of the abnormal log information based on the compilation path includes: Determining whether the compilation path includes a first preset character string; In response to the compilation path including a first preset character string, a first character string in the compilation path that is located after the first preset character string is determined as the class library name.
4. The method according to claim 2, It is characterized in that Determining the class library name of the abnormal log information based on the compilation path includes: Determining whether the compilation path includes a first preset character string; In response to the compilation path not including the first preset character string, a second character string located at the first position in the compilation path is determined as the class library name.
5. The method according to claim 2, It is characterized in that Determining the class library name of the abnormal log information based on the compilation path includes: Determining whether the compilation path includes a second preset character string; In response to the compilation path including a second preset character string, a preset class library name corresponding to the second preset character string in a third mapping relationship is determined as the class library name of the exception log information.
6. The method according to claim 2, It is characterized in that Determining component information in the compilation path based on the class library name and the preset configuration information includes: Determine the offset of the key information in the preset configuration information based on the class library name as the key information; Component information in the compilation path is determined based on the offset of the key information.
7. The method according to claim 1, It is characterized in that The abnormal log information includes the name of the abnormal dynamic library, and the method further includes: Obtain the component dynamic library name corresponding to the component in the target application; Determine whether the component dynamic library name matches the abnormal dynamic library name; In response to the component dynamic library name matching the abnormal dynamic library name, it is determined that the component corresponding to the component dynamic library name is the abnormal component.
8. The method according to claim 1, It is characterized in that Also includes: Get component configuration information determined by the developer; Determining whether the abnormal component matches the component configuration information; In response to whether the abnormal component matches the component configuration information, information of the abnormal component is sent to a target developer.
9. A device for identifying abnormal components, It is characterized in that include: An acquisition module is used to obtain abnormal log information for a target application; A first mapping module, configured to obtain symbolic information of the abnormal address information based on the abnormal address information in the abnormal log information and a first mapping relationship; wherein the symbolic information includes index information, and the first mapping relationship includes a mapping relationship between the address information and the symbolic information obtained based on a preset symbol table; A second mapping module, configured to obtain a compilation path of the abnormal log information based on the index information and a second mapping relationship; wherein the second mapping relationship includes a mapping relationship between the index information and the compilation path obtained based on the preset symbol table, and the index information corresponds to the compilation path one by one; The component determination module is used to determine the abnormal component based on the compilation path and preset configuration information about the compilation path and component information.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 8.
12. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method, device and system for processing stack address in crash file
CN108334515A
Application program crash log processing method, system and apparatus and storage medium
CN109032909A
Mapping relationship establishing method and device and system crash shunting method and device
CN110704302A
Crash log processing method and device, equipment and storage medium
CN110764945A
File analysis method, device and system and storage medium
CN111104185A
Cited By
Abnormal component identification method and apparatus, device, storage medium, and program product
EP4509987A1
Abnormal component identification method and apparatus, device, storage medium, and program product
WO2023197851A1
