Database file generation method and device, electronic equipment and medium

The automatic generation of DBC files through pin classification and message key information creation addresses the inefficiency of manual signal addition, enhancing the speed and efficiency of DBC file production.

CN119166596APending Publication Date: 2024-12-20CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411153169.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The manual generation of Database Base Connectivity (DBC) files for Controller Area Network (CAN) bus communication is cumbersome and time-consuming, especially for projects with a large number of signals, affecting efficiency.

Method used

A method and device that automatically generate DBC files by classifying pins based on their names in a hardware schematic file, generating message key information based on pin and signal types, and using this information to create a controller area network database file.

Benefits of technology

Automatically generates DBC files, reducing the need for manual signal addition, saving developer time, and significantly improving generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166596A_ABST
    Figure CN119166596A_ABST
Patent Text Reader

Abstract

The invention relates to a database file generation method and device, electronic equipment and a medium. The database file generation method comprises the steps that a hardware schematic diagram file is acquired; performing pin classification according to the pin name of each pin in the hardware schematic diagram file to obtain the pin type of each pin; based on the pin type, combining the signal type of each pin to generate message key information; and generating the controller local area network database file corresponding to the hardware schematic diagram file by using the message key information, thereby realizing automatic generation of the controller local area network database file, solving the problem caused by manual signal addition in the generation of the controller local area network database file in the prior art, and improving the generation efficiency of the controller local area network database file. And the generation efficiency of the controller local area network database file is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automotive electronic technology, and in particular to a database file generation method, device, electronic equipment and medium. Background Art

[0002] With the rapid development of automotive electronics technology, Database Base Connectivity (DBC) files are used to describe the communication protocol of the Controller Area Network (CAN) bus, playing a vital role in the development, diagnosis and testing of automotive electronics.

[0003] Specifically, the DBC file describes the communication information on the CAN bus and is an important bridge for data exchange between different nodes on the CAN bus. It enables communication and interconnection between nodes of different manufacturers and models, and realizes system integration and function expansion. At present, DBC files are usually generated by developers using software to manually add signal messages. However, the manual method of adding signals is particularly cumbersome, especially for projects with a large number of signals. Generating a DBC file requires a lot of time and effort, which affects the efficiency of DBC file generation. Summary of the invention

[0004] In view of this, the present application provides a database file generation method, device, electronic device and medium to automatically generate a DBC file based on a hardware schematic file, thereby solving the problem of low efficiency of database file generation due to manual signal addition in the existing related technology.

[0005] In a first aspect, the present application provides a method for generating a database file, comprising:

[0006] Get the hardware schematic file;

[0007] Classify the pins according to the pin names of the pins in the hardware schematic file to obtain the pin type of each pin;

[0008] Based on the pin type and in combination with the signal type of each pin, generate key information of the message;

[0009] The key information of the message is used to generate a controller area network database file corresponding to the hardware schematic file.

[0010] Optionally, obtaining the hardware schematic file includes:

[0011] Obtain hardware and software interface specification files;

[0012] If the file format of the hardware-software interface specification file meets the preset format requirement, the hardware-software interface specification file is determined as the hardware schematic file.

[0013] Optionally, the pin classification is performed according to the pin name of each pin in the hardware schematic file to obtain the pin type of each pin, including:

[0014] Determine the pin name of each pin in the hardware schematic file;

[0015] According to the pin names, all pins in the hardware schematic file are classified to obtain the pin type of each pin.

[0016] Optionally, the generating of the message key information based on the pin type and in combination with the signal type of each pin includes:

[0017] Determine, according to the pin type, pin generation information corresponding to each pin configuration, wherein the pin generation information includes signal generation information, and the signal generation information is used to generate a transmission signal corresponding to the pin;

[0018] Based on the signal type of each pin, determine the message group to which the transmission signal corresponding to each pin belongs;

[0019] The message key information is generated according to the signal information of the message grouping.

[0020] Optionally, based on the signal type of each pin, determining the message group to which the transmission signal corresponding to each pin belongs includes:

[0021] Determine the signal transmission direction of each pin;

[0022] Determine the signal type of each pin according to the signal transmission direction of each pin;

[0023] Based on the signal type, the transmission signal corresponding to each pin is classified into a target message group, and the target message group is the message group to which the transmission signal belongs.

[0024] Optionally, the pin generation information further includes message generation information, and the pin generation information corresponding to each pin configuration is determined according to the pin type, including:

