Assembly line fault positioning method and device, electronic equipment and storage medium

By constructing error matching rules and environmental variable capture ranges, the system matches pipeline test task logs in real time to obtain fault location reports, solving the problems of low fault location efficiency, missing environmental context, and poor rule adaptability in CI/CD pipeline systems, and achieving efficient fault location and cost savings.

CN121560751APending Publication Date: 2026-02-24CHINA FAW CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511733021.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In complex CI/CD pipeline systems with multiple languages ​​and environments, existing tools suffer from low efficiency in fault location, lack of environmental context, and poor rule adaptability, resulting in high fault reproduction rates and high maintenance costs.

Method used

Build error matching rules, output context line numbers and environment variable capture range, match pipeline test task logs in real time, record test instructions and timestamps, obtain fault location reports through fault knowledge repository and send them to testers.

Benefits of technology

It improves fault location efficiency, mitigates missing environmental context, enhances rule adaptability, and saves labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121560751A_ABST
    Figure CN121560751A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of assembly line fault recognition, and discloses an assembly line fault positioning method and device, electronic equipment and a storage medium. The method comprises the following steps: constructing an error matching rule, and outputting a context line number and an environment variable capture range; in response to starting of the assembly line test task, matching a test log of the assembly line test task in real time based on an error matching rule; if the matching is successful, recording a test instruction and a timestamp at the current moment, and obtaining a current environment variable according to the environment variable capture range; extracting and determining an error log according to the successfully matched rows and the number of output context rows; retrieving a fault knowledge warehouse based on the error log, the timestamp, the test instruction and the current environment variable to obtain a fault positioning report; and sending the fault positioning report to a tester in a preset communication mode, so that the tester completes positioning of the assembly line test fault according to the fault positioning report. The fault positioning efficiency is improved, and the labor cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of production line fault identification technology, and in particular to a production line fault location method, apparatus, electronic device, and storage medium. Background Technology

[0002] In complex CI / CD pipeline systems composed of multiple applications, tools such as Jenkins and GitLab CI are widely used to automate task scheduling, code building, and deployment. For example, Jenkins can extract keyword fragments from logs through the Log Parser Plugin to aid in troubleshooting; GitLab CI supports task execution in multiple environments through scripted configuration.

[0003] However, in complex scenarios involving multiple languages ​​(such as Java, C++, Python, etc.) and multiple environments (such as Linux, macOS, etc.), existing technologies have the following key drawbacks:

[0004] The fault location process is inefficient: existing tools' log parsing functions can only extract log fragments near keywords and cannot correlate them with the original execution commands that generated the logs. When a build task fails, developers need to manually compare the logs with the command records, with an average troubleshooting time exceeding 30 minutes, severely hindering iteration efficiency.

[0005] Missing environment context: Existing CI / CD tools do not capture environment variables such as compilation parameters and system configurations when recording execution commands, resulting in low fault reproducibility. This problem is more prominent in complex systems with multiple languages ​​and mixed environments.

[0006] Poor rule adaptability: Traditional log parsing tools rely on fixed rule templates and cannot dynamically adapt to the different log formats of different projects (such as the difference between the print log of Python script and the cout log format of C++). They require frequent modification of plugin code or configuration, resulting in high maintenance costs. Summary of the Invention

[0007] The purpose of this invention is to provide a method, apparatus, electronic device and storage medium for locating faults in production lines, so as to at least solve the problems of low fault location efficiency, lack of environmental context and poor rule adaptability of existing tools, thereby improving fault location efficiency, enhancing rule adaptability and saving labor costs.

[0008] To address the aforementioned technical problems, in a first aspect, the present invention provides a method for locating faults in an assembly line, comprising at least:

[0009] Build error matching rules, output context line numbers, and environment variable capture range;

[0010] In response to the initiation of a pipelined test task, the test logs of the pipelined test task are matched in real time based on the error matching rules.

[0011] If the match is successful, the test command and timestamp at the current moment are recorded, and the current environment variables are obtained according to the environment variable capture range.

