Vehicle fault detection method and device

Through syntax parsing rules, the target text is converted into the syntax structure of the programming language and the object code is generated, which solves the problems of low efficiency and poor flexibility in the configuration of detection rules in the prior art, and realizes efficient fault detection that quickly responds to business needs.

CN118916193APending Publication Date: 2024-11-08ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310517458.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In the existing vehicle fault detection technology, detection rules need to be configured through hard-coded methods, resulting in frequent communication between developers and business personnel, which are inefficient and poor in flexibility, and cannot respond quickly to business needs.

Method used

The syntax parsing rules are used to convert the target text into the syntax structure of the programming language, generate target code, and perform fault detection by executing the code, allowing business personnel to configure fault detection rules to improve efficiency and flexibility.

Benefits of technology

Through the application of syntax parsing rules, the rapid configuration and efficient detection of vehicle fault detection rules are realized, which reduces the communication needs between developers and business personnel, and improves the flexibility and efficiency of fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916193A_ABST
    Figure CN118916193A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle fault detection method and device which are applied to a server side. The server maintains a grammar analysis rule for a text; wherein the grammar analysis rule is used for converting the text into a grammar structure corresponding to a code based on a preset programming language. The method comprises the steps of obtaining a target text used for describing a fault detection rule for a vehicle; based on the grammar analysis rule, carrying out grammar analysis on the target text so as to convert the target text into a grammar structure corresponding to a code based on the programming language; and according to the grammar structure, generating a target code which corresponds to the grammar structure and is based on the programming language, and storing the target code so as to perform fault detection on the vehicle by executing the target code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle fault detection method, device, electronic device, and machine-readable storage medium. Background Art

[0002] Vehicle inspection technology is a method and means of performing performance testing and fault inspection on automobiles with the help of instruments and equipment.

[0003] In current technology, developers usually write detection rules for performing vehicle detection into the code corresponding to the program for detecting vehicle faults in a hard-coded manner.

[0004] On the one hand, due to the current technology, the detection rules can only be configured by developers, and developers need to communicate repeatedly with business personnel to confirm whether the vehicle faults targeted by the detection rules are consistent, resulting in low efficiency in configuring the detection rules; on the other hand, configuring fault detection rules in a hard-coded manner has low flexibility, resulting in low efficiency in fault detection. Summary of the Invention

[0005] The present application provides a vehicle fault detection method, which is applied to a server; the server maintains grammatical parsing rules for text; wherein the grammatical parsing rules are used to convert the text into a grammatical structure corresponding to a code based on a preset programming language; the method includes:

[0006] Obtaining target text for describing a fault detection rule for a vehicle;

[0007] Based on the grammatical parsing rules, the target text is parsed to convert the target text into a grammatical structure corresponding to a code based on the programming language;

[0008] According to the grammatical structure, a target code based on the programming language corresponding to the grammatical structure is generated and the target code is stored, so that the vehicle fault detection is performed by executing the target code.

[0009] Optionally, the text includes expression text.

[0010] Optionally, the programming language is Java.

[0011] Optionally, the grammatical structure is a grammatical tree.

[0012] Optionally, the grammar parsing rule includes a lexical definition sub-rule and a grammar organization sub-rule; wherein the lexical definition sub-rule is used to decompose the text into at least one word; and the grammar organization sub-rule is used to organize the at least one word into a grammar structure corresponding to the code based on the programming language;

[0013] The step of performing grammatical parsing on the target text based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to a code based on the programming language includes:

[0014] Based on the lexical definition sub-rule, performing lexical analysis on the target text to decompose the target text into at least one word;

[0015] Based on the grammatical organization sub-rule, the at least one word obtained by the decomposition is grammatically organized to organize the at least one word into a grammatical structure corresponding to the code based on the programming language.

[0016] Optionally, performing grammatical parsing on the target text based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to a code based on the programming language includes:

[0017] Based on the grammatical parsing rules, the target text is parsed and the intermediate results generated during the grammatical parsing process are verified;

[0018] If the verification passes, the target text is further converted into a grammatical structure corresponding to a code based on the programming language;

[0019] If the verification fails, the conversion of the target text into a grammatical structure corresponding to the code based on the programming language is stopped, and a prompt message indicating that the verification fails is output.

[0020] Optionally, in any of the following three situations, it is determined that the verification fails:

[0021] The intermediate result indicates that the target text contains illegal characters;

[0022] The intermediate result indicates that the target text contains an illegal expression;

