Code compiling method and device, equipment, storage medium and vehicle

By generating macro configuration files and modifying the macro value of the module in response to editing input, the problem of inflexible software compilation methods in the prior art is solved, and flexible adjustment of module status and flexibility in the compilation process are achieved.

CN120010849APending Publication Date: 2025-05-16BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311527856.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing software compilation method is not flexible enough. Frequently modifying the module to be compiled requires constantly switching the config.in file, resulting in the inflexible compilation method.

Method used

By obtaining the project's main compiled file, a macro configuration file is generated, including multiple macro values ​​to characterize the state of the module. In response to editing input, the macro value of the specified module is modified in the macro configuration file, thereby adjusting the state of the module without writing code to modify the macro configuration file.

Benefits of technology

It realizes flexible adjustment of module status during software compilation, improves the flexibility of software compilation, and avoids the need to frequently modify the config.in file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010849A_ABST
    Figure CN120010849A_ABST
Patent Text Reader

Abstract

The invention discloses a code compiling method and device, equipment, a storage medium and a vehicle. The method comprises the steps of obtaining a main compiling file of a project, wherein the main compiling file comprises a plurality of to-be-compiled first modules; a macro configuration file of the project is generated based on the multiple first modules, the macro configuration file comprises multiple macro values, the project comprises multiple second modules, each macro value is used for representing the state of one corresponding second module, the macro values of the first modules in the macro configuration file are first macro values, and the macro values of the second modules except the first modules are second macro values; the first macro value is used for representing that the state of the corresponding first module is an open state, and the second macro value is used for representing that the state of the corresponding second module is a closed state; in response to an editing input associated with a third module, a macro value of the third module is modified in the macro configuration file, the third module being any one of the plurality of second modules. According to the embodiment of the invention, the flexibility of software compiling can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a code compilation method, device, equipment, storage medium and vehicle. Background Art

[0002] In software development, software compilation is an essential step. In the process of software compilation, a project is usually broken down into several modules, and then a custom Makefile is created to specify the modules to be compiled and the compilation steps of these modules in the modules.

[0003] However, when compiling software in this way, every time you want to modify the module to be compiled in the project, you need to modify the config.in file in the project by writing code. In this way, if you need to frequently modify the module to be compiled, you need to constantly switch the config.in file, which makes the software compilation method inflexible. Summary of the invention

[0004] The embodiments of the present application provide a code compilation method, apparatus, device, storage medium and vehicle, which can solve the problem that the existing software compilation method is not flexible enough.

[0005] In a first aspect, an embodiment of the present application provides a code compiling method, the method comprising:

[0006] Obtaining a main compilation file of a project, wherein the main compilation file includes a plurality of first modules to be compiled;

[0007] Generate a macro configuration file for the project based on the multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent the state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module outside the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state;

[0008] In response to an edit input associated with a third module, a macro value of the third module is modified in the macro configuration file, the third module being any one of the plurality of second modules.

[0009] In some embodiments, in response to the editing input, modifying the macro value of the third module in the macro configuration file includes:

[0010] In the case where the editing input is to write the third module in the configuration tool, the macro value of the third module is modified to the first macro value in the macro configuration file, and the configuration tool is used to configure the main compilation file.

[0011] In some embodiments, in response to the editing input, modifying the macro value of the third module in the macro configuration file includes:

[0012] In a case where the editing input is to delete the third module in the configuration tool, the macro value of the third module is modified to the second macro value in the macro configuration file.

[0013] In some embodiments, in response to the editing input, before modifying the macro value of the third module in the macro configuration file, the method further includes:

[0014] Display a macro enable control of the third module, wherein the macro enable control is used to indicate a macro value for enabling the third module;

[0015] In response to the editing input, modifying the macro value of the third module in the macro configuration file comprises:

[0016] In a case where the editing input is an input to a macro start control, the macro value of the third module is modified to the first macro value in the macro configuration file.

[0017] In some embodiments, in response to the editing input, before modifying the macro value of the third module in the macro configuration file, the method further includes:

[0018] Display a macro close control of the third module, wherein the macro open control is used to indicate a macro value for closing the third module;

[0019] In response to the editing input, modifying the macro value of the third module in the macro configuration file comprises:

[0020] In a case where the editing input is an input to a macro close control, the macro value of the third module is modified to a second macro value in the macro configuration file.

[0021] In some embodiments, after modifying the macro value of the third module in the macro configuration file in response to the editing input, the method further includes:

[0022] A fourth module in the project is compiled, wherein the fourth module is a second module whose corresponding macro value in the macro configuration file is the first macro value.