[0012] The error log is extracted and determined based on the successfully matched lines and the number of output context lines.

[0013] Based on the error log, the timestamp, the test command, and the current environment variables, the fault knowledge repository is retrieved to obtain a fault location report;

[0014] The fault location report is sent to the tester via a preset communication method, so that the tester can locate the fault in the pipeline test based on the fault location report.

[0015] Optionally, if a match is successful, the current timestamp and test command are recorded, and the current environment variables are obtained according to the environment variable capture range, specifically including:

[0016] Construct a time-based environment capture script based on the aforementioned environment variable capture range;

[0017] The time environment capture script is injected into each of the test instructions. If a match is successful, the test instruction is recorded, and the timestamp and the current environment variable are obtained based on the environment capture script.

[0018] Optionally, the step of retrieving the fault knowledge repository based on the error log, the timestamp, the test command, and the current environment variables to obtain a fault location report specifically includes:

[0019] Define the test instruction as the first search term;

[0020] Obtain the semantic information of the error log and define the semantic information as the second search term;

[0021] Based on the first search term, the fault knowledge warehouse is searched to obtain the first process warehouse;

[0022] The first process warehouse is retrieved based on the second search term to obtain the second process warehouse;

[0023] The second process repository is retrieved based on the timestamp and the current environment variables to obtain the fault location report.

[0024] Optionally, after sending the fault location report to the tester via a preset communication method so that the tester can locate the fault in the pipeline test based on the fault location report, the method further includes:

[0025] If the tester modifies the fault location report, the modified fault location report will be written into the fault knowledge repository.

[0026] Optionally, the fault location report is at least a JSON file containing four-dimensional data.

[0027] Secondly, the present invention also provides a production line fault location device, comprising at least:

[0028] Build modules are used to construct error matching rules, output context line numbers, and environment variable capture ranges;

[0029] The test matching module is used to respond to the initiation of pipeline test tasks and match the test logs of the pipeline test tasks in real time based on the error matching rules.

[0030] The matching and recording module is used to record the test instructions and timestamp at the current moment when the test log of the pipeline test task is successfully matched in real time based on the error matching rules, and to record the current environment variables according to the environment variable capture range.

[0031] The matching extraction module is used to extract and determine the error log based on the successfully matched lines and the number of output context lines.

[0032] The report acquisition module is used to retrieve the fault knowledge repository based on the error log, the timestamp, the test command, and the current environment variables to obtain a fault location report;

[0033] The report sending module is used to send the fault location report to the tester through a preset communication method, so that the tester can complete the fault location of the pipeline test based on the fault location report.

[0034] Optionally, the matching record module is specifically used for:

[0035] A time-based environment capture script is constructed based on the environment variable capture range; and the time-based environment capture script is injected into each of the test instructions so that when the test log of the pipeline test task is successfully matched in real time based on the error matching rules, the test instruction is recorded, and the timestamp and the current environment variable are obtained based on the environment capture script.

[0036] Optionally, the report acquisition module is specifically used for:

[0037] The test instruction is defined as the first search term; the semantic information of the error log is obtained and the semantic information is defined as the second search term; the fault knowledge repository is searched based on the first search term to obtain the first process repository; the first process repository is searched based on the second search term to obtain the second process repository; and the second process repository is searched based on the timestamp and the current environment variable to obtain the fault location report.

[0038] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that the processor executes the program to implement the steps in the pipeline fault location method of any one of the first aspects.

[0039] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps in the pipeline fault location method of any one of the first aspects.

[0040] The technical solution provided by this invention first constructs error matching rules, output context line counts, and environment variable capture ranges; second, in response to the start of a pipelined test task, it matches the test logs of the pipelined test task in real time based on the error matching rules; third, if a match is successful, it records the test command and timestamp at the current moment and obtains the current environment variables according to the environment variable capture range; fourth, it extracts and determines the error log based on the successfully matched lines and output context line counts; then, it searches the fault knowledge repository based on the error logs, timestamps, test commands, and current environment variables to obtain a fault location report; finally, it sends the fault location report to the testers through a preset communication method so that the testers can locate the pipelined test faults based on the fault location report.