[0023] The intermediate result indicates that the syntax structure contains data with mismatched data types.

[0024] Optionally, the server maintains a correspondence between text and code based on the programming language;

[0025] The method further comprises:

[0026] The corresponding relationship is queried to determine the target code corresponding to the target text.

[0027] Optionally, the method further includes:

[0028] Obtain the vehicle condition information of the target vehicle;

[0029] Based on the target code and the vehicle condition information, a fault detection is performed on the target vehicle, and based on the fault detection result, it is determined whether the target vehicle has a fault.

[0030] Optionally, the vehicle condition information includes sensor data collected for the target vehicle;

[0031] Performing a fault detection on the target vehicle based on the target code and the vehicle condition information, and determining whether the target vehicle has a fault based on the fault detection result, including:

[0032] The sensing data is used as an input parameter of the target code, the target code is executed, and based on the execution result, it is determined whether the target vehicle has a fault.

[0033] Optionally, before performing fault detection on the target vehicle based on the target code and the vehicle condition information, and determining whether the target vehicle has a fault based on the fault detection result, the method further includes:

[0034] Dynamically compile the target code to obtain bytecode corresponding to the target code, and load the bytecode into a fault detection program for the target vehicle running on the server, so as to perform fault detection on the target vehicle by running the fault detection program loaded with the bytecode.

[0035] The present application also provides a vehicle fault detection device, which is applied to a server; the server maintains grammatical parsing rules for text; wherein the grammatical parsing rules are used to convert the text into a grammatical structure corresponding to a code based on a preset programming language; the device includes:

[0036] An acquisition unit, configured to acquire a target text for describing a fault detection rule for a vehicle;

[0037] a conversion unit, configured to perform grammatical parsing on the target text based on the grammatical parsing rules, so as to convert the target text into a grammatical structure corresponding to a code based on the programming language;

[0038] A generating unit is configured to generate, according to the grammatical structure, a target code based on the programming language corresponding to the grammatical structure, and store the target code so as to perform fault detection on the vehicle by executing the target code.

[0039] The present application also provides an electronic device, comprising a communication interface, a processor, a memory, and a bus, wherein the communication interface, the processor, and the memory are interconnected via the bus;

[0040] The memory stores machine-readable instructions, and the processor executes the vehicle fault detection method by calling the machine-readable instructions.

[0041] The present application also provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the vehicle fault detection method is implemented.

[0042] The technical solution provided by this application may at least have the following beneficial effects:

[0043] According to the above embodiment, since the server can maintain grammatical parsing rules for text, wherein the grammatical parsing rules can be used to convert text into a grammatical structure corresponding to a code based on a preset programming language, the server can obtain a target text for describing a vehicle fault detection rule, and perform grammatical parsing on the target text based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to a code based on the programming language. Based on the grammatical structure, a target code based on the programming language corresponding to the grammatical structure can be generated, and the target code can be stored so as to perform vehicle fault detection by executing the target code. Therefore, the server can convert the obtained target text for describing a vehicle fault detection rule into computer-readable code. On the one hand, it allows business personnel to configure vehicle fault rules without the need for negotiation between business personnel and developers, thereby improving the efficiency of vehicle fault rule configuration and thus improving the efficiency of fault detection. On the other hand, the code is stored so that vehicle fault detection can be performed later by loading the target code, thereby improving the flexibility of fault detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 The figure is a flow chart showing a vehicle fault detection method according to an exemplary embodiment.

[0045] Figure 2 FIG. 1 is a flow chart showing another vehicle fault detection method according to an exemplary embodiment.

[0046] Figure 3 It is a grammatical structure shown in an exemplary embodiment.

[0047] Figure 4 The figure is a hardware structure diagram of an electronic device in which a vehicle fault detection device is located, showing an exemplary embodiment.

[0048] Figure 5 It is a block diagram of a vehicle fault detection device showing an exemplary embodiment. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0050] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0051] Vehicle inspection technology is a method and means of performing performance testing and fault inspection on automobiles with the help of instruments and equipment. It can test various working performance indicators of automobiles and find faults and the causes of the faults without disassembling the automobile or assembly.

[0052] In current vehicle detection technology, developers usually write detection rules for performing vehicle detection into the code corresponding to the program for detecting vehicle faults in a hard-coded manner.

[0053] For example, when business personnel need to detect a newly discovered vehicle fault, they need to submit the detection requirements for the vehicle fault to the developer, and then the developer will configure the detection rules for the vehicle fault in a hard-coded manner. At the same time, both parties need to communicate continuously to determine the accuracy of the detection rules.