[0025] When the pin type belongs to a preset first pin classification, obtaining pin configuration information;

[0026] The pin configuration information is used to determine the signal generation information and the message generation information, and the message generation information is used to generate the message transmitted by the pin.

[0027] Optionally, the pin generation information further includes communication message information of a controller area network bus, and the pin generation information corresponding to each pin configuration is determined according to the pin type, including:

[0028] Determining whether the pin type belongs to the pin classification of the controller area network bus;

[0029] If the pin type belongs to the pin classification, obtaining message configuration information set for the controller area network bus;

[0030] The communication message information is generated using the message configuration information.

[0031] In a second aspect, the present application provides a database file generation device, comprising:

[0032] File acquisition module, used to obtain hardware schematic files;

[0033] A pin classification module, used to classify pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin;

[0034] A message key information generation module, used to generate message key information based on the pin type and the signal type of each pin;

[0035] The file generation module is used to generate a controller local area network database file corresponding to the hardware schematic file by using the key information of the message.

[0036] In a third aspect, the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0037] Memory, used to store computer programs;

[0038] The processor is used to implement the steps of the database file generation method as described in any one of the first aspects of the present application when executing the program stored in the memory.

[0039] In a fourth aspect, the present application provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the steps of the database file generation method as described in any one of the first aspects of the present application.

[0040] The embodiment of the present application obtains a hardware schematic file, and classifies the pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin, and then generates message key information based on the pin type in combination with the signal type of each pin, so as to generate a controller LAN database file corresponding to the hardware schematic file by using the message key information, thereby realizing automatic generation of the controller LAN database file, solving the problem in the existing related technology that the generation of the controller LAN database file requires manual addition of signals, saving the developer's time in manually adding signals, reducing a large amount of repetitive work, and effectively improving the generation efficiency of the controller LAN database file. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0044] Figure 1 A flowchart of a method for generating a database file provided in an embodiment of the present application;

[0045] Figure 2 A structural block diagram of a database file generating device provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0048] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0049] The following is an illustrative description of the embodiments of the present application, but it should be noted that the embodiments of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.

[0050] Specifically, the DBC file, as a CAN bus database file, contains all communication information on the CAN bus, such as message ID, signal, signal parsing rules, etc., to provide key information for the parsing and analysis of CAN bus data, thereby realizing data exchange and communication in the CAN bus network.

[0051] In order to solve the problem in the existing related art that DBC file generation requires a lot of time and effort due to the manual addition of signals, the present application provides a database file generation method, device, electronic device and medium, by obtaining a hardware schematic file, and classifying pins according to the pin names of each pin in the hardware schematic file, so as to generate message key information based on the pin type and the signal type of each pin, and then use the message key information to generate a controller LAN database file corresponding to the hardware schematic file, thereby realizing automatic generation of the controller LAN database file based on the hardware schematic file, thereby solving the problem in the existing related art that the generation of the controller LAN database file requires manual addition of signals, saving the time of developers in manually adding signals, reducing a lot of repetitive work, and thus effectively improving the generation efficiency of the controller LAN database file.

[0052] Figure 1 A flowchart of a method for generating a database file provided in an embodiment of the present application. The method for generating a database file provided in an embodiment of the present application may include the following steps:

[0053] Step 110, obtaining a hardware schematic file;

[0054] Among them, the hardware original drawing file may refer to a hardware schematic file, which may contain information such as pin names, input and output direction information of the pins, and some pre-set parameter information, so that a DBC file can be automatically generated based on the hardware schematic file in the future, saving developers' time.

[0055] For example, to save development time, the Hardware Software Interface Spec (HSIS) file output by the hardware development can be obtained as a hardware schematic file. Among them, the information contained in the HSIS file includes various information required by the pins configured by the software, which can specifically include but is not limited to the pin names of the common pins of the modules such as ADC, DIO, PWM, ICU, etc., and the embodiments of the present application do not limit this.

[0056] Step 120, classifying the pins according to the pin names of the pins in the hardware schematic file to obtain the pin type of each pin;

[0057] Specifically, after obtaining the hardware schematic file, the embodiment of the present application can classify all pins in the hardware schematic original file according to the pin names in the hardware schematic file. For example, when the pin names are named according to the pin signals, the pins can be classified according to the signal names in the pin names to classify all the pins in the hardware schematic original file, thereby determining the pin type of each pin, so that it can be determined subsequently whether the pin needs to generate corresponding DBC messages and DBC signals according to the pin type.

