Log recording method, device, terminal device and readable storage medium
By analyzing the interface parameters of the PDU constructor, obtaining the log status and saving path, and generating and saving log files, the problem of not being able to determine the cause of the failure in vehicle diagnosis is solved, and diagnostic efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202111254381.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the prior art, vehicle diagnostic methods cannot accurately determine the cause of the fault and the location of the fault, especially in the diagnostic testing environment of different vehicles, abnormal situations are prone to occur.
By parsing the interface parameters of the PDU constructor, obtaining the log status parameters and log saving path, starting the logging function, generating and saving log files, and recording log information when calling the D-PDU API interface, dynamically controlling the startup and path adjustment of the logging function.
Real-time acquisition of log information is achieved, the efficiency and accuracy of vehicle diagnosis is improved, and the causes of abnormalities during vehicle diagnosis can be accurately analyzed.
Smart Images

Figure CN113986592B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of vehicle diagnosis, and particularly relates to a log recording method, device, terminal device and readable storage medium. Background Art
[0002] Recently, vehicle manufacturers often use MVCI (Modular vehicle communication interface) devices to diagnose and configure the vehicle electronic control units of vehicles, and control the MVCI devices by calling the Diagnostic protocol data unit application programming interface (D-PDU API).
[0003] However, due to different diagnostic test environments for different vehicles, abnormal situations are likely to occur during operation, and it is impossible to accurately determine the cause of the failure and the location of the failure. Summary of the Invention
[0004] Embodiments of this application provide a log recording method, device, terminal device and readable storage medium, which can solve the problem that the relevant vehicle diagnosis methods cannot accurately determine the cause of the failure.
[0005] In a first aspect, embodiments of this application provide a log recording method, including:
[0006] Analyze the PDU construction interface parameters corresponding to the PDU constructor, and obtain the log status parameter and log storage path carried by the PDU construction interface parameters;
[0007] When it is detected that the log status parameter is start, start the log recording function, generate a log file and save it in the log storage path;
[0008] When it is detected that the D-PDU API interface is called, generate the corresponding log information and save it in the log file.
[0009] In one embodiment, after analyzing the PDU construction interface parameters and obtaining the log status parameter and log storage path carried by the PDU construction interface parameters, it includes:
[0010] When it is detected that the log status parameter is off, keep the log recording function off.
[0011] In one embodiment, before the step of analyzing the PDU construction interface parameters corresponding to the PDU constructor, it further includes:
[0012] Load the D-PDU API interface;
[0013] Call the PDU constructor through the D-PDU API protocol to configure the corresponding PDU construction interface parameters.
[0014] In one embodiment, before calling the PDU constructor through the D-PDU API protocol to configure the corresponding PDU construction interface parameters, it further includes:
[0015] Parse the rxf file of the target device to obtain the corresponding configuration information;
[0016] Obtain the path of the D-PDU API interface according to the configuration information;
[0017] Correspondingly, the loading of the D-PDU API interface includes:
[0018] Load the D-PDU API interface through the path.
[0019] In one embodiment, after detecting that the log status parameter is started, starting the log recording function, generating a log file and saving it in the log saving path, it further includes:
[0020] Obtain the call time of the PDU constructor;
[0021] Generate the name of the log file according to the call time.
[0022] In one embodiment, calling the PDU constructor through the D-PDU API protocol to configure the corresponding PDU construction interface parameters includes:
[0023] Initialize the D-PDU API interface library according to the D-PDU API protocol;
[0024] After detecting that the initialization process is completed, call the PDU constructor and configure the corresponding PDU construction interface parameters.
[0025] In one embodiment, the method further includes:
[0026] When receiving a path change instruction, call the PDU constructor based on the path change instruction to obtain the corresponding new saving path;
[0027] When detecting a new log file, save the new log file to the new saving path;
[0028] Save all the log files stored in the log saving path to the new saving path, and delete all the log files in the log saving path.
[0029] In a second aspect, an embodiment of the present application provides a log recording device, including:
[0030] A first parsing module, configured to parse the PDU construction interface parameters corresponding to the PDU constructor, and obtain the log status parameter and the log saving path carried by the PDU construction interface parameters;
[0031] A log generation module, configured to start the log recording function when detecting that the log status parameter is "start", generate a log file and save it in the log saving path;
[0032] A log recording module, configured to generate corresponding log information and save it in the log file when detecting a call to the D-PDU API interface.
[0033] In one embodiment, the device further includes:
[0034] A control module, configured to keep the log recording function closed when detecting that the log status parameter is "closed".
[0035] In one embodiment, the device further includes:
[0036] A loading module, configured to load the D-PDU API interface;
[0037] A parameter configuration module, configured to call the PDU constructor through the D-PDU API protocol and configure the corresponding PDU construction interface parameters.
[0038] In one embodiment, the device further includes:
[0039] A second parsing module, configured to parse the rxf file of the target device to obtain the corresponding configuration information;
[0040] A path determination module, configured to obtain the path of the D-PDU API interface according to the configuration information;
[0041] Correspondingly, the loading module includes:
[0042] A loading unit, configured to load the D-PDU API interface through the path.
[0043] In one embodiment, the device further includes:
[0044] A time acquisition module, configured to acquire the call time of the PDU constructor;
[0045] A name generation module, configured to generate the name of the log file according to the call time.
[0046] In one embodiment, the parameter configuration module includes:
[0047] An initialization unit for initializing the D-PDU API interface library according to the D-PDU API protocol;
[0048] A parameter configuration unit for calling the PDU constructor and configuring the corresponding PDU constructor interface parameters after detecting that the initialization process is completed.
[0049] In one embodiment, the apparatus further includes:
[0050] An instruction receiving module for, when receiving a path change instruction, calling the PDU constructor based on the path change instruction to obtain a corresponding new save path;
[0051] A detection module for, when detecting a new log file, saving the new log file to the new save path;
[0052] A deletion module for saving all log files stored in the log save path to the new save path and deleting all log files in the log save path.
[0053] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the logging method described in any one of the above first aspects is implemented.
[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the logging method described in any one of the above first aspects is implemented.
[0055] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the logging method described in any one of the above first aspects.
[0056] The beneficial effect of the embodiment of the present application compared with the prior art is that by calling the PDU constructor to obtain the log status parameters and log save path of the logging function and adjusting the startup status of the logging function, log information can be obtained and saved in real time to analyze the abnormal reasons in the vehicle diagnosis process according to the log information and improve the efficiency of vehicle diagnosis.
[0057] It can be understood that the beneficial effects of the above second to fifth aspects can refer to the relevant descriptions in the above first aspect and will not be elaborated here. Description of the Drawings
[0058] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments or the description of the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0059] Figure 1 It is a schematic flowchart of the log recording method provided in the first embodiment of the present application;
[0060] Figure 2 It is another schematic flowchart of the log recording method provided in the second embodiment of the present application;
[0061] Figure 3 It is yet another schematic flowchart of the log recording method provided in the third embodiment of the present application;
[0062] Figure 4 It is a schematic structural diagram of the log recording device provided in the fourth embodiment of the present application;
[0063] Figure 5 It is a schematic structural diagram of the terminal device provided in the fifth embodiment of the present application. Detailed implementation manners
[0064] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0065] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0066] It should also be understood that the term " / and / " used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.
[0067] As used in the specification of this application and the appended claims, the term "if" may be construed contextually as "when" or "once" or "in response to determining" or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed contextually to mean "once determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]".
[0068] In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.
[0069] Reference to "one embodiment" or "some embodiments" or the like described in the specification of this application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized.
[0070] The logging method provided by the embodiments of this application can be applied to terminal devices such as mobile phones, tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of this application do not impose any restrictions on the specific types of terminal devices.
[0071] Embodiment 1
[0072] Figure 1 A schematic flowchart of the logging method provided by this application is shown. By way of example and not limitation, this method can be applied to the above-mentioned laptop computer.
[0073] 101. Analyze the PDU construction interface parameters corresponding to the PDU constructor, and obtain the log status parameter and log storage path carried by the PDU construction interface parameters.
[0074] Specifically, the PDU construction interface parameter Optionstr (specifically in the form of a string) corresponding to the PDU constructor of the general D-PDU API (Diagnostic protocol data unit) diagnostic protocol data unit application interface is parsed to obtain the log status parameter and the log save path of the logging function carried by the PDU construction interface parameter. Among them, the log status parameter refers to the parameter that controls the working status of the logging function. The log status parameter includes, but is not limited to, start (true) and close (false). The log save path refers to the save address of the log file generated when the logging function is started.
[0075] Among them, the specific way to configure the PDU construction interface parameter OptionStr is: EXTERNC T_PDU_ERROR PDUConstruct(CHAR8* OptionStr, void* pAPITag). pAPITag represents the tag value defined by the application, which is used to execute event callbacks and indicate the status, errors, and results of the D-PDU API library being used. pAPITag can help the application determine which D-PDU API library is performing the callback at the current moment.
[0076] Among them, the value of the PDU construction interface parameter OptionStr can be specifically set according to actual needs. In this embodiment, the value of the PDU construction interface parameter OptionStr includes, but is not limited to, the log status parameter (EnableLogging) of the logging function and the log save path (PathOfLogging).
[0077] For example: OptionStr = "EnableLogging = 'TRUE' space character PathOfLogging = 'C:\D-PDUAPI LOG\"'", then according to this PDU construction interface parameter OptionStr, it can be determined that the log status parameter is start (TRUE) and the log save path is 'C:\D-PDU API LOG\"'.
[0078] Table 1 Schematic table of return values of some specific PDUConstruct interface parameter OptionStr.
[0079] Definition Description PDU_ERR_SHARING_VIOLATION Function called again without previous destruction PDU_ERR_INVALID_PARAMETERS At least one option property has invalid parameters PDU_ERR_VALUE_NOT_SUPPORTED The D-PDU driver does not support at least one of the option values PDU_ERR_FCT_FAILED Function call failed PDU_STATUS_NOERROR Function call successful
[0080] 102. When it is detected that the log status parameter is start, start the logging function, generate a log file and save it in the log save path.
[0081] Specifically, when it is detected that the log status parameter carried in the PDU construction interface parameter of the D-PDU API interface is enabled (true), the log recording function is started, and a corresponding log file is generated and saved in the log saving path.
[0082] 103. When it is detected that the D-PDU API interface is called, corresponding log information is generated and saved in the log file.
[0083] Specifically, by calling the general D-PDU API interface, log information during vehicle diagnosis and configuration is generated in real time, and the string corresponding to the log information is written into the corresponding log file through the flush method in the file stream class (fstream class) of the operating system.
[0084] In this embodiment, the log status parameter and the log saving path of the log recording function are obtained by calling the PDU constructor, and the start status of the log recording function is adjusted, so that log information can be obtained and saved in real time to analyze the abnormal reasons during vehicle diagnosis according to the log information and improve the efficiency of vehicle diagnosis.
[0085] In one embodiment, before the step of parsing the PDU construction interface parameter corresponding to the PDU constructor, it further includes:
[0086] Load the D-PDU API interface;
[0087] Call the PDU constructor through the D-PDU API protocol to configure the corresponding PDU construction interface parameter.
[0088] Specifically, the D-PDU API interface is loaded, and the PDU construction (PDUConstruct) interface parameter of the general D-PDU API interface is called according to the protocol of the ISO 22900-2 PDU API diagnostic protocol data unit application interface to configure the corresponding PDU construction interface parameter.
[0089] Among them, the PDU construction interface parameter is specifically OptionStr, and the return value of the PDU construction interface parameter OptionStr is in string form; the above string contains a list of attributes and their values; among them, the attributes in the return value of the PDU construction interface parameter OptionStr and the values corresponding to the attributes need to be separated by an = symbol, the value needs to be placed within two'symbols, and there should be at least one space character between the attribute and value pairs.
[0090] In one embodiment, before calling the PDU constructor through the D-PDU API protocol to configure the corresponding PDU construction interface parameter, it further includes:
[0091] Parse the rxf file of the target device to obtain the corresponding configuration information;
[0092] Obtain the path of the D-PDU API interface according to the configuration information;
[0093] Correspondingly, the loading of the D-PDU API interface includes:
[0094] Load the D-PDU API interface through the path.
[0095] Specifically, according to the protocol of the ISO 22900-2 PDU API interface, parse the rxf file (root description file) of the target device (which can be an MVCI device) to find the configuration information of the corresponding MVCI diagnostic box. The path of the D-PDU API interface can be determined through the configuration information, and the D-PDU API interface is loaded based on the path of the D-PDU API interface, so as to facilitate the call of the D-PDU API interface.
[0096] For example: the parsed configuration information is <LIBRARY_FILE URI=
[0097] "file: / c: / tmp1 / PDUAPI_VEHICLEDOCTOR_2.2.1.dll" / >. The corresponding path of the D-PDU API interface is: c: / tmp1 / PDUAPI_VEHICLEDOCTOR_2.2.1.dll.
[0098] In one embodiment, the calling of the PDU constructor through the D-PDU API protocol and configuring the corresponding PDU constructor interface parameters includes:
[0099] Initialize the D-PDU API interface library according to the D-PDU API protocol;
[0100] After detecting that the initialization process is completed, call the PDU constructor and configure the corresponding PDU constructor interface parameters.
[0101] Specifically, call the PDU structure body (PDU Construct) according to the communication protocol of the D-PDU API interface to initialize the D-PDU API interface library. After detecting that the initialization process is completed, call the PDU constructor and configure the corresponding PDU constructor interface parameters to complete the configuration operation of the PDU constructor interface parameters of the D-PDU API interface.
[0102] Embodiment 2
[0103] This embodiment further illustrates Embodiment 1. For the same or similar parts as those in Embodiment 1, please refer to the relevant descriptions in Embodiment 1 for details, which will not be repeated here. As Figure 2 shown, the method further includes:
[0104] S201. When receiving a path change instruction, call the PDU constructor based on the path change instruction to obtain a corresponding new save path;
[0105] S202. When detecting a new log file, save the new log file to the new save path;
[0106] S203. Save all the log files stored in the log save path to the new save path, and delete all the log files in the log save path.
[0107] Specifically, when receiving a path change instruction sent by a user, call the PDU constructor of the general D-PDU API (Diagnostic protocol data unit) diagnostic protocol data unit application programming interface based on the path change instruction to obtain a corresponding new save path (i.e., a new storage path for storing log files). When detecting a new log file (a new log file generated by the log recording function after receiving the path change instruction), save the new log file to the above new save path. At the same time, save all the log files that have been stored in the original log save path to the above new save path. To avoid duplicate log files and data chaos, delete all the log files in the original log save path.
[0108] In one embodiment, after parsing the PDU construction interface parameters and obtaining the log status parameter and the log save path carried by the PDU construction interface parameters, it includes:
[0109] When detecting that the log status parameter is off, keep the log recording function off.
[0110] Specifically, when detecting that the log status parameter carried in the D-PDU API PDU construction interface parameters is true at startup, it is determined that there is no need to perform the storage operation of log recording at present, stop calling the D-PDU API interface, and keep the log recording function off.
[0111] Dynamically controlling the startup or shutdown of the log recording function through the log status parameter carried in the D-PDU API PDU construction interface parameters and dynamically adjusting the save path of the log information according to the path parameter can accurately obtain the corresponding log records when there is a need to obtain log information records, improving the efficiency of vehicle diagnosis and the accuracy of diagnosis results.
[0112] In this embodiment, the PDU construction interface parameters are recalled through a path change instruction to determine a new save path, which facilitates storing the new log file in the new save path when generating a new log file, and transferring all the log files in the original save path to the new save path, avoiding duplicate storage of log files, thus avoiding data chaos and improving the stability of the log file storage operation.
[0113] Embodiment III
[0114] This embodiment is a further description of Embodiment I. For the same or similar parts as in Embodiment I, please refer to the relevant description of Embodiment I for details, which will not be repeated here. As Figure 3 shown, after detecting that the log status parameter is start, starting the log recording function, generating a log file and saving it in the log save path, the method further includes:
[0115] S104. Obtain the call time of the PDU constructor;
[0116] S105. Generate the name of the log file according to the call time.
[0117] Specifically, when starting the log recording function, obtain the time point of the current call to the PDU constructor, and generate the name of the log file according to this call time point.
[0118] For example, if the call time of the PDU constructor is 10:10 on August 1, 2021, the corresponding generated log file name is 2021813101000-DPDU-LOG.txt.
[0119] In one embodiment, the name of the log file can also be generated by other means, which will not be specifically limited here.
[0120] For example, obtain the model of the ECU, and generate the name of the log file based on the model of the ECU. For example: if the ECU model is A-00-2, the corresponding log file name is A-00-2-DPDU-LOG.txt.
[0121] In one embodiment, the method further includes:
[0122] When detecting a deletion instruction, delete the log file corresponding to the deletion instruction.
[0123] Specifically, when detecting a deletion instruction sent by the user (or when detecting that the storage time of the log file exceeds the preset storage duration, or when detecting that the storage space is insufficient at the current moment, generating a corresponding deletion instruction), based on the deletion instruction, delete the corresponding log file, reduce the storage volume, improve the utilization rate of the storage space, and thus improve the storage efficiency of the log information.
[0124] In this embodiment, the log information is obtained by calling the PDU constructor, and the corresponding log file and name are generated, effectively maintaining the stability and accuracy of the log information, and further improving the efficiency and accuracy of vehicle diagnosis operations based on the log information.
[0125] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0126] Embodiment Four
[0127] Corresponding to the log recording method described in the above embodiments, Figure 4 The structural block diagram of the log recording device provided by the embodiment of the present application is shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown.
[0128] Referring to Figure 4 , the log recording device 100 includes:
[0129] A first parsing module 101, configured to parse the PDU construction interface parameters corresponding to the PDU constructor, and obtain the log status parameter and the log saving path carried by the PDU construction interface parameters;
[0130] A log generation module 102, configured to start the log recording function when it is detected that the log status parameter is start, generate a log file and save it in the log saving path; <X
[0131] A log recording module 103, configured to generate corresponding log information and save it in the log file when it is detected that the D-PDU API interface is called.
[0132] In one embodiment, the device further includes:
[0133] A control module, configured to keep the log recording function closed when it is detected that the log status parameter is closed.
[0134] In one embodiment, the device further includes:
[0135] A loading module, configured to load the D-PDU API interface;
[0136] A parameter configuration module, configured to call the PDU constructor through the D-PDU API protocol and configure the corresponding PDU construction interface parameters.
[0137] In one embodiment, the device further includes:
[0138] A second parsing module, configured to parse the rxf file of the target device to obtain corresponding configuration information;
[0139] A path determination module, configured to obtain the path of the D-PDU API interface according to the configuration information;
[0140] Correspondingly, the loading module includes:
[0141] A loading unit, configured to load the D-PDU API interface through the path.
[0142] In one embodiment, the device further includes:
[0143] A time acquisition module, configured to acquire the call time of the PDU constructor;
[0144] A name generation module, configured to generate the name of the log file according to the call time.
[0145] In one embodiment, the parameter configuration module includes:
[0146] An initialization unit, configured to initialize the D-PDU API interface library according to the D-PDU API protocol;
[0147] A parameter configuration unit, configured to call the PDU constructor and configure the corresponding PDU constructor interface parameters after detecting that the initialization process is completed.
[0148] In one embodiment, the device further includes:
[0149] An instruction receiving module, configured to call the PDU constructor based on the path change instruction when receiving a path change instruction, so as to obtain a corresponding new save path;
[0150] A detection module, configured to save the new log file to the new save path when detecting a new log file;
[0151] A deletion module, configured to save all the log files stored in the log save path to the new save path, and delete all the log files in the log save path.
[0152] In this embodiment, by calling the PDU constructor to obtain the log status parameters and the log save path of the log recording function, and adjusting the start status of the log recording function, the log information can be obtained and saved in real time, so as to analyze the abnormal reasons in the vehicle diagnosis process according to the log information and improve the efficiency of vehicle diagnosis.
[0153] It should be noted that for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, for their specific functions and the technical effects brought about, reference can be specifically made to the method embodiment part, and details will not be elaborated here.
[0154] Embodiment Five
[0155] Figure 5 is a schematic structural diagram of the terminal device provided in this embodiment. As Figure 5 shown, the terminal device 5 of this embodiment includes: at least one processor 50 ( Figure 5 only one is shown in the figure), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50. When the processor 50 executes the computer program 52, the steps in any of the above-mentioned method embodiments of the logging method are implemented.
[0156] The terminal device 5 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art can understand that Figure 5 this is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than those shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0157] The so-called processor 50 may be a central processing unit (CPU). The processor 50 may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0158] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as the hard disk or memory of the terminal device 5. In other embodiments, the memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk equipped on the terminal device 5, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 51 may also include both the internal storage unit and the external storage device of the terminal device 5. The memory 51 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program. The memory 51 may also be used to temporarily store data that has been output or will be output.
[0159] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0160] The embodiments of this application also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
[0161] The embodiments of this application provide a computer program product, and when the computer program product runs on a mobile terminal, the mobile terminal can execute to implement the steps in the foregoing method embodiments.
[0162] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-mentioned embodiment methods of this application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate forms, etc. The computer-readable medium can at least include: any entity or device capable of carrying the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium may not be an electrical carrier signal and a telecommunication signal.
[0163] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0164] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0165] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical or other forms.
[0166] The unit described as a separating component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A logging method, characterized in that, Including: Analyze the root description file of the target device for diagnosing and configuring the vehicle electronic control unit of the vehicle, find the configuration information of the target device, determine the path of the D-PDU API interface through the configuration information, and load the D-PDU API interface based on the path of the D-PDU API interface to facilitate the invocation of the D-PDU API interface; Invoke the PDU constructor through the D-PDU API protocol and configure the corresponding PDU constructor interface parameters; Invoke the PDU constructor, analyze the PDU constructor interface parameters corresponding to the PDU constructor, obtain the log status parameter and the log save path carried by the PDU constructor interface parameters, and dynamically control the start or shutdown of the log recording function through the log status parameter carried in the D-PDU API PDU constructor interface parameters; When it is detected that the log status parameter is start, start the log recording function, generate a log file and save it in the log save path; When it is detected that the D-PDU API interface is invoked, generate log information during the vehicle diagnosis and configuration process in real time based on the D-PDU API interface and save it in the log file.
2. The logging method according to claim 1, characterized in that After parsing the PDU constructor interface parameters and obtaining the log status parameter and the log save path carried by the PDU constructor interface parameters, it includes: When it is detected that the log status parameter is shutdown, keep the log recording function shutdown.
3. The logging method according to claim 1, wherein Before invoking the PDU constructor through the D-PDU API protocol and configuring the corresponding PDU constructor interface parameters, it further includes: Analyze the rxf file of the target device to obtain the corresponding configuration information; Obtain the path of the D-PDU API interface according to the configuration information; Correspondingly, the loading of the D-PDU API interface includes: Load the D-PDU API interface through the path.
4. The logging method according to claim 1, wherein After starting the log recording function when it is detected that the log status parameter is start, generating a log file and saving it in the log save path, it further includes: Obtain the call time of the PDU constructor; Generate the name of the log file according to the call time.
5. The logging method according to claim 1, characterized in that Invoking the PDU constructor through the D-PDU API protocol and configuring the corresponding PDU constructor interface parameters includes: Initialize the D-PDU API interface library according to the D-PDU API protocol; After detecting that the initialization process is completed, invoke the PDU constructor and configure the corresponding PDU constructor interface parameters.
6. The logging method according to any one of claims 1 to 5, characterized in that, The method further includes: When a path change instruction is received, invoke the PDU constructor based on the path change instruction to obtain the corresponding new save path; When a new log file is detected, save the new log file to the new save path; Save all the log files stored in the log save path to the new save path and delete all the log files in the log save path.
7. A logging device, characterized in that, Including: A first parsing module, configured to parse a root description file of a target device for diagnosing and configuring a vehicle electronic control unit of a vehicle, find configuration information of the target device, determine a path of a D-PDU API interface based on the configuration information, and load the D-PDU API interface based on the path of the D-PDU API interface, so as to facilitate calling the D-PDU API interface; Call a PDU constructor through a D-PDU API protocol and configure corresponding PDU constructor interface parameters; Call the PDU constructor, parse the PDU constructor interface parameters corresponding to the PDU constructor, obtain a log status parameter and a log saving path carried by the PDU constructor interface parameters, and dynamically control starting or closing of a log recording function through the log status parameter carried in the D-PDU API PDU constructor interface parameters; A log generation module, configured to start a log recording function when detecting that the log status parameter is start, generate a log file and save the log file in the log saving path; A log recording module, configured to generate corresponding log information and save the log information in the log file when detecting a call to the D-PDU API interface.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for acquiring log based on in-vehicle infotainment system and electronic device
CN112988549A