[0054] On the one hand, since the detection rules in current technology need to be configured through hard coding, they can only be configured by developers, and the developers need to communicate repeatedly with business personnel to confirm whether the vehicle faults targeted by the detection rules are consistent, resulting in low configuration efficiency of the detection rules; on the other hand, configuring fault detection rules through hard coding has low flexibility, which leads to low fault detection efficiency.

[0055] In view of this, the present application aims to propose a vehicle fault detection method. The method converts a target text into a grammatical structure based on grammatical parsing rules, and generates a target code based on a programming language according to the grammatical structure.

[0056] During implementation, the method is applied to a server, which maintains grammatical parsing rules for text; wherein the grammatical parsing rules are used to convert the text into a grammatical structure corresponding to a code based on a preset programming language; the server can obtain a target text for describing a fault detection rule for a vehicle;

[0057] Furthermore, the server may perform syntax parsing on the target text based on the syntax parsing rules to convert the target text into a syntax structure corresponding to the code based on the programming language;

[0058] Furthermore, the server may generate a target code based on the programming language corresponding to the grammatical structure according to the grammatical structure, and store the target code so as to perform fault detection on the vehicle by executing the target code.

[0059] According to the above embodiment, since the server can maintain grammatical parsing rules for text, wherein the grammatical parsing rules can be used to convert text into a grammatical structure corresponding to a code based on a preset programming language, the server can obtain a target text for describing a vehicle fault detection rule, and perform grammatical parsing on the target text based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to a code based on the programming language. Based on the grammatical structure, a target code based on the programming language corresponding to the grammatical structure can be generated, and the target code can be stored so as to perform vehicle fault detection by executing the target code. Therefore, the server can convert the obtained target text for describing a vehicle fault detection rule into computer-readable code. On the one hand, it allows business personnel to configure vehicle fault rules without the need for negotiation between business personnel and developers, thereby improving the efficiency of vehicle fault rule configuration and thus improving the efficiency of fault detection. On the other hand, the code is stored so that vehicle fault detection can be performed later by loading the target code, thereby improving the flexibility of fault detection.

[0060] The present application is described below through specific embodiments and in combination with specific application scenarios.

[0061] See Figure 1 , Figure 1 This is a flow chart of a vehicle fault detection method according to an exemplary embodiment. The server maintains grammatical parsing rules for text; wherein the grammatical parsing rules are used to convert the text into a grammatical structure corresponding to a code based on a preset programming language;

[0062] The text may include text for describing fault detection rules for the vehicle. Since the server cannot perform fault detection by executing the fault detection rules contained in the text, it is necessary to convert the text into computer executable code before fault detection can be performed by executing the code.

[0063] This specification does not limit the preset programming language. For example, the programming language may be Java, or another programming language corresponding to the grammatical structure converted from the text.

[0064] In one embodiment shown, the programming language may be Java.

[0065] For example, the grammar parsing rules may be used to convert the text into a grammatical structure corresponding to a Java-based code.

[0066] like Figure 1 As shown, based on the grammatical parsing rules for the text maintained by the server, the server can perform the following steps:

[0067] Step 102 : Obtain target text for describing a fault detection rule for a vehicle.

[0068] For example, the server may obtain text_1 for describing a fault detection rule for a vehicle.

[0069] In one illustrated embodiment, the text includes expression text.

[0070] For example, the server may obtain a target expression text for describing a fault detection rule for a vehicle.

[0071] Step 104 : performing syntax parsing on the target text based on the syntax parsing rules to convert the target text into a syntax structure corresponding to the code based on the programming language.

[0072] Since the target text needs to be converted into the computer-executable code, the target text may be first converted into a grammatical structure corresponding to the code based on the programming language, so that the code based on the programming language can be subsequently generated according to the grammatical structure.

[0073] For example, the server may perform grammatical parsing on the text_1 based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to a code based on the programming language.

[0074] In one embodiment shown, the grammatical structure is a grammatical tree.

[0075] For example, the server may perform syntax parsing on the text_1 based on the syntax parsing rules to convert the target text into a syntax tree corresponding to the code based on the programming language.

[0076] In one embodiment shown, the syntax tree is an AST (abstract syntax tree).

[0077] The AST refers to a tree representation of the abstract syntax structure of the code, and each node on the tree can represent a structure in the code.

[0078] For example, the server may perform grammatical parsing on the text_1 based on the grammatical parsing rules to convert the target text into an AST tree corresponding to the code based on the programming language.