[0041] Therefore, this invention, on the one hand, records the current test command and timestamp, and obtains the current environment variable based on the environment variable capture range, enabling the association of test commands, timestamps, and current environment variables with error matching rules. This allows testers to efficiently obtain relevant information about pipeline faults, improving fault location efficiency and mitigating the problem of missing environmental context. On the other hand, this invention, by retrieving the fault knowledge repository through error logs, timestamps, test commands, and current environment variables, effectively adapts to various log formats, improving rule adaptability and saving labor costs. Attached Figure Description

[0042] Figure 1 This is a flowchart of a pipeline fault location method provided in an embodiment of the present invention;

[0043] Figure 2 This is a flowchart of another pipeline fault location method provided by an embodiment of the present invention;

[0044] Figure 3 This is a schematic diagram of the structure of a production line fault location device provided in an embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0048] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0049] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0050] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0051] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0052] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0053] Figure 1 This is a flowchart of a pipeline fault location method provided by an embodiment of the present invention. This embodiment is applicable to fault location scenarios for at least various types of pipelines. The pipeline fault location method can be, but is not limited to, executed by the pipeline fault location device in this embodiment as the execution subject, which can be implemented in software and / or hardware. Figure 1 As shown, this assembly line fault location method includes at least the following steps:

[0054] S1. Construct error matching rules, output context line numbers, and environment variable capture range.

[0055] Error matching rules can be regular expressions. The default number of output context lines is 10. The environment variable capture scope is used to retrieve necessary environment variables, such as BUILD_ID and NODE_NAME.

[0056] S2. In response to the start of a pipelined test task, the test logs of the pipelined test task are matched in real time based on error matching rules.

[0057] The pipeline test tasks can be obtained by orchestrating tasks based on Jenkins Pipeline.

[0058] S3. If the match is successful, record the test command and timestamp at the current moment, and obtain the current environment variables according to the environment variable capture range.

[0059] A successful match indicates the presence of abnormal logs in the current pipeline test task, meaning the pipeline has a fault. It's understandable that a pipeline test task consists of multiple test instructions.

[0060] S4. Extract and determine the error log based on the number of successfully matched lines and the number of output context lines.

[0061] Among them, a successfully matched line can be a log that matches the test log according to the error matching rule.

[0062] S5. Based on error logs, timestamps, test commands, and current environment variables, retrieve the fault knowledge repository to obtain a fault location report.

[0063] The knowledge repository can be a dedicated GitLab repository that supports version control and stores error matching rules and their corresponding cause analyses. In one specific implementation, optionally, the fault location report is at least a JSON file containing four-dimensional data. For example, a fault location report can look like this: {

[0064] "errorId":"e123",

[0065] "errorLine":"Exception in thread 'main'",

[0066] "context": ["Line10: ...","Line 11:..."],

[0067] "relatedCommand":"java-jar app.jar",

[0068] "env": {"JAVA_HOME": " / usr / lib / jvm / jdk11", "BUILD_ID": "456"},

[0069] "reasonAnalysis":"This error is usually caused by the following reasons:\n1. Null pointer exception...\nSee example: http: / / wiki.example.com / java_exception"}.

[0070] A knowledge repository can be structured as follows: {

[0071] "id": "java_error",

[0072] "regex": "Exception in thread .*",

[0073] "contextLines": 15,

[0074] "envVars": ["JAVA_HOME", "CLASSPATH"],

[0075] "reason": "This error is usually caused by the following reasons:\n1. Null pointer exception (the object initialization logic needs to be checked)\n2. Thread resources are not properly released (try-with-resources is recommended),\nSee the example: http: / / wiki.example.com / java_exception"}.

