Diagnosis method and device based on macro definition, equipment and storage medium
By adopting a macro-defined data interaction method between the vehicle diagnostic equipment and the ECU, the complex interaction process between the diagnostic equipment and the ECU is solved, and a more efficient diagnostic process is achieved, which improves the efficiency and speed of the diagnostic equipment.
Patent Information
- Application Number
- CN202510633530.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-16
AI Technical Summary
The interactive process between existing vehicle diagnostic equipment and ECU is complicated, resulting in inefficient diagnosis.
The data interaction is performed using macro definition. The diagnostic device sends a target macro identifier and a preset macro list of ECU. The ECU calculates and returns data based on the macro definition.
It reduces the number of interactions between the diagnostic equipment and the ECU, improves diagnostic efficiency, reduces the computing burden of the diagnostic equipment, and improves the diagnosis speed.
Smart Images

Figure CN120540262A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle diagnosis, and in particular to a diagnostic method, apparatus, device and storage medium based on macro definition. Background Art
[0002] The data in a vehicle's electronic control unit (ECU) primarily comes from various sensors, which collect various parameters during vehicle operation, such as throttle opening, crankshaft speed, oxygen content, and water temperature. These sensors transmit this information to the ECU in the form of electrical signals. The ECU's internal analog-to-digital converter (AD converter) then converts these electrical signals into digital signals for subsequent processing and calculations.
[0003] Currently, basic data obtained from vehicle ECUs is independent of each other. Some complex data values require a hybrid calculation involving multiple pieces of basic data. This requires diagnostic equipment to request basic data from the ECU multiple times, and then calculate the final value using a formula. This operation mode results in a complex and multi-step diagnostic interaction process between the diagnostic equipment and the ECU, which is not only time-consuming but also significantly reduces diagnostic efficiency. Therefore, improving the diagnostic efficiency of diagnostic equipment has become an urgent issue. Summary of the Invention
[0004] The embodiments of the present application provide a diagnostic method, apparatus, device, and storage medium based on macro definitions. By using macro definitions to interact with data between the diagnostic device and the vehicle ECU, that is, the diagnostic device sends a data request to the ECU, and the ECU calculates and returns data according to the macro definitions, the interaction process between the diagnostic device and the ECU is reduced, thereby improving diagnostic efficiency.
[0005] In a first aspect, an embodiment of the present application provides a macro-definition-based diagnostic method, which is applied to an on-board device, wherein the on-board device is applied to a target vehicle, wherein the target vehicle includes n ECUs, where n is a positive integer; the method comprises:
[0006] receiving a first data request sent by a diagnostic device; the first data request including: a target macro identifier and a target ECU; the target ECU being any one of the n ECUs; the target ECU including a preset macro list; the macro list including a plurality of macros; each macro representing a combination of a plurality of basic data of the target vehicle for diagnosis; each macro corresponding to a macro identifier;
[0007] determining a target macro from the macro list according to the target macro identifier;
[0008] determining target data according to the target macro;
[0009] The target data is sent to the diagnostic device, so that the diagnostic device diagnoses the target vehicle according to the target data.
[0010] In a second aspect, an embodiment of the present application provides a macro-definition-based diagnostic device, which is applied to an on-board device. The on-board device is applied to a target vehicle, and the target vehicle includes n ECUs, where n is a positive integer. The macro-definition-based diagnostic device includes:
[0011] a data request receiving module, configured to receive a first data request sent by a diagnostic device; the first data request including: a target macro identifier and a target ECU; the target ECU being any one of the n ECUs; the target ECU including a preset macro list; the macro list including a plurality of macros; each macro representing a combination of multiple basic data items of the target vehicle for diagnosis; each macro corresponding to a macro identifier;
[0012] a macro determining module, configured to determine a target macro from the macro list according to the target macro identifier;
[0013] A macro processing module, configured to determine target data according to the target macro;
[0014] The data return module is used to send the target data to the diagnostic device so that the diagnostic device can diagnose the target vehicle according to the target data.
[0015] In the third aspect, an embodiment of the present application provides a vehicle-mounted device, comprising: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application.
[0017] In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
[0018] It can be seen that the embodiments of the present application have the following beneficial effects:
[0019] By implementing an embodiment of the present application, a first data request is received from a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU includes a preset macro list; a target macro is determined from the macro list based on the target macro identifier; target data is determined based on the target macro; and the target data is sent to the diagnostic device, so that the diagnostic device can diagnose the target vehicle based on the target data. As can be seen, making data requests through macro definitions can reduce the number of interactions between the diagnostic device and the ECU. The ECU directly calculates the final data based on the macro definition, reducing the computational burden on the diagnostic device, accelerating diagnostic speed, and improving diagnostic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0021] Figure 1 This is a flow chart of a macro-defined diagnostic method provided in an embodiment of the present application;
[0022] Figure 2 This is a system diagram of a macro list management system provided by an embodiment of the present application;
[0023] Figure 3 This is a connection architecture diagram of a target vehicle and a diagnostic device provided in an embodiment of the present application;
[0024] Figure 4 This is a schematic diagram of a calculation of a macro of a macro reference type provided in an embodiment of the present application;
[0025] Figure 5 This is a timing diagram of a macro-defined diagnostic method provided in an embodiment of the present application;
[0026] Figure 6 This is a schematic diagram of the structure of a macro-definition-based diagnostic system provided in an embodiment of the present application;
[0027] Figure 7 This is a schematic structural diagram of a macro-definition-based diagnostic device provided in an embodiment of the present application;
[0028] Figure 8 It is a structural diagram of a vehicle-mounted device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0031] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0032] The following describes the relevant contents, concepts, meanings, technical issues, technical solutions, beneficial effects, etc. involved in the embodiments of this application.
[0033] See Figure 1 , Figure 1 : This is a flow chart of a macro-definition-based diagnostic method provided in an embodiment of the present application. The method is applied to an on-board device, which is applied to a target vehicle. The target vehicle includes n ECUs, where n is a positive integer. The method includes but is not limited to the following steps:
[0034] S101. Receive a first data request sent by a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU includes a preset macro list.
[0035] The target ECU is any one of n ECUs. The target vehicle includes n ECUs, each responsible for data processing and storage for a specific function. For example, there is an engine control unit (ECU) that controls engine performance, a transmission control unit (TCU) that controls the transmission system, and a brake control unit (BCU) that controls the braking system. When diagnosing a vehicle, different faults or detection requirements may involve data from different ECUs. For example, when diagnosing engine performance, the engine ECU can be designated as the target ECU, while when troubleshooting issues with the vehicle's electrical system, the body ECU can be designated as the target ECU.
[0036] The target ECU has a pre-stored macro list containing multiple macros. Each macro represents a combination of multiple pieces of basic data needed for diagnostic purposes. This data can be information collected by various sensors during the vehicle's operation. To ensure quick and accurate location and call of each macro in the macro list, each macro is assigned a unique macro identifier. The macro list in the target ECU allows for operations such as adding, updating, and deleting macros.
[0037] See Figure 2 , Figure 2 This is a system diagram of a macro list management system provided in an embodiment of the present application. The embodiment of the present application involves the management operation of the macro list in the target ECU to provide a flexible and efficient macro management method to adapt to the complex data processing needs of the vehicle.
[0038] The target ECU in the vehicle has a pre-set macro list. As shown in the figure, this list contains multiple macros, labeled MACR001, MACR002, MACR003, ..., and MACROON. Each macro corresponds to specific data processing logic and functionality. These macros are the basic units for processing and analyzing vehicle-related data. For example, some macros may be used to calculate engine operating parameters, while others may be used to process data fed back by vehicle sensors.
[0039] When a vehicle system has new diagnostic or control requirements, a new macro needs to be added to the macro list. The specific operation process is as follows: First, the diagnostic equipment writes the definition of the new macro according to the new requirements, including the macro identification, data source (such as data from a specific sensor or other ECU), data processing formula, etc. Then, the instructions and related definition information of the new macro are sent to the target ECU through the vehicle's internal communication network (such as the CAN bus). After receiving the instructions, the target ECU adds the new macro to the macro list and allocates the corresponding storage location and system resources to it. For example, if the vehicle has added an exhaust emission monitoring function, a new macro can be written to process the data from the exhaust gas sensor and added to the macro list.
[0040] As vehicle operating conditions change or diagnostic algorithms are optimized, existing macros may need to be updated. In this case, the diagnostic equipment modifies the macro definition based on the optimization requirements, such as adjusting the data processing formula or changing the data source. Once the modification is complete, the update instruction and the modified macro definition are sent to the target ECU. The target ECU finds the corresponding macro in the macro list and overwrites the existing definition with the new one, completing the macro update. For example, to more accurately calculate engine fuel consumption, the calculation logic of the relevant macro is adjusted and updated.
[0041] When a macro is no longer applicable to a vehicle system or is no longer needed due to a system upgrade, for example, it can be deleted. The diagnostic device sends a macro deletion command to the target ECU, along with the identifier of the macro to be deleted. Upon receiving the command, the target ECU locates the corresponding macro in its macro list, removes it from the list, and releases the system resources occupied by the macro. For example, if the target vehicle has discarded old fault diagnostic logic, the corresponding macro can be deleted.
[0042] See Figure 3 , Figure 3 This is a diagram of the connection architecture between a target vehicle and diagnostic equipment, provided in an embodiment of the present application. In this embodiment, the target vehicle includes n ECUs, where n is a positive integer. These n ECUs are labeled ECU_1, ECU_2, ECU_3, ..., ECU_N. These ECUs are distributed across different systems in the vehicle, each responsible for collecting and processing data from its corresponding system. For example, ECU_1 might be responsible for data collection and control of the engine system, while ECU_2 might be responsible for data processing of the vehicle's braking system. The onboard device is installed within the target vehicle and establishes a communication connection with the n ECUs within the vehicle. The onboard device collects data from each ECU and performs preliminary organization and processing of this data. It serves as a bridge between the vehicle's internal ECUs and the external diagnostic equipment, performing data transfer and preprocessing. The diagnostic equipment communicates with the onboard device and obtains data from each ECU within the target vehicle through the onboard device. The diagnostic equipment possesses powerful data analysis and diagnostic capabilities, enabling it to assess the target vehicle's operating status and diagnose any faults or abnormalities based on the received data.
[0043] In an embodiment of the present application, the vehicle-mounted device can be communicatively connected to the diagnostic device. For example, a communication link between the two can be established through CAN bus technology, Flex Ray bus technology or other applicable communication technologies, so that accurate and efficient data transmission can be achieved between the vehicle-mounted device and the diagnostic device.
[0044] In a specific embodiment, the diagnostic device, as the data request initiator, can issue a data request to the onboard device based on diagnostic requirements, and the onboard device is responsible for receiving the data request information. Specifically, the onboard device can receive a first data request sent by the diagnostic device, where the first data request includes a target macro identifier and a target ECU. The target ECU includes a preset macro list, which includes multiple macros, each of which corresponds to a unique macro identifier. The target macro identifier can be used to search for the corresponding macro from the preset macro list in the target ECU.
[0045] The macro list includes multiple macros, each of which is a combination definition of multiple basic data. This means that the diagnostic device does not need to directly process a large amount of scattered basic data. Instead, through the abstraction and integration of macros, the diagnostic device can directly obtain the combined or calculated diagnostic data, which greatly simplifies the data processing process, reduces the computing burden of the diagnostic device, and improves diagnostic efficiency.
[0046] Optionally, before receiving the first data request sent by the diagnostic device, the following steps may be further included:
[0047] A101. Receive a macro addition request sent by the diagnostic device; the macro addition request includes: a first ECU and first macro definition information; the first ECU is one of the n ECUs; the first macro definition information includes: a first macro identifier, m data tags, and a data logical relationship; m is a positive integer;
[0048] A102. Determine an initial macro list in the first ECU;
[0049] A103. Determine a first macro according to the first macro definition information;
[0050] A104. Store the first macro in the initial macro list in the first ECU.
[0051] In a specific embodiment, the diagnostic device can define macros based on diagnostic requirements by generating a macro addition request and sending it to the onboard device. Upon receiving the macro addition request from the diagnostic device, the onboard device can parse and process it to add the macro. Specifically, the onboard device receives the macro addition request from the diagnostic device. The macro addition request includes: a first ECU and first macro definition information. The first ECU is one of n ECUs. The first macro definition information includes: a first macro identifier, m data tags, and data logical relationships, where m is a positive integer.
[0052] In a macro addition request, the first ECU refers to the specific electronic control unit (ECU) where the new macro definition will be stored. This ECU can be any of the n ECUs. In the first macro definition information, the first macro identifier uniquely identifies the new macro definition, while the m data tags correspond to basic vehicle operation data, which can come from various sensors or other data collection points. The data logic relationship indicates how the data corresponding to these m data tags is processed, such as performing operations such as addition, subtraction, multiplication, and division, or performing data filtering and sorting operations, to generate macro data that meets specific diagnostic requirements.
[0053] In one possible embodiment, the macro might be #MACRO01(DID0101, DID0102, DID0103), where the # sign indicates the macro definition, MACR001 indicates the macro identifier, and the parentheses () indicate the combined data. DID0101, DID0102, and DID0103 are all data labels. DID0101, DID0102, and DID0103 indicate sequentially combining the three data items with DID data item IDs 0101, 0102, and 0103. Different ECUs have different DID definitions. For example, DID0101 might represent speed, DID0102 might represent temperature, and DID0103 might represent voltage.
[0054] In one possible embodiment, the macro may be #MACRO02(DID0101*256+DID0102), where the # sign indicates a macro definition, MACRO02 indicates a macro identifier, and () indicates a calculation method for a complex data value. DID0101*256+DID0102 means first multiplying the data item value with the DID data item ID of 0101 by 256, and then adding the data item value with the data item ID of 0102 to obtain the final result data value.
[0055] In one possible embodiment, the macro may be #MACRO03(MACRO01, MACRO02), which is defined as a formula. Other macros can be referenced in the formula, where the # sign represents the macro definition, MACRO03 represents the macro identifier, () is the formula, and MACRO1 and MACRO2 represent combining the results of the two macros named MACRO01 and MACRO02.
[0056] Next, the initial macro list in the first ECU is determined. If this is the first time the first ECU receives a macro addition request and the initial macro list has not yet been created, the onboard device can create a new initial macro list for the first ECU to store the new macro. If the initial macro list already exists, it can be directly obtained to store the new macro.
[0057] The on-board device can construct a new macro based on the first macro definition information. The first macro identifier can be used to assign a unique identification code to the newly created macro. Based on the m data tags and the corresponding relationship between the data tags and the basic data, the corresponding basic data can be obtained. This basic data is collected in real time or pre-stored during vehicle operation and represents the operating status information of various vehicle components. For example, if the first ECU is an engine control unit, the "Engine_RPM" data tag can be specified among the m data tags to collect engine speed data. After the engine control unit recognizes this data tag, it can collect the corresponding engine speed data. Next, the m acquired basic data can be processed accordingly based on the data logical relationships. For example, these basic data can be combined, calculated, or otherwise processed according to the operation rules or data processing methods specified by the data logical relationships, ultimately forming a new macro that meets the definition, namely the first macro.
[0058] After successfully creating the first macro, the onboard device stores it in the initial macro list of the first ECU. The onboard device may associate the first macro with the first macro identifier and store them in the initial macro list.
[0059] It can be seen that the on-board equipment allows the diagnostic equipment to send macro addition requests, so that the on-board equipment can customize the macro according to the characteristics of different vehicles, different diagnostic scenarios and changing diagnostic needs. It combines and calculates multiple related basic data according to specific logical relationships to obtain data that can more accurately reflect the vehicle's operating status. For example, when diagnosing engine failure, multiple data such as fuel pressure, intake volume, engine speed, etc. can be combined into a new macro according to specific logical relationships, so as to more accurately judge the engine's working condition and improve the accuracy and pertinence of the diagnosis.
[0060] Optionally, the above step of storing the first macro in the initial macro list in the first ECU may specifically include the following steps:
[0061] B101, determining the macro identifier corresponding to each macro in the initial macro list to obtain a macro identifier list;
[0062] B102. Determine whether the first macro identifier exists in the macro identifier list;
[0063] B103. If so, generate a first error message and return it to the diagnostic device; the first error message is used to instruct the user to modify the first macro identifier in the first macro definition information;
[0064] B104. If not, update the initial macro list according to the first macro.
[0065] In a specific embodiment, a macro identifier list is obtained by traversing each macro in the initial macro list and determining the macro identifier corresponding to each macro in the initial macro list. After obtaining the macro identifier list, the onboard device compares the first macro identifier with each macro identifier in the macro identifier list to determine whether the first macro identifier already exists in the initial macro list. If a duplicate exists, the macro identifier has already been used and cannot be used for a new macro definition. If a duplicate exists, the storage operation can continue.
[0066] If the macro does exist, a first error message is generated and returned to the diagnostic device. The first error message is used to instruct the user to modify the first macro identifier in the first macro definition information, so that the user can reset a unique macro identifier to ensure that the new macro can be correctly stored in the initial macro list. If the macro does not exist, the initial macro list is updated according to the first macro, and the first macro is added to the initial macro list.
[0067] By checking the uniqueness of the macro identifier before storing the first macro, data confusion and errors caused by duplicate macro identifiers can be avoided. Ensuring the uniqueness of macro identifiers ensures that each macro in the ECU is clearly identified, thereby improving data accuracy and consistency.
[0068] S102: Determine a target macro from the macro list according to the target macro identifier.
[0069] In a specific embodiment, after the on-board device receives the first data request sent by the diagnostic device, the target macro can be determined from the macro list in the target ECU according to the target macro identifier in the first data request.
[0070] By quickly locating the target macro based on the target macro identifier and obtaining the corresponding data through the target macro, data screening and processing time can be reduced. Traditionally, diagnostic equipment may need to request different basic data multiple times. This approach requires self-combining and processing the data after multiple acquisitions, which is inefficient. With the macro approach, the on-board equipment can directly perform subsequent data processing and generation based on the target macro, reducing the data exchange and processing steps, significantly improving diagnostic efficiency, saving diagnostic time, and enhancing the performance of the entire on-board diagnostic system.
[0071] S103: Determine target data according to the target macro.
[0072] In this embodiment, a target macro is a predefined data combination defined by m data tags and the logical relationships between these tags. These data tags correspond to the basic data generated during the operation of the target vehicle. This basic data can come from sensors in various parts of the vehicle, such as engine speed sensors, temperature sensors, and pressure sensors, or it can be data stored and processed by other ECUs. The logical relationships specify how to combine, calculate, or filter the data corresponding to these data tags.
[0073] In a specific embodiment, the on-board device obtains the corresponding basic data in the data storage area managed by the target ECU or the related sensor data acquisition channel according to the data tag in the target macro. Then, the on-board device processes the obtained basic data accordingly according to the logical relationship of the data in the target macro, and obtains the target data that meets the definition of the target macro.
[0074] Target macros combine and define basic data based on specific diagnostic requirements. By determining target data according to target macros, scattered basic data can be integrated into more targeted and representative diagnostic data, thereby improving the accuracy of vehicle fault diagnosis. At the same time, by determining target data through target macros, these complex operations are encapsulated in the definition of target macros, which greatly simplifies the diagnostic process and improves diagnostic efficiency.
[0075] Optionally, the above step of determining the target data according to the target macro may specifically include the following steps:
[0076] A301. Determine the macro type corresponding to the target macro to obtain the target macro type; the target macro type includes one of the following: data combination type, data calculation type, and macro reference type;
[0077] A302, determining m target data labels and target data logical relationships in the target macro;
[0078] A303 . Determine the target data according to the target macro type, the m target data labels, and the target data logical relationship.
[0079] In a specific embodiment, the macro type corresponding to the target macro may be determined to obtain the target macro type, wherein the target macro type includes one of the following: data combination type, data calculation type, and macro reference type.
[0080] The data combination type macro mainly combines the data corresponding to multiple different data tags. It does not involve complex calculations. For example, it combines the data corresponding to data tags such as engine speed, coolant temperature, and oil pressure.
[0081] Data calculation macros perform operations on the data corresponding to the data tag according to a specific calculation formula. For example, they calculate the air-fuel ratio based on the engine's intake volume and injection time.
[0082] Macros of the macro reference type can reference other defined macros and form new data by calling the calculation results of other macros or combining data.
[0083] After determining the macro type corresponding to the target macro, the m target data tags and the target data logical relationship in the target macro can be determined, and the target data can be determined based on the target macro type, the m target data tags and the target data logical relationship, that is, based on different macro types, the data corresponding to the m target data tags are processed according to the target data logical relationship to finally obtain the target data.
[0084] By categorizing target macros, the data combination type can be used to quickly retrieve sets of multiple related data, the data calculation type can perform complex data analysis, and the macro reference type can reuse existing macro definitions to avoid duplication of work. This flexibility enables diagnostic equipment to handle a variety of complex diagnostic scenarios and meet the diagnostic needs of different vehicle models and fault types.
[0085] Optionally, the above step of determining the target data according to the target macro type, the m target data tags and the target data logical relationship may specifically include the following steps:
[0086] B301. When the target macro type is the data combination type, determine a first data combination order according to the target data logical relationship;
[0087] B302. Collect corresponding data according to the m target data tags to obtain m first data;
[0088] B303, combining the m first data in the first data combination order to obtain the target data;
[0089] B304. When the target macro type is the data calculation type, determine a first calculation formula according to the target data logical relationship;
[0090] B305. Collect corresponding data according to the m target data tags to obtain m second data;
[0091] B306. Determine the target data according to the first calculation formula and the m second data;
[0092] B307. When the target macro type is the macro reference type, determine p macro identifiers according to the m target data tags; p is a positive integer less than or equal to m;
[0093] B308. Determine p third data according to the p macro identifiers; each macro identifier corresponds to one third data;
[0094] B309. Determine the target data according to the target data logical relationship, mp target data labels and the p third data.
[0095] In a specific embodiment, when the target macro type is a data combination type, the target data logical relationship specifies the data combination method, including the combination order. By parsing the target data logical relationship, the first data combination order corresponding to the target data logical relationship can be obtained, wherein the first data combination order is pre-set according to the diagnostic requirements, for example, sorting according to the importance of the data to the diagnostic results, or sorting according to the relevance of the data in the vehicle system.
[0096] According to the m target data tags, corresponding data can be collected to obtain m first data. After obtaining the m first data, the m first data can be combined in the first data combination order to construct an array or structure to obtain the target data.
[0097] When the target macro type is a data calculation type, the first calculation formula can be determined according to the logical relationship of the target data. At the same time, the corresponding data can be collected according to the m target data tags to obtain m second data. The m second data can be substituted into the first calculation formula for operation to determine the target data.
[0098] When the target macro type is a macro reference type, the macro reference part involved is identified according to the m target data tags, and p macro identifiers are determined. The macro identifiers correspond to other defined macros. The calculation results or combined data of the corresponding macros can be obtained through these macro identifiers, where p is a positive integer less than or equal to m. Therefore, p third data can be determined according to the p macro identifiers, and each macro identifier corresponds to one third data.
[0099] See Figure 4 , Figure 4 This is a schematic diagram of a macro calculation using a macro reference type provided by an embodiment of the present application. As shown in the figure, it includes ECU_1 and ECU_2. Each ECU stores a different macro: ECU_1 contains MACRO01 and MACRO03, while ECU_2 contains MACRO02 and MACRO04. These macros each have specific data processing logic.
[0100] Taking MACRO03 as an example, it is a macro reference type that references the data of MACRO01 and MACRO02, expressed as #MACRO03(MACRO01,MACRO02). When calculating the value of MACRO03, the data of MACRO01 and MACRO02 must first be obtained. ECU_1 retrieves the data of MACRO01 from its own storage and simultaneously requests the data of MACRO02 from ECU_2 through the vehicle's internal communication network. After obtaining the data of MACRO01 and MACRO02, ECU_1 integrates and calculates the data of these two macros according to the data logic relationship predefined by MACRO03, thereby obtaining the final result of MACRO03. For example, if the logic of MACRO03 is to add the data of MACRO01 and MACRO02, ECU_1 will perform the addition operation to obtain the result.
[0101] The target data is determined according to the target data logical relationship, mp target data tags and p third data. The corresponding data can be determined through the mp target data tags, and the p third data determined based on the macro identifier are combined or operated according to the target data logical relationship to finally obtain the target data.
[0102] By developing different processing flows for different target macro types, diverse diagnostic needs can be met. The data combination type is suitable for scenarios where multiple related data sets need to be quickly acquired. The data calculation type can be used for in-depth analysis of the quantitative relationship between data. The macro reference type facilitates the reuse of existing macro definitions, avoiding duplication of work. This allows the diagnostic system to flexibly respond to various vehicle fault diagnosis tasks and improve diagnostic efficiency and accuracy.
[0103] In a possible embodiment, when the target macro type is a data combination type, the target macro is used to obtain a set of basic engine-related operating data, including engine speed, coolant temperature, and oil pressure. The first data combination order set by the target data logical relationship is "engine speed, coolant temperature, oil pressure". When the engine speed collected from the engine speed sensor is 2000 rpm, the coolant temperature collected from the coolant temperature sensor is 90°C, and the oil pressure collected from the oil pressure sensor is 300 kPa, these three first data are combined into a data group according to the first data combination order to obtain the target data.
[0104] In one possible embodiment, assuming that comprehensive performance evaluation data of a vehicle engine is to be obtained, engine-related data and transmission-related data are required for evaluation. Therefore, a target macro is defined in the engine ECU. The macro type of the target macro is a macro reference type. The target macro includes two data tags, which correspond to two macro identifiers. For example, the macro identifier corresponding to macro A is MACRO01, and the macro identifier corresponding to macro B is MACRO02. Macro A is defined in the engine ECU. The instantaneous power of the engine can be calculated based on the data of the engine speed sensor and the torque sensor. Macro B is defined in the transmission ECU. The transmission ratio information is obtained by reading the data of the internal sensors of the transmission. The target macro determines the target data through the logical relationship of the target data: engine performance evaluation = engine instantaneous power × current transmission ratio, and the data corresponding to macro A and macro B.
[0105] Optionally, the above step of determining the p third data according to the p macro identifiers may specifically include the following steps:
[0106] C301. Determine p macros according to the p macro identifiers;
[0107] C302. Determine the ECUs corresponding to the p macros to obtain p ECUs;
[0108] C303. Determine ECUs other than the target ECU among the p ECUs to obtain w ECUs; w is a natural number less than or equal to p; and each ECU corresponds to at least one macro;
[0109] C304. Determine macros corresponding to the w ECUs from the p macros to obtain h macros; where h is an integer greater than or equal to w and less than or equal to p;
[0110] C305. Determine h third data according to the h macros and the w ECUs;
[0111] C306. Determine ph third data according to the ph macros and the target ECU;
[0112] C307. Determine the p third data according to the h third data and the ph third data.
[0113] In a specific embodiment, p macros can be determined based on p macro identifiers. For example, the macro corresponding to the macro identifier can be searched from a macro list of all ECUs to obtain the p macros. Alternatively, a mapping relationship between all macro identifiers and macros is pre-stored in the vehicle-mounted device, and the macro corresponding to the macro identifier can be searched based on this mapping relationship. Each macro is associated with a specific ECU when defined. Therefore, the p determined macros are analyzed, and the ECU corresponding to each macro is found based on the association relationship between macros and ECUs, thereby obtaining the p ECUs.
[0114] Determine the p ECUs excluding the target ECU, resulting in w ECUs, where w is a natural number less than or equal to p. Each ECU corresponds to at least one macro. When w is 0, the p macros may all come from the target ECU. When w is greater than 0 and less than or equal to p, some of the p macros may come from other ECUs.
[0115] Based on the w ECUs determined previously, the system screens the p macros. Since each ECU may correspond to one or more macros, the macros corresponding to these w ECUs are found from the p macros to obtain h macros, where h is an integer greater than or equal to w and less than or equal to p.
[0116] For these h macros, data processing can be performed according to the definition of each macro and its corresponding ECU. According to the data tags in the macro definition, corresponding data can be collected from the corresponding w ECUs. After each macro is processed, h third data can be obtained.
[0117] Among the p macros, except for h macros from other ECUs, the remaining ph macros are related to the target ECU. Therefore, corresponding data can be collected from the target ECU to obtain ph third data.
[0118] The p third data are determined based on the h third data and the ph third data, that is, the h third data and the ph third data are integrated, which can be a set merger or an operation such as sorting according to a specific logical relationship, and finally form the p third data.
[0119] Optionally, the above step of determining h third data according to the h macros and the w ECUs may specifically include the following steps:
[0120] D301. Determine k macros corresponding to a second ECU from the h macros; the second ECU is any one of the w ECUs; k is a natural number less than or equal to h;
[0121] D302. Generate, by the target ECU, a second data request based on the k macros; the second data request includes: macro identifiers corresponding to the k macros;
[0122] D303. Send the second data request to the second ECU through the target ECU, so that the target ECU obtains the k third data corresponding to the k macros.
[0123] In a specific embodiment, k macros corresponding to a second ECU are determined from h macros, where the second ECU is any one of the w ECUs. Because each ECU may be associated with one or more macros, the number of macros corresponding to the second ECU is k, where k is a natural number less than or equal to h.
[0124] The target ECU generates a second data request based on the k macros determined. The second data request includes the macro identifiers corresponding to the k macros. The target ECU sends the second data request to the second ECU, which can accurately identify the macro data for which the target ECU is seeking to obtain. The target ECU can send the data request via the target vehicle's internal communication network, such as the CAN bus. After receiving the second data request, the second ECU searches its own macro list for the corresponding macros based on the k macro identifiers carried in the request, processes the data according to the definitions of these macros, and generates the corresponding k third data. The second ECU then returns this data to the target ECU, thereby enabling the target ECU to obtain the required k third data.
[0125] By clarifying the macro corresponding to each non-target ECU and using the macro identifier as the key information for data request, the data interaction between the target ECU and the second ECU is ensured to be accurate. The second ECU can accurately provide the macro data required by the target ECU based on the macro identifier, avoiding errors or confusion caused by unclear data requests and improving the accuracy of data acquisition.
[0126] S104: Send the target data to the diagnostic device, so that the diagnostic device diagnoses the target vehicle according to the target data.
[0127] In a specific embodiment, after obtaining the target data, the vehicle-mounted device may send the target data to the diagnostic device, so that the diagnostic device can diagnose the target vehicle according to the target data.
[0128] The onboard device sends the target data to the diagnostic device via the vehicle's internal communication network (such as the CAN bus, LIN bus, etc.) or an external communication interface (such as Bluetooth, Wi-Fi, etc.). After receiving the target data, the diagnostic device can analyze and process the target data according to its built-in diagnostic algorithms and rules to diagnose the target vehicle based on the target data.
[0129] See Figure 5 , Figure 5 This is a timing diagram of a macro-definition-based diagnostic method provided in an embodiment of the present application. As shown in the figure, the diagnostic device sends a first data request to the on-board device according to the vehicle diagnostic requirements. The request contains key information required for diagnosis, such as the target macro identifier, target ECU, etc., which clarifies the data range that the diagnostic device expects to obtain.
[0130] After receiving the first data request, the on-board device parses the content therein, extracts the target macro identifier therefrom, and sends the target macro identifier to the target ECU.
[0131] After receiving the target macro identifier, the target ECU determines the corresponding target macro based on its stored macro definition information. It then determines the target data based on the target macro definition (including the macro's data logic relationships and data tags). After calculating or extracting the target data, the target ECU sends it to the onboard device.
[0132] The onboard device receives the target data from the target ECU and forwards it to the diagnostic device. After receiving the target data, the diagnostic device can perform diagnostic analysis on the vehicle based on this data to determine whether the vehicle has any faults or abnormalities.
[0133] As can be seen, using macro definitions for data requests can, on the one hand, reduce the number of interactions and save time waiting for data transmission. On the other hand, the ECU directly calculates the final data based on the macro definitions, eliminating the need for the diagnostic equipment to recalculate, reducing the computing burden on the diagnostic equipment and speeding up diagnosis. In emergency fault diagnosis scenarios, quickly obtaining diagnostic data can save time for repairs and improve vehicle maintenance efficiency.
[0134] In summary, by implementing the embodiments of the present application, a first data request is received from a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU includes a preset macro list; a target macro is determined from the macro list based on the target macro identifier; target data is determined based on the target macro; and the target data is sent to the diagnostic device, so that the diagnostic device can diagnose the target vehicle based on the target data. This shows that making data requests through macro definitions can reduce the number of interactions between the diagnostic device and the ECU. The ECU directly calculates the final data based on the macro definitions, reducing the computational burden on the diagnostic device, accelerating diagnostic speed, and improving diagnostic efficiency.
[0135] See Figure 6 , Figure 6 This is a structural diagram of a macro-definition-based diagnostic system provided in an embodiment of the present application. As shown in the figure, the macro-definition-based diagnostic system 600 includes: a request receiving unit 601, a macro management unit 602, an ECU management unit 603, a data processing unit 604 and a data return unit 605.
[0136] Request receiving unit 601 is responsible for receiving data requests from the diagnostic device. Based on the vehicle's operating status and diagnostic requirements, the diagnostic device issues a data request containing key information such as the target macro identifier. Request receiving unit 601 accurately captures this request, providing a start signal and data requirement guidance for subsequent diagnostic processes.
[0137] Based on the received target macro identifier, the macro management unit 602 manages macros within the system. It locates the target macro from the macro list and determines its definition, data logic, and other information. It also supports operations such as adding, updating, and deleting macros to accommodate changing diagnostic needs. For example, when a new sensor or diagnostic indicator is added to a vehicle, the macro management unit 602 can add a new macro definition.
[0138] The ECU management unit 603 is responsible for interacting with the vehicle's electronic control units (ECUs). It determines the ECU associated with the target macro, sends instructions to the corresponding ECU, and coordinates data transmission and interaction between ECUs. In macro processing involving multiple ECUs, this unit ensures that each ECU accurately provides the required data.
[0139] The data processing unit 604 can process the data according to the macro definition provided by the macro management unit 602 and the data obtained by the ECU management unit 603 according to the preset data logical relationship, and convert the original data into the target data required for diagnosis through calculation, integration and other operations.
[0140] The data return unit 605 is used to send the target data back to the diagnostic device after the data processing unit 604 completes the target data processing, so that the diagnostic device can perform fault diagnosis, performance evaluation and other operations on the vehicle based on the data.
[0141] It can be seen that through the clear division of labor and collaborative work of each unit in the macro-defined diagnostic system 600, an efficient data processing link is formed from receiving requests to returning data, which reduces data processing time, improves diagnostic efficiency, and can quickly respond to diagnostic needs.
[0142] See Figure 7 , Figure 7 : is a structural diagram of a macro-definition-based diagnostic device provided in an embodiment of the present application. The macro-definition-based diagnostic device 700 is applied to an on-board device, and the on-board device is applied to a target vehicle. The target vehicle includes n ECUs, where n is a positive integer. The macro-definition-based diagnostic device 700 includes: a data request receiving module 701, a macro determination module 702, a macro processing module 703, and a data return module 704, wherein:
[0143] The data request receiving module 701 is configured to receive a first data request sent by a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU is any one of the n ECUs; the target ECU includes a preset macro list; the macro list includes a plurality of macros; each macro is used to represent a combination of multiple basic data of the target vehicle used for diagnosis; each macro corresponds to a macro identifier;
[0144] A macro determining module 702 is configured to determine a target macro from the macro list according to the target macro identifier;
[0145] A macro processing module 703 is configured to determine target data according to the target macro;
[0146] The data returning module 704 is configured to send the target data to the diagnostic device so that the diagnostic device can diagnose the target vehicle according to the target data.
[0147] Optionally, before receiving the first data request sent by the diagnostic device, the macro definition-based diagnostic apparatus 700 is further specifically configured to:
[0148] receiving a macro addition request sent by the diagnostic device; the macro addition request includes: a first ECU and first macro definition information; the first ECU is one of the n ECUs; the first macro definition information includes: a first macro identifier, m data tags, and a data logical relationship; m is a positive integer;
[0149] determining an initial macro list in the first ECU;
[0150] determining a first macro according to the first macro definition information;
[0151] The first macro is stored in the initial macro list in the first ECU.
[0152] Optionally, in terms of storing the first macro in the initial macro list in the first ECU, the macro definition-based diagnostic device 700 is further specifically configured to:
[0153] Determine the macro identifier corresponding to each macro in the initial macro list to obtain a macro identifier list;
[0154] Determine whether the first macro identifier exists in the macro identifier list;
[0155] If so, a first error message is generated and returned to the diagnostic device; the first error message is used to instruct the user to modify the first macro identifier in the first macro definition information;
[0156] If not, the initial macro list is updated according to the first macro.
[0157] Optionally, in determining the target data according to the target macro, the macro processing module 703 is further specifically configured to:
[0158] Determine the macro type corresponding to the target macro to obtain the target macro type; the target macro type includes one of the following: data combination type, data calculation type, macro reference type;
[0159] Determine m target data labels and target data logical relationships in the target macro;
[0160] The target data is determined according to the target macro type, the m target data tags and the target data logical relationship.
[0161] Optionally, in determining the target data according to the target macro type, the m target data tags and the target data logical relationship, the macro processing module 703 is further specifically configured to:
[0162] When the target macro type is the data combination type, determining a first data combination order according to the target data logical relationship;
[0163] Collect corresponding data according to the m target data tags to obtain m first data;
[0164] Combining the m first data in the first data combination order to obtain the target data;
[0165] When the target macro type is the data calculation type, determining a first calculation formula according to the target data logical relationship;
[0166] Collect corresponding data according to the m target data tags to obtain m second data;
[0167] Determine the target data according to the first calculation formula and the m second data;
[0168] When the target macro type is the macro reference type, p macro identifiers are determined according to the m target data tags; p is a positive integer less than or equal to m;
[0169] Determine p third data according to the p macro identifiers; each macro identifier corresponds to one third data;
[0170] The target data is determined according to the target data logical relationship, mp target data labels and the p third data.
[0171] Optionally, in determining the p third data according to the p macro identifiers, the macro processing module 703 is further specifically configured to:
[0172] Determining p macros according to the p macro identifiers;
[0173] Determine the ECUs corresponding to the p macros to obtain p ECUs;
[0174] Determine ECUs other than the target ECU among the p ECUs to obtain w ECUs, where w is a natural number less than or equal to p; and each ECU corresponds to at least one macro;
[0175] Determine macros corresponding to the w ECUs from the p macros to obtain h macros; h is an integer greater than or equal to w and less than or equal to p;
[0176] determining h third data according to the h macros and the w ECUs;
[0177] determining ph third data according to the ph macros and the target ECU;
[0178] The p third data are determined according to the h third data and the ph third data.
[0179] Optionally, in determining the h third data according to the h macros and the w ECUs, the macro processing module 703 is further specifically configured to:
[0180] Determining k macros corresponding to a second ECU from the h macros; the second ECU is any one of the w ECUs; k is a natural number less than or equal to h;
[0181] Generate a second data request according to the k macros by the target ECU; the second data request includes: macro identifiers corresponding to the k macros;
[0182] The second data request is sent to the second ECU via the target ECU, so that the target ECU obtains the k third data corresponding to the k macros.
[0183] The macro-definition-based diagnostic device 700 described herein can receive a first data request sent by a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU includes a preset macro list; a target macro is determined from the macro list based on the target macro identifier; target data is determined based on the target macro; and the target data is sent to the diagnostic device, so that the diagnostic device can diagnose the target vehicle based on the target data. This indicates that making data requests through macro definitions can reduce the number of interactions between the diagnostic device and the ECU. The ECU directly calculates the final data based on the macro definitions, reducing the computational burden on the diagnostic device, accelerating diagnostic speed, and improving diagnostic efficiency.
[0184] See Figure 8 , Figure 8 : is a schematic diagram of the structure of an in-vehicle device provided in an embodiment of the present application. The in-vehicle device may include a processor, a memory, a communication interface, and one or more programs. The processor, memory, and communication interface may be interconnected via a bus. The one or more programs are stored in the memory and configured to be executed by the processor. In the embodiment of the present application, the program includes instructions for executing the following steps:
[0185] receiving a first data request sent by a diagnostic device; the first data request including: a target macro identifier and a target ECU; the target ECU being any one of n ECUs; the target ECU including a preset macro list; the macro list including a plurality of macros; each macro representing a combination of a plurality of basic data items of a target vehicle for diagnosis; each macro corresponding to a macro identifier;
[0186] determining a target macro from the macro list according to the target macro identifier;
[0187] determining target data according to the target macro;
[0188] The target data is sent to the diagnostic device, so that the diagnostic device diagnoses the target vehicle according to the target data.
[0189] The vehicle-mounted device described in this application can receive a first data request sent by a diagnostic device; the first data request includes: a target macro identifier and a target ECU; the target ECU includes a preset macro list; a target macro is determined from the macro list based on the target macro identifier; target data is determined based on the target macro; and the target data is sent to the diagnostic device, so that the diagnostic device can diagnose the target vehicle based on the target data. As can be seen, making data requests through macro definitions can reduce the number of interactions between the diagnostic device and the ECU. The ECU directly calculates the final data based on the macro definitions, reducing the computational burden on the diagnostic device, accelerating diagnostic speed, and improving diagnostic efficiency.
[0190] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0191] The present application also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may comprise an electronic device.
[0192] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0193] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and storage medium can also be present in a terminal device or a management device as discrete components.
[0194] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0195] The modules / units included in the devices and products described in the above embodiments may be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for the devices and products applied to or integrated in the chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least part of the modules / units may be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for the devices and products applied to or integrated in the chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as chip, circuit module, etc.) or different components of the chip module, or at least part of the modules / units may be It is implemented in the form of a software program, which runs on the processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on the processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.
[0196] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only a specific implementation method of the embodiments of the present application and is not intended to limit the scope of protection of the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of protection of the embodiments of the present application.
Claims
1. A diagnostic method based on macro definition, characterized in that: Applied to an on-vehicle device, the on-vehicle device is applied to a target vehicle, the target vehicle includes n ECUs, where n is a positive integer; The method comprises: receiving a first data request sent by a diagnostic device; the first data request including: a target macro identifier and a target ECU; the target ECU being any one of the n ECUs; the target ECU including a preset macro list; the macro list including a plurality of macros; each macro representing a combination of a plurality of basic data of the target vehicle for diagnosis; each macro corresponding to a macro identifier; determining a target macro from the macro list according to the target macro identifier; determining target data according to the target macro; The target data is sent to the diagnostic device, so that the diagnostic device diagnoses the target vehicle according to the target data.
2. The method according to claim 1, wherein Before receiving the first data request sent by the diagnostic device, the method further includes: receiving a macro addition request sent by the diagnostic device; the macro addition request includes: a first ECU and first macro definition information; the first ECU is one of the n ECUs; the first macro definition information includes: a first macro identifier, m data tags, and a data logical relationship; m is a positive integer; determining an initial macro list in the first ECU; determining a first macro according to the first macro definition information; The first macro is stored in the initial macro list in the first ECU.
3. The method according to claim 2, wherein The storing of the first macro in the initial macro list in the first ECU includes: Determine the macro identifier corresponding to each macro in the initial macro list to obtain a macro identifier list; Determine whether the first macro identifier exists in the macro identifier list; If so, a first error message is generated and returned to the diagnostic device; the first error message is used to instruct the user to modify the first macro identifier in the first macro definition information; If not, the initial macro list is updated according to the first macro.
4. The method according to claim 2 or 3, wherein: Determining target data according to the target macro includes: Determine the macro type corresponding to the target macro to obtain the target macro type; the target macro type includes one of the following: data combination type, data calculation type, macro reference type; Determine m target data labels and target data logical relationships in the target macro; The target data is determined according to the target macro type, the m target data tags and the target data logical relationship.
5. The method according to claim 4, wherein The determining the target data according to the target macro type, the m target data tags, and the target data logical relationship includes: When the target macro type is the data combination type, determining a first data combination order according to the target data logical relationship; Collect corresponding data according to the m target data tags to obtain m first data; Combining the m first data in the first data combination order to obtain the target data; When the target macro type is the data calculation type, determining a first calculation formula according to the target data logical relationship; Collect corresponding data according to the m target data tags to obtain m second data; Determine the target data according to the first calculation formula and the m second data; When the target macro type is the macro reference type, p macro identifiers are determined according to the m target data tags; p is a positive integer less than or equal to m; Determine p third data according to the p macro identifiers; each macro identifier corresponds to one third data; The target data is determined according to the target data logical relationship, mp target data labels and the p third data.
6. The method according to claim 5, wherein The determining of the p third data according to the p macro identifiers includes: Determining p macros according to the p macro identifiers; Determine the ECUs corresponding to the p macros to obtain p ECUs; Determine ECUs other than the target ECU among the p ECUs to obtain w ECUs, where w is a natural number less than or equal to p; and each ECU corresponds to at least one macro; Determine macros corresponding to the w ECUs from the p macros to obtain h macros; h is an integer greater than or equal to w and less than or equal to p; determining h third data according to the h macros and the w ECUs; determining ph third data according to the ph macros and the target ECU; The p third data are determined according to the h third data and the ph third data.
7. The method according to claim 6, wherein The determining h third data according to the h macros and the w ECUs includes: Determining k macros corresponding to a second ECU from the h macros; the second ECU is any one of the w ECUs; k is a natural number less than or equal to h; Generate a second data request according to the k macros by the target ECU; the second data request includes: macro identifiers corresponding to the k macros; The second data request is sent to the second ECU via the target ECU, so that the target ECU obtains the k third data corresponding to the k macros.
8. A diagnostic device based on macro definition, characterized in that: Applied to an on-vehicle device, the on-vehicle device is applied to a target vehicle, the target vehicle includes n ECUs, where n is a positive integer; The macro definition-based diagnostic device includes: a data request receiving module, configured to receive a first data request sent by a diagnostic device; the first data request including: a target macro identifier and a target ECU; the target ECU being any one of the n ECUs; the target ECU including a preset macro list; the macro list including a plurality of macros; each macro representing a combination of multiple basic data items of the target vehicle for diagnosis; each macro corresponding to a macro identifier; a macro determining module, configured to determine a target macro from the macro list according to the target macro identifier; A macro processing module, configured to determine target data according to the target macro; The data return module is used to send the target data to the diagnostic device so that the diagnostic device can diagnose the target vehicle according to the target data.
9. A vehicle-mounted device, characterized in that: include: a processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, wherein the programs include instructions for executing the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data calling method and device and electronic equipment
CN110297947A
Vehicle fault diagnosis method and device and related equipment
CN111103868A
Label adding method and device, electronic equipment and readable storage medium
CN111597452A
Fault diagnosis method and system and computer readable storage medium
CN112084909A
Remote diagnosis method and device, electronic equipment and computer readable storage medium
CN116300804A