[0023] In a second aspect, an embodiment of the present application provides a code compilation device, the device comprising:

[0024] An acquisition module, used for acquiring a main compilation file of a project, wherein the main compilation file includes a plurality of first modules to be compiled;

[0025] A generating module, configured to generate a macro configuration file of the project based on the multiple first modules, wherein the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent a state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module other than the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state;

[0026] A modification module is used to modify the macro value of the third module in the macro configuration file in response to an editing input associated with the third module, wherein the third module is any one of the plurality of second modules.

[0027] In a third aspect, an embodiment of the present application provides a code compiling device, the device comprising: a processor and a memory storing computer program instructions;

[0028] The processor implements the above code compilation method when executing computer program instructions.

[0029] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the compilation method of the above code is implemented.

[0030] In a fifth aspect, an embodiment of the present application provides a vehicle, which includes computer program instructions, and the computer program instructions, when executed by a processor, implement the above code compilation method.

[0031] In the present application, by obtaining the main compilation file of the project, the main compilation file includes multiple first modules to be compiled; based on the multiple first modules, a macro configuration file of the project is generated, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to characterize the state of a corresponding second module, the macro value of the first module in the macro configuration file is the first macro value, the macro value of the second module outside the first module is the second macro value, the first macro value is used to characterize the state of the corresponding first module as an open state, and the second macro value is used to characterize the state of the corresponding second module as a closed state; in response to the editing input associated with the third module, the macro value of the third module is modified in the macro configuration file, and the third module is any one of the multiple second modules. In this way, after determining the main compilation file and the modules that need to be compiled in the main compilation file, the states of these modules in the project can be flexibly adjusted by editing each module in the project, without having to modify the macro configuration file in the form of writing code to adjust the state of the module, thereby improving the flexibility of software compilation. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 It is a flowchart of a code compilation method provided in an embodiment of the present application;

[0034] Figure 2 is a flowchart of a code compilation method provided by another embodiment of the present application;

[0035] Figure 3 It is a schematic diagram of the hardware structure of a code compiling device provided in an embodiment of the present application;

[0036] Figure 4 It is a schematic diagram of the structure of a code compiling device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0037] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0038] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0039] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.

[0040] Specifically, in order to solve the problems of the prior art, the embodiments of the present application provide a code compilation method, device, equipment, storage medium and vehicle. The code compilation method provided by the embodiments of the present application is first introduced below.

[0041] Figure 1 A schematic diagram of a code compilation method provided by an embodiment of the present application is shown. The method comprises the following steps:

[0042] S110, obtaining a main compilation file of the project, wherein the main compilation file includes a plurality of first modules to be compiled.

[0043] In this embodiment, the project can be the code of the autosar framework, which includes multiple split second modules. The user can manage and configure the kernel of the project and the compilation options of the second modules therein through Kconfig, determine multiple first modules that need to be compiled from the second file, and generate a main compilation file based on the multiple first modules that need to be compiled.

[0044] S120, a macro configuration file of the project is generated based on the multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent the state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module outside the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state.

[0045] In this embodiment, each second module corresponds to a macro value, and each macro value refers to a specific identifier, which is used to characterize the state of the corresponding second module as an open state or a closed state. The open state means that the second module corresponding to the macro value needs to be compiled, and the closed state means that the second module corresponding to the macro value does not need to be compiled.

[0046] After the main compilation file is generated, a macro configuration file may be generated based on the generated main compilation file, and the macro configuration file includes the macro value of each second module. In the macro configuration file, the macro values ​​of the first module are all first macro values, and the macro values ​​of the second modules other than the first module are all second macro values, which means that the first modules are all modules that need to be compiled, and the second modules other than the first modules are all modules that do not need to be compiled.

[0047] S130, in response to an editing input associated with a third module, modifying a macro value of the third module in the macro configuration file, wherein the third module is any one of the plurality of second modules.

[0048] In this embodiment, the user can edit and input any third module in the project to change the state of the macro value of the third module in the macro configuration file, thereby changing the compilation intention of the third module.

[0049] The present application obtains the main compilation file of the project, which includes multiple first modules to be compiled; generates a macro configuration file of the project based on multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to characterize the state of a corresponding second module, the macro value of the first module in the macro configuration file is the first macro value, the macro value of the second module outside the first module is the second macro value, the first macro value is used to characterize the state of the corresponding first module as an open state, and the second macro value is used to characterize the state of the corresponding second module as a closed state; in response to the editing input associated with the third module, the macro value of the third module is modified in the macro configuration file, and the third module is any one of the multiple second modules. In this way, after determining the main compilation file and the modules that need to be compiled in the main compilation file, the states of these modules in the project can be flexibly adjusted by editing each module in the project, without having to modify the macro configuration file in the form of writing code to adjust the state of the module, thereby improving the flexibility of software compilation.