[0076] S6. Send the fault location report to the tester via a preset communication method so that the tester can locate the fault in the pipeline test based on the fault location report.

[0077] The default communication method can be to push a JSON file to the test management platform via HTTP API and trigger an alarm notification to remind testers to check via DingTalk / Lark.

[0078] The technical solution provided in this embodiment first constructs error matching rules, output context line counts, and environment variable capture ranges; second, in response to the start of a pipelined test task, it matches the test logs of the pipelined test task in real time based on the error matching rules; third, if a match is successful, it records the test command and timestamp at the current moment and obtains the current environment variables according to the environment variable capture range; fourth, it extracts and determines the error log based on the successfully matched lines and output context line counts; then, it searches the fault knowledge repository based on the error logs, timestamps, test commands, and current environment variables to obtain a fault location report; finally, it sends the fault location report to the testers through a preset communication method so that the testers can locate the pipelined test faults based on the fault location report.

[0079] Therefore, this embodiment, on the one hand, records the current test command and timestamp, and obtains the current environment variable based on the environment variable capture range, enabling the matching results of the error matching rules that associate the test command, timestamp, and current environment variable. This allows testers to efficiently obtain relevant information about pipeline faults, improving fault location efficiency and mitigating the problem of missing environmental context. On the other hand, this embodiment, by retrieving the fault knowledge repository through error logs, timestamps, test commands, and current environment variables, can effectively adapt to various log formats, improving rule adaptability and saving labor costs.

[0080] Based on the above embodiments or implementation methods Figure 2 This is a flowchart of another pipeline fault location method provided by an embodiment of the present invention. This embodiment is based on the above embodiment and includes additional steps. Figure 2 As shown, this assembly line fault location method includes at least the following steps:

[0081] S1. Construct error matching rules, output context line numbers, and environment variable capture range.

[0082] S2. In response to the start of a pipelined test task, the test logs of the pipelined test task are matched in real time based on error matching rules.

[0083] S31. Construct a time environment capture script based on the environment variable capture range.

[0084] The time environment capture script can be specifically represented as follows:

[0085] CMD_START=$(date +%s%3N)#Millisecond-level timestamp;

[0086] ENV_INFO=$(env | grep -E "JAVA_HOME | PATH").

[0087] S32. Inject a time environment capture script into each test command. If a match is successful, record the test command and obtain the timestamp and current environment variables based on the environment capture script.

[0088] Injecting a time environment capture script into each test instruction can be achieved by adding the script to each test instruction so that the time environment capture script is executed first when the test instruction is executed.

[0089] S4. Extract and determine the error log based on the number of successfully matched lines and the number of output context lines.

[0090] S51. Define the test instruction as the first search term.

[0091] Understandably, the amount of data in the fault knowledge warehouse is growing rapidly. The purpose of defining the test command as the first search term is to perform preliminary screening of the huge fault knowledge warehouse in order to quickly locate relevant fault analysis.

[0092] S52. Obtain the semantic information of the error log and define the semantic information as the second search term.

[0093] The semantic information can be understood as a fault summary / digest / type of the error log.

[0094] S53. Search the fault knowledge repository based on the first search term to obtain the first process repository.

[0095] The first process repository contains only fault analysis related to the current test instruction.

[0096] S54. Retrieve the first process warehouse based on the second search term to obtain the second process warehouse.

[0097] The second process repository contains only fault analyses related to the current test instruction and the current fault type.

[0098] S55. Retrieve the second process repository based on timestamps and current environment variables to obtain a fault location report.

[0099] S6. Send the fault location report to the tester via a preset communication method so that the tester can locate the fault in the pipeline test based on the fault location report.

[0100] S7. If the tester modifies the fault location report, the modified fault location report will be written into the fault knowledge repository.

[0101] In this context, testers modifying fault location reports indicate discrepancies between the received reports and the actual test scenarios, necessitating manual adjustments. Writing the revised fault location reports to a fault knowledge repository enables knowledge sharing. When the fault recurs in other projects, other testers can directly refer to this information, improving testing efficiency.

