Code generation method and device of vehicle driving module and storage medium
By acquiring and encapsulating the configuration requirements and interface information of the vehicle's target drive module, configuration code that meets user needs is generated, solving the problem that existing technologies cannot generate configuration code for diverse drive modules, and improving the accuracy and efficiency of configuration.
Patent Information
- Application Number
- CN202211139809.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-09-19
AI Technical Summary
Existing vehicle drive module configuration specifications cannot meet diverse needs, especially for software drive modules that do not conform to unified standard documents, and cannot generate configuration code that meets user requirements.
By obtaining the configuration requirements of the vehicle target drive module, obtaining the interface declaration information and interface call method information, and encapsulating them, the configuration code corresponding to the target drive module is generated, including the interface declaration code and the interface call method code.
It enables driver modules that do not conform to the preset standard format to successfully generate configuration code, meeting the specific configuration requirements of the target driver module, improving the accuracy and efficiency of configuration, and avoiding errors in manually correcting configuration code later.
Smart Images

Figure CN115576532B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of vehicle basic software, and particularly relates to a code generation method and device of a vehicle driving module, a storage medium and an electronic device. BACKGROUND
[0002] With the rapid development of the automobile industry, people's demand for vehicle driving modules is gradually diversified. For the initialization of the software driving module of the vehicle control unit management module, a unified standard file is generally used to specify the related configuration specification, but the existing related configuration specification cannot meet the diversified vehicle driving modules, and the configuration generation result of the software driving module that does not conform to the unified standard file specification cannot meet the user's demand. SUMMARY
[0003] In order to solve at least one of the above technical problems, the present disclosure provides a code generation method, device, storage medium and electronic device of a vehicle driving module.
[0004] According to an aspect of the present disclosure, a code generation method of a vehicle driving module is provided, which comprises:
[0005] obtaining configuration requirement information of a target driving module of a vehicle;
[0006] if the configuration requirement information does not match a preset standard format, obtaining interface declaration information and interface calling method information of the target driving module;
[0007] performing encapsulation processing on the interface declaration information and the interface calling method information to generate configuration code corresponding to the target driving module, wherein the configuration code comprises interface declaration code and interface calling method code.
[0008] In some possible implementation manners, the method further comprises:
[0009] if the configuration requirement information matches the preset standard format, obtaining the interface declaration information and interface content information of the target driving module;
[0010] performing encapsulation processing on the interface declaration information and the interface content information to generate configuration code corresponding to the target driving module.
[0011] In some possible implementation manners, the method further comprises:
[0012] initializing the target driving module based on the configuration code.
[0013] In some possible implementation manners, before the initialization of the target driving module based on the configuration code, the method further comprises:
[0014] obtain control unit identification information corresponding to the target driver module;
[0015] The initializing the target driver module based on the configuration code comprises:
[0016] The method further comprises:
[0017] In some possible implementation manners, before the obtaining the interface declaration information and the interface calling method information of the target driver module, the method further comprises:
[0018] extracting calling requirement information in the configuration requirement information;
[0019] format-converting the calling requirement information based on a preset format to obtain the interface calling method information.
[0020] In some possible implementation manners, the method further comprises:
[0021] adding configuration option information corresponding to the target driver module into a configuration page corresponding to the target driver module to obtain a target configuration page corresponding to the target driver module;
[0022] In response to a configuration display request for the target driver module, displaying the target configuration page on a target interface.
[0023] In some possible implementation manners, the interface content information comprises an interface name, an interface type, and an interface input parameter type,
[0024] The method further comprises:
[0025] The method further comprises:
[0026] According to a second aspect of the present disclosure, a code generation apparatus of a vehicle driver module is provided, and the apparatus comprises:
[0027] A first information obtaining module is configured to obtain configuration requirement information of a target driver module of a vehicle;
[0028] A second information obtaining module is configured to, in a case where the configuration requirement information does not match a preset standard format, obtain interface declaration information and interface calling method information of the target driver module;
[0029] The configuration code generation module is configured to encapsulate the interface declaration information and the interface calling method information, and generate configuration code corresponding to the target drive module, wherein the configuration code comprises interface declaration code and interface calling method code.
[0030] According to a third aspect of the present disclosure, an electronic device is provided, comprising at least one processor, and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the code generation method of the vehicle drive module according to any one of the first aspect by executing the instructions stored in the memory.
[0031] According to a fourth aspect of the present disclosure, a computer readable storage medium is provided, wherein the computer readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the code generation method of the vehicle drive module according to any one of the first aspect.
[0032] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, but not limiting the present disclosure.
[0033] The present disclosure is implemented, and has the following beneficial effects:
[0034] By obtaining the configuration requirement information of the target drive module of the vehicle, the specific configuration requirement of the target drive module is understood; in the case that the configuration requirement information does not match the preset standard format, the interface declaration information and the interface calling method information of the target drive module are obtained, and the configuration information meeting the requirement of the target drive module is obtained, so as to ensure the expected generation result; the interface declaration information and the interface calling method information are encapsulated, and the configuration code corresponding to the target drive module is generated, so that the drive module not meeting the preset standard format can successfully generate the configuration code.
[0035] Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions and advantages of the embodiments or prior art in the specification, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0037] Figure 1A flowchart of a code generation method of a vehicle drive module according to an embodiment of the present disclosure is shown.
[0038] Figure 2 A structural diagram of a configuration interface of a target drive module according to an embodiment of the present disclosure is shown.
[0039] Figure 3 A flowchart of a code generation method of a vehicle drive module according to an embodiment of the present disclosure is shown.
[0040] Figure 4 A structural diagram of a configuration interface of a target drive module according to an embodiment of the present disclosure is shown.
[0041] Figure 5 A flowchart of an interface calling method information acquisition method according to an embodiment of the present disclosure is shown.
[0042] Figure 6 A flowchart of a target configuration page display method according to an embodiment of the present disclosure is shown.
[0043] Figure 7 A flowchart of a code generation method of a vehicle drive module according to an embodiment of the present disclosure is shown.
[0044] Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present disclosure will be clearly and completely described in the embodiments of the present disclosure in combination with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present disclosure, but not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present disclosure.
[0046] It should be noted that the terms "first", "second", and the like in the specification and claims of the present disclosure and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.
[0047] Various exemplary embodiments, features, and aspects of the present disclosure will be described below with reference to the accompanying drawings. Like reference numerals in the drawings denote like or similar elements. Although various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless specifically noted.
[0048] The term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
[0049] The term "and / or" used in the present text is only used to describe association relationship of associated objects, and means that three relationships can exist, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" in the present text means any one of a plurality or any combination of at least two of a plurality, for example, at least one of A, B, and C includes any one or more elements selected from the set consisting of A, B, and C.
[0050] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the specific embodiments below. Those skilled in the art should understand that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, elements and circuits well known to those skilled in the art are not described in detail in order to highlight the main idea of the present disclosure.
[0051] In the prior art, for the initialization call configuration of a drive module conforming to the classic automotive open system architecture platform (AUTOSAR Classic Platform, CP AUTOSAR) specification, the related configuration can be normally referred to the CP AUTOSAR specification to generate the related call code. The short name (Short Name), module service type (EcuMModuleService), and module parameter type (EcuMModuleParameter) of the drive module are configured, the declaration header file in which the initialization function of the initialization drive module is generated according to the shortName, and the initialization function usage method of the initialization drive module Adc is generated according to the shortName, EcuMModuleService, and EcuMModuleParameter. However, for some drive modules that do not conform to the CP AUTOSAR specification or are user-defined, the related call code cannot be normally generated according to the CP AUTOSAR specification. Therefore, the present disclosure adds related configurations of the drive module, so that the drive modules conforming to and not conforming to the CP AUTOSAR specification can normally generate the related call code. The running environment of the present disclosure can be an electronic control unit state management module (ECU State Management, EcuM) configured with CP AUTOSAR, which can define the terminal device of the related configuration specification EcuMDriverInitItem.
[0052] Figure 1 A flowchart of a code generation method of a vehicle drive module according to an embodiment of the present disclosure is shown as follows, Figure 1 The method includes the following steps.
[0053] S101, obtaining configuration requirement information of a target drive module of a vehicle;
[0054] The electronic control unit state management module obtains the configuration requirement information of the target drive module to be configured, and understands the specific configuration requirement of the target drive module. The configuration requirement information includes the configuration requirement of the target drive module.
[0055] S102, in the case that the configuration requirement information does not match the preset standard format, obtaining interface declaration information and interface call method information of the target drive module;
[0056] The electronic control unit state management module judges whether the configuration requirement information matches the preset standard format. If not, it indicates that the target drive module does not conform to the preset standard document, and the existing preset standard format cannot meet the configuration requirement of the target drive module. At this time, the interface declaration information and the interface call method information of the target drive module are obtained, and the interface call method information includes the compilation method of the initialization function of the target drive module.
[0057] In one embodiment, a configuration interface can be provided, and configuration information of the target drive module is received based on the configuration interface. The configuration information of the target drive module includes, but is not limited to, configuration corresponding to a preset standard format, interface declaration information, interface calling method, module name and control unit identification information. The interface declaration information is used to configure a declaration header file where an initialization function of the target drive module is located; the interface calling method is used to configure a usage method of the initialization function of the target drive module; and the module name is used to configure a name of the target drive module. The configuration corresponding to the preset standard format includes, but is not limited to, a configuration name, an interface type and an interface input parameter type. The configuration name is used to name a configuration name corresponding to the target drive module, the interface type is used to configure a type of the initialization function of the target drive module, and the interface input parameter type is used to configure a definition of a function prototype and a parameter passed to the function. The preset standard format cannot meet the configuration requirement of the target drive module, and therefore, the interface declaration information and the interface calling method information are acquired to explicitly determine the configuration requirement of the target drive module.
[0058] In one embodiment, the configuration name is a short name (shortName), the interface type is a module service type (EcuMModuleService), the interface input parameter type is a module parameter type (EcuMModuleParameter), the interface declaration information is a declaration header file (EcuMItemHeaderFile), the interface calling method information is a module content (EcuMItemContent) and a module name (EcuMItemName). The target drive module is an Xyyy module, the configuration requirement of the Xyyy module is “EcuMItemHeaderFile: Xyyy_Init.h, EcuMItemContent: Xyyy_Init(Xyyy_CfgInfo)”, the interface declaration information of the Xyyy module is Xyyy_Init.h, and the calling method information of the Xyyy module is Xyyy_Init(Xyyy_CfgInfo).
[0059] S103, encapsulating the interface declaration information and the interface calling method information to generate configuration code corresponding to the target drive module,
[0060] The configuration code includes interface declaration code and interface calling method code.
[0061] The electronic control unit state management module encapsulates the interface declaration information based on the preset framework to generate interface declaration code corresponding to the target drive module, and encapsulates the interface calling method information to generate interface calling method code.
[0062] Please refer to Figure 2, exemplary, based on the automobile open system architecture platform, obtaining the EcuMItemHeaderFile:Xyyy_Init.h configuration of the target drive module Xyyy module, obtaining the interface declaration information Xyyy_Init.h, based on the interface declaration information Xyyy_Init.h, generating the declaration header file in which the initialization function of the initialization drive module is located: #include "Xyyy_Init.h" ; according to the EcuMItemContent:Xyyy_Init(Xyyy_CfgInfo) configuration of the Xyyy module, obtaining the interface calling method information Xyyy_Init(Xyyy_CfgInfo), based on the interface calling method information Xyyy_Init(Xyyy_CfgInfo), generating the initialization function usage method of the initialization drive module Xyyy: Xyyy_Init(Xyyy_CfgInfo).
[0063] The specific configuration requirements of the target drive module are determined, and in the case that the configuration requirement information does not match the preset standard format, configuration information meeting the requirements of the target drive module is obtained, so that the expected generation result is ensured, and the configuration code of the drive module that does not match the preset standard format can be successfully generated.
[0064] Please refer to Figure 3 In some embodiments, the method further comprises:
[0065] S201, in the case that the configuration requirement information matches the preset standard format, obtaining the interface declaration information and the interface content information of the target drive module;
[0066] S202, encapsulating the interface declaration information and the interface content information to generate the configuration code corresponding to the target drive module.
[0067] The electronic control unit state management module determines whether the configuration requirement information matches the preset standard format. If it matches, it means that the target drive module meets the preset standard document, and the existing preset standard format can meet the configuration requirements of the target drive module. At this time, the interface declaration information and the interface content information of the target drive module are obtained, the interface content information includes the interface name, the interface type and the interface input parameter type. The interface declaration information is encapsulated to generate the interface declaration code, and the interface content information is encapsulated to generate the interface calling method code.
[0068] Please refer to Figure 4, exemplary, the target driving module is an Adc module, the configuration requirement of the Adc module is "EcuMItemHeaderFile: Adc.h; EcuMItemName: Adc; EcuMModuleService: Init; EcuMModuleParameter: POSTBUILD_PTR", the interface declaration information of the Adc module is Adc.h, the calling content information of the Adc module is that the interface name is Adc, the interface type is Init, and the interface input parameter type is POSTBUILD_PTR. Based on the interface declaration information Adc.h, a declaration header file in which an initialization function of the initialization driving module is generated: #include "Adc.h"; based on the calling content information that the interface name is Adc, the interface type is Init, and the interface input parameter type is POSTBUILD_PTR, an interface calling method code of the initialization function of the initialization driving module Adc is generated: Adc_Init (& Adc_Config).
[0069] For the initialization calling configuration of the driving module conforming to the CP AUTOSAR specification, the related interface configuration can be normally referred to the CP AUTOSAR specification, and the related interface calling method code is generated.
[0070] In some embodiments, the method further comprises:
[0071] S301, initializing the target driving module based on the configuration code.
[0072] When the target driving module has an initialization requirement, the configuration code corresponding to the target driving module needs to be compiled to complete the initialization of the target driving module.
[0073] The configuration code is used to generate an initialization result conforming to the user's expectation, to ensure the correctness of the configuration of the target driving module, to avoid the user manually correcting the configuration code of the target driving module due to errors in the later application process, and to greatly reduce the configuration efficiency.
[0074] In some embodiments, before initializing the target driving module based on the configuration code, the method further comprises:
[0075] S401, obtaining control unit identification information corresponding to the target driving module;
[0076] Initializing the target driving module based on the configuration code comprises:
[0077] Compiling the configuration code to obtain a target configuration program of the target driving module.
[0078] In one embodiment, before initializing the target drive module based on the configuration code, the control unit identification information of the configuration is acquired, and the control unit identification information points to the kernel of the electronic control unit where the target drive module initialization is performed.
[0079] In one embodiment, the control unit identification information can be an electronic control unit control kernel index (EcuMEcucCoreDefinitionRef), and the kernel of the electronic control unit where the target drive module initialization is performed is determined according to the electronic control unit control kernel index. When the target drive module needs to be initialized, the kernel of the electronic control unit is controlled to initialize the target drive module. If the acquired control unit identification information is empty, the default kernel of the electronic control unit is used as the place to initialize the target drive module.
[0080] The kernel of the electronic control unit where the target drive module initialization is performed is quickly located, and the efficiency of the target drive module initialization is improved.
[0081] Please refer to Figure 5 In some embodiments, before acquiring the interface declaration information and the interface calling method information of the target drive module, the method comprises:
[0082] S501, extracting the calling requirement information in the configuration requirement information;
[0083] S502, performing format conversion on the calling requirement information based on a preset format to obtain the interface calling method information.
[0084] The calling requirement information in the configuration requirement information written by the user based on the requirement is extracted, and the calling requirement information is converted into a preset format to obtain the interface calling method. The target drive module that does not conform to the preset specification can be obtained, accurate interface calling method code can be generated, and the efficiency of the configuration is improved.
[0085] Please refer to Figure 6 In some embodiments, the method further comprises:
[0086] S601, adding the configuration option information corresponding to the target drive module to the configuration page corresponding to the target drive module to obtain the target configuration page corresponding to the target drive module;
[0087] S602, in response to a configuration display request for the target drive module, displaying the target configuration page on the target interface.
[0088] Optionally, all configuration option information corresponding to the target driver module is added to a configuration interface corresponding to the configuration directory information of the target driver module, to obtain a target configuration interface. When receiving a configuration display request of the target driver module, all configuration option information corresponding to the target driver module is displayed on the target interface. This helps the user to quickly view the specific configuration options of the target driver module initialization, and improves the configuration efficiency of the target driver module.
[0089] For example, all configuration information of the target driver module Adc is "EcuMItemHeaderFile: Adc.h; EcuMItemName: Adc; EcuMModuleService: Init; EcuMModuleParameter: POSTBUILD_PTR". When the user needs to quickly understand the configuration information of the target driver module Adc, all configuration information "EcuMItemHeaderFile: Adc.h; EcuMItemName: Adc; EcuMModuleService: Init; EcuMModuleParameter: POSTBUILD_PTR" can be quickly viewed through the configuration directory information (EcuMModuleRef).
[0090] In some embodiments, the interface content information includes an interface name, an interface type, and an interface input parameter type.
[0091] The interface declaration information and the interface content information are encapsulated to generate configuration code corresponding to the target driver module, including:
[0092] S701, encapsulating the interface declaration information, the interface name, the interface type, and the interface input parameter type to generate configuration code corresponding to the target driver module.
[0093] The interface name is the name of the configuration corresponding to the target driver module, the interface type is the initialization type of the target driver module, and the interface input parameter type is the input parameter type of the initialization function of the target driver module.
[0094] For example, the interface name can be in the form of "Adc_Init", where Adc is the name of the target driver module, facilitating the user to quickly locate and view the related configuration. The interface type includes an initialization (Init) type and a start (Start) type, and if the configuration of the interface type is empty, the Init is taken as the default type. The interface input parameter type is used to define the function prototype and the parameters passed to the function, and the interface input parameter type includes NULL_PTR, POSTBUILD_PTR, and VOID types. If the interface input parameter type is the NULL_PTR type, the electronic control unit state management module EcuM should use a null pointer to call the function. If the interface input parameter type is the POSTBUILD_PTR type, the electronic control unit state management module EcuM should use a valid pointer to call the function. If the interface input parameter type is the VOID type, the electronic control unit state management module EcuM can use any type of pointer to call the function. According to the interface name, the interface type, and the interface input parameter type, the interface calling method information of the target driver module is quickly generated, and the configuration efficiency of the target driver module is improved.
[0095] Referring to Figure 7 According to a second aspect of the present disclosure, a code generation device of a vehicle driving module is provided, and the device includes:
[0096] A first information acquisition module 10 is configured to acquire configuration requirement information of a target driving module of a vehicle.
[0097] A second information acquisition module 20 is configured to acquire interface declaration information and interface calling method information of the target driving module in a case where the configuration requirement information does not match a preset standard format.
[0098] A configuration code generation module 30 is configured to encapsulate the interface declaration information and the interface calling method information to generate configuration code corresponding to the target driving module, and the configuration code includes interface declaration code and interface calling method code.
[0099] In some embodiments, the device further includes:
[0100] A third information acquisition module is configured to acquire the interface declaration information and interface content information of the target driving module in a case where the configuration requirement information matches the preset standard format.
[0101] An encapsulation module is configured to encapsulate the interface declaration information and the interface content information to generate the configuration code corresponding to the target driving module.
[0102] In some embodiments, the device further includes:
[0103] An initialization module is configured to initialize the target driver module based on the configuration code.
[0104] In some embodiments, the device further comprises:
[0105] A fourth information obtaining module is configured to obtain control unit identification information corresponding to the target driver module.
[0106] The initialization module comprises:
[0107] A control unit is configured to control a target control unit corresponding to the control unit identification information to compile the configuration code to obtain a target configuration program of the target driver module.
[0108] In some embodiments, the device further comprises:
[0109] An information extracting module is configured to extract calling requirement information in the configuration requirement information.
[0110] The calling requirement information is format-converted based on a preset format to obtain the interface calling method information.
[0111] In some embodiments, the device further comprises:
[0112] A target configuration page obtaining module is configured to add configuration option information corresponding to the target driver module into a configuration page corresponding to the target driver module to obtain a target configuration page corresponding to the target driver module.
[0113] A display module is configured to display the target configuration page on a target interface in response to a configuration display request for the target driver module.
[0114] In some embodiments, the interface content information comprises an interface name, an interface type, and an interface input parameter type.
[0115] The packaging module comprises:
[0116] A packaging processing unit is configured to package the interface declaration information, the interface name, the interface type, and the interface input parameter type to generate configuration code corresponding to the target driver module.
[0117] In some embodiments, the device provided by the embodiments of the present disclosure has functions or comprises modules which can be used to execute the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, it will not be repeated here.
[0118] This application provides a code generation device for a vehicle drive module. The device can be a terminal or a server. The code generation device for the vehicle drive module includes a processor and a memory. The memory stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by the processor to implement the code generation method for the vehicle drive module provided in the above method embodiments.
[0119] Memory is used to store software programs and modules. The processor executes these stored software programs and modules to perform various functional applications and data processing. Memory can primarily consist of a program storage area and a data storage area. The program storage area stores the operating system, application programs required for functionality, etc.; the data storage area stores data created based on device usage, etc. Furthermore, memory can include high-speed random access memory (RAM) and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.
[0120] The methods and embodiments provided in this application can be executed in electronic devices such as mobile terminals, computer terminals, servers, or similar computing devices. Figure 8 This is a hardware structure block diagram of an electronic device for a vehicle drive module code generation method provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device 900 can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 910 (CPUs 910 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 930 for storing data, and one or more storage media 920 (e.g., one or more mass storage devices) for storing application programs 923 or data 922. The memory 930 and storage media 920 may be temporary or persistent storage. The program stored in the storage media 920 may include one or more modules, each module may include a series of instruction operations on the electronic device. Furthermore, the CPU 910 may be configured to communicate with the storage media 920 and execute the series of instruction operations in the storage media 920 on the electronic device 900. Electronic device 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input / output interfaces 940, and / or one or more operating systems 921, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0121] The input / output interface 940 can be configured to receive or transmit data via a network. Examples of the network can include a wireless network provided by a communication provider of the electronic device 900. In an example, the input / output interface 940 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In an example, the input / output interface 940 can be a radio frequency (RF) module configured to communicate with the Internet through a wireless manner.
[0122] Those skilled in the art can understand that, Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device described above. For example, the electronic device 900 can further include more or less components than those shown, or have a different configuration of components than those shown. Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device described above. For example, the electronic device 900 can further include more or less components than those shown, or have a different configuration of components than those shown. Figure 8 The structure shown is only schematic, and does not limit the structure of the electronic device described above. For example, the electronic device 900 can further include more or less components than those shown, or have a different configuration of components than those shown.
[0123] The embodiment of the present application further provides a computer readable storage medium, which can be arranged in an electronic device to save at least one instruction or at least one program for implementing a code generation method of a vehicle driving module in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the code generation method of the vehicle driving module provided by the method embodiment.
[0124] Optionally, in the embodiment, the storage medium can be located in at least one network server of a plurality of network servers of a computer network. Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing program codes.
[0125] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the method provided in the various optional implementation manners described above.
Claims
1. A method for generating code for a vehicle drive module, characterized in that, The method includes: Obtain the configuration requirements information for the vehicle's target drive module; If the configuration requirement information does not match the preset standard format, the interface declaration information and interface calling method information of the target driver module are obtained. The preset standard format is used to characterize the format that conforms to the AUTOSAR specification. The interface declaration information is used to configure the declaration header file where the initialization function of the target driver module is located. The interface calling method information includes the compilation method of the initialization function corresponding to the target driver module. The interface declaration information and the interface call method information are encapsulated to generate the configuration code corresponding to the target driver module. The configuration code includes the interface declaration code and the interface call method code. The target driver module is initialized based on the configuration code.
2. The method according to claim 1, characterized in that, The method further includes: If the configuration requirement information matches the preset standard format, obtain the interface declaration information and interface content information of the target driver module; The interface declaration information and the interface content information are encapsulated to generate the configuration code corresponding to the target driver module.
3. The method according to claim 1, characterized in that, Before initializing the target driver module, the method further includes: Obtain the control unit identification information corresponding to the target drive module; The initialization of the target driver module based on the configuration code includes: The target control unit corresponding to the control unit identification information is controlled, and the configuration code is compiled to obtain the target configuration program of the target driver module.
4. The method according to claim 1, characterized in that, Before obtaining the interface declaration information and interface call method information of the target driver module, the following steps are included: Extract the call requirement information from the configuration requirement information; The call request information is converted based on a preset format to obtain the interface call method information.
5. The method according to claim 1 or 2, characterized in that, The method further includes: Add the configuration option information corresponding to the target driver module to the configuration page corresponding to the target driver module to obtain the target configuration page corresponding to the target driver module; In response to a configuration display request for the target driver module, the target configuration page is displayed on the target interface.
6. The method according to claim 2, characterized in that, The interface content information includes the interface name, interface type, and interface input parameter types. The step of encapsulating the interface declaration information and the interface content information to generate the configuration code corresponding to the target driver module includes: The interface declaration information, the interface name, the interface type, and the interface input parameter type are encapsulated to generate the configuration code corresponding to the target driver module.
7. A code generation device for a vehicle drive module, characterized in that, The device includes: The first information acquisition module is used to acquire the configuration requirements information of the vehicle target drive module; The second information acquisition module is used to acquire the interface declaration information and interface calling method information of the target driver module when the configuration requirement information does not match the preset standard format. The preset standard format is used to characterize the format that conforms to the AUTOSAR specification. The interface declaration information is used to configure the declaration header file where the initialization function of the target driver module is located. The interface calling method information includes the compilation method of the initialization function corresponding to the target driver module. A configuration code generation module is used to encapsulate the interface declaration information and the interface call method information to generate configuration code corresponding to the target driver module. The configuration code includes interface declaration code and interface call method code. The target driver module is initialized based on the configuration code.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the code generation method for the vehicle drive module as described in any one of claims 1-6.
9. An electronic device, characterized in that, The system includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the code generation method for a vehicle drive module as described in any one of claims 1-6 by executing the instructions stored in the memory.
Citation Information
Patent Citations
User interface management system for automotive open system architecture configuration tool, and method therefor
WO2022169007A1