Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for determining fault data of a vehicle electronic control unit, and an electronic device, so as to improve real-time performance and accuracy of fault recording.
In a first aspect, an embodiment of the present invention provides a method for determining fault data of a vehicle electronic control unit, including: collecting related parameter data of a vehicle electronic control unit according to a preset frequency, and storing the related parameter data to a preset storage position; if a fault generating signal is monitored, counting acquisition parameters of related parameter data to obtain a statistical result; the acquisition parameter indicates the acquisition times and/or the acquisition duration of the related parameter data; if the statistical result meets a preset first condition, acquiring initial data corresponding to the fault generation signal from a preset storage position; the initial data comprises related parameter data acquired before the fault generation signal is generated and related parameter data acquired after the fault generation signal is generated; based on the initial data, fault data corresponding to the fault generation signal is determined.
Further, the related parameter data includes parameter data corresponding to a plurality of parameters; the preset frequency comprises sub-frequencies corresponding to a plurality of parameters; the sub-frequencies are predetermined based on the variation trend of the parameters; the preset storage position comprises cache areas corresponding to a plurality of parameters; the method comprises the following steps of collecting relevant parameter data of a vehicle electronic control unit according to a preset frequency, and storing the relevant parameter data to a preset storage position, wherein the steps comprise: for each parameter, acquiring parameter data corresponding to the parameter of the vehicle electronic control unit according to the sub-frequency corresponding to the parameter; and storing the acquired parameter data corresponding to the parameters to a cache region corresponding to the parameters.
Further, after the acquired parameter data corresponding to the parameter is stored in the buffer area corresponding to the parameter, the method further includes: acquiring the parameter data storage capacity stored in a cache region; and if the parameter data storage amount is larger than a preset storage amount threshold value, deleting the parameter data with the earliest acquisition time in the cache region.
Furthermore, the preset storage position stores relevant parameter data and corresponding acquisition time; acquiring initial data corresponding to the fault generation signal from a preset storage position, wherein the step comprises the following steps; determining a time range corresponding to initial data to be acquired based on the generation time of the fault generation signal; extracting stored relevant parameter data with acquisition time meeting a time range from a preset storage position; and determining the extracted related parameter data as initial data corresponding to the fault generation signal.
Further, the initial data comprises related parameter data of which the acquisition time meets a predetermined time range; the time range is determined based on the generation time of the fault generation signal; the related parameter data comprises parameter data corresponding to a plurality of parameters; each parameter corresponds to a sub-frequency of the parameter data corresponding to the acquisition parameter; the step of determining fault data corresponding to the fault generation signal based on the initial data includes: determining a time point to be interpolated of parameter data corresponding to each parameter in the initial parameters based on the sub-frequencies corresponding to the parameters; determining parameter data corresponding to the time points to be interpolated based on the parameter data corresponding to the parameters aiming at the time points to be interpolated of the parameter data corresponding to each parameter; and determining the parameter data corresponding to each acquired parameter and the parameter data corresponding to the time points to be interpolated into a data sequence formed by time sequencing as fault data corresponding to the fault generation signal.
Further, the step of determining a time point to be interpolated of the parameter data corresponding to each parameter in the initial parameters based on the sub-frequencies corresponding to the plurality of parameters includes: and determining the acquisition time corresponding to the parameter data corresponding to the parameter with the highest sub-frequency in the plurality of parameters as the time point to be interpolated of the parameter data corresponding to each parameter.
Further, the step of determining the parameter data corresponding to the time point to be interpolated based on the parameter data corresponding to the parameter includes: determining the parameter data corresponding to the last acquisition time of the time point to be interpolated in the parameter data corresponding to the parameter as the parameter data corresponding to the time point to be interpolated; or determining the parameter data corresponding to the acquisition time with the minimum time difference with the time point to be interpolated in the parameter data corresponding to the parameter as the parameter data corresponding to the time point to be interpolated; or, determining the average value of the parameter data corresponding to the last acquisition time and the parameter data corresponding to the next acquisition time of the time points to be interpolated in the parameter data corresponding to the parameters as the parameter data corresponding to the time points to be interpolated.
In a second aspect, an embodiment of the present invention further provides a failure data determination device for a vehicle electronic control unit, including: the data acquisition module is used for acquiring related parameter data of the vehicle electronic control unit according to a preset frequency and storing the related parameter data to a preset storage position; the acquisition parameter counting module is used for counting acquisition parameters of related parameter data to obtain a statistical result if a fault generation signal is monitored; the acquisition parameter indicates the acquisition times and/or the acquisition duration of the related parameter data; the initial data acquisition module is used for acquiring initial data corresponding to the fault generation signal from a preset storage position if the statistical result meets a preset first condition; the initial data comprises related parameter data acquired before the fault generation signal is generated and related parameter data acquired after the fault generation signal is generated; and the fault data determining module is used for determining fault data corresponding to the fault generation signal based on the initial data.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the foregoing method.
In a fourth aspect, embodiments of the present invention also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described method.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for determining fault data of a vehicle electronic control unit and electronic equipment, wherein relevant parameter data of the vehicle electronic control unit are collected according to a preset frequency, and the relevant parameter data are stored to a preset storage position; if a fault generating signal is monitored, counting acquisition parameters of related parameter data to obtain a statistical result; if the statistical result meets a preset first condition, acquiring initial data corresponding to the fault generation signal from a preset storage position; the initial data comprises related parameter data acquired before a fault generation signal is generated and related parameter data acquired after the fault generation signal is generated; and determining fault data corresponding to the fault generation signal based on the initial data. The method improves the real-time performance and accuracy of fault recording.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, the functions of the vehicle-mounted ECU are more and more powerful and complex, and the reasons for the faults of the ECU are more and more complex. The failure cause location analysis usually depends on the failure snapshot recorded in the NVM by the ECU, so the real-time and accuracy of the failure snapshot record play an extremely important role in the failure location.
At present, a fault snapshot recording scheme adopted in the automobile industry is generally a snapshot acquisition scheme based on a DEM in an automotive architecture or a fault snapshot acquisition system self-developed by a manufacturer, that is, after a fault occurs, environmental data inside an ECU is acquired once and recorded in an NVM, and this type of fault snapshot recording scheme may be referred to as a single-frame fault snapshot scheme.
The single-frame fault snapshot recording scheme used in the existing vehicle-mounted ECU can meet most fault positioning analysis requirements, but still has the following problems:
1, data real-time performance: the single-frame snapshot is usually recorded after the occurrence of the fault, and there is a certain deviation between the recording time and the fault occurrence time.
2, data accuracy: since the data recording lags behind the occurrence of the fault, the recorded data does not necessarily reflect the environment at the moment of the occurrence of the fault, particularly certain data that change rapidly (typically, for example, the magnitude of the current).
3 failure analysis efficiency: the single-frame snapshot cannot be used for observing the change trend of the environmental data, is not beneficial to analysis and positioning of some complex problems, and even can bias the analysis direction of the complex problems, so that the fault analysis and positioning efficiency is greatly reduced.
Based on this, the method, the device and the electronic equipment for determining the fault data of the vehicle electronic control unit provided by the embodiment of the invention can be applied to fault data analysis scenes of various vehicle ECUs.
For the convenience of understanding the present embodiment, a method for determining fault data of a vehicle electronic control unit disclosed in the present embodiment will be described in detail first.
An embodiment of the present invention provides a method for determining fault data of a vehicle electronic control unit, as shown in fig. 1, the method includes the following steps:
and S100, collecting related parameter data of the vehicle electronic control unit according to a preset frequency, and storing the related parameter data to a preset storage position.
Specifically, the relevant parameter data may be environmental data of the vehicle electronic control unit, such as temperature, operating speed, memory usage rate, and the like. Accordingly, the relevant parameter data may include parameter data corresponding to a plurality of parameters.
Because the variation trend of each parameter is different, for example, the temperature change is usually slow, and the influence of the vehicle running mode on the memory utilization rate is large, corresponding to each parameter, different collection frequency preset frequencies can be set. Therefore, the preset frequency may also include sub-frequencies corresponding to a plurality of parameters; the sub-frequencies are predetermined based on the variation trend of the parameter.
For storing each parameter, the preset storage location may include a buffer area corresponding to a plurality of parameters. The cache is typically a storage area lost in the event of a power loss. For each parameter, parameter data corresponding to the parameter of the vehicle electronic control unit can be collected according to the sub-frequency corresponding to the parameter, and the collected parameter data corresponding to the parameter is stored in a cache region corresponding to the parameter.
After the acquired parameter data corresponding to the parameters are stored in the cache region corresponding to the parameters, the parameter data storage amount stored in the cache region can be acquired; the data storage capacity can reflect the data acquisition times; and if the parameter data storage amount is larger than a preset storage amount threshold value, deleting the parameter data with the earliest acquisition time in the cache region. In practical implementation, different storage amount thresholds may be set for the buffer areas of different parameters, and may be specifically determined according to the data amount of the parameter acquired each time.
Step S102, if a fault generation signal is monitored, collecting parameters of relevant parameter data are counted to obtain a statistical result; the acquisition parameters indicate the acquisition times and/or the acquisition duration of the related parameter data.
The acquisition parameter may be acquisition frequency or acquisition duration. When the acquisition parameters are acquisition times, the statistical result can be the acquisition times of the relevant parameter data after the fault generation signal is monitored; when the acquisition parameter is acquisition duration, the statistical result may be acquisition duration of the relevant parameter data after the fault generation signal is monitored.
Step S104, if the statistical result meets a preset first condition, acquiring initial data corresponding to the fault generation signal from a preset storage position; the initial data includes the relevant parameter data collected before the generation of the fault generation signal and the relevant parameter data collected after the generation of the fault generation signal.
The preset first condition may be that the collection frequency of the relevant parameter data reaches a preset frequency after the fault generation signal is monitored; or the acquisition time of the relevant parameter data reaches the preset time after the fault generation signal is monitored, and is specifically relevant to the acquisition parameters.
When the related parameter data are stored, the acquisition time of the related parameter data can be stored to a preset storage position at the same time. When acquiring the initial data, first, a time range corresponding to the initial data to be acquired may be determined based on the generation time of the fault generation signal, for example, ten minutes before and after the generation time of the fault generation signal; extracting the stored relevant parameter data with the acquisition time meeting the time range from a preset storage position; and determining the extracted related parameter data as initial data corresponding to the fault generation signal.
When the data stored in the preset storage location is matched with the data amount corresponding to the time range, the data in the preset storage location can be directly determined as the initial data by referring to the implementation manner of 'deleting the parameter data with the earliest acquisition time in the cache area if the parameter data storage amount is greater than the preset storage amount threshold'.
And step S106, determining fault data corresponding to the fault generation signal based on the initial data.
In specific implementation, the initial data comprises related parameter data of which the acquisition time meets a predetermined time range; wherein the time range is determined based on the generation time of the fault generation signal. Specifically, a time point to be interpolated of the parameter data corresponding to each parameter in the initial parameter may be determined based on the sub-frequencies corresponding to the multiple parameters, for example, the acquisition time corresponding to the parameter data corresponding to the parameter with the highest sub-frequency in the multiple parameters is determined as the time point to be interpolated of the parameter data corresponding to each parameter; then, determining parameter data corresponding to the time point to be interpolated based on the parameter data corresponding to the parameter for the time point to be interpolated of the parameter data corresponding to each parameter; and determining the parameter data corresponding to each acquired parameter and the parameter data corresponding to the time points to be interpolated into a data sequence formed by time sequencing as fault data corresponding to the fault generation signal.
When the parameter data corresponding to the time point to be interpolated is determined, the parameter data corresponding to the last acquisition time of the time point to be interpolated in the parameter data corresponding to the parameter can be determined as the parameter data corresponding to the time point to be interpolated; or determining the parameter data corresponding to the acquisition time with the minimum time difference with the time point to be interpolated in the parameter data corresponding to the parameter as the parameter data corresponding to the time point to be interpolated; or, determining the average value of the parameter data corresponding to the last acquisition time and the parameter data corresponding to the next acquisition time of the time points to be interpolated in the parameter data corresponding to the parameters as the parameter data corresponding to the time points to be interpolated; or generating a fitting curve based on the parameter data corresponding to the parameters, and determining the parameter data corresponding to the time point to be interpolated according to the parameter value corresponding to the time point to be interpolated on the fitting curve. The specific property can be determined according to the requirement.
The embodiment of the invention provides a method for determining fault data of a vehicle electronic control unit, which comprises the steps of collecting relevant parameter data of the vehicle electronic control unit according to a preset frequency, and storing the relevant parameter data to a preset storage position; if a fault generating signal is monitored, counting acquisition parameters of related parameter data to obtain a statistical result; if the statistical result meets a preset first condition, acquiring initial data corresponding to the fault generation signal from a preset storage position; the initial data comprises related parameter data acquired before a fault generation signal is generated and related parameter data acquired after the fault generation signal is generated; and determining fault data corresponding to the fault generation signal based on the initial data. The method improves the real-time performance and accuracy of fault recording.
The embodiment of the invention also provides another fault data determination method of the vehicle electronic control unit. The method is mainly provided for the problem of data acquisition of the single-frame fault scheme of the conventional vehicle-mounted ECU, and mainly solves the following problems:
a, the real-time performance and accuracy of fault snapshot data are solved;
b, the problem that the single-frame fault snapshot cannot show the data change trend;
the method can update and record related data information in real time before and after the fault occurs; different snapshot data packets can be formed according to the faults and stored in the NVM; furthermore, continuous snapshot information recorded by the continuous fault snapshot system can be read through background software, and data can be displayed in a graphical mode;
the method can be realized by a fault continuous snapshot system, wherein the system comprises a data acquisition module, a snapshot group packaging module, a data storage module, a data transmission module and a data transmission module, and the functions and the processing flow among the functions of each sub-module are as follows:
1, a data acquisition module:
(1) registering a data acquisition interface of the fault continuous snapshot into an OS (operating System) task, and triggering data refreshing and recording of a corresponding period through different periodic tasks.
(2) BEFORE a fault occurs, the fault continuous snapshot system collects data according to the number of data recording times N _ BEFORE BEFORE the fault occurs, and stores the data in different data buffers (corresponding to the cache regions).
(3) AFTER a fault occurs, the fault continuous snapshot system collects data according to the number of times N _ AFTER of data record AFTER the fault occurs, namely AFTER the fault occurs, ECU environmental data of the number of times N _ AFTER are collected and stored in different data buffers, and the collection of the original fault data is completed.
2, snapshot group package module:
(1) and after the data acquisition is finished, selecting required data from the buffer of the data acquisition module according to the type of the fault.
(2) By adopting a time-based data interpolation method, as shown in fig. 2, a certain update time at which the fastest frequency data is updated is mapped to the time axes of other update cycle data, and corresponding data is interpolated at the corresponding time, so that the synchronization of the data in different update cycles is realized, and the work of the fault snapshot group package is completed.
3, a data storage module: storing the packaged snapshot data to an NVM (non-volatile memory), so that subsequent reading is facilitated;
4, a data transmission module: when fault analysis is performed, data reading is required to be performed through background software. And the data transmission module sends the snapshot data stored in the NVM to background software according to a continuous failure snapshot data transmission protocol. The transmission protocol is as shown in fig. 3, and adopts a combination of description area + data area, where the information block with M identifier is necessary information, and the information block with U identifier is optional information. The information of the fault code, the information of the data updating period, the information of the data updating times, the information of the fault associated data ID and the information of the fault associated data are necessary information; absolute time information, relative time information, and other fault information are optional information.
5, a data display module: and analyzing the data sent by the data transmission module, visualizing the data through a graphical interface, and displaying the fault snapshot data.
The method adopts an environment data real-time acquisition scheme, registers the data acquisition event into the OS task scheduling, and ensures the real-time performance and the accuracy of the acquired data; through a fault continuous snapshot packet packing algorithm and a time-based data interpolation method, the synchronous shooting of all data is effectively ensured, and the updating period and the number of all data are ensured to be consistent with the data in the fastest updating period; the method also adopts a fault snapshot transmission protocol, particularly adopts a combination mode of a description area and a data area, and has flexible analysis protocol and strong expansibility; according to the method, the ECU environmental data are captured in real time through OS scheduling, the real-time performance and the accuracy of the data are guaranteed, the data information before and after the fault occurs in a period of time is recorded, the change trend of the data before and after the fault occurs can be effectively displayed by matching with background software, the fault location is convenient, and the fault solving efficiency is improved.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a failure data determining apparatus of a vehicle electronic control unit, as shown in fig. 4, the apparatus including:
the data acquisition module 400 is used for acquiring relevant parameter data of the vehicle electronic control unit according to a preset frequency and storing the relevant parameter data to a preset storage position;
an acquisition parameter statistics module 402, configured to, if a fault generation signal is monitored, perform statistics on acquisition parameters of relevant parameter data to obtain a statistical result; the acquisition parameter indicates the acquisition times and/or the acquisition duration of the related parameter data;
an initial data obtaining module 404, configured to obtain initial data corresponding to the fault generation signal from a preset storage location if the statistical result meets a preset first condition; the initial data comprises related parameter data acquired before the fault generation signal is generated and related parameter data acquired after the fault generation signal is generated;
and a fault data determination module 406, configured to determine fault data corresponding to the fault generation signal based on the initial data.
The fault data determination device of the vehicle electronic control unit provided by the embodiment of the invention has the same technical characteristics as the fault data determination method of the vehicle electronic control unit provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, the electronic device includes a processor 130 and a memory 131, the memory 131 stores machine executable instructions capable of being executed by the processor 130, and the processor 130 executes the machine executable instructions to implement the fault data determination method of the vehicle electronic control unit.
Further, the electronic device shown in fig. 5 further includes a bus 132 and a communication interface 133, and the processor 130, the communication interface 133 and the memory 131 are connected through the bus 132.
The Memory 131 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 132 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The processor 130 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 130. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the invention also provides a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the method for determining the fault data of the vehicle electronic control unit.
The method and the device for determining fault data of the vehicle electronic control unit and the computer program product of the electronic device provided by the embodiment of the invention comprise a computer readable storage medium storing program codes, wherein instructions included in the program codes can be used for executing the method described in the previous method embodiment, and specific implementation can be referred to the method embodiment, and is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part thereof, which essentially contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a gateway electronic device, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.