[0102] In another specific implementation scenario, the technical solution provided in this embodiment can be specifically as follows:

[0103] Test scenario: A complex system of an automotive software company contains 100+ applications, involving three languages: Java (vehicle control), C++ (autonomous driving), and Python (data analysis). The build environment includes Linux (server), macOS (iOS tools), and embedded systems (vehicle terminals). The average number of builds per day is 150+. Traditional fault location takes 30 minutes per test, and the rate of repeated troubleshooting of the same type of error reaches 60%.

[0104] 1. Tool Integration:

[0105] Deployed based on a Jenkins cluster (1 master and 8 slaves), with each slave node configured with a Java / C++ / Python environment.

[0106] • JFrog Artifactory is used for artifact storage, GitLab is used for version control, DingTalk is used for alerting, and GitLab is used as the fault knowledge repository.

[0107] 2. Implementation process:

[0108] Step 1: The administrator configures the C++ build error matching rules, output context line number, and environment variable capture range in the scheduling center:

[0109] {"id":"cpp_nullptr",

[0110] "regex":"error: nullptr' was not declared in this scope",

[0111] "contextLines":10,

[0112] "envVars":["CC","CXX"],

[0113] "reason": "This error is caused by a gcc version lower than 4.6 (nullptr is a C++11 feature). Solutions:\n1. Upgrade gcc to 4.6 or higher\n2. Replace nullptr with NULL for compatibility with older versions"}

[0114] Step 2: The developer submits C++ code, triggering a Jenkins task (i.e., the pipeline test task is started). The execution center intercepts the compilation command cmake.., records the timestamp 1719000000000 and the environment variable CC=gcc-4.4.

[0115] Step 3: Build fails (at this point, the match is successful, but a failure has occurred), the log output is error: 'nullptr' was not declared in this scope.

[0116] Step 4: The log analysis center matches the cpp_nullptr rule, extracts the 10 lines of logs before and after it, associates the command cmake .. with the environment CC=gcc-4.4, and searches the fault knowledge repository to obtain the cause analysis.

[0117] Step 5: Generate a fault location report and push it to DingTalk. Testers can click the link to view "error logs + test instructions + environment variables + cause analysis" and resolve the problem within 2 minutes by upgrading gcc.

[0118] Therefore, this embodiment, on the one hand, records the current test command and timestamp, and obtains the current environment variable based on the environment variable capture range, enabling the matching results of the error matching rules that associate the test command, timestamp, and current environment variable. This allows testers to efficiently obtain relevant information about pipeline faults, improving fault location efficiency and mitigating the problem of missing environmental context. On the other hand, this embodiment, by retrieving the fault knowledge repository through error logs, timestamps, test commands, and current environment variables, can effectively adapt to various log formats, improving rule adaptability and saving labor costs.

[0119] Figure 3This is a schematic diagram of a fault location device for a production line according to an embodiment of the present invention. This embodiment is applicable to fault location scenarios for at least various production lines, and the fault location device can be implemented in software and / or hardware. Figure 3 As shown, the assembly line fault location device includes at least:

[0120] Module 110 is used to build error matching rules, output context line numbers, and environment variable capture ranges.

[0121] The test matching module 120 is used to respond to the initiation of pipeline test tasks and match the test logs of pipeline test tasks in real time based on error matching rules.

[0122] The matching and recording module 130 is used to record the test instructions and timestamp at the current moment when the test log of the pipeline test task is successfully matched in real time based on the error matching rules, and to record the current environment variables according to the environment variable capture range.

[0123] The matching extraction module 140 is used to extract and determine the error log based on the number of successfully matched lines and the number of output context lines.

[0124] The report acquisition module 150 is used to retrieve the fault knowledge repository based on error logs, timestamps, test commands, and current environment variables to obtain fault location reports.

[0125] The report sending module 160 is used to send the fault location report to the tester through a preset communication method, so that the tester can locate the fault in the pipeline test based on the fault location report.