[0050] As an optional embodiment, the above S130 may include:

[0051] In the case where the editing input is to write the third module in the configuration tool, the macro value of the third module is modified to the first macro value in the macro configuration file, and the configuration tool is used to configure the main compilation file.

[0052] In this embodiment, the configuration data in the project can be managed by a configuration tool to quickly configure and customize the modules in the project. For example, the configuration tool can be a DaVinci or Qt5 configuration tool. Specifically, the third module can be written into the configuration tool by editing input, and the third module can be written into the project by the configuration tool.

[0053] In this way, the project can traverse the configuration tool in real time. If it is detected that there is a third module written in the configuration tool, it can be automatically inferred that the third module is a newly added module that needs to be compiled. Then, the macro value of the third module can be modified to the first macro value in the macro configuration file to indicate that the state of the macro value of the third module is on.

[0054] This embodiment can perform automatic reasoning through a configuration tool, thereby flexibly adding modules that need to be compiled to the main compilation project.

[0055] As an optional embodiment, the above S130 may include:

[0056] In a case where the editing input is to delete the third module in the configuration tool, the macro value of the third module is modified to the second macro value in the macro configuration file.

[0057] In this embodiment, the third module can be deleted in the configuration tool through editing input, and the third module can be deleted from the project through the configuration tool.

[0058] In this way, the project can traverse the configuration tool in real time. If it is detected that there is a deleted third module in the configuration tool, it can automatically infer that the third module is updated from a module that originally needs to be compiled to a module that does not need to be compiled. Then, the macro value of the third module can be modified to the second macro value in the macro configuration file to indicate that the state of the macro value of the third module is closed.

[0059] This embodiment can perform automatic reasoning through a configuration tool, thereby flexibly deleting modules that need to be compiled from the main compilation project.

[0060] As an optional embodiment, before the above S130, the following may also be included:

[0061] Display a macro enable control of the third module, wherein the macro enable control is used to indicate a macro value for enabling the third module;

[0062] The above S130 may include:

[0063] In a case where the editing input is an input to a macro start control, the macro value of the third module is modified to the first macro value in the macro configuration file.

[0064] In this embodiment, a macro configuration page can be displayed on the display interface of the project, and the macro of the third module that needs to be frequently switched on and off can be added to the macro configuration page, on which the macro value of the third module can be directly configured.

[0065] For example, the macro configuration page includes a macro enable control and a macro disable control of the configured third module. The user can edit and input the macro enable control on the macro configuration page to indicate that the macro value of the third module is modified to the first macro value, so as to indicate that the state of the macro value of the third module is an enable state, so that the third module can be considered as a newly added module that needs to be compiled.

[0066] This embodiment can modify a second module in the main compilation project into a module that needs to be compiled by inputting on the macro configuration page, thereby achieving flexible and multiple adjustments.

[0067] As an optional embodiment, before the above S130, the following may also be included:

[0068] Display a macro close control of the third module, wherein the macro open control is used to indicate a macro value for closing the third module;

[0069] The above S130 may include:

[0070] In a case where the editing input is an input to a macro close control, the macro value of the third module is modified to a second macro value in the macro configuration file.

[0071] In this embodiment, a macro configuration page can be displayed on the display interface of the project. The macro configuration page can be a Qt5 configuration page. The macro of the third module that needs to be frequently switched on and off can be added to the macro configuration page, and the macro value of the third module can be directly configured on this page.

[0072] For example, the macro configuration page includes a macro on control and a macro off control of the configured third module. The user can edit and input the macro off control on the macro configuration page to indicate that the macro value of the third module is modified to the second macro value, so as to indicate that the state of the macro value of the third module is a closed state, so that the third module can be considered as a module that does not need to be compiled.

[0073] This embodiment can modify a second module in the main compilation project into a module that does not need to be compiled by inputting on the macro configuration page, thereby achieving flexible and multiple adjustments.

[0074] As an optional embodiment, after the above S130, the following may also be included:

[0075] A fourth module in the project is compiled, wherein the fourth module is a second module whose corresponding macro value in the macro configuration file is the first macro value.

[0076] In this embodiment, after the macro configuration file is determined, the macro configuration file in the project can be read by calling a compiler, and the project can be compiled based on the macro configuration file. A compiler is a tool that translates high-level programming language code into machine code or executable program.