[0058] Step 130, based on the pin type and in combination with the signal type of each pin, generate key message information;

[0059] Among them, the signal type of the pin may refer to the type of signal transmitted by the pin, and can be specifically used to determine whether the signal transmitted by the pin is a sending signal or a receiving signal. For example, the signal type of the pin may include a sending signal type and a receiving signal type, etc., and the embodiment of the present application does not limit this. In this step, the embodiment of the present application can determine for each pin whether the pin needs to generate a DBC message and a DBC signal according to the pin type, and can determine whether the signal to be generated by the pin is a sending signal or a receiving signal according to the signal type of the pin, so as to classify the signal to be generated by the pin into a suitable message group according to the signal type, and then generate the message key information corresponding to the hardware schematic file according to the signal information in the message group, so that the controller local area network database file corresponding to the hardware schematic file can be automatically generated using the message key information later.

[0060] Step 140: Generate a controller area network database file corresponding to the hardware schematic file using the key information of the message.

[0061] Specifically, after obtaining the message key information corresponding to the hardware schematic file, the embodiment of the present application can store the message key information in a database to automatically generate a controller LAN database file corresponding to the hardware schematic file based on the message key information, thereby realizing the automatic generation of the controller LAN database file, without the need for developers to manually add and organize the signals and messages required to be generated by the pins in the hardware schematic file, thereby saving developers time in organizing signals and messages and reducing a large amount of repetitive work.

[0062] In summary, the embodiment of the present application obtains a hardware schematic file, and classifies the pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin, and then generates message key information based on the pin type and the signal type of each pin, so as to utilize the message key information to generate a controller LAN database file corresponding to the hardware schematic file, thereby realizing automatic generation of the controller LAN database file, solving the problem in the existing related technology that the generation of the controller LAN database file requires manual addition of signals, saving developers time in manually adding signals, reducing a large amount of repetitive work, and effectively improving the generation efficiency of the controller LAN database file.

[0063] For example, in the development process, the HSIS file is an indispensable file for communication between hardware engineers and the underlying software development project. The embodiment of the present application can obtain an HSIS file of a certain format as a hardware schematic file, and use the various pin names contained in the HSIS file to classify all the pins in the hardware schematic file to obtain the pin classification of each pin. Optionally, the embodiment of the present application obtains the hardware schematic file, including: obtaining a hardware-software interface specification file; if the file format of the hardware-software interface specification file meets the preset format requirements, the hardware-software interface specification file is determined as the hardware schematic file. Among them, the preset format requirements may refer to the format requirements set in advance for module identification and information extraction, which can be specifically set by the developer according to the module identification requirements and information extraction needs, and the embodiment of the present application does not limit this.

[0064] For example, after obtaining a certain HSIS file, the file format of the HSIS file can be determined, such as the file format of the HSIS file can be determined based on the suffix of the file name, and then the file format of the HSIS file can be determined by judging whether the file format of the HSIS file is a preset file format to determine whether the HSIS file can meet the requirements of module identification and information extraction. Therefore, when the file format of the HSIS file is a preset file format, it can be considered that the HSIS file can meet the requirements of module identification and information extraction, that is, the file format of the HSIS file meets the preset format requirements; and when the file format of the HSIS file does not belong to the preset file format, it is considered that the HSIS file can meet the requirements of module identification and information extraction, and then it can be considered that the currently acquired HSIS file does not meet the preset format requirements, and then the HSIS file can be ignored or deleted. The embodiments of the present application are not limited to this.

[0065] When it is determined that the currently acquired HSIS file meets the preset format requirements, the HSIS file can be directly determined as a hardware schematic file, so as to classify the pins according to the pin names in the HSIS file in turn, and obtain the pin classification generated after the pin classification. Among them, the pin classification generated after the pin classification can include the pin classification of each pin in the hardware schematic file. Optionally, the embodiment of the present application classifies the pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin, which can specifically include the following sub-steps:

[0066] Sub-step S11, determining the pin name of each pin in the hardware schematic file;

[0067] Sub-step S12, classifying all pins in the hardware schematic file according to the pin names to obtain the pin type of each pin.