[0126] Optionally, the matching record module 130 is specifically used for:

[0127] A time-based environment capture script is constructed based on the scope of environment variable capture; and, the time-based environment capture script is injected into each test instruction to record the test instruction and obtain the timestamp and current environment variables based on the environment capture script when the test log of the pipeline test task is successfully matched in real time based on the error matching rules.

[0128] Optionally, the report acquisition module is specifically used for:

[0129] The test command is defined as the first search term; and the semantic information of the error log is obtained and defined as the second search term; and the fault knowledge repository is retrieved based on the first search term to obtain the first process repository; and the first process repository is retrieved based on the second search term to obtain the second process repository; and the second process repository is retrieved based on the timestamp and current environment variables to obtain the fault location report.

[0130] Optionally, it also includes:

[0131] The report writing module 170 is used to write the modified fault location report into the fault knowledge repository when the tester modifies the fault location report.

[0132] Optionally, the fault location report is at least a JSON file containing four-dimensional data.

[0133] The technical solution provided in this embodiment first constructs error matching rules, output context line counts, and environment variable capture ranges through a construction module. Further, in response to the initiation of a pipelined test task, the test matching module matches the test logs of the pipelined test task in real time based on the error matching rules. Further, when a match is successfully made in the test logs of the pipelined test task based on the error matching rules, the matching recording module records the current test command and timestamp, and records the current environment variables according to the environment variable capture range. Further, the matching extraction module extracts and determines the error logs based on the successfully matched lines and the output context line counts. Further, the report acquisition module searches the fault knowledge repository based on the error logs, timestamps, test commands, and current environment variables to obtain a fault location report. Finally, the report sending module sends the fault location report to the testers via a preset communication method, enabling the testers to locate pipelined test faults based on the fault location report.

[0134] Therefore, this embodiment, on the one hand, records the current test command and timestamp, and obtains the current environment variable based on the environment variable capture range, enabling the matching results of the error matching rules that associate the test command, timestamp, and current environment variable. This allows testers to efficiently obtain relevant information about pipeline faults, improving fault location efficiency and mitigating the problem of missing environmental context. On the other hand, this embodiment, by retrieving the fault knowledge repository through error logs, timestamps, test commands, and current environment variables, can effectively adapt to various log formats, improving rule adaptability and saving labor costs.

[0135] This embodiment provides an electronic device. Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. See also: Figure 4The electronic device 1000 includes a processor 1001 and a memory 1002. The memory 1002 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 1001, the steps in any of the above pipeline fault location methods are performed. Through the above technical solution, the processor 1001 and the memory 1002 are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanism (not shown). The memory 1002 stores a computer program that can be executed by the processor. When the electronic device 1000 is running, the processor 1001 executes the computer program to execute the pipeline fault location method in any optional implementation of the above embodiments, so as to at least achieve the following functions: constructing error matching rules, output context line number and environment variable capture range; in response to the start of the pipeline test task, matching the test log of the pipeline test task in real time based on the error matching rules; if the matching is successful, recording the test instruction and timestamp at the current moment, and obtaining the current environment variable according to the environment variable capture range; extracting and determining the error log based on the successfully matched line and the output context line number; searching the fault knowledge repository based on the error log, timestamp, test instruction and current environment variable to obtain a fault location report; sending the fault location report to the tester through a preset communication method so that the tester can complete the location of the pipeline test fault based on the fault location report.

[0136] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the pipeline fault location method provided in all embodiments of this application: constructing error matching rules, output context line numbers, and environment variable capture ranges; responding to the start of a pipeline test task, matching the test logs of the pipeline test task in real time based on the error matching rules; if a match is successful, recording the test instruction and timestamp at the current moment, and obtaining the current environment variables according to the environment variable capture range; extracting and determining the error log based on the successfully matched lines and output context line numbers; retrieving the fault knowledge repository based on the error logs, timestamps, test instructions, and current environment variables to obtain a fault location report; and sending the fault location report to testers via a preset communication method so that testers can locate pipeline test faults based on the fault location report.