[0079] In one embodiment shown, the grammatical parsing rule includes a lexical definition sub-rule and a grammatical organization sub-rule; wherein the lexical definition sub-rule is used to decompose the text into at least one word; the grammatical organization sub-rule is used to organize the at least one word into a grammatical structure corresponding to the code based on the programming language; the grammatical parsing of the target text based on the grammatical parsing rule to convert the target text into a grammatical structure corresponding to the code based on the programming language includes: based on the lexical definition sub-rule, performing lexical analysis on the target text to decompose the target text into at least one word; based on the grammatical organization sub-rule, performing grammatical organization on the at least one word obtained by decomposition to organize the at least one word into a grammatical structure corresponding to the code based on the programming language.

[0080] The lexical definition sub-rule can be used to decompose the target text into at least one word. Specifically, the lexical definition sub-rule can pre-define at least one legal word, and the target text can be decomposed in a top-down manner to obtain at least one word corresponding to the target text.

[0081] The grammar organization sub-rule may be used to organize the at least one disassembled word into a grammar structure corresponding to a code based on the programming language.

[0082] For example, the grammar organization sub-rule may organize the at least one word into a grammar tree corresponding to a code based on the programming language.

[0083] Lexical analysis refers to the process of converting a character sequence into a word sequence in computer science.

[0084] The grammatical organization may refer to a process of organizing the at least one word into a grammatical structure.

[0085] For example, the server can perform lexical analysis on the text_1 based on the lexical definition sub-rule to break the text_1 into at least one word; based on the grammatical organization sub-rule, the server can perform grammatical organization on the at least one word obtained by breaking it down to organize the at least one word into a grammatical structure corresponding to the code based on the programming language.

[0086] It should be noted that the grammatical structure can be a grammatical tree, and the server can traverse each tree node of the grammatical tree according to a preset traversal method to obtain the code based on the programming language corresponding to the grammatical tree. In one embodiment shown, the grammatical parsing of the target text based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to the code based on the programming language includes: based on the grammatical parsing rules, the target text is grammatically parsed, and the intermediate results generated during the grammatical parsing process are verified; if the verification passes, the target text is further converted into a grammatical structure corresponding to the code based on the programming language; if the verification fails, the conversion of the target text into a grammatical structure corresponding to the code based on the programming language is stopped, and a prompt message indicating that the verification fails is output.

[0087] In the process of grammatical parsing of the target text, an intermediate result can be generated. The server can also verify the intermediate result. If the verification passes, the target text can be further converted into a grammatical structure corresponding to the code based on the programming language. If the verification fails, the conversion of the target text into a grammatical structure corresponding to the code based on the programming language can be stopped, and a prompt message indicating that the verification failed can be output.

[0088] For example, the server can perform grammatical parsing on the text_1 based on the grammatical parsing rules, and verify the intermediate results generated during the grammatical parsing process; if the verification passes, the text_1 can continue to be converted into a grammatical structure corresponding to the code based on the programming language; if the verification fails, the conversion of the text_1 into a grammatical structure corresponding to the code based on the programming language can be stopped, and a prompt message indicating that the verification failed can be output.

[0089] In one embodiment shown, the server determines that the verification fails in any one of the following three situations: the intermediate result indicates that the target text contains illegal characters; the intermediate result indicates that the target text contains illegal expressions; the intermediate result indicates that the grammatical structure contains data that does not match the data type.

[0090] In the process of performing lexical analysis on the target text based on the lexical definition sub-rule to decompose the target text into at least one word, the intermediate result may indicate that the target text contains illegal characters, then the server may stop the decomposition process of the target text and may output a prompt message indicating that the verification fails; the target text may be an expression text, and the intermediate result may also indicate that the expression text contains an illegal expression, then the server may stop the decomposition process of the target text and may output a prompt message indicating that the verification fails.

[0091] In the process in which the server performs grammatical organization on the at least one word obtained by decomposition based on the grammatical organization sub-rule to organize the at least one word into a grammatical structure corresponding to the code based on the programming language, the grammatical structure may be a grammatical tree, and the intermediate result may indicate that the data types between the tree nodes contained in the grammatical tree do not match. In this case, the server may stop the decomposition process of the target text and may output a prompt message indicating that the verification failed.

