Method, device and storage medium for processing call stack information
By building an associated database of call stack record tables and knowledge base record tables, and using string matching and matching score calculation, the problem of low efficiency in searching call stack records when the target operating system is abnormal is solved, and the cause of the fault is quickly and accurately located.
Patent Information
- Application Number
- CN202510592014.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-08
AI Technical Summary
When the target operating system is abnormal, the efficiency of searching call stack records in the prior art is low, making it difficult to quickly and accurately locate the root cause of the problem.
By obtaining the call stack data information of the target operating system, using regular expressions to extract the call stack function sequence, and building an associated database of the call stack record table and the knowledge base record table, string matching and matching score calculation are performed to determine the target call stack record.
It improves the efficiency of searching call stack records, enables fast and accurate location of fault causes, and reduces troubleshooting time.
Smart Images

Figure CN120104395B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, and storage medium for processing call stack information. Background Art
[0002] In today's highly complex computer operations and maintenance environment, ensuring operating system stability and responsiveness has become a key factor in successful business operations. When a target operating system encounters an anomaly, quickly and accurately locating the root cause is crucial for timely service restoration and minimizing mission losses. Traditional troubleshooting methods often rely on the technician's experience and intuition, but this approach is inadequate in large-scale distributed systems, especially when faced with frequent and changing failure scenarios. In existing technologies, call stack information, a crucial clue for system failure analysis, is typically stored as raw, unstructured strings. This means that in the call stack, key information such as function call sequences, timestamps, and memory addresses are jumbled together, forming a long string of text that is difficult to intuitively parse. When an anomaly occurs in the target operating system and operations and maintenance personnel or automated systems need to locate the call stack record containing a specific abnormal function, this storage method undoubtedly increases the difficulty of the search and reduces matching efficiency.
[0003] With respect to the problem in related technologies of low efficiency in searching call stack records when an exception occurs in a target operating system, no effective solution has been proposed so far. Summary of the Invention
[0004] The main purpose of this application is to provide a method, device and storage medium for processing call stack information to solve the problem of low efficiency in searching call stack records when an exception occurs in the target operating system in the related art.
[0005] To achieve the above objectives, according to one aspect of the present application, a method for processing call stack information is provided. The method comprises: when an exception occurs in a target operating system, obtaining data information of a call stack to be matched; determining a call stack function sequence to be matched based on the data information of the call stack to be matched; and performing string matching in a call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack records are arranged in sequence.
[0006] Furthermore, determining the call stack function sequence to be matched based on the data information of the call stack to be matched includes: matching the data information of the call stack to be matched with a predefined regular expression, extracting multiple call stack functions, filtering the call stack functions in the multiple call stack functions according to a preset call stack function weight ratio table, and obtaining the call stack function sequence to be matched.
[0007] Furthermore, before performing string matching in a call stack record table according to a call stack function sequence to be matched to obtain at least one target call stack record, the method includes: constructing a call stack record table, wherein the call stack record table includes multiple call stack records, and the call stack record table includes at least a primary key of a knowledge base record table; constructing a knowledge base record table, wherein the knowledge base record table includes multiple records of knowledge base information, and the primary key of the knowledge base record table is a knowledge base number, wherein the multiple knowledge base information records include information for handling target operating system exceptions; establishing an association between the call stack record table and the knowledge base record table based on the primary key of the knowledge base record table; and constructing a target database based on the call stack record table and the knowledge base record table.
[0008] Furthermore, constructing a call stack record table includes: creating a table structure of the call stack record table, wherein the table structure of the call stack record table includes at least one field for storing the primary key of the knowledge base record table; importing multiple call stack records into the table structure of the call stack record table to construct a call stack record table, wherein the multiple call stack records include at least the name of the call stack function and the location information of the call stack function in the call stack.
[0009] Furthermore, constructing the knowledge base record table includes: creating a table structure of the knowledge base record table, wherein the table structure of the knowledge base record includes at least one primary key field; creating the primary key of the knowledge base record table; importing multiple records of knowledge base information into the table structure of the knowledge base record to construct the knowledge base record table.
[0010] Furthermore, performing string matching in a call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record includes: determining, in the call stack record table, a call stack record containing any one call stack function in the call stack function sequence to be matched based on a string matching method to obtain a plurality of candidate call stack records; respectively calculating the matching scores between the candidate call stack records and the call stack function sequence to be matched to obtain a plurality of matching scores; and determining at least one target call stack record from the candidate call stack records according to the plurality of matching scores.
[0011] Furthermore, the matching scores between the candidate call stack records and the call stack function sequence to be matched are calculated respectively to obtain multiple matching scores, including: determining a matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions existing in the call stack record and the call stack function sequence to be matched; based on the matching degree calculation method, determining the matching score of the candidate call stack record in the multiple candidate call stack records.
[0012] Furthermore, based on the matching degree calculation method, determining the matching score of a candidate call stack record among multiple candidate call stack records includes: arranging the multiple candidate call stack records line by line in sequence, and arranging the multiple call stack functions in the same candidate call stack record in adjacent rows in sequence; comparing the multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line according to the string matching method to obtain at least one hit call stack record; performing a matching degree calculation between at least one hit call stack record and the call stack function sequence to be matched based on the matching degree calculation method to obtain a matching score of at least one hit call stack record.
[0013] Furthermore, after performing string matching in the call stack record table according to the call stack function sequence to be matched and obtaining at least one target call stack record, the method includes: obtaining a knowledge base record table associated with the call stack record table; determining a record of the knowledge base information associated with the target call stack record based on the knowledge base record table to obtain a record of the target knowledge base information; extracting relevant information for handling target operating system exceptions from the record of the target knowledge base information; and determining a solution strategy for handling exceptions in the target operating system based on the relevant information.
[0014] To achieve the above-mentioned objectives, according to another aspect of the present application, a device for processing call stack information is provided. The device comprises: an acquisition unit configured to acquire data information of a call stack to be matched when an exception occurs in a target operating system; a first determination unit configured to determine a call stack function sequence to be matched based on the data information of the call stack to be matched; and a matching unit configured to perform string matching in a call stack record table based on the call stack function sequence to be matched, thereby obtaining at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack records are arranged in sequence.
[0015] Furthermore, the first determination unit includes: a matching module for matching the data information of the call stack to be matched with a predefined regular expression to extract multiple call stack functions, and a configuration module for filtering the call stack functions in the multiple call stack functions according to a preset call stack function weight ratio table to obtain a call stack function sequence to be matched.
[0016] Furthermore, the device includes: a first construction unit, used to construct a call stack record table before performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack record table includes at least the primary key of the knowledge base record table; a second construction unit, used to construct a knowledge base record table, wherein the knowledge base record table includes multiple records of knowledge base information, the primary key of the knowledge base record table is the knowledge base number, and the multiple knowledge base information records include information for handling target operating system exceptions; an association unit, used to associate the call stack record table and the knowledge base record table based on the primary key of the knowledge base record table; a third construction unit, used to construct a target database based on the call stack record table and the knowledge base record table.
[0017] Furthermore, the first construction unit includes: a first creation module, used to create a table structure of a call stack record table, wherein the table structure of the call stack record table includes at least one field for storing the primary key of the knowledge base record table; a first import module, used to import multiple call stack records into the table structure of the call stack record table to construct a call stack record table, wherein the multiple call stack records include at least the name of the call stack function and the location information of the call stack function in the call stack.
[0018] Furthermore, the second construction unit includes: a second creation module, used to create the table structure of the knowledge base record table, wherein the table structure of the knowledge base record contains at least one primary key field; a third creation module, used to create the primary key of the knowledge base record table; a second import module, used to import multiple records of knowledge base information into the table structure of the knowledge base record to construct the knowledge base record table.
[0019] Furthermore, the matching unit includes: a query module, which is used to determine the call stack record of any call stack function in the call stack function sequence to be matched in the call stack record table based on a string matching method, and obtain multiple candidate call stack records; a calculation module, which is used to respectively calculate the matching scores between the candidate call stack records and the call stack function sequence to be matched, and obtain multiple matching scores; and a determination module, which is used to determine at least one target call stack record from the candidate call stack records based on the multiple matching scores.
[0020] Furthermore, the calculation module includes: a first determination submodule, used to determine the matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions existing in the call stack record and the call stack function sequence to be matched; a second determination submodule, used to determine the matching score of the candidate call stack record among multiple candidate call stack records based on the matching degree calculation method.
[0021] Furthermore, the second determination submodule includes: a sorting component for arranging multiple candidate call stack records line by line in sequence, and multiple call stack functions in the same candidate call stack record are arranged in sequence in adjacent rows; a retrieval component for comparing multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line based on a string matching method to obtain at least one hit call stack record; a matching degree calculation component for performing a matching degree calculation between at least one hit call stack record and the call stack function sequence to be matched based on a matching degree calculation method to obtain a matching score of at least one hit call stack record.
[0022] Furthermore, the device includes: a second determination unit, used to perform string matching in the call stack record table according to the call stack function sequence to be matched, and after obtaining at least one target call stack record, determine the record of knowledge base information associated with at least one target call stack record in the target database to obtain the record of the target knowledge base information; an extraction unit, used to extract relevant information for processing target operating system exceptions from the record of the target knowledge base information; and a third determination unit, used to determine a solution strategy for processing exceptions of the target operating system based on the relevant information.
[0023] According to another aspect of the present application, a computer-readable storage medium is provided, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any method for processing call stack information.
[0024] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a processing method for executing any one of call stack information.
[0025] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, which implement the steps of any one of the above-mentioned methods for processing call stack information when executed by a processor.
[0026] In an embodiment of the present application, when an exception occurs in the target operating system, data information of the call stack to be matched is obtained; a call stack function sequence to be matched is determined based on the data information of the call stack to be matched; and string matching is performed in a call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack record are arranged in sequence, thereby solving the technical problem in the related art of low efficiency in searching for call stack records when an exception occurs in the target operating system.
[0027] When an exception occurs in the target operating system, the data information of the call stack related to the exception is actively obtained. Using this data information, the sequence of call stack functions to be matched when the exception occurs can be determined. Since the present application uses the sorting information of the call stack function as the data information of the call stack to be matched and the dominant feature of the call stack record, it directly conforms to the essential principle that the most critical information when the operating system is abnormal is the order of arrangement of the call stack functions. Therefore, the matched target call stack record is very representative and can be used as a data-level representative of the data information of the call stack related to the exception, so as to facilitate subsequent analysis and realize effective processing of the data information of the call stack; and since the matching method of the present application is string matching, its efficiency is much higher than the matching efficiency of the neural network in the prior art. Therefore, the present application improves the efficiency of searching for call stack records. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0029] Figure 1 A hardware structure block diagram of a computer terminal for implementing a method for processing call stack information is shown;
[0030] Figure 2 is a flowchart of a method for processing call stack information provided in an embodiment of the present application;
[0031] Figure 3 is a schematic diagram of a method for processing call stack information provided according to an embodiment of the present application;
[0032] Figure 4 is a schematic diagram of a device for processing call stack information provided according to an embodiment of the present application;
[0033] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display and analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information provided by the aforementioned user or organization.
[0037] Example 1
[0038] According to an embodiment of the present application, an embodiment of a method for processing call stack information is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for processing call stack information is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (illustrated as 102a, 102b, ..., 102n in the figure) (the processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0040] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." This data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device). As discussed in the embodiments of this application, this data processing circuitry functions as a processor control (e.g., selecting a variable resistor terminal path connected to an interface).
[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for processing call stack information in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizes the above-mentioned method for processing call stack information. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0042] Transmission device 106 is used to receive or transmit data via a network. A specific example of such a network may include a wireless network provided by the communications provider of computer terminal 10. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] The display may be a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0044] Under the above operating environment, this application provides Figure 2 The processing method of the call stack information shown. Figure 2 This is a flowchart of a method for processing call stack information provided according to an embodiment of the present application.
[0045] Step S201: When an exception occurs in the target operating system, data information of the call stack to be matched is obtained.
[0046] Optionally, when the target operating system encounters an exception, such as a kernel crash or service interruption, it generates a vmcore file (also known as a virtual memory core dump file) containing fault information. The vmcore file stores the call stack information at the time of the target operating system crash, which records the call status of multiple call stack functions.
[0047] Optionally, the data information of the call stack to be matched refers to a series of function call information extracted from the vmcore file or other related crash log when an exception or failure occurs in the target operating system, waiting to be compared and matched with the call stack recorded in the target database. The data information of the call stack to be matched may include the name, memory address, offset, etc. of the call stack function to reflect the function call sequence and context environment of the target operating system when the failure occurs. The data information of the call stack to be matched can be a text string. For example, the following is a fragment of the data information of the call stack to be matched in string format:
[0048] Plaintext
[0049] [123456.789012]CallTrace: / / The start of the call stack trace, the time when the system error occurred;
[0050] [123456.789056][ <ffffffff8172d530>]do_page_fault+0x2d / 0x40 / / Call the do_page_fault function, which is located at the memory address offset 0x2d and has a size of 0x40 bytes. Calling the do_page_fault function usually means that the system has encountered a page fault, possibly because a non-existent or protected memory page was accessed;
[0051] [123456.789345][ <ffffffff816c93f0>]handle_mm_fault+0x7b6 / 0x1030 / / Call the handle_mm_fault function, which is located at memory offset 0x7b6 and has a size of 0x1030 bytes. handle_mm_fault is a key function in the Linux kernel that handles page faults in the memory management system.
[0052] [123456.789678][ <ffffffff816703d0>]mm_access_pte+0x60 / 0x100 / / The mm_access_pte function is called, which is responsible for accessing the page table entry. Its offset in memory is 0x60 and its total size is 0x100 bytes;
[0053] [123456.789901][ <ffffffff81670470>]page_cache_get_page+0x1a0 / 0x300 / / Call the page_cache_get_page function, which is used to get the page in the page cache. Its location offset in memory is 0x1a0 and its total size is 0x300 bytes;
[0054] [123456.790123][ <ffffffff816c9980>]__do_page_fault+0x50 / 0x80 / / The call stack traces back to the __do_page_fault function, which is an internal implementation of do_page_fault, with an offset of 0x50 and a total size of 0x80 bytes;
[0055] [123456.790345][ <ffffffff816c9a00>]do_page_fault+0x30 / 0x40 / / The do_page_fault function is called from a different location, i.e. the offset is changed to 0x30, but the total size is still 0x40 bytes. This may be due to recursive calls within the function or multiple attempts to handle the same page fault.
[0056] [123456.790567][ <ffffffff81670500>]page_cache_get_page+0x230 / 0x300 / / The page_cache_get_page function is called again, this time at offset 0x230, with a total size of 0x300 bytes unchanged, reflecting a call to the same or similar functionality in a different context;
[0057] [123456.790890][ <ffffffff816c93f0>]handle_mm_fault+0x7b6 / 0x1030 / / The call stack returns to the same position of the handle_mm_fault function again, which may be due to multiple attempts to resolve the page fault but failed, eventually leading to a system crash;
[0058] [123456.791112][ <ffffffff816703d0>]mm_access_pte+0x60 / 0x100 / / The call stack returns to the same position of the handle_mm_fault function again. This may be because multiple attempts to resolve the page fault failed, which eventually led to the system crash.
[0059] The call stack data fragments to be matched above show the series of function calls and memory access processes that led to the system failure. By analyzing these call details, we can locate the problem and determine whether the system crash was caused by hardware failure, software defect, or configuration error, so as to take appropriate measures to resolve the problem.
[0060] Step S202: determining a call stack function sequence to be matched according to data information of the call stack to be matched.
[0061] Optionally, after obtaining the call stack data to be matched, it can be preprocessed and analyzed to extract the call stack functions. This process can be performed through string parsing and regular expression matching to separate multiple call stack functions from the data. A filtering operation is then performed on the extracted multiple call stack functions to obtain a call stack function sequence to be matched.
[0062] For example, based on the call stack data information fragment in the example above, applying a predefined regular expression pattern to match and extract function names can obtain multiple call stack functions: ['do_page_fault', 'handle_mm_fault', 'mm_access_pte', 'page_cache_get_page', '__do_page_fault']. Then, filtering operations are performed on the extracted call stack functions to obtain the call stack function sequence to be matched: ['mm_access_pte', 'page_cache_get_page', '__do_page_fault'].
[0063] The above-mentioned call stack function sequence to be matched can be used as a basis for finding the fault when the target operating system encounters a problem or an exception occurs, thereby solving the fault problem.
[0064] Step S203 , performing string matching in a call stack record table according to the call stack function sequence to be matched, and obtaining at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack records are arranged in sequence.
[0065] In summary, since this application uses the sorting information of the call stack function as the data information of the call stack to be matched and the dominant feature of the call stack record, it directly conforms to the essential principle that the most critical information when the operating system is abnormal is the order of the call stack function arrangement. Therefore, the matched target call stack record is very representative and can be used as a data-level representative of the data information of the call stack related to the exception, which is convenient for subsequent analysis and realizes the effective processing of the call stack data information. Moreover, since the matching method of this application is string matching, its efficiency is much higher than the matching efficiency of the neural network in the prior art. Therefore, this application improves the efficiency of searching for call stack records.
[0066] In order to obtain a call stack function sequence to be matched that can accurately locate the fault problem, in the call stack information processing method provided in the embodiment of the present application, determining the call stack function sequence to be matched based on the data information of the call stack to be matched includes:
[0067] The first step is to match the data information of the call stack to be matched with a pre-defined regular expression to extract multiple call stack functions.
[0068] Optionally, a regular expression is a text processing tool that can help extract specific patterns or information from complex data. The above-mentioned pre-defined regular expression refers to a pattern matching rule for extracting function names from the call stack data information to be matched. When processing the data information of the call stack to be matched, the above-mentioned pre-defined regular expression can be used to accurately identify and extract function names, as well as associated addresses and other important details. Configuring corresponding weights for call stack functions in multiple call stack functions can be used to measure the importance of call stack functions in fault analysis.
[0069] For example, a call stack data message to be matched is received as follows:
[0070] plaintext
[0071] [493.486958]CallTrace:
[0072] 12345.67901][ <ffffffff81020d61>]schedule+0x30 / 0x30
[0073] [12345.67922]?__schedule+0x20 / 0x40
[0074] [12345.67943][ <ffffffff81020da5>]do_execve+0x35 / 0x60
[0075] [12345.67964]#1[ffffffff81056000]__do_execve+0x11 / 0x50( / usr / bin / something)
[0076] [12345.67985][ <ffffffff81020dc2>]sys_execve+0x12 / 0x20
[0077] The regular expression is as follows:
[0078] calltrace_patterns={
[0079] 1:re.compile(r'.+[0-9]+\]\s+\[<[0-9a-f]+>\][?]×(\S+)\+0x'),
[0080] 2:re.compile(r'.×#[0-9]+\[[0-9a-f]+\](\S+)at'),
[0081] 3:re.compile(r'.×\]\s+(\S+)\+0x')
[0082] }
[0083] The list of extracted function names is: ['schedule','__schedule','do_execve','__do_execve','sys_execve'].
[0084] In the second step, the call stack functions in the plurality of call stack functions are filtered according to a preset call stack function weight matching table to obtain a call stack function sequence to be matched.
[0085] Optionally, after configuring the weights, the extracted call stack functions can be further filtered. Filtering can be achieved based on a preset call stack function weight ratio table. The call stack function weight ratio table assigns different weights to call stack functions based on their commonness in the call stack and their importance in fault analysis. For example, schedule may be assigned a weight of 0.1 due to its frequent appearance in the call stack, __schedule is assigned a weight of 0.2, and do_execve may be assigned a weight of 0.5 because it is related to specific hardware or drivers. __do_execve is assigned a weight of 0.7, indicating that it is more important in fault analysis, and 'sys_execve' is assigned a weight of 0.6. Call stack functions with lower weights can be removed. These call stack functions appear in most fault scenarios and are of limited help in locating specific faults. Through this filtering step, we can focus on those call stack functions with higher weights that are directly related to the fault, thereby obtaining a call stack function sequence to be matched.
[0086] For example, based on the above example, multiple call stack functions are extracted. Assuming that the preset filtering standard is that call stack functions with a weight less than 0.2 will be eliminated, the function name list after filtering is ['__schedule', 'do_execve', '__do_execve', 'sys_execve'].
[0087] In summary, the above steps enable efficient and accurate extraction of call stack function sequences to be matched, focusing on call stack functions directly related to the fault. This improves the efficiency of subsequent database matching and fault location, reduces the processing of irrelevant data, and enables faster response to faults and more accurate location of the cause.
[0088] In order to construct a target database capable of tightly integrating call stack data with knowledge base data, in a method for processing call stack information provided in an embodiment of the present application, before performing string matching in a call stack record table based on a call stack function sequence to be matched to obtain at least one target call stack record, the method includes:
[0089] The first step is to construct a call stack record table, wherein the call stack record table includes multiple call stack records, and the call stack record table at least includes the primary key of the knowledge base record table.
[0090] Optionally, the call stack record table includes the primary key of the knowledge base record table, and the call stack record can be linked to the knowledge base record table, so as to reasonably use the failure mode and solution strategy and other contents in the knowledge base record table.
[0091] The second step is to construct a knowledge base record table, wherein the knowledge base record table includes multiple knowledge base information records, the primary key of the knowledge base record table is the knowledge base number, wherein the multiple knowledge base information records include information for handling target operating system exceptions.
[0092] Optionally, the knowledge base record table can store historical data about fault problems and solutions (or information on handling target operating system exceptions). Each knowledge base information record has a unique knowledge base number as the primary key to ensure the uniqueness and retrievability of the data.
[0093] The third step is to associate the call stack record table with the knowledge base record table based on the primary key of the knowledge base record table.
[0094] Optionally, by using the primary key (knowledge base number) of the knowledge base record table as a foreign key in the call stack record table, an association between the two tables can be achieved, facilitating quick query of knowledge base information associated with a specific call stack.
[0095] The call stack record table and the knowledge base record table are integrated into a target database, so that multiple call stack records are stored in the target database in a structured manner.
[0096] In summary, through the above steps, the call stack record table and the knowledge base record table are associated with each other, achieving a tight integration of the call stack data and the knowledge base data, which facilitates the subsequent efficient retrieval of call stack records and the matching of fault information and solutions corresponding to the call stack records.
[0097] In order to construct a call stack record table that can be closely connected with the knowledge base record table, in the method for processing call stack information provided in the embodiment of the present application, constructing the call stack record table includes:
[0098] The first step is to create a table structure of a call stack record table, wherein the table structure of the call stack record table includes at least one field for storing a primary key of a knowledge base record table.
[0099] For example, the table structure of the call stack record table can be shown in Table 1:
[0100] Table 1
[0101]
[0102] The call stack record table structure includes the "knowledge base number," which serves as the primary key for the knowledge base record table. The call stack record table also includes the record table ID, knowledge base number, call stack function, its position in the call stack, and the call stack ID. This design allows for efficient organization and indexing of call stack data, facilitating subsequent call stack matching and knowledge base queries.
[0103] In the second step, multiple call stack records are imported into the table structure of the call stack record table to construct the call stack record table, wherein the multiple call stack records at least include the name of the call stack function and the position information of the call stack function in the call stack.
[0104] Optionally, importing multiple call stack records into the call stack record table structure organizes the call stack records into a table. The call stack records can contain the name of the calling function, its position in the call stack, and other related information. This storage method allows tracking the order of function calls.
[0105] In summary, building a call stack record table through the above steps can improve the efficiency and accuracy of processing call stack information.
[0106] In order to construct a knowledge base record table that can be associated with the call stack record table, optionally, in the method for processing call stack information provided in an embodiment of the present application, constructing the knowledge base record table includes:
[0107] The first step is to create a table structure of the knowledge base record table, wherein the table structure of the knowledge base record contains at least one primary key field.
[0108] For example, the table structure of the knowledge base record is shown in Table 2:
[0109] Table 2
[0110]
[0111] The aforementioned knowledge base record table also uses structured storage, including fields such as the knowledge base ID, knowledge base number, hotspot tracking call stack, call stack, top value, knowledge base link, aone problem link, tool, operating system field, call stack function, title, fault description, root cause analysis, solution, environment information, log, hot patch, and time update. This ensures that fault information and solutions related to call stack records can be clearly recorded and managed. Through this structured storage method, the system can more efficiently process and utilize call stack records and knowledge base data, enabling rapid troubleshooting and problem location.
[0112] The second step is to create the primary key of the knowledge base record table.
[0113] Optionally, a primary key is a special type of table field whose values must be unique within the table.
[0114] The third step is to import multiple records of knowledge base information into the table structure of the knowledge base record to construct a knowledge base record table.
[0115] Optionally, the knowledge base information record may include detailed information related to the target operating system exception, such as fault description, root cause analysis, solution, and environment information, which will play a decisive role in troubleshooting.
[0116] In summary, building a knowledge base record table through the above steps can help operation and maintenance personnel or developers quickly identify the problem so that they can take corrective measures to resolve the problem.
[0117] In order to obtain at least one target call stack record that can accurately locate the fault problem, in the call stack information processing method provided in the embodiment of the present application, string matching is performed in the call stack record table according to the call stack function sequence to be matched, and the at least one target call stack record is obtained, including:
[0118] In the first step, a call stack record containing any call stack function in the call stack function sequence to be matched is determined in the call stack record table based on a string matching method to obtain multiple candidate call stack records.
[0119] Alternatively, traditional search algorithms often use a single-threaded, record-by-record matching process. However, when processing highly structured data such as call stacks, single-threaded searches can be very time-consuming, especially when the database contains a large number of different call stack records. In the target database, a multi-stack parallel search can be used to query the call stack record table for call stack records containing the call stack function sequence to be matched. Multi-stack parallel search can accelerate this process by processing multiple call stack records in parallel.
[0120] In the second step, the matching scores between the candidate call stack records and the call stack function sequences to be matched are calculated respectively to obtain multiple matching scores.
[0121] Optionally, the matching score can be calculated based on the degree of overlap and proximity between multiple call stack functions in the candidate call stack record and the sequence of call stack functions to be matched. This method of calculating the matching score can quantify the similarity between multiple call stack functions in the candidate call stack record and the sequence of call stack functions to be matched, thereby providing a basis for subsequent decision-making.
[0122] In the third step, at least one target call stack record is determined from the candidate call stack records according to the multiple matching scores.
[0123] For example, the top k call stack records with the highest matching scores may be used as at least one target call stack record.
[0124] In summary, through the above steps, string matching and matching score calculation to determine at least one target call stack record can greatly improve the efficiency and accuracy of fault diagnosis and provide strong support for operations and development personnel.
[0125] In order to more accurately evaluate the matching degree between the call stack function in the candidate call stack record and the call stack function sequence to be matched, optionally, in the call stack information processing method provided in the embodiment of the present application, the matching scores between the candidate call stack record and the call stack function sequence to be matched are calculated respectively, and the obtained multiple matching scores include:
[0126] The first step is to determine the matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions that exist in the call stack record and the call stack function sequence to be matched.
[0127] Optionally, the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched represents the similarity between the call stack record and the call stack function sequence to be matched in terms of the number of call stack functions, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched represents the similarity between the two in terms of position information. The closer the position is, the stronger the similarity between the two. That is, the above-mentioned method for determining the matching degree calculation is based on the position information of the call stack function in the call stack and the number information of the call stack function. This process aims to quantify the matching degree between the call stack function in the candidate call stack record and the call stack function sequence to be matched. The number of call stack functions that match the call stack function sequence to be matched in the candidate call stack record can be calculated. This is usually the most basic similarity indicator. The relative order of the matched call stack functions in the candidate call stack record can also be considered. If the same order is maintained in the candidate call stack record, then their matching degree should be higher.
[0128] For example, we can first define a hit call stack function sequence, which represents the number of matching call stack functions between the call stack function sequence to be matched and the candidate call stack record. This step provides a preliminary similarity measure, namely the number of call stack functions shared by the two call stacks. We then introduce the concept of function position weight to enhance the matching calculation. The relative order of call stack functions in the call stack function sequence to be matched is important for determining the cause of the fault. Therefore, a function position weight (W_pos) is defined. If the matching call stack function position is closer to the front in the candidate call stack record, the function position weight is assigned a higher value; conversely, if the matching position is closer to the back, the function position weight is correspondingly reduced.
[0129] Combining the function matching cardinality and the function position weight, the matching degree calculation formula can be as follows:
[0130] text{MatchingDegree}=(N_{matched}} / N_{total})×W_{pos}
[0131] text{MatchingDegree} represents the matching score of the call stack record, that is, the calculation result reflects the consistency between the call stack function sequence to be matched and the candidate call stack in the call stack record table in terms of function matching and position.
[0132] N_{matched} represents the number of functions that exactly match the function sequence in the call stack to be matched and the candidate call stack. A "match" means that both call stacks contain functions with the same name. N_{matched} is a basic metric for measuring call stack similarity; the more function matches, the higher the similarity.
[0133] N_{total} represents the total number of functions in the call stack sequence to be matched. By dividing N_{matched} by N_{total}, we can get a ratio that reflects how many functions in the call stack sequence to be matched are matched in the candidate call stack. Even if two call stacks have the same N_{matched}, if one call stack has a higher N_{total}, its matching ratio will be lower, indicating that the overall similarity is lower than that of a call stack with a lower N_{total} but a higher matching ratio.
[0134] W_{pos} represents the function position weight, which takes into account the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched. If in the call stack function sequence to be matched and the candidate call stack, the call stack functions hit during matching are not only numerous but also relatively early in the call stack, then the value of W_{pos} will be higher. On the contrary, the value of W_{pos} will be lower, reflecting the importance of function position to the matching degree. W_{pos} can be calculated by first calculating the difference between the length of the call stack function sequence to be matched and the index, and then dividing the difference by the length of the call stack function sequence to be matched to obtain the function position weight. In the second step, based on the matching degree calculation method, the matching score of the candidate call stack record among multiple candidate call stack records is determined.
[0135] For example, the call stack function sequence to be matched is ABCD. Multiple candidate call stack records are ABD, AEFG, and BCE. Based on the matching degree calculation method determined above, the hit call stack function sequence for ABD is determined to be AB, with a hit count percentage of 1 / 2, a function position weight of (4-0) / 4, and a matching score of 0.5. For AEFG, only A is hit, with less than two hits, and the hit call stack function sequence does not exist, resulting in a score of 0. The hit call stack function sequence for BCE is determined to be BC, with a hit count percentage of 1 / 2, a function position weight of (4-1) / 4, and a matching score of 0.375.
[0136] In summary, by calculating the matching scores of candidate call stack records through the above steps, we can obtain at least one target call stack record that has a higher degree of match with the call stack function sequence to be matched. This means that we can more accurately locate the fault. Furthermore, we can reduce the analysis of irrelevant call stack records, thereby reducing resource consumption.
[0137] In order to improve matching efficiency, based on the matching degree calculation method, determining the matching score of a candidate call stack record in multiple candidate call stack records includes: arranging the multiple candidate call stack records in sequence line by line, and arranging the multiple call stack functions in the same candidate call stack record in sequence in adjacent lines; comparing the multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line according to the string matching method to obtain at least one hit call stack record; performing a matching degree calculation between the at least one hit call stack record and the call stack function sequence to be matched based on the matching degree calculation method to obtain a matching score of at least one hit call stack record. Optionally, each candidate call stack record can contain multiple lines of data, each line of data records a call stack function of the candidate call stack record, and the call stack record can be obtained line by line, and the similarities and differences between the call stack function and the first call stack function in the call stack function sequence to be matched are compared. If the two are the same, the call stack function of the next line is matched with the similarities and differences between the first call stack function in the call stack function sequence to be matched, and the above operation is repeated until the two are different or the newly obtained behavior is another candidate call stack record, and then the similarities and differences between the other candidate call stack record and the second call stack function in the call stack function sequence to be matched are re-compared. The hit call stack record can be a candidate call stack record with two call stack functions that are the same as the call stack function sequence to be matched, or it can be set to more than two other values. In the above process, it is only necessary to traverse the candidate call stack record line by line once to find multiple hit call stack records, and then obtain the corresponding multiple target call stack records. This method reduces the number of queries on the candidate call stack records, thereby improving matching efficiency. It should be noted that if no hit call stack record is obtained after traversing line by line, the first function in the call stack record to be matched is deleted and the above process is restarted until at least one hit call stack record is obtained.
[0138] For example, the call stack function sequence to be matched may be [a, b, c, d, e, f, g], and some data of the candidate call stack record is shown in Table 3 below:
[0139] Table 3
[0140]
[0141] Among them, the first column in Table 3 represents the id of the candidate call stack record, the second column represents the call stack function, and the third column represents the position (i.e., order) of the call stack function in the candidate call stack record. String matching is performed line by line with the function indexed as [0] in the call stack function sequence to be matched. If the strings are the same, the next line is matched. Whenever a new candidate call stack record is switched to (i.e., a new id appears in the row), it is checked whether the number of call stack functions that are the same as the call stack function sequence to be matched in the previous candidate call stack record is greater than two in a row. If the number is greater than two, the candidate call stack record is used as the hit call stack record. For example, when matching the first call stack function a in the call stack function sequence to be matched, the hit call stack record ids are 1 and 2, the hit call stack function sequence corresponding to hit call stack record 1 is ab, and the hit call stack function sequence corresponding to hit call stack record 2 is abc.
[0142] In summary, the above matching method can obtain multiple hit call stack records after a line-by-line traversal. This multi-stack parallel string matching method reduces the number of database queries and improves matching efficiency.
[0143] To improve the efficiency of troubleshooting, in a method for processing call stack information provided in an embodiment of the present application, after performing string matching in a call stack record table based on a call stack function sequence to be matched and obtaining at least one target call stack record, the method includes:
[0144] The first step is to obtain the knowledge base record table associated with the call stack record table.
[0145] Optionally, a call stack record table and a knowledge base record table may be pre-built, and the two tables may be associated through a call stack ID.
[0146] In the second step, the record of the knowledge base information associated with the target call stack record is determined according to the knowledge base record table, and the record of the target knowledge base information is obtained.
[0147] Optionally, the knowledge base number field in the call stack record may be used to query the knowledge base record table to find a record of knowledge base information that matches the record.
[0148] For example, there is a target call stack record with a knowledge base number of kb1234, which indicates that it is associated with a record of a knowledge base information in the knowledge base record table. The record of the knowledge base information associated with kb1234 in the knowledge base record table is as follows:
[0149] Knowledge Base ID: kb1234;
[0150] Title: File system read and write exception;
[0151] Description: The system frequently crashes when performing large amounts of file read and write operations.
[0152] Root cause analysis: A bug in the file system driver prevented it from properly handling concurrent access requests.
[0153] Solution: Update the kernel version to v4.19.78 and apply a specific patch to resolve the file system driver issue;
[0154] Environment: Ubuntu 18.04;
[0155] File system type: ext4.
[0156] The third step is to extract relevant information for handling target operating system exceptions from the records of the target knowledge base information.
[0157] Optionally, the above-mentioned relevant information for handling the target operating system exception may include a description of the fault problem, possible root cause analysis, known solutions and environment, etc.
[0158] For example, the relevant information extracted from the target knowledge base information record in the first step is "The root cause analysis is that there is a bug in the file system driver, which fails to correctly handle concurrent access requests. The solution is to update the kernel version to v4.19.78 and apply a specific patch to resolve the file system driver problem."
[0159] The fourth step is to determine the solution strategy for handling exceptions in the target operating system based on relevant information.
[0160] Optionally, determining a solution strategy for handling an exception on the target operating system based on relevant information may be performed by the following specific steps:
[0161] Step 1: Environmental analysis operation: Analyze the current environment of the target operating system, including hardware configuration, software version, running status, etc.
[0162] Step 2: Problem identification operation: Based on the fault description and analysis results extracted from the target knowledge base, identify the specific problems in the target operating system;
[0163] Step 3: Strategy evaluation operation: Evaluate the feasibility of the solution strategy provided in the target knowledge base, considering its impact on the current environment;
[0164] Step 4: Develop specific steps: Translate the evaluated solution strategy into a series of specific, executable steps.
[0165] In summary, through the above steps, the efficiency and accuracy of fault identification can be improved based on the detailed description and root cause analysis in the knowledge base record table, avoiding blind repairs and thus greatly reducing the losses caused by faults.
[0166] For example, according to this embodiment, Figure 3 Schematic diagram of a method for processing call stack information according to an embodiment of the present application. The specific steps are as follows:
[0167] Receive the call stack to be matched in the string format input by the user;
[0168] Extract the call stack function from the input string;
[0169] The call stack functions are filtered using a preset call stack function weight ratio table to obtain a call stack function sequence to be matched, thereby reducing the impact of downtime public functions on the call stack matching results;
[0170] Query the database to obtain the call stack records containing the call stack function sequence to be matched, use a multi-stack parallel search matching solution, and calculate the matching degree of each call stack;
[0171] Returns the knowledge base information corresponding to the call stacks with the top k matching degrees, and the knowledge base information corresponding to the top k call stacks ranked from high to low matching degrees.
[0172] In summary, the above steps can improve the efficiency and accuracy of troubleshooting, helping developers locate and solve problems more quickly.
[0173] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0174] Example 2
[0175] The present application also provides a device for processing call stack information. It should be noted that the device for processing call stack information in the present application can be used to execute the method for processing call stack information provided in the present application. The following describes the device for processing call stack information provided in the present application.
[0176] According to an embodiment of the present application, a device for implementing the above-mentioned method for processing call stack information is also provided, such as Figure 4 As shown, the device includes: an acquisition unit 401, a first determination unit 402 and a matching unit 403.
[0177] Specifically, the acquisition unit 401 is used to acquire data information of the call stack to be matched when an exception occurs in the target operating system;
[0178] A first determining unit 402 is configured to determine a call stack function sequence to be matched based on data information of the call stack to be matched;
[0179] The matching unit 403 is used to perform string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack record are arranged in sequence.
[0180] Optionally, in the call stack information processing device provided in the embodiment of the present application, the first determination unit 402 includes: a matching module, used to match the data information of the call stack to be matched with a predefined regular expression, and extract multiple call stack functions; a configuration module, used to filter the call stack functions in the multiple call stack functions according to a preset call stack function weight ratio table, and obtain a call stack function sequence to be matched.
[0181] Optionally, in the call stack information processing device provided in the embodiment of the present application, the device includes: a first construction unit, used to construct a call stack record table before performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack record table includes at least the primary key of the knowledge base record table; a second construction unit, used to construct a knowledge base record table, wherein the knowledge base record table includes multiple knowledge base information records, and the primary key of the knowledge base record table is the knowledge base number, wherein the multiple knowledge base information records include information for handling target operating system exceptions; an association unit, used to associate the call stack record table and the knowledge base record table based on the primary key of the knowledge base record table; a third construction unit, used to construct a target database based on the call stack record table and the knowledge base record table.
[0182] Optionally, in the call stack information processing device provided in an embodiment of the present application, the first construction unit includes: a first creation module, used to create a table structure of a call stack record table, wherein the table structure of the call stack record table includes at least one field for storing the primary key of the knowledge base record table; a first import module, used to import multiple call stack records into the table structure of the call stack record table to construct a call stack record table, wherein the multiple call stack records include at least the name of the call stack function and the location information of the call stack function in the call stack.
[0183] Optionally, in the call stack information processing device provided in an embodiment of the present application, the second construction unit includes: a second creation module, used to create a table structure of a knowledge base record table, wherein the table structure of the knowledge base record contains at least one primary key field; a third creation module, used to create the primary key of the knowledge base record table; a second import module, used to import multiple records of knowledge base information into the table structure of the knowledge base record to construct a knowledge base record table.
[0184] Optionally, in the call stack information processing device provided in the embodiment of the present application, the matching unit 403 includes: a query module, used to determine the call stack record of any call stack function in the call stack function sequence to be matched in the call stack record table based on a string matching method, and obtain multiple candidate call stack records; a calculation module, used to respectively calculate the matching scores between the candidate call stack records and the call stack function sequence to be matched, and obtain multiple matching scores; a determination module, used to determine at least one target call stack record from the candidate call stack records based on the multiple matching scores.
[0185] Optionally, in the call stack information processing device provided in the embodiment of the present application, the calculation module includes: a first determination sub-module, used to determine the matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions existing in the call stack record and the call stack function sequence to be matched; a second determination sub-module, used to determine the matching score of a candidate call stack record among multiple candidate call stack records based on the matching degree calculation method.
[0186] Optionally, in the call stack information processing device provided in the embodiment of the present application, the second determination submodule includes: a sorting component for arranging multiple candidate call stack records line by line in sequence, and multiple call stack functions in the same candidate call stack record are arranged in sequence in adjacent rows; a retrieval component for comparing multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line based on a string matching method to obtain at least one hit call stack record; a matching degree calculation component for performing a matching degree calculation between at least one hit call stack record and the call stack function sequence to be matched based on a matching degree calculation method to obtain a matching score of at least one hit call stack record.
[0187] Optionally, in the call stack information processing device provided in the embodiment of the present application, the device includes: a second determination unit, used to perform string matching in the call stack record table according to the call stack function sequence to be matched, and after obtaining at least one target call stack record, determine the record of knowledge base information associated with at least one target call stack record in the target database to obtain the record of the target knowledge base information; an extraction unit, used to extract relevant information for processing target operating system exceptions from the record of the target knowledge base information; and a third determination unit, used to determine a solution strategy for processing exceptions of the target operating system based on the relevant information.
[0188] The call stack information processing device provided in the embodiment of the present application obtains data information of the call stack to be matched through the acquisition unit 401 when an exception occurs in the target operating system; the first determination unit 402 determines the call stack function sequence to be matched based on the data information of the call stack to be matched; the matching unit 403 performs string matching in the call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack record are arranged in sequence, which solves the problem of low efficiency in searching for call stack records when an exception occurs in the target operating system in the related art, thereby achieving the effect of improving the efficiency of searching for call stack records.
[0189] It should be noted that the acquisition unit 401, first determination unit 402, and matching unit 403 correspond to steps S201 to S203 in Example 1. The examples and application scenarios implemented by the three units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0190] Example 3
[0191] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal or an electronic device.
[0192] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0193] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: when an exception occurs in the target operating system, obtain the data information of the call stack to be matched; determine the call stack function sequence to be matched based on the data information of the call stack to be matched; perform string matching in the call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack record are arranged in sequence.
[0194] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: determining the call stack function sequence to be matched based on the data information of the call stack to be matched, including: matching the data information of the call stack to be matched with a pre-defined regular expression, extracting multiple call stack functions, filtering the call stack functions in the multiple call stack functions according to a preset call stack function weight ratio table, and obtaining the call stack function sequence to be matched.
[0195] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: before performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, the method includes: constructing a call stack record table, wherein the call stack record table includes multiple call stack records, and the call stack record table includes at least the primary key of the knowledge base record table; constructing a knowledge base record table, wherein the knowledge base record table includes multiple knowledge base information records, and the primary key of the knowledge base record table is the knowledge base number, wherein the multiple knowledge base information records include information for handling target operating system exceptions; establishing an association between the call stack record table and the knowledge base record table based on the primary key of the knowledge base record table; and constructing a target database based on the call stack record table and the knowledge base record table.
[0196] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: constructing a call stack record table includes: creating a table structure of a call stack record table, wherein the table structure of the call stack record table includes at least one field for storing the primary key of the knowledge base record table; importing multiple call stack records into the table structure of the call stack record table to construct a call stack record table, wherein the multiple call stack records include at least the name of the call stack function and the location information of the call stack function in the call stack.
[0197] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: constructing a knowledge base record table includes: creating a table structure of the knowledge base record table, wherein the table structure of the knowledge base record contains at least one primary key field; creating the primary key of the knowledge base record table; importing multiple records of knowledge base information into the table structure of the knowledge base record to construct the knowledge base record table.
[0198] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, including: determining the call stack record of any call stack function in the call stack function sequence to be matched in the call stack record table based on the string matching method to obtain multiple candidate call stack records; calculating the matching scores between the candidate call stack records and the call stack function sequence to be matched respectively to obtain multiple matching scores; and determining at least one target call stack record from the candidate call stack records based on the multiple matching scores.
[0199] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: respectively calculating the matching scores between the candidate call stack records and the call stack function sequence to be matched, and obtaining multiple matching scores including: determining the matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions that exist in the call stack record and the call stack function sequence to be matched; based on the matching degree calculation method, determining the matching score of the candidate call stack record in multiple candidate call stack records.
[0200] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: arranging multiple candidate call stack records line by line in sequence, and arranging multiple call stack functions in the same candidate call stack record in adjacent lines in sequence; comparing the multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line according to the string matching method to obtain at least one hit call stack record; performing a matching degree calculation between at least one hit call stack record and the call stack function sequence to be matched based on the matching degree calculation method to obtain a matching score of at least one hit call stack record.
[0201] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for processing call stack information: after performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, the method includes: obtaining a knowledge base record table associated with the call stack record table; determining a record of knowledge base information associated with at least one target call stack record based on the knowledge base record table to obtain a record of the target knowledge base information; extracting relevant information for processing target operating system exceptions from the record of the target knowledge base information; and determining a solution strategy for processing exceptions of the target operating system based on the relevant information.
[0202] Optionally, Figure 5 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one is shown) processor 502, memory 504, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0203] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for processing call stack information in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method for processing call stack information. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0204] The processor may call the information and application programs stored in the memory through the transmission device to execute the above steps in the above method for processing call stack information.
[0205] An embodiment of the present application provides a solution for processing call stack information. When an exception occurs in a target operating system, data information of a call stack to be matched is obtained; a call stack function sequence to be matched is determined based on the data information of the call stack to be matched; and a string match is performed in a call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack records are arranged in sequence. This solves the technical problem of low efficiency in searching call stack records when an exception occurs in the target operating system in related technologies, thereby achieving the technical effect of improving the efficiency of searching call stack records.
[0206] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), a PAD or other terminal device. Figure 5 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 5 Different configurations shown.
[0207] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0208] Example 4
[0209] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for processing call stack information provided in the first embodiment.
[0210] Optionally, the storage medium is also configured to store program code for executing the following steps: In this embodiment, the above-mentioned storage medium can be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0211] Optionally, the storage medium is also configured to store program code for executing the following steps: In this embodiment, the storage medium is configured to store program code for executing the following steps: when an exception occurs in the target operating system, obtaining data information of the call stack to be matched; determining the call stack function sequence to be matched based on the data information of the call stack to be matched; performing string matching in the call stack record table based on the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack record are arranged in sequence.
[0212] Optionally, the storage medium is also configured to store program code for executing the following steps: determining the call stack function sequence to be matched based on the data information of the call stack to be matched, including: matching the data information of the call stack to be matched with a predefined regular expression, extracting multiple call stack functions, filtering the call stack functions in the multiple call stack functions according to a preset call stack function weight ratio table, and obtaining the call stack function sequence to be matched.
[0213] Optionally, the storage medium is also configured to store program code for executing the following steps: before performing string matching in a call stack record table according to a call stack function sequence to be matched to obtain at least one target call stack record, the method includes: constructing a call stack record table, wherein the call stack record table includes multiple call stack records, and the call stack record table includes at least a primary key of a knowledge base record table; constructing a knowledge base record table, wherein the knowledge base record table includes multiple records of knowledge base information, and the primary key of the knowledge base record table is a knowledge base number, wherein the multiple knowledge base information records include information for handling target operating system exceptions; establishing an association between the call stack record table and the knowledge base record table based on the primary key of the knowledge base record table; and constructing a target database based on the call stack record table and the knowledge base record table.
[0214] Optionally, the storage medium is also configured to store program code for executing the following steps: constructing a call stack record table includes: creating a table structure of a call stack record table, wherein the table structure of the call stack record table includes at least one field for storing the primary key of the knowledge base record table; importing multiple call stack records into the table structure of the call stack record table to construct a call stack record table, wherein the multiple call stack records include at least the name of the call stack function and the location information of the call stack function in the call stack.
[0215] Optionally, the storage medium is also configured to store program code for executing the following steps: constructing a knowledge base record table includes: creating a table structure of the knowledge base record table, wherein the table structure of the knowledge base record contains at least one primary key field; creating a primary key of the knowledge base record table; importing multiple records of knowledge base information into the table structure of the knowledge base record to construct the knowledge base record table.
[0216] Optionally, the storage medium is also configured to store program code for executing the following steps: performing string matching in a call stack record table according to a call stack function sequence to be matched to obtain at least one target call stack record, including: determining, in a string matching manner, a call stack record in the call stack record table containing any one call stack function in the call stack function sequence to be matched, to obtain a plurality of candidate call stack records; respectively calculating the matching scores between the candidate call stack records and the call stack function sequence to be matched, to obtain a plurality of matching scores; and determining at least one target call stack record from the candidate call stack records according to the plurality of matching scores.
[0217] Optionally, the storage medium is also configured to store program code for executing the following steps: respectively calculating the matching scores between the candidate call stack records and the call stack function sequence to be matched, and obtaining multiple matching scores including: determining a matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions that exist in the call stack record and the call stack function sequence to be matched; based on the matching degree calculation method, determining the matching scores of the candidate call stack records in multiple candidate call stack records.
[0218] Optionally, the storage medium is also configured to store program code for executing the following steps: arranging multiple candidate call stack records line by line in sequence, and arranging multiple call stack functions in the same candidate call stack record in adjacent lines in sequence; comparing multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line based on a string matching method to obtain at least one hit call stack record; performing a matching degree calculation between at least one hit call stack record and the call stack function sequence to be matched based on a matching degree calculation method to obtain a matching score for at least one hit call stack record.
[0219] Optionally, the storage medium is also configured to store program code for executing the following steps: after performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, the method includes: obtaining a knowledge base record table associated with the call stack record table; determining a record of knowledge base information associated with at least one target call stack record based on the knowledge base record table to obtain a record of the target knowledge base information; extracting relevant information for handling target operating system exceptions from the record of the target knowledge base information; and determining a solution strategy for handling exceptions in the target operating system based on the relevant information.
[0220] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the method for processing call stack information.
[0221] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0222] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0223] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0224] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0225] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0226] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., various media that can store program code.
[0227] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for processing call stack information, characterized in that: include: When an exception occurs in the target operating system, data information of the call stack to be matched is obtained; Determining a call stack function sequence to be matched according to the data information of the call stack to be matched, wherein the call stack function sequence to be matched is used to represent the execution order of functions in the data information of the call stack to be matched; Performing string matching in a call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, wherein the call stack record table includes multiple call stack records, and the call stack functions in the call stack records are arranged in sequence; Performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record includes: Determine, in a string matching manner, a call stack record containing any one of the call stack function sequences to be matched in the call stack record table, to obtain a plurality of candidate call stack records; Calculating matching scores between the candidate call stack records and the call stack function sequences to be matched respectively to obtain multiple matching scores; Determine at least one target call stack record from the candidate call stack records according to the plurality of matching scores; Calculating the matching scores between the candidate call stack records and the call stack function sequences to be matched respectively includes: Determining a matching degree calculation method based on a ratio of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and an index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of identical call stack functions existing in the call stack record and the call stack function sequence to be matched; Based on the matching degree calculation method, a matching score of a candidate call stack record among the multiple candidate call stack records is determined.
2. The method according to claim 1, characterized in that Determining the call stack function sequence to be matched according to the data information of the call stack to be matched includes: Matching the data information of the call stack to be matched with a predefined regular expression to extract multiple call stack functions; The multiple call stack functions are filtered according to a preset call stack function weight matching table to obtain a call stack function sequence to be matched.
3. The method according to claim 1, characterized in that After performing string matching in the call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, the method further includes: Obtaining a knowledge base record table associated with the call stack record table; Determining a record of knowledge base information associated with the target call stack record according to the knowledge base record table to obtain a record of target knowledge base information; Extracting relevant information for handling target operating system exceptions from records of target knowledge base information; A solution strategy for handling an exception in the target operating system is determined based on the relevant information.
4. The method according to claim 3, characterized in that Before performing string matching in a call stack record table according to the call stack function sequence to be matched to obtain at least one target call stack record, the method further includes: Constructing a call stack record table, wherein the call stack record table includes the multiple call stack records, and the call stack record table includes at least a primary key of a knowledge base record table; Constructing the knowledge base record table, wherein the knowledge base record table includes a plurality of knowledge base information records, a primary key of the knowledge base record table is a knowledge base number, wherein the plurality of knowledge base information records include information for handling anomalies of the target operating system; The call stack record table and the knowledge base record table are associated according to the primary key of the knowledge base record table.
5. The method according to claim 4, characterized in that Building a call stack record table includes: Creating a table structure of the call stack record table, wherein the table structure of the call stack record table includes at least one field for storing a primary key of the knowledge base record table; The plurality of call stack records are imported into the table structure of the call stack record table to construct the call stack record table, wherein the plurality of call stack records at least include the name of the call stack function and the position information of the call stack function in the call stack.
6. The method according to claim 4, characterized in that Constructing the knowledge base record table includes: Creating a table structure of the knowledge base record table, wherein the table structure of the knowledge base record table includes at least one primary key field; Creating a primary key for the knowledge base record table; A plurality of records of knowledge base information are imported into the table structure of the knowledge base record to construct the knowledge base record table.
7. The method according to claim 1, characterized in that Determining, based on the matching degree calculation method, a matching score of a candidate call stack record among the multiple candidate call stack records includes: Arrange multiple candidate call stack records in sequence line by line, and arrange multiple call stack functions in the same candidate call stack record in sequence in adjacent lines; Comparing multiple call stack functions in the candidate call stack record with the call stack function sequence to be matched line by line based on a string matching method to obtain at least one hit call stack record; A matching degree calculation is performed between the at least one hit call stack record and the call stack function sequence to be matched based on the matching degree calculation method to obtain a matching score of the at least one hit call stack record.
8. A device for processing call stack information, characterized in that: include: An acquisition unit, configured to acquire data information of a call stack to be matched when an exception occurs in the target operating system; a first determining unit, configured to determine a call stack function sequence to be matched based on the data information of the call stack to be matched, wherein the call stack function sequence to be matched is used to represent an execution order of functions in the data information of the call stack to be matched; a matching unit, configured to perform string matching in a call stack record table according to the call stack function sequence to be matched, to obtain at least one target call stack record, wherein the call stack record table includes a plurality of call stack records, and the call stack functions in the call stack records are arranged in sequence; The matching unit includes: a query module for determining, in a call stack record table, a call stack record containing any call stack function in a call stack function sequence to be matched, based on a string matching method, to obtain a plurality of candidate call stack records; a calculation module for respectively calculating matching scores between the candidate call stack records and the call stack function sequence to be matched, to obtain a plurality of matching scores; and a determination module for determining at least one target call stack record from the candidate call stack records based on the plurality of matching scores; The calculation module includes: a first determination submodule, used to determine the matching degree calculation method based on the proportion of the number of call stack functions in the hit call stack function sequence to the number of call stack functions in the call stack function sequence to be matched, and the index of the first call stack function in the hit call stack function sequence in the call stack function sequence to be matched, wherein the hit call stack function sequence is a combination of the same call stack functions existing in the call stack record and the call stack function sequence to be matched; a second determination submodule, used to determine the matching score of a candidate call stack record among multiple candidate call stack records based on the matching degree calculation method.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the method for processing call stack information according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the method for processing call stack information according to any one of claims 1 to 7 when running.
11. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps of the method for processing call stack information according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Distributed software abnormity diagnosis method based on execution locus tracking
CN106502907A
Operation method of intelligent auxiliary decision-making and maintenance system
CN116192675A