[0137] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0138] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0139] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0140] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for locating faults in an assembly line, characterized in that, At least including: Build error matching rules, output context line numbers, and environment variable capture range; In response to the initiation of a pipelined test task, the test logs of the pipelined test task are matched in real time based on the error matching rules. If the match is successful, the test command and timestamp at the current moment are recorded, and the current environment variables are obtained according to the environment variable capture range. The error log is extracted and determined based on the successfully matched lines and the number of output context lines. Based on the error log, the timestamp, the test command, and the current environment variables, the fault knowledge repository is retrieved to obtain a fault location report; The fault location report is sent to the tester via a preset communication method, so that the tester can locate the fault in the pipeline test based on the fault location report.

2. The assembly line fault location method according to claim 1, characterized in that, If a match is successful, the current timestamp and test command are recorded, and the current environment variables are obtained according to the environment variable capture range, specifically including: Construct a time-based environment capture script based on the aforementioned environment variable capture range; The time environment capture script is injected into each of the test instructions. If a match is successful, the test instruction is recorded, and the timestamp and the current environment variable are obtained based on the environment capture script.

3. The assembly line fault location method according to claim 1, characterized in that, The step of retrieving a fault location report from the fault knowledge repository based on the error log, the timestamp, the test command, and the current environment variables specifically includes: Define the test instruction as the first search term; Obtain the semantic information of the error log and define the semantic information as the second search term; Based on the first search term, the fault knowledge warehouse is searched to obtain the first process warehouse; The first process warehouse is retrieved based on the second search term to obtain the second process warehouse; The second process repository is retrieved based on the timestamp and the current environment variables to obtain the fault location report.

4. The assembly line fault location method according to claim 1, characterized in that, After the fault location report is sent to the tester via a preset communication method, so that the tester can locate the fault in the pipeline test based on the fault location report, the method further includes: If the tester modifies the fault location report, the modified fault location report will be written into the fault knowledge repository.

5. The assembly line fault location method according to claim 1, characterized in that, The fault location report is at least a JSON file containing four-dimensional data.

6. A fault location device for an assembly line, characterized in that, At least including: Build modules are used to construct error matching rules, output context line numbers, and environment variable capture ranges; The test matching module is used to respond to the initiation of pipeline test tasks and match the test logs of the pipeline test tasks in real time based on the error matching rules. The matching and recording module is used to record the test instructions and timestamp at the current moment when the test log of the pipeline test task is successfully matched in real time based on the error matching rules, and to record the current environment variables according to the environment variable capture range. The matching extraction module is used to extract and determine the error log based on the successfully matched lines and the number of output context lines. The report acquisition module is used to retrieve the fault knowledge repository based on the error log, the timestamp, the test command, and the current environment variables to obtain a fault location report; The report sending module is used to send the fault location report to the tester through a preset communication method, so that the tester can complete the fault location of the pipeline test based on the fault location report.

7. The assembly line fault location device according to claim 6, characterized in that, The matching record module is specifically used for: A time-based environment capture script is constructed based on the environment variable capture range; and the time-based environment capture script is injected into each of the test instructions so that when the test log of the pipeline test task is successfully matched in real time based on the error matching rules, the test instruction is recorded, and the timestamp and the current environment variable are obtained based on the environment capture script.

8. The assembly line fault location device according to claim 6, characterized in that, The report acquisition module is specifically used for: Define the test instruction as the first search term; and obtain the semantic information of the error log and define the semantic information as the second search term; Furthermore, the fault knowledge repository is retrieved based on the first search term to obtain the first process repository; as well as The first process warehouse is retrieved based on the second search term to obtain the second process warehouse; Additionally, the second process repository is retrieved based on the timestamp and the current environment variables to obtain the fault location report.

9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the pipeline fault location method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps in the pipeline fault location method according to any one of claims 1 to 5.