[0068] As an example of the present application, a hardware engineer can list all pins that require software configuration in an HSIS file. When the file format of the HSIS file meets the preset format requirements, the HSIS file can be used as a hardware schematic file. Subsequently, all pins can be classified according to the pin names in the HSIS file. For example, when the pin name is a model signal name, all signals can be classified according to the letters before the first horizontal line of the signal name. If a horizontal line is preceded by a combination of the same letters and different numbers, such as HSD1_DO_EN / HSD2_DO_EN, they need to be divided into two different groups. Thus, the type of pin classification can be determined according to the signal classification as the pin type.

[0069] After the pins are classified, the embodiment of the present application can determine whether each pin needs to generate a corresponding DBC message and DBC signal according to the pin type obtained after the pin classification, and determine whether the signal generated by the pin is a sending signal or a receiving signal according to the input and output direction of each pin in the HSIS file, and then classify the signal into a suitable message group according to the signal type, so that the message key information can be generated according to the signal information in the message group. Optionally, the embodiment of the present application generates the message key information based on the pin type and the signal type of each pin, which can specifically include the following sub-steps:

[0070] Sub-step S21, determining pin generation information corresponding to each pin according to the pin type, wherein the pin generation information includes signal generation information, and the signal generation information is used to generate a transmission signal corresponding to the pin;

[0071] Sub-step S22, determining the message group to which the transmission signal corresponding to each pin belongs based on the signal type of each pin;

[0072] Sub-step S23, generating the message key information according to the signal information of the message grouping.

[0073] Among them, the transmission signal corresponding to the pin may refer to the signal that the pin needs to transmit, such as including a sending signal and / or a receiving signal, and the implementation of this application does not limit this. Specifically, after the pins are classified, the embodiment of the present application can determine for each pin whether the pin needs to generate a corresponding DBC message and DBC signal according to the pin type, and can generate the pin generation information corresponding to the configuration of the pin according to the DBC message and / or DBC signal that the pin needs to generate, so that the pin generation information can be used to generate the DBC message and / or DBC signal that the pin needs to generate.

[0074] Of course, the pin generation information in the embodiment of the present application may include other information in addition to the signal generation information, such as message generation information, so that the message generation information can be used to generate the message required by the pin later.

[0075] Optionally, the embodiment of the present application determines the pin generation information corresponding to each pin configuration according to the pin type, which may specifically include: when the pin type belongs to the preset first pin classification, obtaining the pin configuration information; using the pin configuration information, determining the signal generation information and the message generation information, the message generation information is used to generate the message transmitted by the pin. Among them, the preset first pin classification may refer to the pin classification pre-set for the pins that need to generate DBC signals and messages, such as DC, DIO, CAN, PWM, ICU and other pin types.

[0076] For example, when the preset first pin classification includes pin types such as ADC, DIO, CAN, PWM, ICU, etc., but does not include non-first pin classifications such as SPI and IIC, when the pin is classified as pin types such as ADC, DIO, CAN, PWM, ICU, etc., that is, when the pin type of the pin is ADC, DIO, CAN, PWM or ICU, it can be considered that the pin type of the pin belongs to the preset first pin classification, and it is necessary to configure this pin to generate the corresponding DBC signal and DBC message, and the pin configuration information in the obtained HSIS file can be obtained to determine the signal generation information and message generation information of the pin by using the obtained pin configuration information, so that the signal generation information can be used to generate the DBC signal required to be generated by the pin, and the message generation information can be used to generate the DBC message required to be generated by the pin, thereby saving the developer time to organize signals and messages; and when the pin is classified as non-first pin classifications such as SPI and IIC, it can be considered that the pin type of the pin does not belong to the preset first pin classification, and it is not necessary to configure the corresponding pin to generate the DBC signal and DBC message, thereby reducing a lot of repetitive work.

[0077] Optionally, when the pin is classified as a pin classification of the CAN bus, the embodiment of the present application can determine that the pin needs to generate a CAN communication message, such as a CAN pin can generate two groups of communication messages, namely, a send message and a receive message. Therefore, in some optional embodiments of the present application, the pin generation information corresponding to the pin configuration may include the communication message information of the controller area network bus. The embodiment of the present application determines the pin generation information corresponding to each pin configuration according to the pin type, which may specifically include: judging whether the pin type belongs to the pin classification of the controller area network bus; if the pin type belongs to the pin classification of the controller area network bus, obtaining the message configuration information set for the controller area network bus; and using the message configuration information to generate communication message information. Among them, the message configuration information may refer to the information pre-configured for the controller area network bus message; the communication message information may be used to generate a communication message, and may specifically include various information for indicating how to generate a communication message, such as the number of bytes contained in the communication message. Among them, the communication message may include a send message and a receive message.

