Debugging document generation method and device, electronic equipment and storage medium
By collecting and analyzing debugging data, and using hook functions and pre-trained language models to generate structured debugging documentation, the problem of time-consuming and inconsistent manual writing was solved. This resulted in efficient and standardized debugging documentation generation, promoting team collaboration and knowledge sharing.
Patent Information
- Application Number
- CN202511657505.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, debugging documentation generation relies on manual writing, which is time-consuming, error-prone, and lacks unified management, resulting in inconsistent documentation quality and making it difficult to support subsequent code maintenance and team collaboration.
By collecting debugging data during the debugging process, hook functions are used to capture operation command sequences, error logs, variable change trajectories, and breakpoint trigger records in real time. Combined with a pre-trained language model, debugging objectives, key information, and verification results are extracted, and structured debugging documents are generated based on templates.
It enables the automated generation of efficient and standardized debugging documentation, reducing manual writing time, ensuring content integrity and consistency, and improving team collaboration efficiency and knowledge sharing capabilities.
Smart Images

Figure CN121580981A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of debugging, in particular to a debugging document generation method, a debugging document generation apparatus, an electronic device, a chip, a storage medium and a computer program product. BACKGROUND
[0002] In related technologies, for a debugging project, a developer usually manually writes a debugging document after completing a debugging task. Such a method relies on manual summarization, which not only takes a long time, but also easily affects the completeness and accuracy of the document due to unclear expression or missing key information. In addition, due to the lack of a unified document management mechanism, debugging documents are often scattered and difficult to find and maintain.
[0003] The above problems lead to uneven quality of debugging documents, which is difficult to effectively support subsequent code maintenance and team collaboration. Therefore, there is an urgent need for a technical solution that can automatically extract debugging key information and generate structured debugging documents to improve the generation efficiency and usability of debugging documents.
[0004] SUMMARY Embodiments of the present application provide a debugging document generation method, a debugging document generation apparatus, an electronic device, a chip, a storage medium and a computer program product.
[0005] The debugging document generation method provided by the embodiments of the present application comprises: collecting debugging data in a debugging process of a debugging task; extracting first information based on the debugging data; the first information comprises one or more of the following information: debugging target, debugging process key information and debugging verification result; generating a debugging document based on the first information.
[0006] The debugging document generation apparatus provided by the embodiments of the present application comprises: a data collection module configured to collect debugging data in a debugging process of a debugging task; an analysis module configured to extract first information based on the debugging data; the first information comprises one or more of the following information: debugging target, debugging process key information and debugging verification result; a document generation module configured to generate a debugging document based on the first information.
[0007] The electronic device provided by the embodiments of the present application comprises a processor and a memory, the memory is configured to store a computer program, and the processor is configured to call and run the computer program stored in the memory to execute the debugging document generation method provided by any of the embodiments of the present application.
[0008] The chip provided by the embodiments of the present application comprises: a processor configured to call and run a computer program from a memory, so that a device installed with the chip executes the debugging document generation method provided by any of the embodiments of the present application.
[0009] The storage medium provided by the embodiments of the present application is configured to store a computer program, and the computer program causes a computer to execute the debugging document generation method provided by any of the embodiments of the present application.
[0010] The computer program product provided by the embodiments of the present application comprises a computer program, and the computer program causes a processor to execute the debugging document generation method provided by any of the embodiments of the present application.
[0011] Through the debugging document generation method, the debugging document generation device, the electronic device, the chip, the storage medium and the computer program product provided by the embodiments of the present application, first, the debugging data in the debugging process of the debugging task is collected, then the debugging target, the debugging process key information and the debugging verification result and other information are extracted based on the debugging data, and the debugging document is generated based on the information. In this way, the manual recording is replaced by an automatic way, which can effectively reduce the time input of engineers in the debugging document writing, improve the efficiency, and ensure the standardization and integrity of the content of the debugging document. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 The implementation flow of the debugging document generation method provided by the embodiments of the present application is shown Figure 1 ; Figure 2 The implementation flow of the debugging document generation method provided by the embodiments of the present application is shown Figure 2 ; Figure 3 The structure diagram of the debugging document generation device 300 provided by the embodiments of the present application is shown Figure 4 The working timing diagram provided by the embodiments of the present application is shown Figure 5 The structure diagram of the debugging document generation device 500 provided by the embodiments of the present application is shown Figure 6 The schematic structure diagram of the electronic device provided by the embodiments of the present application is shown Figure 7 The schematic structure diagram of the chip provided by the embodiments of the present application is shown DETAILED DESCRIPTION
[0013] With reference to the drawings and embodiments of the present application, the technical solutions in the embodiments of the present application will be described. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0014] It should be noted that in the embodiments of the present application, the term "and / or" is only used to describe the association relationship of the associated objects, and can represent the existence of three relationships, for example, A and / or B, which can represent the existence of A alone, the existence of A and B together, and the existence of B alone. In addition, in the embodiments of the present application, the character " / " generally represents an "or" relationship between the front and rear associated objects.
[0015] In the description of the embodiments of the present application, the term "corresponding" can represent a direct or indirect corresponding relationship between the two, can also represent an associated relationship between the two, and can also indicate a relationship such as indicated, configured, and configured.
[0016] In order to facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies of the embodiments of the present application are described as follows, and the following related technologies can be combined with the technical solutions of the embodiments of the present application in any way, which all belong to the protection scope of the embodiments of the present application.
[0017] In the related art, after completing a debugging task, the current software development needs to manually record the debugging method in the corresponding electronic document; this often encounters the following problems: 1. Time-consuming and labor-intensive, often requiring engineers to spend 1-2 hours or more to do it; 2. May be due to individual expression problems or omissions, resulting in discounted summary and arrangement; 3. There is no fixed place to store the document, which may cause accidental deletion or others cannot find the specific location of the corresponding document.
[0018] Reference Figure 1 , Figure 1 The implementation process of the debugging document generation method provided by the embodiments of the present application is shown in Figure 1 As shown in Figure 1 The debugging document generation method provided by the embodiments of the present application includes the following steps: Step 101: Collecting debugging data in the debugging process of the debugging task.
[0019] In the embodiments of the present application, the debugging data refers to a collection of various operation behaviors and state information generated in the software debugging process, including but not limited to operation instruction sequences, error logs, variable change trajectories, breakpoint triggering records, etc. The debugging data can reflect the specific behavior path and problem positioning process of the debugging process, and the debugging data is an important basis for generating debugging documents. For example, when debugging an SPI communication module of an embedded system, the debugging data may include modifying the SPI clock frequency to 1 MHz, setting the interrupt enable bit, reading the register value and printing the output, etc. When debugging a Web application interface, the debugging data may include sending a GET request to / api / user / 123, receiving a 404 Not Found response, calling a database query function without returning a result, etc.
[0020] In the embodiments of the present application, the debugging data is usually stored in text, binary, JSON or other structured formats, and can be captured in real time through a hook function. The hook function is a programming mechanism used to intercept and modify the behavior of certain specific functions during program execution. In the embodiments of the present application, the hook function is used to capture operation instruction sequences, error logs, variable change trajectories, breakpoint triggering records, etc. in real time during the debugging process. For example, in the Windows platform, the CreateProcess, ReadProcessMemory, etc. debugger APIs can be intercepted based on the Microsoft Detours library; in the Linux platform, the eBPF can be mounted to the kernel tracepoint to listen to the sys_enter_ptrace system call, analyze the parameter structure, extract the debugging operation type and target address. The hook function can transparently record the key information of the debugging process without changing the original program logic, ensuring the integrity and accuracy of the debugging data.
[0021] In the embodiments of the present application, the relationship between the debugging data and the debugging task is that the debugging data is an objective record of the execution process of the debugging task, reflecting the operation behavior of the debugging personnel, the system response and the debugging result. For example, in the task of debugging the target to solve the SPI communication timeout problem, the debugging data may include modifying the clock frequency to 1 MHz, enabling the DMA transmission mode, and the loop test pass rate of 100%, etc. The debugging data constitutes the basis for subsequent extraction of the first information, and is the core content source for generating the debugging document.
[0022] In the embodiments of the present application, in actual implementation, the collection mode of the debugging data should be adapted according to different debugging environments and platforms. For example, the Detours library is used to intercept the debugger API in the Windows environment, and the eBPF technology is used to monitor the system call in the Linux environment, which can realize cross-platform data collection. The debugging data collected through the hook function has high timestamp accuracy and integrity, which is convenient for the subsequent AI analysis engine to extract the debugging target, the key information in the debugging process and the debugging verification result. In addition, the debugging data can be efficiently transmitted through shared memory or ring buffer, reducing the performance impact on the debugging process.
[0023] Based on this, in an optional embodiment of the present application, the collection of the debugging data in the debugging process of the debugging task includes: The hook function is used to collect the debugging data in the debugging process of the debugging task. The debugging data includes one or more of the following data: operation instruction sequence, error log, variable change trajectory and breakpoint triggering record.
[0024] In the embodiments of the present application, the operation instruction sequence refers to an ordered set of a series of operation commands executed by the user or the system in the debugging process. The instructions in the operation instruction sequence can include starting the debugger, setting the breakpoint, single-step execution, viewing the memory, etc. The instructions in the operation instruction sequence can reflect the debugging path and idea of the debugger. By collecting the operation instruction sequence, the entire debugging process can be restored, which is convenient for subsequent analysis and document generation.
[0025] In the embodiments of the present application, the error log is a set of error information output by the program or the debugger in the debugging process. The information contained in the error log usually includes exception type, occurrence position, stack trace and the like, which is helpful to locate the problem source. Collecting the error log can provide key problem description and diagnosis basis for the debugging document, and improve the accuracy and integrity of the document.
[0026] In the embodiments of the present application, the variable change trajectory refers to the change history record of each variable value in the debugging process. By tracking the assignment, reading and modification of the variable, the change process of the program running state can be clearly understood. By tracking the assignment, reading and modification of the variable, the change process of the program running state can be clearly understood, which is of great significance for identifying logical errors and understanding algorithm execution flow. In the present application, the collection of the variable change trajectory helps to build more detailed debugging context information.
[0027] In the embodiments of the present application, breakpoint trigger record refers to event record generated when program execution flow reaches the set breakpoint in the debugging process. The breakpoint trigger record contains breakpoint address, trigger time, register state at that time and other information, which helps to analyze program execution path and abnormal behavior. The behavior of collecting breakpoint trigger record can assist in verifying the effectiveness of the debugging result, and the breakpoint trigger record can be used as one of the key evidences in the debugging document.
[0028] In the embodiments of the present application, there is a close data correlation relationship between the debugging data in the debugging process of the above five types of debugging tasks. For example, the operation instruction sequence determines when to set a breakpoint, and the breakpoint trigger record reflects the actual execution effect of the instruction; the error log is often associated with a specific variable change or breakpoint trigger, and together constitutes a complete portrait of the debugging problem. By comprehensively collecting the debugging data in the debugging process of the five types of debugging tasks, the debugging process can be comprehensively captured, laying a solid foundation for subsequent AI analysis and document generation.
[0029] Step 102: based on the debugging data, extracting first information; the first information includes one or more of the following information: debugging target, debugging process key information and debugging verification result.
[0030] In the embodiments of the present application, the first information is the key content extracted from the debugging data. The first information specifically includes the debugging target (i.e. the problem to be solved by the debugging task), the key information in the debugging process (such as parameter adjustment, key steps, etc.), and the debugging verification result (such as whether the test passes, whether the performance index meets the standard, etc.).
[0031] In the embodiments of the present application, the debugging target is the problem to be solved by the debugging task, and there is one or more debugging targets in a debugging task. For example, solving the SPI communication timeout problem, repairing the HTTP 500 error, optimizing the database query efficiency, etc.
[0032] In the embodiments of the present application, the debugging process key information refers to the key operation or key parameter executed in the debugging process, which usually involves parameter adjustment, code modification, configuration change, etc. For example, the debugging personnel executed the operation of modifying the SPI clock frequency to 1MHz, executed the operation of adding exception handling logic, implemented the operation of replacing the third-party library version, etc. In the embodiments of the present application, the debugging verification result refers to the evaluation result of whether the problem has been solved after the debugging is completed, which usually includes whether the test passes, whether the performance index meets the standard, whether there are residual problems, etc. For example, the loopback test pass rate reaches 100%, the interface response time is reduced from 500 milliseconds to 100 milliseconds, and the memory leakage detection result shows no leakage.
[0033] In the embodiments of the present application, the debugging data is usually derived from a series of operations performed by the developer during the debugging process, such as setting breakpoints, viewing variable values, running test scripts, etc. The debugging data can exist in various forms such as log files, console outputs, API call records, etc., and the formats are not uniform, and there may be redundant information. In order to improve the accuracy and efficiency of subsequent information extraction, it is necessary to preprocess the original debugging data before extraction.
[0034] In the embodiments of the present application, preprocessing refers to preliminary cleaning and sorting of the original debugging data, so that the preprocessed debugging data is more in line with the needs of subsequent extraction of the first information. The preprocessing can include one or more of the following processing methods: Timestamp annotation: Since the debugging process usually lasts for a long time, and multiple debugging behaviors may occur simultaneously, a timestamp needs to be added to each debugging record to facilitate subsequent organization and analysis of data in chronological order. For example, in the debugger output, the system can automatically add a timestamp before each log, such as 2025-04-05T14:30:45Z.
[0035] Repeated data filtering: During the debugging process, there may be a large number of repetitive instructions, such as printing the same error information multiple times, continuously calling the same function, etc. Repetitive instructions or data with continuous same content not only increase the data volume, but also may cause the debugging analysis result to be distorted.
[0036] Structured conversion: Debugging data is usually unstructured text, which is difficult to use directly for machine learning or natural language processing. Structured conversion is the process of converting unstructured text into a standard data structure, such as JSON, XML, or table format. Extract the information about variable names, values, and types in the log and construct it as a JSON object.
[0037] Based on this, in an optional embodiment of the present application, before extracting the first information based on the debugging data, the method further includes: Preprocessing the debugging data; the preprocessing includes one or more of the following processing methods: timestamp annotation, repeated data filtering, structured conversion.
[0038] In the embodiments of the present application, through the above preprocessing steps, the quality and usability of the debugging data can be significantly improved. On the one hand, timestamp annotation helps to establish a clear timeline, making the debugging process more traceable; on the other hand, removing redundant data can reduce the consumption of computing resources and improve analysis efficiency; and structured conversion provides a good input basis for subsequent term standardization, intent recognition, etc.
[0039] In the embodiments of the present application, the debugging process usually generates a large amount of unstructured text data, such as error logs, variable change records, breakpoint triggering events, etc. Debugging data is difficult to be directly used for document generation and must be processed to extract useful information. A pre-trained language model can be used for first information extraction. The pre-trained language model can automatically identify debugging targets (such as solving SPI communication timeout problems), key operations (such as modifying the clock frequency to 1 MHz), and verification results (such as loopback test pass rate 100%) by modeling the semantics of the debugging data.
[0040] In the embodiments of the present application, the pre-trained language model can use a BERT-based pre-training model.
[0041] In the embodiments of the present application, technical terms in the debugging data can be described in a standardized manner, that is, technical terms appearing in the debugging data are uniformly converted into a standard and consistent expression method, which can also be referred to as term entity linking. Due to different habits of various tools, platforms or developers involved in the debugging process, the same concept may have different names. For example, spidev_test tool, SPI test program, SPI device test program, etc. may all refer to the same functional entity. If the technical terms are not unified, the document content will be chaotic, affecting readability and retrieval efficiency. Through natural language processing (NLP), unstructured terms in the debugging log (such as “memory overflow” and “null pointer”) are automatically mapped to a standardized fault library, and the user's core debugging target is located by combining intent recognition technology, and the matching accuracy is improved by 40%.
[0042] In the embodiments of the present application, the process of standardized description relies on the semantic mapping ability of the pre-trained language model. The pre-trained language model can automatically replace non-standard expressions with unified terms by learning a large number of debugging terms and the corresponding standard names of the debugging terms when encountering non-standard expressions. The process of standardized description not only improves the consistency of the document, but also enhances the communication efficiency between cross-project and cross-team.
[0043] In specific implementation, the standardized description can be multi-dimensionally judged in combination with a domain dictionary, a context, and user-defined rules. For example, when the pre-trained language model identifies the spidev_test tool, it will query the commonly used alternative terms of the tool in the debugging field and select the most appropriate standardized expression. For new terms not included, the user can be prompted whether the new term should be included in the standard term library, so as to realize continuous optimization of the standard term library.
[0044] In the embodiments of the present application, log analysis can also be performed on the debugging data by using a pre-trained language model. Log analysis is a key link for ensuring stable operation and safety of a system. Its importance is reflected in improving safety by identifying abnormalities and potential threats, optimizing performance to reduce maintenance costs, and helping enterprises meet compliance requirements. At the data management level, a distributed architecture is needed to efficiently collect large-scale logs. In combination with a high-reliability storage solution (such as a distributed file system or cloud storage) and a classification storage strategy, data security and queryability can be ensured. In the analysis link, multi-dimensional technologies (such as time series analysis and association rule mining) and machine learning algorithms are used to realize automatic anomaly detection. Finally, the results are intuitively presented by using a visualization tool, providing strong support for operation and maintenance decisions.
[0045] Based on this, in an optional embodiment of the present application, the first information is extracted based on the debugging data, including: The first information is extracted based on the debugging data by using a pre-trained language model. The method further includes: The technical terms in the debugging data are described in a standardized manner by using the pre-trained language model.
[0046] In the embodiments of the present application, the use of a pre-trained language model to extract key information from debugging data can significantly improve the automation level of debugging document generation. This can reduce the time cost of manual sorting, thereby achieving efficient debugging knowledge sedimentation, and further promoting team collaboration and subsequent problem reproduction. By standardizing the description of technical terms in the debugging data, the standardization description behavior can eliminate the information distortion problem caused by individual expression differences. The standardization description behavior can improve the standardization and consistency of the document content. The standardization and consistency of the document content can facilitate knowledge retrieval and sharing in the later stage. The convenience of knowledge retrieval and sharing can enhance the knowledge management capability of the enterprise.
[0047] In the embodiments of the present application, the debugging data has a first attribute and a second attribute. The first attribute refers to the importance degree of each operation instruction in the debugging process, which is used to measure the key role of the operation instruction in solving the problem. For example, the operation of modifying a key parameter may have a high first attribute value, while the auxiliary operation of viewing logs may have a low first attribute value. The second attribute of the operation instruction refers to whether the effectiveness of the solution can be verified after the operation instruction is executed, that is, whether the operation instruction can provide feedback information to judge whether the debugging result meets the expectation. For example, after completing a configuration adjustment, a test case is run to obtain explicit feedback information to judge whether the debugging result meets the expectation.
[0048] In the embodiments of the present application, the first attribute weight and the second attribute weight are relative coefficients set according to a typical mode of the debugging process, and respectively represent the contribution degrees of the two attributes when evaluating the data characteristics. For example, the first attribute weight can be set to 0.6, indicating that the instruction importance accounts for a large proportion in the overall evaluation; the second attribute weight can be set to 0.4, indicating that the importance of effect verification is slightly lower but still important. The first attribute weight and the second attribute weight can be dynamically adjusted according to different debugging scenarios. The second attribute weight will be increased in the system stability debugging process, and the first attribute weight will be increased in the performance tuning process.
[0049] In the embodiments of the present application, by multiplying the first attribute value and the first attribute weight, and multiplying the second attribute value and the second attribute weight, and adding the two, the comprehensive characteristic value of each debugging data point can be calculated, which can be called context semantic weight calculation. This characteristic value reflects the importance of the data point in the entire debugging process, which is helpful for subsequent extraction of key steps from the debugging data. According to the characteristic values of the data, the key steps can be extracted from the debugging data.
[0050] Based on this, in an optional embodiment of the present application, the debugging process key information includes: key steps and key parameters; and the method includes: determining characteristic values of the data in the debugging data based on the values of the first attribute and the second attribute of the data in the debugging data, the first attribute weight and the second attribute weight; the first attribute represents instruction importance; and the second attribute represents effect verification importance; extracting the key steps from the debugging data based on the characteristic values of the data in the debugging data.
[0051] In the embodiments of the present application, the key steps are those data items with high characteristic values selected from the debugging data set, which represent the most core operations or decision points in the debugging process. For example, when debugging a communication protocol problem, modifying the baud rate, adding log output, running a test script, etc. can be key steps. These steps usually play a decisive role in solving the problem or provide important verification basis.
[0052] In the embodiments of the present application, the key steps can be screened by setting a threshold value of the characteristic value. For example, when the characteristic value is greater than or equal to 0.8, the data point with the characteristic value greater than or equal to 0.8 is considered as a key step. In addition, context semantic analysis can be combined to further confirm which steps really affect the achievement of the debugging target. The above multi-dimensional analysis method makes the extraction of key steps not only rely on numerical indicators, but also consider logical causal relationships.
[0053] In the embodiments of the present application, the method of extracting key steps based on eigenvalues can quickly locate the core operation in the debugging process, thereby reducing redundant records and improving the simplicity and readability of the digital document. In this way, the digital document can focus on the truly valuable content, thereby improving the team collaboration efficiency and accelerating the problem reproduction and knowledge inheritance speed.
[0054] Step 103: generating a debugging document based on the first information.
[0055] In the embodiments of the present application, the debugging document is a structured document generated according to the extracted first information and a preset debugging report template. The template includes multiple fields, such as problem description, environment configuration, debugging process key information, problem occurrence time, impact range, problem classification, problem solution, conclusion and optimization suggestion, etc., to ensure that the generated document meets the unified format requirements, facilitating reading and archiving. For example, in a task where the debugging target is to solve the SPI communication timeout problem, the generated debugging document may include the following contents: problem description: SPI communication has a timeout phenomenon, resulting in data loss. Debugging process key information: 1. Modify the SPI clock frequency to 1MHz; 2. Enable DMA transmission mode; 3. Perform loopback test. Debugging verification result: the pass rate of loopback test is 100%, and the problem has been solved. Optimization suggestion: it is suggested to add a hardware watchdog function to further enhance the system stability.
[0056] Based on this, in an optional embodiment of the present application, the generating of the debugging document based on the first information includes: generating the debugging document according to a debugging report template based on the first information; wherein, The debugging report template includes second information, and the second information includes one or more of the following information: problem description, problem occurrence time, impact range, problem classification, and problem solution.
[0057] In the embodiments of the present application, the debugging report template is a set of predefined document format structures for organizing and presenting the content of the debugging document. The template includes multiple fields, such as problem description, environment configuration, debugging process key information, problem occurrence time, impact scope, problem classification, problem solution, conclusion and optimization suggestion, etc., to ensure that the generated document meets the unified format requirements, facilitating reading and archiving. Among them, the problem description: clearly and concisely describes the phenomenon of the problem, such as system crash, function failure, etc. Occurrence time: specifically records the time and date of the problem occurrence, so as to accurately trace the problem source. Impact scope: clearly defines the scope of the problem, such as the number of users affected, business processes, etc.; problem classification: classifies the problem to facilitate more effective problem solving; solution: describes the specific method, reason and process of solving the problem, as well as the effect achieved. The template supports user-defined extension to meet the needs of different projects and debugging scenarios.
[0058] In the embodiments of the present application, the generated debugging document can not only be directly exported for engineers to view, but also can be synchronized to the enterprise's internal knowledge management system and generate retrieval tags, such as T10 project-SPI debugging-202508.
[0059] The relationship between the debugging document and the debugging task is that the debugging document is a summary and record of the execution process and results of the debugging task, reflecting the achievement of the debugging target in the execution process of the debugging task, the execution of the debugging process key information, and the effectiveness of the debugging verification result. For example, in the task of solving the SPI communication timeout problem, the debugging document records the operation behavior of the debugging personnel, the system response and the debugging result, and the debugging document provides an important basis for subsequent problem tracing, experience accumulation and knowledge sharing.
[0060] In the embodiments of the present application, the debugging document can be automatically uploaded to the cloud project knowledge base and generate a retrieval index containing key metadata. The cloud project knowledge base refers to an enterprise-level knowledge management system deployed on a cloud platform, which is used to centrally store various technical documents related to the project. The cloud project knowledge base supports multi-user access, version control, permission management and other functions, ensuring the security and traceability of the debugging document. For example, Confluence, Notion, Wiki, etc. belong to such systems. In the embodiments of the present application, the debugging document is automatically uploaded to the designated project space, facilitating subsequent review and reference.
[0061] In the embodiments of the present application, a retrieval index can also be generated for the debugging document, the retrieval index refers to structured data generated for improving the searching efficiency of the debugging document, in the embodiments of the present application, the third information of the debugging document is used to construct the retrieval index, the third information includes the project name to which the debugging task belongs, the name of the debugging task, and the generation time of the debugging document, and the like, so that the user can search through any one field. When the user inputs a query content such as T10 project-SPI debugging-202508, the relevant debugging document can be quickly located by using the retrieval index.
[0062] Based on this, in an optional embodiment of the present application, the method further comprises: storing the debugging document into a cloud project knowledge base; and generating a retrieval index of the debugging document; the retrieval index includes third information; the third information includes one or more of the following information: the project name to which the debugging task belongs, the name of the debugging task, and the generation time of the debugging document.
[0063] In the embodiments of the present application, a document generator can be used to generate the debugging document based on the first information.
[0064] Reference Figure 2 , Figure 2 The implementation process of the debugging document generation method provided in the embodiments of the present application is shown in Figure 2 As shown in Figure 2 , the debugging document generation method provided in the embodiments of the present application includes the following steps: collecting debugging data from the original data of the debugging task through Hook, and displaying the collection process through a graphical user interface (Graphical User Interface, GUI), performing preprocessing operation on the debugging data after the data collection is completed to obtain preprocessed debugging data, extracting first information from the preprocessed debugging data through an AI analysis engine, generating a debugging document through a document generator based on the first information and according to a pre-set debugging document template, storing the debugging document to the local, and uploading the debugging document to a project knowledge base in the cloud.
[0065] Reference Figure 3 , Figure 3 The structure diagram of the debugging document generation device 300 provided in the embodiments of the present application is shown in Figure 3 As shown in Data collection module: cross-platform hook technology is used to realize the non-invasive capture of debugging process data. For example, on the Windows platform, the Microsoft Detours library is used to intercept the debugger application programming interface (API) (such as CreateProcess, ReadProcessMemory), and by modifying the first 5 bytes of the target function (jump instruction (JMP)), the call is redirected to a custom hook function, realizing real-time capture of debugging data. On the Linux platform, the eBPF (extended Berkeley Packet Filter) is used to mount the kernel tracepoint, listen to the sys_enter_ptrace system call, analyze the parameter structure defined in the format file (such as struct ptrace_request), extract the debugging operation type (PTRACE_PEEKTEXT / PTRACE_CONT, etc.) and target address (document [X technology]), and visualize the data collection process through the GUI interface. Data preprocessing: ring buffer (kernel mode) + two-level dynamic buffer (user mode) architecture is used to timestamp, filter and structure the debugging data, with a data throughput of up to 1000 debugging instruction records per second.
[0066] AI analysis engine for technical term standardization: based on a pre-trained natural language processing (NLP) model such as the BERT pre-training model (the fine-tuning data set contains 200,000 debugging field terms), technical term standardization and debugging intent recognition are realized: through the BiLSTM-CRF model, the instruction sequence is sequentially labeled to identify the "problem positioning → parameter adjustment → verification test" three-stage behavior boundary, with an accuracy of 91.3%; key step extraction: using an improved TextRank algorithm, with "instruction importance (weight 0.6) + effect verification (weight 0.4)" as the feature, the core debugging steps (such as "modify the SPI clock frequency to 1MHz") are automatically extracted, with a recall rate of 89%.
[0067] Document generator includes: standard template library, built-in XML format debugging document template in standard template library, XML format includes <problemdescription> 、 <environment> 、 <steps> 、 <verification>The equal mandatory field supports user-defined extension tags (such as <SPI_Parameters>); knowledge base synchronization: automatically upload the generated debugging document to the specified space of Confluence through the intranet API, generate a search tag based on the debugging scene keyword (such as "T10 project-SPI debugging"), and the document search response time is less than 2 seconds; the debugging document format can be a word version, supporting automatic switching of document templates according to the debugging scene (such as kernel debugging / application layer debugging), and updating the newly generated debugging case to the knowledge base through an incremental synchronization algorithm, and the template reuse rate is increased by 60%, supporting scene feature extraction, template parameter adaptive filling, and knowledge base incremental updating. The document generator supports the permission-format linkage mechanism of the export module, combines the permission management idea of QuickAPI, realizes the "role-format" binding (such as administrators can export complete debugging logs, and ordinary users can only export desensitized step instructions), and supports multiple format encryption export such as PDF / Markdown / JSON. The document generator can encrypt and upload the generated debugging document to the cloud project knowledge base, and the cloud project knowledge base can be realized through an edge node.
[0068] In the code debugging process of the debugging document generation apparatus 300 in the embodiment of the application, syntax checking can be performed through the menu "Tools|Check Syntax" or the shortcut key "CTRL+F7", and the debugging result is displayed on the information interface; when setting a breakpoint, F9 or clicking the left side of the code line can be used to mark, and after running the test script (F5), the program will be paused at the breakpoint; single-step debugging can be performed by selecting "Debug|Step Into" in the debugging interface, pressing F10 to execute single-step skipping (Step over) or F11 to enter the function inside (Step Into); during the debugging process, the debugging viewer can also be opened, and object properties or variable names can be input to view the running result in real time, so as to efficiently locate the problem.
[0069] In the embodiments of the present application, several tools are also provided, such as Apifox, which is a full-process collaborative platform integrating API documentation, debugging, mock data and automated testing. By integrating the functions of Postman, Swagger, Mock and JMeter, it realizes global synchronization with one modification, supports IDEA plug-in automatic generation of documents, seamless import of Postman data, and provides a clean Chinese interface and a completely free mode, which significantly improves development efficiency. Cursor is an AI-based intelligent programming tool that can replace VSCode to achieve code generation, intelligent completion, conversational programming and quick switching between multiple AI models (such as ChatGPT and Claude), helping efficient development. QuickReporter focuses on batch generation of structured Word reports, supports dynamic insertion of data, pictures and tables, ensures that the report format remains unchanged when experimental data changes, and is suitable for scenarios such as scientific research and testing that require frequent updates.
[0070] In the embodiments of the present application, in the development of the test process of the debugging document generation device 300, Apifox can be used to replace Postman to realize one-stop management of interface debugging and document generation, and Cursor can be combined to automatically generate code snippets through natural language description to improve development efficiency. For batch document processing needs, QuickReporter can efficiently generate pay slips, contracts and other repetitive files to reduce manual operations. Jmeter supports script recording and debugging and provides performance testing solutions for process-based businesses to cover optimization needs from interfaces to systems.
[0071] Reference Figure 4 , Figure 4 The working timing diagram provided by the embodiments of the present application, as shown in Figure 4 , includes a triggering stage, a collection stage, an analysis stage and a generation stage. Among them, Triggering stage: after the user completes the debugging, the GenerateDoc() interface is called to wake up the data collection service through inter-process communication (IPC).
[0072] Collection stage: the hook function captures the debugging data in the preset time period of the debugger. The preset time period is set by the user, and the collected debugging data is compressed through the buffer and then transmitted to the AI analysis engine through shared memory.
[0073] Analysis stage: the AI analysis engine completes the term standardization and step extraction to obtain the first information and generate a structured intermediate result. The time for the AI analysis engine to extract the first information can be set according to actual conditions.
[0074] The generation stage: the document generator fills in the template according to the first information, generates and exports a debugging document in a.docx format, and synchronously pushes the debugging document to the user and a cloud project knowledge base.
[0075] The debugging document generation method provided in the embodiments of the present application first collects the debugging data in the debugging process of the debugging task, then extracts the debugging target, the debugging process key information and the debugging verification result and other first information based on the debugging data, and generates the debugging document based on these information. In this way, by replacing manual recording with an automated manner, the time investment of engineers in debugging document writing can be effectively reduced, the efficiency is improved, and the normativity and integrity of the content of the debugging document are ensured; the debugging data in the debugging process is collected by using the hook function, which can capture various key information generated in the debugging process in real time, such as the operation instruction sequence, the error log, the variable change trajectory and the breakpoint triggering record. In this way, not only the accuracy and comprehensiveness of data collection are improved, but also the structured degree of the debugging data is enhanced, providing a high-quality data basis for subsequent information extraction and document generation; by performing preprocessing operations such as time stamp labeling, repeated data filtering and structured conversion on the debugging data, the consistency and usability of the debugging data can be improved. This helps to eliminate the influence of redundant and inconsistent information, thereby improving the quality and accuracy of subsequent information extraction; by using the pre-trained language model to analyze the debugging data, the debugging target, the key steps and the verification result and other information can be automatically recognized and extracted, and the technical terms in the debugging data can be converted into unified standardized expressions. This helps to eliminate the differences in the use of terms by different personnel, and improves the professionalism and consistency of the debugging document; the attribute weight mechanism is introduced to quantitatively evaluate the importance of the instructions and the importance of the effect verification in the debugging data, and the feature values of the data are calculated accordingly, so as to realize the accurate extraction of the key steps, which helps to highlight the core operations and key decision points in the debugging process, and makes the debugging document more focused on the key path of problem solving; the first information extracted is filled into the corresponding fields in combination with the pre-defined debugging report template, and a debugging document with unified format and complete content is generated. This template-based generation method not only improves the readability and professionalism of the document, but also facilitates the later retrieval and archival management; by uploading the debugging document to the cloud project knowledge base and generating a retrieval index containing the project name, the debugging task name and the generation time, the centralized storage and efficient retrieval of the debugging document are realized. This helps to improve the team collaboration efficiency and ensures the accumulation and reuse of debugging experience.
[0076] The embodiments of the present application also provide a debugging document generation device 500, which refers to Figure 5 , Figure 5 The structure diagram of the debugging document generation device 500 provided in the embodiments of the present application, the debugging document generation device 500 in the embodiments includes: The data collection module is configured to collect debugging data in a debugging process of the debugging task. The analysis module is configured to extract first information based on the debugging data, wherein the first information comprises one or more of the following information: a debugging target, debugging process key information, and a debugging verification result. The document generation module is configured to generate a debugging document based on the first information.
[0077] In the embodiments of the present application, the data collection module is configured to collect debugging data in a debugging process of the debugging task by using a hook function, and the debugging data comprises one or more of the following data: an operation instruction sequence, an error log, a variable change trajectory, and a breakpoint triggering record.
[0078] In the embodiments of the present application, the data collection module is configured to pre-process the debugging data, and the pre-processing comprises one or more of the following processing modes: time stamp labeling, repeated data filtering, and structured conversion.
[0079] In the embodiments of the present application, the analysis module is configured to extract the first information based on the debugging data by using a pre-trained language model, and to normalize the technical terms in the debugging data by using the pre-trained language model.
[0080] In the embodiments of the present application, the debugging process key information comprises a key step and a key parameter, and the analysis module is configured to determine a characteristic value of each data in the debugging data based on a value of a first attribute, a value of a second attribute, a first attribute weight, and a second attribute weight of each data in the debugging data, wherein the first attribute represents instruction importance, and the second attribute represents effect verification importance, and to extract the key step from the debugging data based on the characteristic value of each data in the debugging data.
[0081] In the embodiments of the present application, the document generation module is configured to generate the debugging document based on the first information and according to a debugging report template, wherein the debugging report template comprises second information, and the second information comprises one or more of the following information: a problem description, a problem occurrence time, an influence range, a problem classification, and a problem solution.
[0082] In the embodiments of the present application, the document generation module is configured to store the debugging document in a cloud project knowledge base, to generate a retrieval index of the debugging document, and to include third information in the retrieval index, wherein the third information comprises one or more of the following information: a project name to which the debugging task belongs, a name of the debugging task, and a debugging document generation time.
[0083] Those skilled in the art should understand that, Figure 5 The implementation functions of the units in the illustrated debugging document generation apparatus 500 can be understood in reference to the related descriptions of the foregoing methods. Figure 5 The functions of the units in the illustrated debugging document generation apparatus 500 can be implemented by a program running on a processor, or by a specific logic circuit.
[0084] Figure 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. Figure 6 The illustrated electronic device includes a processor 610, which can invoke and run a computer program from a memory to implement the debugging document generation method provided in the embodiments of the present application.
[0085] Optionally, as Figure 6 illustrated, the electronic device can further include a memory 620. The processor 610 can invoke and run a computer program from the memory 620 to implement the debugging document generation method provided in the embodiments of the present application.
[0086] The memory 620 can be a separate device independent of the processor 610, or can be integrated in the processor 610.
[0087] Optionally, as Figure 6 illustrated, the electronic device can further include a transceiver 630, which can be controlled by the processor 610 to generate a debugging document with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices.
[0088] The transceiver 630 can include a transmitter and a receiver. The transceiver 630 can further include an antenna, and the number of antennas can be one or more.
[0089] The electronic device can specifically be the debugging document generation apparatus 300 / debugging document generation apparatus 500 of the embodiments of the present application, and the electronic device can implement the corresponding processes in the methods of the embodiments of the present application that are implemented by the debugging document generation apparatus 300 / debugging document generation apparatus 500. For brevity, details are not repeated here.
[0090] Illustratively, the embodiments of the present application further provide a computer program product, which includes a computer program executable by the processor 610 of the electronic device to complete the steps of any of the foregoing methods.
[0091] Figure 7 is a schematic structural diagram of a chip of the embodiments of the present application. Figure 7 The illustrated chip includes a processor 710, which can invoke and run a computer program from a memory to implement the method in the embodiments of the present application.
[0092] Optionally, as shown in Figure 7 The chip can further include a memory 720. The processor 710 can call and run a computer program from the memory 720 to implement the method in the embodiments of the present application.
[0093] The memory 720 can be a separate device independent of the processor 710, or can be integrated in the processor 710.
[0094] Optionally, the chip can further include an input interface 730. The processor 710 can control the input interface 730 to generate debugging documents with other devices or chips, specifically, information or data sent by other devices or chips can be obtained.
[0095] Optionally, the chip can further include an output interface 740. The processor 710 can control the output interface 740 to generate debugging documents with other devices or chips, specifically, information or data can be output to other devices or chips.
[0096] The chip can be applied to the electronic device in the embodiments of the present application, and the chip can implement the corresponding processes realized by the electronic device in each method of the embodiments of the present application. For the sake of brevity, it will not be repeated here.
[0097] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0098] It should be understood that the processor of the embodiments of the present application can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the method embodiments described above can be completed by the integrated logic circuit of hardware in the processor or the instructions in the form of software. The processor described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a ready programmable gate array (FPGA) or other programmable logic devices, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or can be executed by a combination of hardware and software units in the code processor. The software unit can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.
[0099] It is to be understood that the memory in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synchlink DRAM (SLDRAM), and a Direct Rambus RAM (DR RAM). It should be noted that the memory of the system and method described herein is intended to include, but not be limited to, these and any other suitable types of memory.
[0100] It should be understood that the above-mentioned memory is exemplary but not limiting, for example, the memory in the embodiments of the present application can also be a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synch link DRAM (SLDRAM), and a direct memory bus random access memory (Direct Rambus RAM, DR RAM), etc. That is, the memory in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0101] The embodiments of the present application further provide a storage medium for storing a computer program. The storage medium can be applied to the electronic device in the embodiments of the present application, and the computer program causes the computer to execute the corresponding procedures implemented by the electronic device in the various methods of the embodiments of the present application. For brevity, details are not repeated here.
[0102] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0104] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0105] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0106] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0107] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or an electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0108] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.< / verification> < / steps> < / environment> < / problemdescription>
Claims
1. A method of debugging document generation, characterized by, The method comprises: collecting debugging data in a debugging process of a debugging task; extracting first information based on the debugging data; the first information comprises one or more of the following information: debugging target, debugging process key information, and debugging verification result; generating a debugging document based on the first information.
2. The method of claim 1, wherein, The method of collecting debugging data in a debugging process of a debugging task comprises: collecting debugging data in a debugging process of a debugging task by using a hook function; the debugging data comprises one or more of the following data: operation instruction sequence, error log, variable change trajectory, breakpoint trigger record.
3. The method of claim 2, wherein, Before extracting the first information based on the debugging data, the method further comprises: preprocessing the debugging data; the preprocessing comprises one or more of the following processing methods: timestamp annotation, repeated data filtering, and structured conversion.
4. The method of claim 3, wherein, The method of extracting the first information based on the debugging data comprises: extracting the first information based on the debugging data by using a pre-trained language model; the method further comprises: standardizing the description of technical terms in the debugging data by using the pre-trained language model.
5. The method of claim 4, wherein, The debugging process key information comprises key steps and key parameters; the method comprises: determining a characteristic value of each data in the debugging data based on the value of a first attribute, the value of a second attribute, the weight of the first attribute, and the weight of the second attribute of each data in the debugging data; the first attribute represents instruction importance; the second attribute represents effect verification importance; extracting the key steps from the debugging data based on the characteristic value of each data in the debugging data.
6. The method of claim 5, wherein, The method of generating a debugging document based on the first information comprises: generating the debugging document based on the first information according to a debugging report template; wherein, the debugging report template comprises second information, and the second information comprises one or more of the following information: problem description, problem occurrence time, influence range, problem classification, and problem solution.
7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: storing the debugging document in a cloud project knowledge base; and generating a retrieval index of the debugging document; the retrieval index comprises third information; the third information comprises one or more of the following information: project name to which the debugging task belongs, name of the debugging task, and debugging document generation time.
8. A debugging document generating apparatus characterized by comprising: The method comprises: a data collection module for collecting debugging data in a debugging process of a debugging task; an analysis module for extracting first information based on the debugging data; the first information comprises one or more of the following information: debugging target, debugging process key information, and debugging verification result; a document generation module for generating a debugging document based on the first information.
9. An electronic device, comprising: The method comprises: a processor and a memory for storing a computer program; the processor is configured to invoke and run the computer program stored in the memory to execute the debugging document generation method according to any one of claims 1 to 7.
10. A storage medium, characterized by A computer program is stored in the memory, and the computer program enables the computer to execute the debugging document generation method according to any one of claims 1 to 7.