[0092] For example, the server can perform grammatical parsing on the text_1 based on the grammatical parsing rules, and verify the intermediate results generated in the grammatical parsing process. If the intermediate result indicates that the text_1 contains illegal characters, the server can stop the disassembly process of the target text and output a prompt message indicating that the verification failed; or, if the intermediate result indicates that the text_1 contains illegal expressions, the server can stop the disassembly process of the target text and output a prompt message indicating that the verification failed; or, if the intermediate result indicates that the data types between the tree nodes in the grammatical tree corresponding to the text_1 do not match, the server can stop the disassembly process of the target text and output a prompt message indicating that the verification failed.

[0093] It should be noted that the grammatical structure may include a grammatical tree. If the intermediate result indicates that the grammatical tree contains data with mismatched data types, the data types of the tree nodes contained in the grammatical tree can be converted first to make the data types of the various tree nodes contained in the grammatical tree consistent; if the conversion fails, the disassembly process of the target text can be stopped, and a prompt message indicating that the verification failed can be output.

[0094] For example, if the intermediate result indicates that the syntax tree contains data with mismatched data types, all data types can be converted to double types. If the conversion fails, the disassembly process for the target text can be stopped, and a prompt message indicating that the verification failed can be output.

[0095] In this way, the problem that the target text cannot be used to detect vehicle faults due to different data types of the characters contained in the target text can be solved, thereby improving the efficiency of fault detection.

[0096] Step 106 : Generate a target code based on the programming language corresponding to the grammatical structure according to the grammatical structure, and store the target code so as to perform fault detection on the vehicle by executing the target code.

[0097] The object code may refer to a computer-executable code, and the vehicle fault detection can be performed by executing the code.

[0098] For example, the server may generate a target code based on the programming language corresponding to the grammatical structure according to the grammatical structure, and may store the target code so as to perform fault detection on the vehicle by executing the target code.

[0099] In one embodiment shown, the server maintains a correspondence between text and code based on the programming language; the method further includes: querying the correspondence to determine a target code corresponding to the target text.

[0100] The code based on the programming language is a code corresponding to the grammatical structure. When the grammatical structure is a grammatical tree, the grammatical tree can be traversed in a preset traversal method to obtain the code based on the programming language corresponding to the grammatical tree.

[0101] The server can maintain a correspondence between text and code based on the programming language. When the server obtains the target text, it can query the relationship to confirm whether the correspondence contains the target code corresponding to the target text. If the correspondence contains the target code corresponding to the target text, the target code can be obtained; if the correspondence does not contain the target code corresponding to the target text, the target text can be further parsed based on the grammatical parsing rules to convert the target text into a grammatical structure corresponding to the code based on the programming language.

[0102] For example, the server may query the corresponding relationship to determine the target code corresponding to the text_1.

[0103] In this way, when the corresponding relationship includes a target code corresponding to the target text, the target code can be directly obtained without converting the target text when the same target text is obtained, thereby improving the efficiency of fault detection.

[0104] In one embodiment shown, the method further includes: obtaining vehicle condition information of the target vehicle; performing fault detection on the target vehicle based on the target code and the vehicle condition information, and determining whether the target vehicle has a fault based on the fault detection result.

[0105] For example, since the target code contains fault detection rules for the vehicle, the server can obtain the vehicle condition information of the target vehicle, and can perform fault detection on the target vehicle based on the target code and the vehicle condition information, and can determine whether the target vehicle has a fault based on the fault detection result.

[0106] This specification does not limit how the server obtains the vehicle condition information of the target vehicle. For example, the vehicle may proactively send the vehicle condition information to the server within a preset period, or the server may send an acquisition request to the vehicle within a preset period to obtain the vehicle condition information from the vehicle.

[0107] In one embodiment shown, the vehicle condition information includes sensor data collected for the target vehicle; based on the target code and the vehicle condition information, a fault detection is performed on the target vehicle, and based on the fault detection result, it is determined whether the target vehicle has a fault, including: using the sensor data as an input parameter of the target code, executing the target code, and determining whether the target vehicle has a fault based on the execution result.

[0108] For example, the vehicle condition information may include sensor data collected for the target vehicle. The server may use the sensor data as input parameters of the target code, execute the target code, and determine whether the target vehicle has a fault based on the execution result.

[0109] In one embodiment shown, before performing fault detection on the target vehicle based on the target code and the vehicle condition information, and determining whether the target vehicle has a fault based on the fault detection result, the method also includes: dynamically compiling the target code to obtain a bytecode corresponding to the target code, and loading the bytecode into a fault detection program for the target vehicle running on the server, so as to perform fault detection on the target vehicle by running the fault detection program loaded with the bytecode.