[0078] In some optional embodiments of the present application, based on the signal type of each pin, determining the message group to which the transmission signal corresponding to each pin belongs, specifically may include: determining the signal transmission direction of each pin; determining the signal type of each pin according to the signal transmission direction of each pin; and classifying the transmission signal corresponding to each pin into a target message group based on the signal type, wherein the target message group is the message group to which the transmission signal belongs. The signal transmission direction of the pin refers to the input and output direction of the pin.

[0079] As an example of the present application, it is possible to determine whether the signal generated by the pin is a sending signal or a receiving signal based on the input and output directions of each pin in the HSIS file, that is, determine the signal type of the pin based on the signal transmission direction of the pin. For example, when the signal transmission direction of the pin is IN, it is possible to determine that the signal type of the pin is an input signal type, that is, a signal is received through the pin; and when the signal transmission direction of the pin is OUT, it is possible to determine that the signal type of the pin is an output signal type, that is, a signal is sent through the pin.

[0080] After determining whether the signal corresponding to each pin is a sending signal or a receiving signal, a signal can be classified into a suitable message group according to the signal type, and then signals of different signal types can be divided into different message groups. Different message groups determine different messages and unique message codes (IDentit, ID), so that key message information can be generated based on the signal information of the message group.

[0081] Taking the microcontroller unit (MCU) as the host as an example, it can be determined based on the message configuration information that the sending message is a communication content containing 5 bytes, and then the corresponding sending message information can be generated based on the communication content of the sending message being 5 bytes as the communication message information; in addition, it can be decided whether to add a new signal based on the presence or absence of a CAN chip control signal. For example, when the CAN chip control signal includes CAN1_DO_EN / CAN1_DO_STB, etc., by identifying the pin name and extracting information, it can be found that the naming feature of the control signal is that the pin name contains both DO and CAN; when a pin with such a naming feature is found, the signal generated by this pin can be added to the message group corresponding to the sending message.

[0082] In addition, based on the message configuration information, it can be determined that the received message is a communication content containing 5 bytes, and it can also be decided whether to add a new signal based on the diagnostic information signal. For example, when the name of the diagnostic information signal includes CAN1_DI_ERR / CAN1_DI_INH, etc., it can be found that the naming feature of the diagnostic information signal is that the name contains both DI and CAN. When the pin used to transmit the diagnostic information signal with this naming feature is found, it can be determined that the pin type of this pin belongs to the pin classification of the controller LAN bus, so that the communication message information of the controller LAN bus can be obtained subsequently according to the pin type, as the pin generation information corresponding to the configuration of the pin.

[0083] After obtaining the pin generation information of the corresponding configuration of the pin, the signal required to be generated by the pin can be generated according to the pin generation information, and the generated signal can be added to the message group corresponding to the received message, and then the message key information can be generated according to the signal information in the message group. The message key information may include: message name, message type, message ID, message size, period, etc. Among them, the message name and message type can be obtained after signal classification, such as the message name can be classified according to the letter before the first horizontal line of the signal name, and the message type can be used to determine whether the message required to be generated by the pin is a sending message or a receiving message.

[0084] In one embodiment of the present application, the length of each signal can be specified in advance, for example, the length of the ADC signal is specified as 16 bits, the length of the DO signal is specified as 2 bits, the length of the DI signal is specified as 1 bit, etc. After the signal length is specified, each signal can be integrated into the same type of message group according to the alphabetical or Arabic numeral sequence of each signal, and the signal length can be accumulated, and the layout can be arranged in sequence. For example, in the case where the maximum length of a message is 8 bytes, when eight bytes are accumulated or the length of the next signal added is greater than 8 bytes, the message automatically stops adding new signals, and the Arabic numeral 1 (for example, DVTC_ADC1_OUT) can be added after the alphabetical classification name of the message, and then a new message group is added to add subsequent signals, so that the ID of the new message is the ID value of the previous message plus one, and the new message name is also the name of the previous message plus one (for example, DVTC_ADC2_OUT).