[0077] The macro configuration file includes a series of macro definitions, including a module whose macro value is a first macro value and a module whose macro value is a second macro value. The compiler can compile only the fourth module whose macro value is the first macro value in the macro configuration file. In this way, compiling based on the macro configuration file can provide the ability to customize code in different environments or different user needs.

[0078] As an optional embodiment, Figure 2 As shown, compiling the project code can include the following seven steps:

[0079] Step 1: kconfig; kconfig can be used to generate a main compilation file, wherein multiple sub-modules to be compiled under various levels of sub-directories that need to be compiled can be defined in the main compilation file through makefile, that is, multiple first modules to be compiled included in the main compilation file.

[0080] Step 2: Compile each sub-module; output the compilation result to the sys_cfg.conf / sys_cfg.h file, which is the macro configuration file.

[0081] Step 3: Use configuration tools such as DaVinci to add / reduce a module. You can use configuration tools such as DaVinci to manage projects and add or delete a submodule in the configuration tool.

[0082] Step 4: Automatically infer the macro value of the module; when it is detected that a submodule is added or deleted in the configuration tool, the macro value of the submodule can be automatically inferred;

[0083] Step 5: Modify the macro value; modify the macro value of the submodule in the macro configuration file of the project;

[0084] Step 6: Qt5 macro configuration page;

[0085] Step 7: Qt5 macro configuration page; you can also directly configure the sub-modules that need to be modified repeatedly on the Qt5 macro configuration page. Whenever an operation on a sub-module is detected on the Qt5 macro configuration page, the macro value corresponding to the sub-module can be modified in the macro configuration file accordingly.

[0086] Step 8: Compiler scheduling: Schedule the sys_cfg.conf / sys_cfg.h file through the compiler.

[0087] Based on the code compiling method provided in the above embodiment, the present application also provides a specific implementation of a code compiling device. Please refer to the following embodiment.

[0088] See first Figure 3 The code compilation device 300 provided in the embodiment of the present application includes the following modules:

[0089] An acquisition module 301 is used to acquire a main compilation file of a project, wherein the main compilation file includes a plurality of first modules to be compiled;

[0090] A generating module 302 is used to generate a macro configuration file of the project based on the multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent the state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module outside the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state;

[0091] The modification module 303 is used to modify the macro value of the third module in the macro configuration file in response to the editing input associated with the third module, and the third module is any one of the multiple second modules.

[0092] The device can obtain the main compilation file of the project, which includes multiple first modules to be compiled; generate a macro configuration file of the project based on the multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to characterize the state of a corresponding second module, the macro value of the first module in the macro configuration file is the first macro value, the macro value of the second module outside the first module is the second macro value, the first macro value is used to characterize the state of the corresponding first module as an open state, and the second macro value is used to characterize the state of the corresponding second module as a closed state; in response to the editing input associated with the third module, modify the macro value of the third module in the macro configuration file, and the third module is any one of the multiple second modules. In this way, after determining the main compilation file and the modules that need to be compiled in the main compilation file, the states of these modules in the project can be flexibly adjusted by editing each module in the project, without having to modify the macro configuration file in the form of writing code to adjust the state of the module, thereby improving the flexibility of software compilation.

[0093] As an implementation of the present application, the modification module 303 may further include:

[0094] A writing unit is used to modify the macro value of the third module to the first macro value in the macro configuration file when the editing input is to write the third module in the configuration tool, and the configuration tool is used to configure the main compilation file.

[0095] As an implementation of the present application, the modification module 303 may further include:

[0096] The deleting unit is used to modify the macro value of the third module to the second macro value in the macro configuration file when the editing input is to delete the third module in the configuration tool.

[0097] As an implementation of the present application, the compiling device 300 of the above code may further include:

[0098] A first display unit, used for displaying a macro enable control of a third module, wherein the macro enable control is used for indicating a macro value for enabling the third module;

[0099] The modification module 303 may further include:

[0100] The first editing unit is used to modify the macro value of the third module to the first macro value in the macro configuration file when the editing input is an input to a macro start control.

[0101] As an implementation of the present application, the compiling device 300 of the above code may further include:

[0102] A second display unit, used to display a macro-off control of a third module, wherein the macro-on control is used to indicate a macro value for closing the third module;

[0103] The modification module 303 may further include:

[0104] The second editing unit is used to modify the macro value of the third module to a second macro value in the macro configuration file when the editing input is an input to a macro close control.

[0105] As an implementation of the present application, the compiling device 300 of the above code may further include:

[0106] A compiling module is used to compile a fourth module in the project, wherein the fourth module is a second module whose corresponding macro value in the macro configuration file is a first macro value.

