Problem report generation method and device and storage medium
By configuring an error monitoring program in the code, automatically obtaining and parsing error events, and generating problem reports with Git information, the inefficiency problem in traditional methods is solved, and rapid positioning and accurate exception code reporting is achieved.
Patent Information
- Application Number
- CN202510441957.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-19
AI Technical Summary
The traditional method of creating problem reporting relies on manual operations, resulting in low efficiency and the inability to quickly locate exception codes and attribution responsibilities, and the information is scattered in different systems.
By configuring error monitoring programs in front-end and back-end code, error events are automatically obtained, call stack information is parsed, and automatic problem reports are generated by combining Git engineering information and developer information.
Automatic determination of abnormal code positioning information, version information and developer information is realized, which improves the efficiency of problem reports generation and reduces manual intervention and positioning time.
Smart Images

Figure CN120508468A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software engineering technology, and in particular to a problem reporting method, device, and storage medium. Background Art
[0002] In the current software development and maintenance process, handling website error messages is a crucial step in ensuring stable website operation. When errors occur during website operation, a problem report needs to be generated for subsequent analysis and repair.
[0003] Currently, traditional methods of creating problem reports mostly rely on manual operations, which is time-consuming and results in low efficiency in creating problem reports. Summary of the Invention
[0004] The purpose of this application is to provide a method, device and storage medium for generating a problem report, aiming to solve the problem of low efficiency in creating problem reports.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a method for generating a problem report, the method comprising: obtaining an error event of a target website; an error event refers to an event in which the target website cannot operate normally due to a code abnormality of the target website; based on the error event, determining error information related to the error event; the error information includes abnormal code location information, abnormal code version information, and abnormal code developer information; based on the error information, generating a problem report.
[0007] The problem report generation method provided in the embodiment of the present application can automatically determine the error information related to the error event, which includes the exception code location information, the exception code version information and the developer information of the exception code, and automatically create a problem report based on the error information, thereby improving the efficiency of creating problem reports.
[0008] In one possible implementation, the front-end code and back-end code of the target website are respectively configured with error monitoring programs, and obtaining error events of the target website includes: obtaining error events of the target website through the error monitoring programs of the front-end code and the back-end code.
[0009] In one possible implementation, the exception code location information includes call stack information, the file name and line number where the exception code is located, and based on the error event, determining the error information related to the error event, including: obtaining the call stack information when the error event occurs; parsing the call stack information to obtain the file name and line number where the exception code is located.
[0010] In one possible implementation, the abnormal code version information includes Git project information and a commit identifier. Based on the error event, error information related to the error event is determined, including: obtaining the Git project information of the target website; and determining the commit identifier corresponding to the abnormal code based on the Git project information.
[0011] In a possible implementation, determining the commit identifier corresponding to the abnormal code based on the Git project information includes: if the Git project exists and is accessible, accessing the Git project to determine the commit identifier corresponding to the abnormal code.
[0012] In one possible implementation, accessing a Git project and determining a commit identifier corresponding to the abnormal code includes: accessing the Git project and determining a Git branch currently corresponding to the target website; and determining a commit identifier corresponding to the abnormal code based on the Git branch currently corresponding to the target website.
[0013] In the second aspect, the present application provides a problem report generating device, which includes: a communication unit and a processing unit; the communication unit is used to obtain an error event of a target website; an error event refers to an event in which the target website cannot operate normally due to a code abnormality of the target website; the processing unit is used to determine error information related to the error event based on the error event; the error information includes abnormal code location information, abnormal code version information and developer information of the abnormal code; the processing unit is also used to generate a problem report based on the error information.
[0014] In a possible implementation, the communication unit is further configured to obtain error events of the target website through an error monitoring program of the front-end code and an error monitoring program of the back-end code.
[0015] In a possible implementation, the communication unit is further configured to obtain call stack information when the error event occurs; and the processing unit is further configured to parse the call stack information to obtain the file name and line number where the abnormal code is located.
[0016] In a possible implementation, the communication unit is further configured to obtain Git project information of the target website; and the processing unit is further configured to determine a commit identifier corresponding to the abnormal code based on the Git project information.
[0017] In a possible implementation, when the Git project exists and is accessible, the processing unit is further configured to access the Git project and determine a commit identifier corresponding to the abnormal code.
[0018] In one possible implementation, the processing unit is further used to access the Git project to determine the Git branch currently corresponding to the target website; the processing unit is further used to determine the commit identifier corresponding to the abnormal code based on the Git branch currently corresponding to the target website.
[0019] In a third aspect, the present application provides a problem report generating device, which includes: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the problem report generating method described in the first aspect and any possible implementation method of the first aspect.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal, the terminal executes the problem report generation method described in the first aspect and any possible implementation of the first aspect.
[0021] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is run on a problem report generating device, enables the problem report generating device to execute the problem report generating method as described in the first aspect and any possible implementation of the first aspect.
[0022] In a sixth aspect, the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the problem report generation method described in the first aspect and any possible implementation of the first aspect.
[0023] Specifically, the chip provided in this application also includes a memory for storing computer programs or instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0025] Figure 1 A schematic diagram of the composition of a problem report generating device provided in an embodiment of the present application;
[0026] Figure 2 A flowchart of a method for generating a problem report provided in an embodiment of the present application;
[0027] Figure 3 A flowchart of another problem report generation method provided in an embodiment of the present application;
[0028] Figure 4 A schematic diagram of the structure of a problem report generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0030] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "back," "inner," "outer," and the like, indicating directions or positional relationships, are based on the directions or relative positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this application and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific direction, be constructed, or operate in a specific direction. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned directionality descriptions may be flexibly set in actual application, provided that the relative positional relationships shown in the accompanying drawings are met.
[0031] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0032] In the embodiments of the present application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, article, or device comprising the element.
[0033] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0034] In the description of this specification, specific features, structures, materials or characteristics may be combined in an appropriate manner in any one or more embodiments or examples.
[0035] In the current software development and operation and maintenance process, handling website error information is an important part of ensuring the stable operation of the website. When an error occurs during website operation, a problem report (i.e., a bug report) needs to be generated for subsequent analysis and repair.
[0036] Currently, traditional error monitoring systems (such as Sentry and ELK tools) only record error logs, requiring manual reproduction of error scenarios and linking to the codebase. Testers must take screenshots or manually create bug reports after reproducing the error steps, while developers must trace back to the code using logs. Furthermore, existing tools (such as GitLab Issues) cannot automatically link website runtime errors to code commit records.
[0037] As can be seen from the preceding description, traditional bug reporting methods have the following major problems. First, there's excessive manual intervention, with the entire process from error discovery to bug report creation largely relying on manual effort. Second, locating abnormal code is inefficient, requiring manual analysis of call stack information and comparison of code versions. Third, responsibility is unclear, making it impossible to quickly associate the faulty line of code with the last person who modified it. Fourth, information is fragmented, with error logs, code versions, and fix records scattered across different systems.
[0038] In view of this, an embodiment of the present application provides a problem report generation method, the method comprising: obtaining an error event of a target website, determining error information related to the error event based on the error event, and generating a problem report based on the error information. In other words, the problem report generation method provided in an embodiment of the present application can automatically determine error information related to the error event, the error information including abnormal code location information, abnormal code version information, and abnormal code developer information, and automatically create a problem report based on the error information, thereby improving the efficiency of creating problem reports.
[0039] For example, Figure 1 Schematic diagram of the composition of a problem report generating device 10 provided in an embodiment of the present application. Figure 1 As shown, the problem report generating device 10 may include a processor 101 and a bus 102 .
[0040] Furthermore, the problem report generating device 10 may further include a communication interface 103 and a memory 104 . The processor 101 , the memory 104 and the communication interface 103 may be connected via a bus 102 .
[0041] The processor 101 is a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 101 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0042] The bus 102 is used to transmit information between the components included in the problem report generating device 10 .
[0043] Communication interface 103 is used to communicate with other devices or other communication networks. Such other communication networks may be Ethernet, radio access networks (RAN), wireless local area networks (WLAN), etc. Communication interface 103 may be a module, circuit, communication interface, or any other device capable of communication.
[0044] The memory 104 is used to store instructions, where the instructions may be computer programs.
[0045] The memory 104 may be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0046] It should be noted that memory 104 can exist independently of processor 101 or be integrated with processor 101. Memory 104 can be used to store instructions, program code, or data. Memory 104 can be located within or outside of problem report generation device 10, without limitation. Processor 101 is configured to execute instructions stored in memory 104 to implement the problem report generation method provided in the following embodiments of this application.
[0047] It should be noted that the problem report generating device 10 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system or a computer with Figure 1 In addition, Figure 1 The composition shown in the Figure 1 The limitations of each device in Figure 1 In addition to the parts shown, Figure 1 The various devices in the figures may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0048] In the embodiment of the present application, the chip system can be composed of chips, or can include chips and other discrete devices.
[0049] In addition, the actions and terms involved in the various embodiments of this application can refer to each other without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are only examples, and other names can also be used in specific implementations without limitation.
[0050] The problem report generation method provided by the embodiment of the present application is described below with reference to the accompanying drawings. Among them, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiment of the present application is only an example, and other names can also be used in the specific implementation without limitation. The actions involved in the various embodiments of the present application are only an example, and other names can also be used in the specific implementation, such as: "included in" in the embodiment of the present application can also be replaced by "carried on" or "carried in", etc.
[0051] like Figure 2 As shown, the embodiment of the present application proposes a method for generating a problem report, which includes:
[0052] S201: Obtain error events of the target website.
[0053] An error event refers to an event in which the target website cannot operate normally due to code anomalies of the target website.
[0054] In one possible implementation, corresponding error monitoring programs are configured in the front-end code and back-end code of the target website. When an error occurs during the operation of the website, the error event is obtained through the error monitoring program. For details, please refer to the following Figure 3 The embodiments described are not described in detail here.
[0055] Exemplarily, the above error events may include front-end error events and back-end error events. Front-end error events may include JavaScript code errors, resource loading errors, and asynchronous operation errors. Back-end error events may include server-side code errors, database errors, and third-party service call errors.
[0056] S202: Based on the error event, determine error information related to the error event.
[0057] The error information includes the abnormal code location information, abnormal code version information, and abnormal code developer information.
[0058] Optionally, the abnormal code location information may include call stack information, the file name and line number where the abnormal code is located. The abnormal code version information may include Git project information and commit identifier. The abnormal code developer information may include the developer's name and contact information.
[0059] In one possible implementation, when an error occurs, call stack information is obtained, and the file name and line number of the abnormal code are obtained based on the call stack information. The file name and line number of the abnormal code are operated on according to preset commands to obtain the username that submitted the abnormal code, and the name and contact information of the developer are obtained based on the username. The Git project name corresponding to the target website is obtained, and the Git branch currently corresponding to the target website is filtered out from all available Git branches in the Git project based on the Git project name. The commit identifier (Commit ID) corresponding to the abnormal code is then searched in the commit history of the Git branch.
[0060] S203: Generate a problem report based on the error information.
[0061] In one possible implementation, a bug report is generated based on the error information and a preset bug report template. Specifically, the error information is filled in according to the format of the bug report template to generate a complete bug report.
[0062] Exemplarily, the bug report template may include basic error information, call stack information, the file name and line number of the abnormal code, Git project and branch information, Commit ID, and developer information.
[0063] Optionally, when filling the error information into the bug report template, you can format and organize the error information. For example, you can bold the basic error information and perform syntax highlighting on the call stack information.
[0064] Optionally, you can also obtain log information related to the error event and include it in the bug report. This log information can include front-end browser console logs and back-end server logs. Log information provides more context and environmental information about the error event, helping relevant personnel to more fully understand the error event.
[0065] Furthermore, after generating a bug report, the bug report can be sent to the project management platform's interface using a pre-set format and parameters. A notification is then sent to relevant personnel informing them that the bug report has been created. Furthermore, feedback information from the project management platform can be received for subsequent tracking and processing. This feedback information includes the bug number and status.
[0066] In the problem report generation method provided by the present application, an error event of a target website is obtained, error information related to the error event is determined based on the error event, and a problem report is generated based on the error information. In other words, the problem report generation method provided by the embodiment of the present application can automatically determine the error information related to the error event, the error information including the abnormal code location information, the abnormal code version information, and the developer information of the abnormal code, and automatically create a problem report based on the error information, thereby improving the efficiency of creating problem reports.
[0067] In one embodiment, Figure 3 As shown, the above S201 can be specifically determined through the following S301.
[0068] S301. Obtain error events of a target website through an error monitoring program of a front-end code and an error monitoring program of a back-end code.
[0069] Alternatively, the aforementioned process of acquiring the target website's error event through the front-end code's error monitoring program may include calling the window.onerror function to acquire the error event when an error occurs during the execution of the target website's front-end code. Alternatively, a try...catch block may be used for local error acquisition. If an error occurs, the program immediately jumps to the catch block, where the error event can be acquired.
[0070] Alternatively, the aforementioned implementation of acquiring the target website's error event through the backend code's error monitoring program may include: when an error occurs during the execution of the target website's backend code, the exception handling mechanism may acquire the error event. Specifically, code that may cause an exception is executed within a try block. If an exception occurs, the program jumps to an except block or a catch block, thereby acquiring the error event.
[0071] It should be noted that the target website's front-end and back-end code each have error monitoring programs configured. For the front-end code, JavaScript's global error handling function window.onerror and / or a try...catch block can be configured as error monitoring programs. For the back-end code, the corresponding exception handling mechanism can be configured as an error monitoring program based on the programming language and framework used. For example, Python can configure a try...except block, and Java can configure a try...catch block.
[0072] In one embodiment, when the exception code location information includes call stack information and the file name and line number where the exception code is located, the above S202 can be specifically determined through the following S401 to S402.
[0073] S401: Obtain call stack information when an error event occurs.
[0074] Optionally, if the error event is caused by the front-end code, the above S401 may be implemented by: after obtaining the error event, obtaining the call stack information when the error event occurs by accessing the stack property of the Error object.
[0075] Optionally, if the error event is caused by backend code, the above S401 can be implemented as follows: in Python, the call stack information when the error event occurs can be obtained through the traceback module. In Java, it can be obtained through the getStackTrace() method.
[0076] S402: Parse the call stack information to obtain the file name and line number where the abnormal code is located.
[0077] In one possible implementation, a parsing algorithm is used to parse the call stack information and extract the file name and line number. Specifically, the parsing algorithm performs string segmentation and matching according to the format rules of the call stack to extract information such as the function name, file name, and line number.
[0078] For example, taking the parsing of JavaScript call stack information as an example, the JavaScript call stack format is functionName@fileName:lineNumber:columnNumber. Among them, functionName represents the function name, fileName represents the file name, lineNumber represents the line number, and columnNumber represents the column number. According to this format rule, the parsing algorithm uses @ to separate the function name and file name parts, and uses : to separate the file name, line number, and column number parts. For example, if the call stack information is "myFunction@example.js:10:5", the result of string segmentation of the call stack information using the parsing algorithm is: "Function name: myFunction, file name: example.js, line number: 10, column number: 5".
[0079] Optionally, after obtaining the file name and line number of the abnormal code, you can locate the specific code file and the line number of the error in the code directory of the target website project. When locating, consider the integrity of the file path and the conversion between relative and absolute paths to ensure that the corresponding code file and line number can be accurately found to improve the accuracy of positioning. In addition, you can also extract the error code line and related code snippets before and after it from the located code file, fill it into the bug report, and format and annotate it to improve the readability of the information.
[0080] Optionally, the relevant code snippets can be extracted according to preset rules. For example, 10 lines of code before and after the error line can be extracted to ensure that the code snippets can fully demonstrate the context of the problem.
[0081] In one embodiment, when the abnormal code version information includes Git project information and a commit identifier, the above S202 can be specifically determined through the following S501 to S502.
[0082] S501. Obtain Git project information of the target website.
[0083] The Git project information may include a Git repository address and / or a Git project name.
[0084] In one possible implementation, the Git project information of the target website is obtained from a configuration file. Specifically, the configuration file content is loaded using a file reading function, and the Git project information corresponding to the target website name is searched in the configuration file.
[0085] It should be noted that when the target website is deployed, the mapping relationship between the website name and the Git project information is pre-configured in the configuration file.
[0086] In another possible implementation, the Git project information of the target website is obtained from the environment variable. Specifically, the value of the environment variable GIT_REPO_INFO is read to obtain the Git project information.
[0087] It should be noted that when the target website is deployed, the GIT_REPO_INFO environment variable is set in advance in the deployment environment. The value of this environment variable includes the Git project information of the target website, and the environment variable can be directly read when needed.
[0088] S502: Determine the commit identifier corresponding to the abnormal code based on the Git project information.
[0089] In one possible implementation, the Git project information is used to verify whether it exists and is accessible. If the Git project exists and is accessible, the Git project is accessed and the Git branch currently corresponding to the target website is selected from all available Git branches in the Git project. Based on the code modification time or other relevant information in the call stack information, the commit ID corresponding to the abnormal code is searched in the commit history of the Git branch currently corresponding to the target website.
[0090] Optionally, the above-mentioned verification process for whether a Git project exists and is accessible can be implemented as follows: For remote Git projects, verification can be performed through a network request. For example, an HTTP or HTTPS request can be sent to the uniform resource locator (URL) of the remote Git repository and the response status code can be checked for verification. For local Git projects, local file system operations can be used to check whether a .git subdirectory exists within the directory and confirm whether the directory is a Git repository. The status and availability of the repository can be checked by executing Git commands.
[0091] Optionally, the above-mentioned implementation process of searching for the Commit ID corresponding to the abnormal code in the commit history of the Git branch currently corresponding to the target website can be: through the Git command line tool or application programming interface (API), combined with the timestamp of the code modification or the file modification record, locate the Commit ID closest to the time when the error occurred in the target website.
[0092] It is understandable that since the development environment may correspond to the development branch and the production environment may correspond to the main branch, it is necessary to determine the Git branch currently corresponding to the target website to ensure that subsequent operations are performed on the correct branch.
[0093] Optionally, if the Git project is inaccessible, the failure reason is recorded and relevant information about the Git project is retrieved through a backup mechanism. For example, manual intervention or cache search. Manual intervention refers to manually checking the accessibility of the Git project, updating configuration information, and resolving network issues. Cache search refers to searching and retrieving relevant information about the Git project from a previously stored cache.
[0094] In one embodiment, when the developer information of the exception code includes the developer's name and contact information, the above S202 can be specifically determined through the following S601 to S602.
[0095] S601: Operate the file name and line number of the abnormal code based on a preset command to determine the user name that submitted the abnormal code.
[0096] One possible implementation involves using the git blame command and specifying the path to the file containing the anomalous code to view the last modification information for each line of code in that file. In the blame command output, find the modification record corresponding to the line number and extract the committer information (i.e., the user name who committed the anomalous code).
[0097] Another possible implementation involves using the API provided by the Git hosting platform to request the last modification information for each line of code in the file containing the abnormal code. The request must include the Git repository information and the file path. After receiving the API response, the system parses the modification record for the corresponding line number and extracts the committer information (i.e., the username that submitted the abnormal code).
[0098] S602: Determine the name and communication information of the corresponding developer based on the user name.
[0099] In one possible implementation, a user name is converted into a corresponding full name and communication information by querying a user information database. Specifically, the user information database includes a mapping relationship between user names and full names, as well as a mapping relationship between user names and email addresses. Based on the user name, the full name (i.e., the developer's name) and email address (i.e., the developer's communication information) corresponding to the user name can be found in the user information database.
[0100] It is understandable that converting the user name to obtain the developer's name and communication information can ensure the accuracy and completeness of the developer's information so that relevant personnel can be notified later.
[0101] To sum up, the problem report generation method provided in the embodiment of the present application obtains error events during website runtime in real time, combines call stack information and Git project information, automatically locates the location of the abnormal code and the last submitter information, generates a bug report and sends it to the project management platform, realizes the automation of the entire process of error acquisition, abnormal code location, developer allocation and bug report generation, greatly improves the efficiency and accuracy of creating bug reports, and reduces the cost of manual intervention.
[0102] The problem report generation method provided in the embodiment of the present application can be applied to the following aspects:
[0103] 1-1. Microservice Architecture of Web Development Team
[0104] The microservice architecture has a large number of services, complex dependencies, and scattered error information. Automatically creating bug reports can quickly locate problems and improve team collaboration efficiency.
[0105] 1-2. Continuous integration or DevOps environment
[0106] Automatic bug reporting reduces manual intervention and speeds up bug fixing and deployment cycles.
[0107] 1-3. Enterprises that need to respond quickly to production failures
[0108] By acquiring error events in real time and automatically creating bug reports, fault response time can be shortened and business losses can be reduced.
[0109] In addition, the problem report generation method provided in the embodiment of the present application can also be combined with continuous integration (CI) tools or continuous deployment (CD) tools to achieve the linkage of error repair, automatic testing and redeployment, and can also be extended to error handling of mobile or desktop applications, and can also be combined with artificial intelligence (AI) to predict high-frequency error code segments.
[0110] It is understandable that the above-mentioned problem report generation method can be implemented by a problem report generation device. In order to realize the above-mentioned functions, the problem report generation device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments disclosed in this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments disclosed in this application.
[0111] The embodiment disclosed in the present application can divide the functional modules of the problem report generation device generated by the above-mentioned method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment disclosed in the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0112] Figure 4 This is a schematic diagram of the structure of a problem report generating device provided in an embodiment of the present application. Figure 4 As shown, the problem report generating device 40 can be used to perform Figure 2 and Figure 3 The problem report generating method shown in FIG. The problem report generating device 40 includes: a communication unit 401 and a processing unit 402 .
[0113] Communication unit 401 is used to obtain error events of the target website; an error event refers to an event in which the target website cannot operate normally due to code abnormalities of the target website; processing unit 402 is used to determine error information related to the error event based on the error event; the error information includes abnormal code location information, abnormal code version information and abnormal code developer information; processing unit 402 is also used to generate a problem report based on the error information.
[0114] In a possible implementation, the communication unit 401 is further configured to obtain error events of the target website through an error monitoring program of the front-end code and an error monitoring program of the back-end code.
[0115] In a possible implementation, the communication unit 401 is further configured to obtain call stack information when an error event occurs; and the processing unit 402 is further configured to parse the call stack information to obtain the file name and line number of the abnormal code.
[0116] In a possible implementation, the communication unit 401 is further configured to obtain Git project information of the target website; and the processing unit 402 is further configured to determine a commit identifier corresponding to the abnormal code based on the Git project information.
[0117] In a possible implementation, when the Git project exists and is accessible, the processing unit 402 is further configured to access the Git project and determine a commit identifier corresponding to the abnormal code.
[0118] In one possible implementation, the processing unit 402 is further used to access the Git project to determine the Git branch currently corresponding to the target website; the processing unit 402 is further used to determine the commit identifier corresponding to the abnormal code based on the Git branch currently corresponding to the target website.
[0119] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0120] The present disclosure also provides a computer-readable storage medium having instructions stored thereon. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the problem report generating method provided in the above-mentioned embodiment of the present disclosure.
[0121] The embodiments of the present disclosure also provide a computer program product containing instructions, which, when executed on an electronic device, enables the electronic device to execute the problem report generating method provided by the embodiments of the present disclosure.
[0122] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0123] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for generating a problem report, characterized in that: The method comprises: Obtaining an error event of a target website; the error event refers to an event in which the target website cannot operate normally due to a code anomaly of the target website; Based on the error event, determining error information related to the error event; the error information includes abnormal code location information, abnormal code version information, and developer information of the abnormal code; A problem report is generated based on the error information.
2. The method according to claim 1, characterized in that The front-end code and back-end code of the target website are respectively configured with error monitoring programs, and the error events of the target website are obtained, including: The error events of the target website are obtained through the error monitoring program of the front-end code and the error monitoring program of the back-end code.
3. The method according to claim 1 or 2, characterized in that The exception code location information includes call stack information, the file name and line number where the exception code is located, and determining error information related to the error event based on the error event includes: Obtaining call stack information when the error event occurs; The call stack information is parsed to obtain the file name and line number where the abnormal code is located.
4. The method according to claim 3, characterized in that The abnormal code version information includes Git project information and a commit identifier. The determining, based on the error event, error information related to the error event includes: Obtain Git project information of the target website; Based on the Git project information, determine a commit identifier corresponding to the exception code.
5. The method according to claim 4, characterized in that The determining, based on the Git project information, a commit identifier corresponding to the abnormal code includes: If the Git project exists and is accessible, access the Git project to determine a commit identifier corresponding to the exception code.
6. The method according to claim 4, characterized in that Accessing the Git project and determining the commit identifier corresponding to the abnormal code includes: Access the Git project and determine the Git branch currently corresponding to the target website; Based on the Git branch currently corresponding to the target website, a commit identifier corresponding to the abnormal code is determined.
7. A problem report generating device, characterized in that: The device includes: a communication unit and a processing unit; The communication unit is configured to obtain an error event of a target website; the error event refers to an event in which the target website cannot operate normally due to a code anomaly of the target website; The processing unit is configured to determine error information related to the error event based on the error event; the error information includes abnormal code location information, abnormal code version information, and developer information of the abnormal code; The processing unit is further configured to generate a problem report based on the error information.
8. A problem report generating device, characterized in that: include: A processor and a communication interface; the communication interface is coupled to the processor, and the processor is configured to execute a computer program or instruction to implement the problem report generating method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the problem report generating method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the problem report generating method according to any one of claims 1 to 6 is implemented.