[0085] In addition, the message ID can be specified to start from hexadecimal 0x100, indicating that the message marked by the message ID is a sending message, that is, the highest bit of the message ID is 1, indicating that this message is a sending message. The message ID is specified to start from hexadecimal 0x200, indicating that the message marked by the message ID is a receiving message, that is, the highest bit of the message ID is 2, indicating that this message is a receiving message. The final message ID can be determined according to the alphabetical and Arabic numeral sequence of the message name. For example, if the ID of message ADC1_OUT is 0x214, the ID of message ADC2_OUT is 0x215; for example, when the ID of message DO1_IN is 0x105, it can be determined that the ID of message DO2_IN is 0x106.

[0086] In the embodiment of the present application, the message period can be set in advance, such as setting the period of ordinary messages to 10ms, and setting the period of memory-related messages to 100ms. For example, considering that the message period is usually only valid for output messages, that is, it is an output message for the MCU, and it is a received message for the PC-side CAN software, so it is a received message for the CAN tool software. The refresh period can be specified by the CAN tool software, such as specifying that the received message is refreshed every 10ms, and the present application example does not make specific restrictions on this.

[0087] After obtaining the key message information corresponding to the hardware schematic file, the embodiment of the present application can store the key message information in a database to obtain a database including the signal information of all pins in the HSIS file that need to generate DBC signals, and all the contents of this database, including all grouped signal information, messages, and pre-set information, can be written into an array in the script, so as to use this script to generate a DBC file as a controller LAN database file corresponding to the hardware schematic file, thereby realizing the automatic generation of DBC files, allowing developers to generate DBC files by using scripts. For example, when running the script, the script code will output all signal information and message information in all arrays as DBC files. If subsequent developers need to add custom signals and messages, they can add them based on this DBC file, thereby reducing a lot of repetitive work and saving developers time to organize signals and messages.

[0088] It should be noted that, for the purpose of simple description, the method embodiments are expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited to the described order of actions, because according to the embodiments of the present application, certain steps may be performed in other orders or simultaneously.

[0089] like Figure 2As shown, the embodiment of the present application also provides a database file generation device, which may specifically include the following modules:

[0090] The file acquisition module 210 is used to acquire the hardware schematic file;

[0091] A pin classification module 220, configured to classify pins according to the pin names of the pins in the hardware schematic file to obtain the pin type of each pin;

[0092] A message key information generating module 230, configured to generate message key information based on the pin type and in combination with the signal type of each pin;

[0093] The file generation module 240 is used to generate a controller area network database file corresponding to the hardware schematic file by using the key information of the message.

[0094] Optionally, the file acquisition module 210 includes the following submodules:

[0095] The file acquisition submodule is used to obtain the hardware and software interface specification files;

[0096] The file determination submodule is used to determine the hardware-software interface specification file obtained by the file acquisition submodule as the hardware schematic file when the file format of the hardware-software interface specification file meets the preset format requirement.

[0097] Optionally, the pin classification module 220 includes the following submodules:

[0098] A pin name determination submodule, used to determine the pin name of each pin in the hardware schematic file;

[0099] The pin classification submodule is used to classify all the pins in the hardware schematic file according to the pin names to obtain the pin type of each pin.

[0100] Optionally, the message key information generating module 230 may include the following submodules:

[0101] A pin generation information submodule, used to determine the pin generation information corresponding to each pin according to the pin type, wherein the pin generation information includes signal generation information, and the signal generation information is used to generate a transmission signal corresponding to the pin;

[0102] A message grouping submodule, used to determine the message group to which the transmission signal corresponding to each pin belongs based on the signal type of each pin;

[0103] The message key information generating submodule is used to generate the message key information according to the signal information of the message grouping.

[0104] Optionally, the message grouping submodule is specifically used to: determine the signal transmission direction of each pin; determine the signal type of each pin according to the signal transmission direction of each pin; based on the signal type, classify the transmission signal corresponding to each pin into a target message group, and the target message group is the message group to which the transmission signal belongs.

[0105] Optionally, the pin generation information further includes message generation information, and the pin generation information submodule includes the following units:

[0106] A first acquiring unit, configured to acquire pin configuration information when the pin type belongs to a preset first pin classification;

[0107] The first generating unit is used to use the pin configuration information to determine the signal generating information and the message generating information, wherein the message generating information is used to generate the message transmitted by the pin.

[0108] Optionally, the pin generation information further includes communication message information of a controller area network bus, and the pin generation information submodule includes:

[0109] A judging unit, used for judging whether the pin type belongs to the pin classification of the controller area network bus;