[0110] The dynamic compilation may refer to compiling the functional modules required by the fault detection program into a dynamic link library. When the program is started, the functional modules are not loaded, but are called based on the dynamic link library according to user needs during runtime.

[0111] The dynamic compilation may compile the code into bytecode corresponding to the code, and the server may load the bytecode into the fault detection program.

[0112] The server may be equipped with a dynamic compiler, which may include Janino, wherein Janino is a lightweight Java compiler that can be directly called in a Java program to dynamically compile Java code and load the compiled bytecode into the Java program.

[0113] Specifically, the Janino can provide a class loader, which can be used to load the bytecode corresponding to the target code. At the same time, the system class loader can load the common code that the target code depends on through parent delegation.

[0114] For example, the server can dynamically compile the target code corresponding to the text_1 to obtain a bytecode corresponding to the target code, and load the bytecode into a fault detection program for the target vehicle running on the server. The server can perform fault detection on the target vehicle by running the fault detection program loaded with the bytecode.

[0115] By dynamically loading the target code, the fault detection rules can be dynamically configured, thereby improving the efficiency of fault detection.

[0116] In one embodiment shown, the server can maintain a correspondence between a text and a bytecode file corresponding to the text; based on the target code and the vehicle condition information, the target vehicle is detected for fault, and based on the fault detection result, it is determined whether the target vehicle has a fault, including: loading the bytecode into a fault detection program for the target vehicle running on the server, and performing fault detection on the target vehicle based on the vehicle condition information and the fault detection program.

[0117] For example, the server can load the bytecode corresponding to the text_1 into the fault detection program for the target vehicle running on the server, and can perform fault detection on the target vehicle based on the vehicle condition information of the target vehicle and the fault detection program.

[0118] In order to make those skilled in the art better understand the technical solutions in the embodiments of this specification, the following takes the text as an expression text, and the expression text is "signal+1=100000" as an example, combined with the following Figure 2 The flowchart of the vehicle fault detection method shown is used to illustrate the embodiment of this specification.

[0119] See Figure 2 , Figure 2 FIG. 1 is a flow chart showing another vehicle fault detection method according to an exemplary embodiment.

[0120] First, the server can obtain a text_1 describing a fault detection rule for a vehicle. The text_1 may be "signal+1=100000." The server can maintain a correspondence between text and code based on the programming language. The server can query the correspondence to determine whether it contains the target code corresponding to "signal+1=100000." If the correspondence does not contain the target code corresponding to "signal+1=100000," the target text can be further parsed based on the parsing rules.

[0121] The server can perform lexical analysis on the "signal+1=100000" based on the lexical definition sub-rule, and can decompose the "signal+1=100000" into five words, wherein the five words may include "signal", "+", "1", "=" and "100000". Based on the grammatical organization sub-rule, the server can perform grammatical organization on the at least one word obtained by decomposition, so as to organize the five words into the following form: Figure 3 An exemplary embodiment is shown showing a grammatical structure.

[0122] The server can also perform syntax parsing on the "signal+1=100000" based on the syntax parsing rules, and verify the intermediate results generated during the syntax parsing process; if the verification passes, the "signal+1=100000" can continue to be converted into a syntax structure corresponding to the code based on the programming language; if the verification fails, the conversion of the "signal+1=100000" into a syntax structure corresponding to the code based on the programming language can be stopped, and a prompt message indicating that the verification failed can be output.

[0123] Specifically, the server can perform syntax parsing on the "signal+1=100000" based on the syntax parsing rules, and verify the intermediate results generated in the syntax parsing process. If the intermediate result indicates that the "signal+1=100000" contains illegal characters, the server can stop the disassembly process of the target text and output a prompt message indicating that the verification failed; or, if the intermediate result indicates that the "signal+1=100000" contains an illegal expression, the server can stop the disassembly process of the target text and output a prompt message indicating that the verification failed; or, if the intermediate result indicates that the data types between the tree nodes in the syntax tree corresponding to the "signal+1=100000" do not match, the server can convert all data types into double type. If the conversion fails, the disassembly process for the target text can be stopped, and a prompt message indicating that the verification failed can be output.

[0124] The grammatical structure may be a grammatical tree. The server may traverse each tree node of the grammatical tree according to a preset traversal method, obtain a target code based on the programming language corresponding to the grammatical tree, and store the target code so as to perform fault detection on the vehicle by executing the target code.