[0107] The code compiling device provided in the embodiment of the present invention can implement each step in the above method embodiment, and will not be described again here to avoid repetition.

[0108] Figure 4 A schematic diagram of the hardware structure of a code compiling device provided in an embodiment of the present application is shown.

[0109] The code compiling device may include a processor 401 and a memory 402 storing computer program instructions.

[0110] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0111] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.

[0112] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0113] The processor 401 implements any one of the code compiling methods in the above embodiments by reading and executing the computer program instructions stored in the memory 402 .

[0114] In one example, the code compiling device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0115] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0116] Bus 410 includes hardware, software or both, and the parts of the compiling device of code are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0117] The code compilation device may be based on the above embodiment, thereby realizing the code compilation method and apparatus combined with the above embodiment.

[0118] In addition, in combination with the code compilation method in the above embodiment, the embodiment of the present application may provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the code compilation methods in the above embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.

[0119] In addition, an embodiment of the present application also provides a vehicle, including computer program instructions, which, when executed by a processor, can implement the steps and corresponding contents of the aforementioned method embodiment.

[0120] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0121] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0122] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0123] Aspects of the present disclosure are described above with reference to the flowcharts and / or block diagrams of the methods, devices and vehicles according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0124] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A code compiling method, characterized in that: The method comprises: Obtaining a main compilation file of a project, wherein the main compilation file includes a plurality of first modules to be compiled; Generate a macro configuration file for the project based on the multiple first modules, the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent the state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module outside the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state; In response to an edit input associated with a third module, a macro value of the third module is modified in the macro configuration file, the third module being any one of the plurality of second modules.

2. The code compiling method according to claim 1, characterized in that: The step of modifying the macro value of the third module in the macro configuration file in response to the editing input associated with the third module comprises: In the case where the editing input is to write the third module in the configuration tool, the macro value of the third module is modified to the first macro value in the macro configuration file, and the configuration tool is used to configure the main compilation file.

3. The code compiling method according to claim 1, characterized in that: The step of modifying the macro value of the third module in the macro configuration file in response to the editing input associated with the third module comprises: In a case where the editing input is to delete the third module in the configuration tool, the macro value of the third module is modified to the second macro value in the macro configuration file.

4. The code compiling method according to claim 1, characterized in that: In response to the editing input associated with the third module, before modifying the macro value of the third module in the macro configuration file, the method further includes: Display a macro enable control of the third module, wherein the macro enable control is used to indicate a macro value for enabling the third module; The step of modifying the macro value of the third module in the macro configuration file in response to the editing input associated with the third module comprises: In a case where the editing input is an input to a macro start control, the macro value of the third module is modified to the first macro value in the macro configuration file.

5. The code compiling method according to claim 1, characterized in that: In response to the editing input associated with the third module, before modifying the macro value of the third module in the macro configuration file, the method further includes: Display a macro close control of the third module, wherein the macro open control is used to indicate a macro value for closing the third module; The step of modifying the macro value of the third module in the macro configuration file in response to the editing input associated with the third module comprises: In a case where the editing input is an input to a macro close control, the macro value of the third module is modified to a second macro value in the macro configuration file.

6. The code compiling method according to claim 1, characterized in that: After modifying the macro value of the third module in the macro configuration file in response to the editing input associated with the third module, the method further comprises: A fourth module in the project is compiled, wherein the fourth module is a second module whose corresponding macro value in the macro configuration file is the first macro value.

7. A code compiling device, characterized in that: The device comprises: An acquisition module, used for acquiring a main compilation file of a project, wherein the main compilation file includes a plurality of first modules to be compiled; A generating module, configured to generate a macro configuration file of the project based on the multiple first modules, wherein the macro configuration file includes multiple macro values, the project includes multiple second modules, each macro value is used to represent a state of a corresponding second module, the macro value of the first module in the macro configuration file is a first macro value, the macro value of the second module other than the first module is a second macro value, the first macro value is used to represent that the state of the corresponding first module is an on state, and the second macro value is used to represent that the state of the corresponding second module is a off state; A modification module is used to modify the macro value of the third module in the macro configuration file in response to an editing input associated with the third module, wherein the third module is any one of the plurality of second modules.

8. A code compiling device, characterized in that: The code compiling device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the code compiling method according to any one of claims 1 to 6 is implemented.

9. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by a processor, implement the code compiling method according to any one of claims 1 to 6.

10. A vehicle, characterized in that: The vehicle comprises computer program instructions, which, when executed by a processor, implement the method for compiling the code according to any one of claims 1 to 6.