[0110] A second acquisition unit, configured to acquire, when the pin type belongs to the pin classification, message configuration information set for the controller area network bus;

[0111] The second generating unit is used to generate communication message information by using the message configuration information.

[0112] In a specific implementation, the above-mentioned database file generating device can be integrated in an electronic device, so that the electronic device obtains the hardware schematic file and classifies the pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin, and then generates message key information based on the pin type and the signal type of each pin, so as to generate the controller LAN database file corresponding to the hardware schematic file by using the message key information, thereby realizing the automatic generation of the controller LAN database file, solving the problem caused by the need to manually add signals in the generation of the controller LAN database file in the existing related technology, thereby saving the developer's time for manually adding signals, reducing a lot of repetitive work, and being able to effectively improve the generation efficiency of the controller LAN database file.

[0113] like Figure 3As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114, and the memory 113 is used to store computer programs; the processor 111 is used to implement the steps of the database file generation method provided by any of the aforementioned method embodiments when executing the program stored in the memory 113.

[0114] In one embodiment of the present application, the processor 111, when used to execute the program stored in the memory 113, implements the database file generation method provided by any of the aforementioned method embodiments, including: obtaining a hardware schematic file; classifying pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin; based on the pin type, combined with the signal type of each pin, generating message key information; using the message key information, generating a controller local area network database file corresponding to the hardware schematic file.

[0115] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the database file generation method provided in any of the aforementioned method embodiments are implemented.

[0116] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0118] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0119] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating a database file, characterized in that: include: Get the hardware schematic file; Classify the pins according to the pin names of the pins in the hardware schematic file to obtain the pin type of each pin; Based on the pin type and in combination with the signal type of each pin, generate key information of the message; The key information of the message is used to generate a controller area network database file corresponding to the hardware schematic file.

2. The method for generating a database file according to claim 1, characterized in that: The obtaining of the hardware schematic file includes: Obtain hardware and software interface specification files; If the file format of the hardware-software interface specification file meets the preset format requirement, the hardware-software interface specification file is determined as the hardware schematic file.

3. The method for generating a database file according to claim 1, characterized in that: The pin classification is performed according to the pin name of each pin in the hardware schematic file to obtain the pin type of each pin, including: Determine the pin name of each pin in the hardware schematic file; According to the pin names, all pins in the hardware schematic file are classified to obtain the pin type of each pin.

4. The method for generating a database file according to claim 1, characterized in that: The generating of the key information of the message based on the pin type and the signal type of each pin includes: Determine, according to the pin type, pin generation information corresponding to each pin configuration, wherein the pin generation information includes signal generation information, and the signal generation information is used to generate a transmission signal corresponding to the pin; Based on the signal type of each pin, determine the message group to which the transmission signal corresponding to each pin belongs; The message key information is generated according to the signal information of the message grouping.

5. The method for generating a database file according to claim 4, characterized in that: Based on the signal type of each pin, determine the message group to which the transmission signal corresponding to each pin belongs, including: Determine the signal transmission direction of each pin; Determine the signal type of each pin according to the signal transmission direction of each pin; Based on the signal type, the transmission signal corresponding to each pin is classified into a target message group, and the target message group is the message group to which the transmission signal belongs.

6. The method for generating a database file according to claim 4, characterized in that: The pin generation information further includes message generation information, and the pin generation information corresponding to each pin configuration is determined according to the pin type, including: When the pin type belongs to a preset first pin classification, obtaining pin configuration information; The pin configuration information is used to determine the signal generation information and the message generation information, and the message generation information is used to generate the message transmitted by the pin.

7. The method for generating a database file according to claim 4, characterized in that: The pin generation information further includes communication message information of the controller area network bus. The pin generation information corresponding to each pin configuration is determined according to the pin type, including: Determining whether the pin type belongs to the pin classification of the controller area network bus; If the pin type belongs to the pin classification, obtaining message configuration information set for the controller area network bus; The communication message information is generated using the message configuration information.

8. A database file generating device, characterized in that: include: File acquisition module, used to obtain hardware schematic files; A pin classification module, used to classify pins according to the pin names of each pin in the hardware schematic file to obtain the pin type of each pin; A message key information generation module, used to generate message key information based on the pin type and the signal type of each pin; The file generation module is used to generate a controller local area network database file corresponding to the hardware schematic file by using the key information of the message.

9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the database file generation method as described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the steps of the database file generation method as described in any one of claims 1-7.