[0125] The server can dynamically compile the target code corresponding to "signal+1=100000" to obtain a bytecode corresponding to the target code, and can load the bytecode into the fault detection program for the target vehicle running on the server.

[0126] The server may use the sensor data collected for the target vehicle as input parameters of the fault detection program, and may determine whether the target vehicle has a fault by running the fault detection program loaded with the bytecode.

[0127] Corresponding to the embodiment of the vehicle fault detection method, this specification also provides an embodiment of a vehicle fault detection device.

[0128] See Figure 4 , Figure 4This is a hardware structure diagram of an electronic device in which a vehicle fault detection device is located, which is shown as an exemplary embodiment. At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0129] See Figure 5 , Figure 5 This is a block diagram of a vehicle fault detection device according to an exemplary embodiment. The vehicle fault detection device can be applied to Figure 3 The electronic device shown in the figure is used to implement the technical solution of this specification. The device can be applied to a server; the server can maintain grammatical parsing rules for text; the grammatical parsing rules can be used to convert the text into a grammatical structure corresponding to a code based on a preset programming language; the device can include:

[0130] An acquisition unit 502 is configured to acquire a target text for describing a fault detection rule for a vehicle;

[0131] a conversion unit 504, configured to perform syntax parsing on the target text based on the syntax parsing rules, so as to convert the target text into a syntax structure corresponding to a code based on the programming language;

[0132] The generating unit 506 is configured to generate a target code based on the programming language corresponding to the grammatical structure according to the grammatical structure, and store the target code so as to perform fault detection on the vehicle by executing the target code.

[0133] In this embodiment, the text includes expression text.

[0134] In this embodiment, the programming language is Java.

[0135] In this embodiment, the grammatical structure is a grammatical tree.

[0136] In this embodiment, the grammar parsing rule includes a lexical definition sub-rule and a grammar organization sub-rule; wherein the lexical definition sub-rule is used to decompose the text into at least one word; and the grammar organization sub-rule is used to organize the at least one word into a grammar structure corresponding to the code based on the programming language;

[0137] The conversion unit 504 can be specifically used to:

[0138] Based on the lexical definition sub-rule, performing lexical analysis on the target text to decompose the target text into at least one word;

[0139] Based on the grammatical organization sub-rule, the at least one word obtained by the decomposition is grammatically organized to organize the at least one word into a grammatical structure corresponding to the code based on the programming language.

[0140] In this embodiment, the conversion unit 504 may be specifically configured to:

[0141] Based on the grammatical parsing rules, the target text is parsed and the intermediate results generated during the grammatical parsing process are verified;

[0142] If the verification passes, the target text is further converted into a grammatical structure corresponding to a code based on the programming language;

[0143] If the verification fails, the conversion of the target text into a grammatical structure corresponding to the code based on the programming language is stopped, and a prompt message indicating that the verification fails is output.

[0144] In this embodiment, in any of the following three situations, it is determined that the verification fails:

[0145] The intermediate result indicates that the target text contains illegal characters;

[0146] The intermediate result indicates that the target text contains an illegal expression;

[0147] The intermediate result indicates that the syntax structure contains data with mismatched data types.

[0148] In this embodiment, the server maintains a correspondence between text and code based on the programming language;

[0149] The apparatus may further include a query unit configured to:

[0150] The corresponding relationship is queried to determine the target code corresponding to the target text.

[0151] In this embodiment, the device may further include a detection unit configured to:

[0152] Obtain the vehicle condition information of the target vehicle;

[0153] Based on the target code and the vehicle condition information, a fault detection is performed on the target vehicle, and based on the fault detection result, it is determined whether the target vehicle has a fault.

[0154] In this embodiment, the vehicle condition information includes sensor data collected for the target vehicle;

[0155] The detection unit can be specifically used for:

[0156] The sensing data is used as an input parameter of the target code, the target code is executed, and based on the execution result, it is determined whether the target vehicle has a fault.

[0157] In this embodiment, the device may further include a loading unit, configured to:

[0158] Dynamically compile the target code to obtain bytecode corresponding to the target code, and load the bytecode into a fault detection program for the target vehicle running on the server, so as to perform fault detection on the target vehicle by running the fault detection program loaded with the bytecode.

[0159] The implementation process of the functions and effects of each unit in the device is specifically described in the implementation process of the corresponding steps in the method, which will not be repeated here.

[0160] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying any creative work.

[0161] The systems, devices, modules, or units described in the embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0162] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0163] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0164] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0165] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0166] The description herein is based on specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0167] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0168] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when..." or "in response to determining."

