Abnormal information collection tool generation method and device, and computer device
Patent Information
- Application Number
- CN202211621455.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-12-16
AI Technical Summary
但是,目前都是以App版本来推导代码版本,采集的代码版本粒度太粗
[0038] The aforementioned method, apparatus, computer equipment, storage medium, and computer program product for generating anomaly information collection tools involve a server scanning character information to obtain a target character segment, inserting anomaly information collection character segment into the target character segment, and obtaining target character information. Then, version information is acquired, and the version information and target character information are packaged together to obtain the anomaly information collection tool. This tool is executed on a terminal, and when executed, it collects anomaly information through the anomaly information collection character segment. First, the server obtains the target character information by scanning character information and inserting the anomaly information collection character segment into it, thus automatically inserting the anomaly information collection character segment into the anomaly handling logic. Since the anomaly information collection character segment can automatically collect anomaly information, it further realizes automatic anomaly information collection, greatly improving the efficiency of anomaly information collection.
Smart Images

Figure CN115934473B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer application technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for generating anomaly information collection tools. Background Technology
[0002] With the rapid development of technology, all kinds of apps have appeared on the market to make people's lives more convenient.
[0003] When an app crashes, the terminal collects user feedback information at the time of the crash and uploads it to the server to help developers analyze and locate the cause of the crash. However, currently, the code version is inferred from the app version, resulting in too coarse-grained code version data. Furthermore, existing technologies require developers to manually insert the data collection device. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating anomaly information collection tools that can automatically collect anomaly information, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a method for generating an anomaly information collection tool. The method includes:
[0006] The target character segment is obtained by scanning character information;
[0007] An abnormal information collection character segment is inserted into the target character segment to obtain the target character information;
[0008] Get version information;
[0009] The version information and the target character information are packaged together to obtain an exception information collection tool; the exception information collection tool is used to execute on the terminal, and when the terminal executes the exception information collection tool, exception information is collected through the exception information collection character segment.
[0010] In one embodiment, the above-mentioned scanning of character information to obtain the target character segment includes:
[0011] Retrieve the pre-set key character set;
[0012] Scan the character information to obtain the character to be processed;
[0013] When the character to be processed matches the key character set, the target character segment is obtained based on the character to be processed.
[0014] In one embodiment, the above method further includes:
[0015] The terminal receives the abnormal information collected through the abnormal information collection character segment; the abnormal information carries a corresponding timestamp.
[0016] Determine the crash information from the anomaly information;
[0017] Based on the timestamp, obtain the abnormal information prior to the crash information;
[0018] The acquired anomaly information is displayed in a visual manner.
[0019] Secondly, an anomaly information collection method is provided. The method includes:
[0020] Execute the anomaly information collection tool; the anomaly information collection tool includes anomaly information collection character segment and target character information;
[0021] The abnormal information collection character segment is used to monitor whether the target character information is abnormal;
[0022] When the target character information is abnormal, abnormal information is collected through the abnormal information collection character segment.
[0023] In one embodiment, the above-mentioned collection of abnormal information through the abnormal information collection character segment includes:
[0024] Receive control parameters sent by the server;
[0025] The abnormal information is collected through the abnormal information collection character segment according to the control parameters.
[0026] Thirdly, this application also provides an apparatus for generating an anomaly information collection tool. The apparatus includes:
[0027] The scanning module is used to scan character information to obtain the target character segment;
[0028] The insertion module is used to insert the abnormal information collection character segment into the target character segment to obtain the target character information;
[0029] The acquisition module is used to obtain version information;
[0030] The sending module is used to package the version information and the target character information to obtain an abnormal information collection tool; the abnormal information collection tool is used to execute on the terminal, and when the terminal executes the abnormal information collection tool, it collects abnormal information through the abnormal information collection character segment.
[0031] Fourthly, this application also provides an anomaly information collection device. The device includes:
[0032] The execution module is used to execute the exception information collection tool; the exception information collection tool includes an exception information collection character segment and target character information;
[0033] The detection module is used to monitor whether the target character information is abnormal by collecting the abnormal information character segment;
[0034] The acquisition module is used to acquire abnormal information through the abnormal information acquisition character segment when the target character information is abnormal.
[0035] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the methods in any of the above embodiments.
[0036] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0037] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0038] The aforementioned method, apparatus, computer equipment, storage medium, and computer program product for generating anomaly information collection tools involve a server scanning character information to obtain a target character segment, inserting anomaly information collection character segment into the target character segment, and obtaining target character information. Then, version information is acquired, and the version information and target character information are packaged together to obtain the anomaly information collection tool. This tool is executed on a terminal, and when executed, it collects anomaly information through the anomaly information collection character segment. First, the server obtains the target character information by scanning character information and inserting the anomaly information collection character segment into it, thus automatically inserting the anomaly information collection character segment into the anomaly handling logic. Since the anomaly information collection character segment can automatically collect anomaly information, it further realizes automatic anomaly information collection, greatly improving the efficiency of anomaly information collection. Attached Figure Description
[0039] Figure 1 This is an application environment diagram of an anomaly information collection tool generation method in one embodiment;
[0040] Figure 2 This is a flowchart illustrating a method for generating an anomaly information collection tool in one embodiment;
[0041] Figure 3This is a flowchart illustrating an anomaly information collection method in one embodiment;
[0042] Figure 4 This is a structural block diagram of an anomaly information collection tool generation device in one embodiment;
[0043] Figure 5 This is a structural block diagram of an anomaly information acquisition device in one embodiment;
[0044] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] The abnormal information collection tool generation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The server scans character information to obtain the target character segment, inserts an exception information collection character segment into the target character segment, and obtains the target character information. Then, it obtains version information, packages the version information and the target character information to obtain an exception information collection tool, and finally sends the exception information collection tool to terminal 102. Terminal 102 receives and executes the exception information collection tool. Terminal 102 detects whether the target character information is abnormal through the exception information collection character segment. When the target character information is abnormal, it collects the exception information through the exception information collection character segment and sends the collected exception information to server 104, which then performs further processing based on the exception information. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server, a personal computer, or a server cluster consisting of multiple servers.
[0047] In one embodiment, such as Figure 2 As shown, a method for generating an anomaly information collection tool is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0048] S202, scan character information to obtain the target character segment.
[0049] Character information refers to a set of characters of various types, including letters, numbers, operators, punctuation marks, and other symbols. In the computer field, it can be source code. A target character segment refers to a portion of the character information that requires further processing.
[0050] Optionally, the server can scan each character included in the character information to obtain the target character segment.
[0051] Optionally, the server can scan each character combination in each line of character information to obtain the target character. For example, if the current line of character information is "Hello world", the server first scans "hello" and then scans "world".
[0052] Optionally, the server can scan the scanned character information according to a key character set to obtain the target character segment. The key character set refers to a pre-set set of characters, which can be configured according to specific application scenarios. The specific process of the server scanning the scanned character information according to the key character set can be referred to the process described in the following embodiments.
[0053] S204, Insert the exception information collection character segment into the target character segment to obtain the target character information.
[0054] Among them, the abnormal information collection character segment refers to the pre-set character set that can collect abnormal information; the target character information refers to the character information formed after inserting the abnormal information collection field into the character information.
[0055] For example, if the character information is "Hello world", the exception information collection character segment is "nice", and the target character segment is "hello", then the target character information is "Hello nice world".
[0056] Optionally, the server can insert exception information collection segments before and after the execution statements in the target segment. This allows for better analysis of exception situations by collecting exception information before and after the execution of the statements.
[0057] S206, Get version information.
[0058] Version information refers to information that can represent the version sequence of character information.
[0059] Optionally, the server can obtain the version information corresponding to the character information by executing a version execution tool. By obtaining the version of the character information, the specific version of the character information can be accurately located during subsequent analysis of the anomaly information, thereby enabling accurate analysis of the anomaly information.
[0060] For example, if the character information is source code, the server can obtain the current source code version information from the version control management system through a version execution tool.
[0061] Optionally, the server can add instructions to the character information so that when the target character information is packaged, it will automatically execute the version control tool's instructions to obtain the current version information of the character information before running the character information, and write the version information into the source code project. This allows the version information used during packaging to be read when the target character information is run.
[0062] S208, package the version information and target character information to obtain the exception information collection tool; the exception information collection tool is used to execute on the terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment.
[0063] Among them, exception information refers to information generated by the terminal during operation, such as the code stack information of the currently executing program, the exception type and reason caught by try-catch, the request address, request parameters and error code of the failed network request, and the error information returned by the SDK.
[0064] Optionally, the exception information may also include crash information, which refers to the information generated when the terminal crashes. For example, application crash information may include the code stack information where the crash occurred, the application's code version information, device information, etc.
[0065] Specifically, the server packages the version information and target character information into an exception information collection tool, and then sends the exception information collection tool to the terminal. The terminal executes the exception information collection tool and collects exception information through the exception information collection character segment in the tool.
[0066] Optionally, the server can encrypt the abnormal information collection tool using a preset encryption method and send the encrypted abnormal information collection tool to the terminal. The terminal needs to decrypt the encrypted abnormal information collection tool before executing it and collecting abnormal information through the abnormal information collection tool.
[0067] Optionally, the server can compress the anomaly information collection tool before sending it to the terminal. The terminal can then decompress the tool based on the compression code, thus reducing data transmission pressure.
[0068] Optionally, the server provides the anomaly information collection tool to the terminal in the form of an SDK.
[0069] It's important to note that the anomaly information collection tool does not involve sensitive user data and does not require user authorization; it can be enabled for all users. Compared to obtaining all methods and parameters executed during application runtime, the log information collected by the anomaly information collection tool is more accurate and efficient.
[0070] In the above-described method for generating an exception information collection tool, the server scans character information to obtain a target character segment, and inserts an exception information collection character segment into the target character segment to obtain the target character information. Then, version information is obtained, and the version information and the target character information are packaged together to obtain the exception information collection tool. This tool is executed on the terminal, and when the terminal executes it, exception information is collected through the exception information collection character segment. First, the server obtains the target character information by scanning character information and inserts the exception information collection character segment into it, thus automatically inserting the exception information collection character segment into the exception handling logic. Since the exception information collection character segment can automatically collect exception information, it further realizes automatic collection of exception information, greatly improving the efficiency of exception information collection.
[0071] In one embodiment, the process of obtaining a target character segment by scanning character information includes: acquiring a pre-set key character set; scanning character information to obtain a character to be processed; and obtaining a target character segment based on the character to be processed when the character to be processed matches the key character set.
[0072] The key character set is a pre-defined set of characters used to retrieve the target character range. For example, the key character set could be try-catch, onFailure, onError, etc.
[0073] Specifically, the server first obtains a pre-set key character set, then scans the character information to obtain the character to be processed, matches the character to be processed with the key character set, and when the character to be processed matches the key character set, the character to be processed is determined to be the target character segment.
[0074] For example, the server scans character information, matches key characters such as "try-catch", "onfailure", and "onError" to obtain the target character segment, and then inserts an exception information collection character segment into the target character segment. When the terminal runs the target character information, the exception information collection character segment is triggered. At this time, the exception information collection character segment collects exception information and uploads it.
[0075] In the above embodiments, the server obtains the target character segment through the key character set, thereby realizing the automatic insertion of the abnormal information collection character segment.
[0076] In one embodiment, the method further includes: receiving abnormal information collected by the receiving terminal through the abnormal information collection character segment; the abnormal information carrying a corresponding timestamp; determining crash information from the abnormal information; obtaining abnormal information prior to the crash information based on the timestamp; and displaying the obtained abnormal information in a visual manner.
[0077] For example, the server receives the exception information collected by the terminal through the exception information collection character segment. The exception information carries the corresponding timestamp. For example, if the exception information is collected at 13:10, then the corresponding timestamp is also 13:10.
[0078] Optionally, the server can determine the crash information from the abnormal information using corresponding identifiers. For example, when collecting abnormal information, the terminal can identify the crash information as 1 and mark the other abnormal information as 0. In this case, the server can quickly determine the crash information from the abnormal information using the identifiers.
[0079] Optionally, after determining the crash information, abnormal information within a preset time period before the crash information is obtained based on the timestamp, such as crash information within 3 days before the crash. Obtaining abnormal information from a longer period before the crash is less meaningful for analyzing abnormal information.
[0080] For example, the server can color-code the acquired exception information according to the chronological order, such as coloring exception information within one day before the crash in red and exception information within two days in orange, so that developers can analyze the exception information.
[0081] In the above embodiment, the server displays the exception information preceding the crash information based on the timestamp, which facilitates the analysis of exception information by developers. Furthermore, the server can reconstruct the exception events that occurred in the application before the crash, as well as the exception log details.
[0082] In one embodiment, such as Figure 3 As shown, an anomaly information collection method is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:
[0083] S302, Execute the exception information collection tool; the exception information collection tool includes the exception information collection character segment and the target character information.
[0084] Specifically, after the terminal obtains the exception information collection tool, it executes the exception information collection tool. The exception information collection tool includes an exception information collection character field and a target character field.
[0085] S304 monitors whether the target character information is abnormal by collecting abnormal information from the character segment.
[0086] Specifically, the terminal can detect whether the target character information is abnormal by collecting the abnormal information character segment.
[0087] Optionally, the terminal can collect exception information via the exception information collection character field based on control parameters issued by the server. These control parameters include the timing of exception information reporting, runtime exception information collection rules, etc., and can be dynamically adjusted in the background management interface. The collection rules specify the types of exceptions that can be collected and the scope of collection.
[0088] For example, "collecting exception types" means that you can specify to collect all exception types, or collect only specific types of exceptions, such as only collecting exceptions in try-catch blocks or only collecting exceptions in the onFailure type.
[0089] For example, the collection scope refers to the ability to specify whether to collect all logs or only the exception logs of a specific module. By specifying the collection scope, only exception information within the scope can be collected, such as only collecting exceptions under the face recognition module. In other embodiments, collection can also be automatically started after a certain number of crashes are detected when the user uses the app, or collection can be started only for users on a whitelist configured by the server.
[0090] S306, When the target character information is abnormal, the abnormal information is collected through the abnormal information collection character segment.
[0091] Specifically, when the target character information is abnormal, the abnormal information is collected through the abnormal information collection character segment.
[0092] Optionally, the terminal uploads the abnormal information to the server according to the timing of the abnormal information reporting in the control parameters.
[0093] In the above embodiments, the terminal executes an anomaly information collection tool, which enables automatic collection of anomaly information. Furthermore, by controlling the parameters, the terminal can accurately collect the anomaly information.
[0094] In one exemplary embodiment, an exception information collection tool for source code is provided. First, when packaging the app source code into an installation file, the current version information of the source code in the version control management system is simultaneously obtained and written into the installation file. Then, by scanning keywords in the code, exception handling blocks are located, and exception log collection code is inserted into these blocks. This exception log collection code uploads the exception types and reasons caught by try-catch blocks, the program call stack of the exception block, the request address, parameters, and error codes of failed network requests, and error information returned by third-party SDKs as exception logs to the server. Furthermore, the server also issues control parameters, including the timing of log reporting and runtime exception information collection rules.
[0095] During app runtime, when the app reaches the exception handling process, it records the current runtime exception information, including the code stack information of the currently executing program, the type and reason of the exception caught by try-catch, the request address, request parameters and error code of the failed network request, and the error information returned by the SDK. When the app crashes, it records the current crash information, including the code stack information of the crash, the app's code version information, device information, etc.
[0096] In the above embodiments, code version information can be automatically written into the installation package during packaging, and the specific code version information of the app can be collected when a crash occurs. Secondly, compared to the traditional solution that uses try-catch protection for abnormal code to allow the app to continue running, which may result in insufficient collection of app runtime exception information, this embodiment will collect sufficient exception information.
[0097] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0098] Based on the same inventive concept, this application also provides an abnormal information collection tool generation device and an abnormal information collection device for implementing the above-mentioned abnormal information collection tool generation method. The solution provided by this device is similar to the implementation scheme described in the above-described method. Therefore, the specific limitations of one or more abnormal information collection tool generation devices and abnormal information collection device embodiments provided below can be found in the limitations of the abnormal information collection tool generation method and abnormal information collection method described above, and will not be repeated here.
[0099] In one embodiment, such as Figure 4 As shown, an anomaly information collection tool generation device is provided, comprising: a scanning module 100, an insertion module 200, an acquisition module 300, and a sending module 400, wherein:
[0100] The scanning module 100 is used to scan character information to obtain the target character segment.
[0101] The insertion module 200 is used to insert the abnormal information collection character segment into the target character segment to obtain the target character information.
[0102] Module 300 is used to obtain version information.
[0103] The sending module 400 is used to package version information and target character information to obtain an exception information collection tool; the exception information collection tool is used to execute on the terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment.
[0104] In one embodiment, the scanning module includes:
[0105] The character acquisition unit is used to acquire a pre-set set of key characters.
[0106] The character scanning unit is used to scan character information to obtain the character to be processed.
[0107] The matching unit is used to obtain the target character segment based on the character to be processed when the character to be processed matches the key character set.
[0108] In one embodiment, the above-described apparatus further includes:
[0109] The exception receiving module is used to receive exception information collected by the terminal through the exception information collection character segment; the exception information carries the corresponding timestamp.
[0110] The determination module is used to identify crash information from exception information.
[0111] The filtering module is used to retrieve abnormal information prior to the crash information based on the timestamp.
[0112] The display module is used to visually present the acquired anomaly information.
[0113] In one embodiment, such as Figure 5 As shown, an anomaly information acquisition device is provided, including: an execution module 500, a detection module 600, and an acquisition module 700, wherein:
[0114] The execution module 500 is used to execute the exception information collection tool; the exception information collection tool includes the exception information collection character segment and the target character information.
[0115] The detection module 600 is used to monitor whether the target character information is abnormal by collecting abnormal information character segments.
[0116] The acquisition module 700 is used to collect abnormal information through the abnormal information acquisition character segment when the target character information is abnormal.
[0117] In one embodiment, the acquisition module 700 includes:
[0118] The parameter receiving unit is used to receive control parameters sent by the server.
[0119] The anomaly acquisition unit is used to collect anomaly information through the anomaly information acquisition character segment based on control parameters.
[0120] The aforementioned anomaly information collection tool generation device and its various modules can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0121] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores character information data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a method for generating an anomaly information collection tool.
[0122] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0123] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: scanning character information to obtain a target character segment; inserting an exception information collection character segment into the target character segment to obtain target character information; obtaining version information; packaging the version information and the target character information to obtain an exception information collection tool; the exception information collection tool is used to execute on a terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment.
[0124] In one embodiment, the process of scanning character information to obtain a target character segment when the processor executes a computer program includes: acquiring a pre-set key character set; scanning character information to obtain characters to be processed; and obtaining the target character segment based on the characters to be processed when the characters to be processed match the key character set.
[0125] In one embodiment, when the processor executes the computer program, it further includes: receiving abnormal information collected by the terminal through the abnormal information collection character segment; the abnormal information carrying a corresponding timestamp; determining crash information from the abnormal information; obtaining abnormal information prior to the crash information based on the timestamp; and displaying the obtained abnormal information in a visual manner.
[0126] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: executing an anomaly information collection tool; the anomaly information collection tool includes an anomaly information collection character segment and target character information; monitoring whether an anomaly occurs in the target character information through the anomaly information collection character segment; and when an anomaly occurs in the target character information, collecting anomaly information through the anomaly information collection character segment.
[0127] In one embodiment, the process of collecting exception information through the exception information collection character segment when the processor executes a computer program includes: receiving control parameters sent by the server; and collecting exception information through the exception information collection character segment according to the control parameters.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: scanning character information to obtain a target character segment; inserting an exception information collection character segment into the target character segment to obtain target character information; obtaining version information; packaging the version information and the target character information to obtain an exception information collection tool; the exception information collection tool is used to execute on a terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment.
[0129] In one embodiment, the process of scanning character information to obtain a target character segment when a computer program is executed by a processor includes: acquiring a pre-set key character set; scanning character information to obtain characters to be processed; and obtaining the target character segment based on the characters to be processed when the characters to be processed match the key character set.
[0130] In one embodiment, when the computer program is executed by the processor, it further includes: receiving abnormal information collected by the receiving terminal through the abnormal information collection character segment; the abnormal information carrying a corresponding timestamp; determining crash information from the abnormal information; obtaining abnormal information prior to the crash information based on the timestamp; and displaying the obtained abnormal information in a visual manner.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: executing an exception information collection tool; the exception information collection tool includes an exception information collection character segment and target character information; monitoring whether the target character information is abnormal through the exception information collection character segment; when the target character information is abnormal, collecting exception information through the exception information collection character segment.
[0132] In one embodiment, when the computer program is executed by the processor, it further includes: collecting exception information through the exception information collection character segment, including: receiving control parameters sent by the server; and collecting exception information through the exception information collection character segment according to the control parameters.
[0133] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: scanning character information to obtain a target character segment; inserting an exception information collection character segment into the target character segment to obtain target character information; obtaining version information; packaging the version information and the target character information to obtain an exception information collection tool; the exception information collection tool is used to execute on a terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment.
[0134] In one embodiment, the process of scanning character information to obtain a target character segment when a computer program is executed by a processor includes: acquiring a pre-set key character set; scanning character information to obtain characters to be processed; and obtaining the target character segment based on the characters to be processed when the characters to be processed match the key character set.
[0135] In one embodiment, when the computer program is executed by the processor, it further includes: receiving abnormal information collected by the receiving terminal through the abnormal information collection character segment; the abnormal information carrying a corresponding timestamp; determining crash information from the abnormal information; obtaining abnormal information prior to the crash information based on the timestamp; and displaying the obtained abnormal information in a visual manner.
[0136] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: executing an exception information collection tool; the exception information collection tool includes an exception information collection character segment and target character information; monitoring whether an exception occurs in the target character information through the exception information collection character segment; and when an exception occurs in the target character information, collecting exception information through the exception information collection character segment.
[0137] In one embodiment, when the computer program is executed by the processor, it further includes: collecting exception information through the exception information collection character segment, including: receiving control parameters sent by the server; and collecting exception information through the exception information collection character segment according to the control parameters.
[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0139] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An abnormal information collection tool generation method characterized by comprising: Applied to a server, the method includes: The target character segment is obtained by scanning character information; An abnormal information collection character segment is inserted into the target character segment to obtain the target character information; Get version information; The version information and the target character information are packaged together to obtain an exception information collection tool; the exception information collection tool is used to execute on a terminal, and when the terminal executes the exception information collection tool, exception information is collected through the exception information collection character segment; the exception information collection character segment is used to collect the exception information collected from the target character information; The process of scanning character information to obtain the target character segment includes: Obtain a pre-set key character set; the key character set includes one or more of try-catch, onFailure, and onError; The character information is scanned to obtain the character to be processed; When the character to be processed matches the key character set, the target character segment is obtained based on the character to be processed. The step of inserting an abnormal information collection character segment into the target character segment to obtain target character information includes: The exception information collection character segment is inserted before and after the execution statement in the target character segment to obtain the target character information.
2. The method of claim 1, wherein, The method further includes: The terminal receives the abnormal information collected through the abnormal information collection character segment; the abnormal information carries a corresponding timestamp. Determine the crash information from the anomaly information; Based on the timestamp, obtain the abnormal information prior to the crash information; The acquired anomaly information is displayed in a visual manner.
3. An abnormal information collection method characterized by comprising: Applied to a terminal, the method includes: An anomaly information collection tool is executed; the anomaly information collection tool is generated by the anomaly information collection tool generation method according to claim 1. The abnormal information collection character segment is used to monitor whether the target character information is abnormal; When the target character information is abnormal, abnormal information is collected through the abnormal information collection character segment.
4. The method according to claim 3, characterized in that, The step of collecting abnormal information through the abnormal information collection character segment includes: Receive control parameters sent by the server; The abnormal information is collected through the abnormal information collection character segment according to the control parameters.
5. An anomaly information collection tool generation device, characterized in that, Applied to a server, the device includes: The scanning module is used to scan character information to obtain the target character segment; The insertion module is used to insert the abnormal information collection character segment into the target character segment to obtain the target character information; The acquisition module is used to obtain version information; A sending module is used to package the version information and the target character information to obtain an exception information collection tool; the exception information collection tool is used to execute on a terminal, and when the terminal executes the exception information collection tool, it collects exception information through the exception information collection character segment; the exception information collection character segment is used to collect the exception information collected from the target character information; The scanning module includes: A character acquisition unit is used to acquire a pre-set key character set; the key character set includes one or more of try-catch, onFailure, and onError. A character scanning unit is used to scan the character information to obtain the character to be processed; The matching unit is used to obtain a target character segment based on the character to be processed when the character to be processed matches the key character set; The insertion module is also used to insert the exception information collection character segment before and after the execution statement in the target character segment to obtain the target character information.
6. The apparatus according to claim 5, characterized in that, The device further includes: An anomaly receiving module is used to receive the anomaly information collected by the terminal through the anomaly information collection character segment; the anomaly information carries a corresponding timestamp; A determination module is used to determine crash information from the abnormal information; A filtering module is used to obtain the abnormal information prior to the crash information based on the timestamp; The display module is used to visually present the acquired anomaly information.
7. An anomaly information collection device, characterized in that, Applied to a terminal, the device includes: An execution module is used to execute an anomaly information collection tool; the anomaly information collection tool is generated by the anomaly information collection tool generation device according to claim 5. The detection module is used to monitor whether the target character information is abnormal by collecting the abnormal information character segment; The acquisition module is used to acquire abnormal information through the abnormal information acquisition character segment when the target character information is abnormal.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2 or 3 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2 or 3 to 4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2 or 3 to 4.
Citation Information
Patent Citations
Web page script error positioning method and apparatus
CN105468511A
Automatic packaging method and device, storage medium and computer equipment
CN107450941A