[0169] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.

[0170] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

Claims

1. A vehicle fault detection method, applied to a server; the server maintains a grammatical parsing rule for a text; wherein: The grammar parsing rules are used to convert the text into a grammar structure corresponding to a code based on a preset programming language; the method comprises: Obtaining a target text for describing a fault detection rule for a vehicle; Based on the grammatical parsing rules, grammatically parse the target text to convert the target text into a grammatical structure corresponding to a code based on the programming language; According to the grammatical structure, a target code based on the programming language corresponding to the grammatical structure is generated, and the target code is stored, so as to perform fault detection on the vehicle by executing the target code.

2. The method according to claim 1, wherein the text comprises expression text. The method according to claim 1 , wherein the programming language is Java. The method according to claim 1 , wherein the grammatical structure is a grammatical tree.

5. The method according to claim 1, wherein the grammar parsing rule comprises a lexical definition sub-rule and a grammar organization sub-rule; wherein, The lexical definition sub-rule is used to decompose the text into at least one word; the grammar organization sub-rule is used to organize the at least one word into a grammar structure corresponding to the code based on the programming language; The step of performing grammatical parsing on the target text based on the grammatical parsing rule to convert the target text into a grammatical structure corresponding to a code based on the programming language includes: Based on the lexical definition sub-rule, performing lexical analysis on the target text to decompose the target text into at least one word; Based on the grammatical organization sub-rule, the at least one word obtained by the decomposition is grammatically organized to organize the at least one word into a grammatical structure corresponding to the code based on the programming language.

6. The method according to claim 1, wherein the step of performing grammatical parsing on the target text based on the grammatical parsing rule to convert the target text into a grammatical structure corresponding to a code based on the programming language comprises: Based on the grammatical parsing rules, the target text is parsed and the intermediate results generated in the grammatical parsing process are verified; If the verification passes, the target text is further converted into a grammatical structure corresponding to a code based on the programming language; If the verification fails, the conversion of the target text into a grammatical structure corresponding to the code based on the programming language is stopped, and a prompt message indicating that the verification fails is output.

7. According to the method of claim 6, in any one of the following three situations, it is determined that the verification fails: The intermediate result indicates that the target text contains illegal characters; The intermediate result indicates that the target text contains an illegal expression; The intermediate result indicates that the syntax structure contains data with mismatched data types.

8. The method according to claim 1, wherein the server maintains a correspondence between the text and the code based on the programming language; The method further comprises: The corresponding relationship is queried to determine the target code corresponding to the target text.

9. The method according to claim 1 or 8, further comprising: Obtain vehicle condition information of the target vehicle; Based on the target code and the vehicle condition information, a fault detection is performed on the target vehicle, and based on the fault detection result, it is determined whether the target vehicle has a fault.

10. The method according to claim 9, wherein the vehicle condition information comprises sensor data collected for the target vehicle; Based on the target code and the vehicle condition information, a fault detection is performed on the target vehicle, and based on the fault detection result, it is determined whether the target vehicle has a fault, including: The sensing data is used as an input parameter of the target code, the target code is executed, and based on the execution result, it is determined whether the target vehicle has a fault.

11. The method according to claim 9, before performing fault detection on the target vehicle based on the target code and the vehicle condition information and determining whether the target vehicle has a fault based on the fault detection result, the method further comprises: Dynamically compile the target code to obtain a bytecode corresponding to the target code, and load the bytecode into a fault detection program for the target vehicle running on the server, so as to perform fault detection on the target vehicle by running the fault detection program loaded with the bytecode.

12. A vehicle fault detection device, applied to a server; the server maintains grammatical parsing rules for text; wherein, The grammatical parsing rules are used to convert the text into a grammatical structure corresponding to a code based on a preset programming language; the device comprises: An acquisition unit, used for acquiring a target text for describing a fault detection rule for a vehicle; A conversion unit, configured to perform syntax parsing on the target text based on the syntax parsing rules, so as to convert the target text into a syntax structure corresponding to a code based on the programming language; A generating unit is used to generate a target code based on the programming language corresponding to the grammatical structure according to the grammatical structure, and store the target code so as to perform fault detection on the vehicle by executing the target code.

13. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the vehicle fault detection method according to any one of claims 1 to 11 by calling the machine-readable instructions.

14. A machine-readable storage medium, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the vehicle fault detection method according to any one of claims 1 to 11 is implemented.