Data processing method and device, equipment and computer medium
By sorting and optimizing the code of the front-end module of the AP platform CM module in the AUTOSAR standard, the memory usage and redundant code expansion during compilation are reduced, the compilation efficiency is improved, and the excessive compilation content is solved in the AUTOSAR standard when generating code in the C++ template. question.
Patent Information
- Application Number
- CN202410923984.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-12
AI Technical Summary
In the AUTOSAR standard, when the front-end module of the CM module in the AP platform uses C++ template to generate code, it leads to excessive compilation content, high memory usage, low compilation efficiency, and seriously affects project development efficiency.
By obtaining the program to be compiled, sorting it out to reduce redundant code, optimizing inheritance relationships, instantiating template functions, reducing the expansion of template classes, directly inheriting the actual used classes and functions, converting some template classes into non-template classes, and reducing compilation time Memory usage.
Reduces system memory usage during compilation, improves compilation efficiency, saves system resources, and reduces redundant code expansion.
Smart Images

Figure CN118939265A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a data processing method, device, equipment and computer medium. Background Art
[0002] In the AP platform of the AUTOSAR standard, CM (Communication Module) is an important module. The CM module is divided into two parts, one is the back-end module, which provides a service module for the back-end, and the other is the front-end module, which provides an interface module for the application. For the front-end module, the current development language recommended by AUTOSAR is C++, and it is recommended that the front-end use C++ templates to generate code. Using C++ template programming to generate code for specific configured applications is conducive to the flexibility of code generation, but the specific C++ template implementation recommended by the AUTOSAR standard is found to be too bloated in actual project applications. When using the host computer configuration tool to configure 100 applications with CM communication, the memory occupied by the C++ code generated by the template during compilation reaches 40G, which directly leads to the full memory of the compilation server, more compilation content, and low compilation efficiency, which seriously affects the efficiency of project development. Summary of the invention
[0003] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problem in the related art that when compiling code, there is a lot of compilation content and low compilation efficiency.
[0004] In a first aspect, the present application provides a data processing method, comprising:
[0005] Get the program to be compiled;
[0006] Arranging the program to be compiled to obtain a target program;
[0007] The target program is compiled.
[0008] In a second aspect, the present application provides a data processing device, including:
[0009] An acquisition unit, used for acquiring a program to be compiled;
[0010] A collating unit, used for collating the program to be compiled to obtain a target program;
[0011] A compiling unit is used to compile the target program.
[0012] In a third aspect, the present application provides an electronic device, including:
[0013] Processor; and
[0014] A memory, configured to store executable instructions of the processor;
[0015] The processor is configured to execute any method in the first aspect or any possible implementation manner of the first aspect by executing the executable instructions.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements any method in the first aspect or any possible implementation manner of the first aspect.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.
[0018] The present application provides a method for obtaining a program to be compiled; organizing the program to be compiled to obtain a target program; and compiling the target program. The method can automatically organize the program to be compiled before compilation, thereby streamlining the program to be compiled, reducing compilation content, and improving compilation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 A flowchart of a data processing method provided in one embodiment of the present application;
[0021] Figure 2 A schematic diagram of the structure of a data processing device provided in one embodiment of the present application;
[0022] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.
[0024] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0025] First, the first part of the terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0026] The upper computer refers to a computer that can directly issue control commands, usually a PC / host computer / mastercomputer / upper computer, and displays various signal changes (hydraulic pressure, water level, temperature, etc.) on the screen. The lower computer is a computer that directly controls the equipment to obtain the equipment status, usually a PLC / single chip microcomputer / slavecomputer / lower computer and the like. The command issued by the upper computer is first given to the lower computer, and the lower computer then interprets the command into the corresponding timing signal to directly control the corresponding equipment. The lower computer reads the equipment status data (usually analog) from time to time, converts it into a digital signal and feeds it back to the upper computer. In short, the actual situation varies greatly, but the essence remains the same: both the upper and lower computers need to be programmed and have a dedicated development system.
[0027] Class Template mainly describes a template, which is a class template. It is a general class, in which data members, parameter types of member functions and return value types of member functions do not need to be specifically specified, and these types are all virtual. Class template can be regarded as a cake mold, which defines a pattern so that some data members, parameters of some member functions and return values of some member functions in the class can take any type. The existence of class template does not represent a specific actual class, but represents a class of classes. The C++ language compilation system will generate a class, namely template class, based on the class template and specific data types.
[0028] Template Class mainly describes a class declared using a class template, that is, a class obtained by specifying the virtual type parameter in the class template as a specific data type parameter. It can be regarded as a cake made by a cake mold. It is a real class, which is essentially the same as an ordinary class. It is a class obtained by instantiating the type parameter of the class template.
[0029] In short, class templates provide a way to define a class that can handle multiple data types, and template classes are a specific implementation generated by the compiler system after combining this class template with a specific data type. Class template is an abstract concept that defines how to generate a template class, and template class is the concretization of this abstract concept.
[0030] Inheritance is a form of software reuse. Inheritance allows you to reuse the data and behavior of existing classes and create new classes by giving them new functionality.
[0031] A template function is a general function that can be used to process multiple types of data, rather than just one type. In C++, a template function is defined by a function template, where a function template is a blueprint for a general function that can generate specific function instances based on different data types. Function templates allow you to define a function that operates on any type of variable, greatly enhancing the versatility of function design. By parameterizing the parameter type, a function template can adapt to operations on different types of objects within a certain range. This means that, using function templates, you can define a family of functions that all use the same code, achieve code reuse, avoid duplication of work, and enhance program security.
[0032] Member variables are variables defined in the class body, that is, global variables. Member variables are used to define the state of an object.
[0033] A function is a grammatical structure that has a specific function.
[0034] In the AP platform of the AUTOSAR standard, CM (Communication Module) is an important module. The CM module is divided into two parts, one is the back-end module, which provides a service module for the back-end, and the other is the front-end module, which provides an interface module for the application. For the front-end module, the current development language recommended by AUTOSAR is C++, and it is recommended that the front-end use C++ templates to generate code. Using C++ template programming to generate code for specific configured applications is conducive to the flexibility of code generation, but the specific C++ template implementation recommended by the AUTOSAR standard is found to be too bloated in actual project applications. When using the host computer configuration tool to configure 100 applications with CM communication, the memory occupied by the C++ code generated by the template during compilation reaches 40G, which directly leads to the full memory of the compilation server, more compilation content, and low compilation efficiency, which seriously affects the efficiency of project development.
[0035] The solution provided by this application can reduce unnecessary use of C++ templates, reduce redundant code expansion during compilation, reduce system memory usage during compilation, and improve development efficiency.
[0036] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0037] Figure 1 A flowchart of a data processing method provided by an exemplary embodiment of the present application is provided. The execution subject of the method may be an electronic device for executing compilation. The method includes at least the following steps:
[0038] S101, obtaining a program to be compiled;
[0039] In some optional embodiments of the present application, the program to be compiled may be a program in AP (Adaptive Platform) in the AUTOSAR standard.
[0040] S102, arranging the program to be compiled to obtain a target program;
[0041] In some optional embodiments of the present application, in the aforementioned S102, arranging the program to be compiled includes the following S1021-S1022:
[0042] S1021, obtaining a second template class in the program to be compiled, which references the first template class but uses only a first part of functions in the first template class;
[0043] S1022. Release the reference relationship between the second template class and the first template class, and adjust the first partial function to a function in the second template class.
[0044] In this way, when compiling specific application codes, the expansion of template classes is avoided, the memory usage during compilation is reduced, and the compilation content can be reduced.
[0045] The first partial function may be any partial function, and the first template class and the second template class may refer to any template class in the program to be compiled.
[0046] Optionally, the number of functions in the first part of functions may be 1.
[0047] Optionally, the number of functions in the second template class that are associated with the first part of functions is less than a preset threshold, wherein the preset threshold may be set by relevant personnel.
[0048] For example, class A inherits from class B, which is a template class. After class A inherits from class B, it only uses a function functionB in class B, and functionB has little relationship with the member variables in B, so it can be decoupled. Under this condition, functionB can be directly extracted as a functional function of class A, and class A no longer inherits class B.
[0049] In some optional embodiments of the present application, in the aforementioned S102, the program to be compiled is organized, including: S1023. When, in the program to be compiled, there is a situation where the third template class references the fourth template class, and the fourth template class references the fifth template class, if the third template class only references the methods and / or member variables in the fifth template class after instantiation, then the third template class references the fourth template class, and the fourth template class references the fifth template class, and is directly adjusted to the third template class reference the fifth template class.
[0050] This method can reduce indirect inheritance in the middle, shorten the inheritance path, and eliminate the need to expand the code of the intermediate class when the code is expanded, thereby reducing the expansion of the code at compile time and reducing the memory usage at compile time.
[0051] Accordingly, the aforementioned third template class, fourth template class, and fifth template class may refer to any template class in the program to be compiled.
[0052] In some optional embodiments of the present application, in the aforementioned S102, the program to be compiled is organized, including: when in the program to be compiled, there is a situation where the third template class references the fourth template class, the fourth template class references the fifth template class, and the fifth template class references any class, if the third template class only references the fifth template class and / or the methods or member variables in the aforementioned any class after instantiation, then the third template class references the fourth template class, the fourth template class references the fifth template class, and the fifth template class references any class are directly adjusted to the third template class references the fifth template class and / or the aforementioned any class. The aforementioned any class can refer to a template class or a non-template class.
[0053] For example, taking the third template class as A, the fourth template class as B, and the fifth template class as C, the reference relationship among A, B, and C can be as follows:
[0054] Class A:public B <t>
[0055] Class B:public C <t>
[0056] Class C:public D <t>
[0057] That is: Template class A inherits from Template class B, Template class B inherits from Template class C, and Template class C inherits from Template class D (D may not be a template class). The above is a lengthy inheritance relationship of A->B->C->D, but after generating code instantiation, Template class A only uses methods or member variables in Template class C or Template class D. At this point, you can summarize the lengthy inheritance relationship and the methods and member variables of the classes actually used, and turn the indirect reference relationship into direct inheritance. As above, if Template class A only uses methods in Template class D, then Template class A directly inherits Template class D, that is: Class A: public D <t>, reducing the indirect inheritance in the middle and shortening the inheritance path, so that when the code is expanded, it is not necessary to expand the code of the intermediate class. This reduces the expansion of the code at compile time and reduces the memory usage at compile time.
[0058] In some optional embodiments of the present application, in the aforementioned S102, the program to be compiled is organized, including: S1024, when in the program to be compiled, there is a parameter of the second part function that is a member variable of the sixth template class, then the data type to which the member variable belongs is used as the parameter of the second part function.
[0059] The aforementioned data types may be integer type, character type, Bool type or other data types.
[0060] The second partial function may be any partial function.
[0061] The sixth template class may refer to any template class in the program to be compiled.
[0062] This situation refers to: in the program to be compiled, a member variable of a template function is used as a function parameter. In this scenario, when the code is compiled, the template class to which the parameter belongs must also be expanded, which increases the memory usage during compilation. In this case, if the function parameter is a member variable of the template class, the type of the specific member variable can be directly used as the function parameter, and the template class is not used in the function parameter. This reduces the expansion of the code during compilation and reduces the memory usage during compilation.
[0063] In some optional embodiments of the present application, in the aforementioned S102, the program to be compiled is organized, including: S1025. When in the program to be compiled, among all the functions included in the seventh template class, only some functions are template functions of the seventh template class, the seventh template class is adjusted to a non-template class, and the some functions are adjusted to functions with template declarations of the seventh template class.
[0064] The seventh template class can refer to any template class in the program to be compiled, which can reduce the expansion of code and reduce the memory usage during compilation.
[0065] Specifically, the aforementioned non-template class may refer to a common class.
[0066] For example, in some template classes, member variables do not need to be templated, and only some functions need to be templated. In this case, when using the corresponding member functions or member variables, the template class needs to be expanded first, which brings unnecessary code growth. At this time, for template classes with only some member functions that are template functions, remove the template declaration of the template class to make it a normal C++ class, and transfer the template declaration to the internal template function. This also turns the template class into a normal class containing template functions. In this way, when compiling in C++, the code expansion is reduced and the memory usage during compilation is reduced.
[0067] In some optional embodiments of the present application, at least two of the aforementioned steps S1021 and S1022, S1023, S1024 and S1025 may be executed simultaneously.
[0068] S103: compile the target program.
[0069] In some optional embodiments of the present application, the method further includes: in response to a tidying instruction for tidying the program to be compiled, triggering the execution of obtaining the program to be compiled.
[0070] In some optional embodiments, relevant personnel may trigger the aforementioned tidying instruction by clicking a start button for instructing the program to be compiled to be tidyed.
[0071] In some optional embodiments of the present application, the method further includes: displaying the target program. Displaying the target program facilitates relevant personnel to view the compilation results and to check the target program.
[0072] In some optional embodiments of the present application, the method further includes: displaying a comparison result between the program to be compiled and the target program for relevant personnel to check the target program.
[0073] The present application provides a method for obtaining a program to be compiled; organizing the program to be compiled to obtain a target program; and compiling the target program. The method can automatically organize the program to be compiled before compilation, thereby streamlining the program to be compiled, reducing compilation content, and improving compilation efficiency.
[0074] The solution of the present application summarizes the use of the front-end module template of the CM module, classifies the use of the CM module, optimizes the inheritance relationship according to the characteristics of each use type and the specific methods and variables used, reduces the use of template classes, reduces the expansion of template classes during compilation, reduces the occupancy of compilation memory, and reduces the redundant use of template classes, reduces the expansion of application code during compilation, reduces the occupancy of compilation memory, and saves system resources by shortening the inheritance path of template classes, instantiating template functions, converting template classes into template functions, and optimizing the use of template classes in function parameters. In addition, after optimizing the use of templates, the use of redundant C++ templates is reduced, the memory occupied by template class expansion during compilation is reduced, the occupancy of system memory during compilation is reduced, and the compilation efficiency is improved.
[0075] Figure 2 A schematic diagram of a data processing device provided for an exemplary embodiment of the present application, the device comprising:
[0076] An acquisition unit 21, used for acquiring a program to be compiled;
[0077] The arranging unit 22 is used to arrange the program to be compiled to obtain a target program;
[0078] The compiling unit 23 is used to compile the target program.
[0079] In some optional embodiments of the present application, when the aforementioned device is used to organize the program to be compiled, it is specifically used to:
[0080] Obtaining a second template class in the program to be compiled, which references the first template class but uses only a first portion of functions in the first template class;
[0081] The reference relationship between the second template class and the first template class is released, and the first partial function is adjusted to a function in the second template class.
[0082] In some optional embodiments of the present application, when the aforementioned device is used to organize the program to be compiled, it is specifically used to:
[0083] When, in the program to be compiled, there is a situation where the third template class references the fourth template class, and the fourth template class references the fifth template class, if the third template class only references methods and / or member variables in the fifth template class after instantiation, the third template class references the fourth template class, and the fourth template class references the fifth template class, and is directly adjusted to the third template class reference the fifth template class.
[0084] In some optional embodiments of the present application, when the aforementioned device is used to organize the program to be compiled, it is specifically used to:
[0085] When in the program to be compiled, there is a parameter of the second part function which is a member variable of the sixth template class, the data type to which the member variable belongs is used as the parameter of the second part function.
[0086] In some optional embodiments of the present application, when the aforementioned device is used to organize the program to be compiled, it is specifically used to:
[0087] When, in the program to be compiled, among all the functions included in the seventh template class, only some functions are template functions of the seventh template class, the seventh template class is adjusted to a non-template class, and the some functions are adjusted to functions with template declarations of the seventh template class.
[0088] In some optional embodiments of the present application, the aforementioned device is also used for:
[0089] In response to a tidying instruction for tidying the program to be compiled, the step of obtaining the program to be compiled is triggered.
[0090] In some optional embodiments of the present application, the aforementioned apparatus is also used to: display the target program.
[0091] The solution of the present application summarizes the use of the front-end module template of the CM module, classifies the use of the CM module, optimizes the inheritance relationship according to the characteristics of each use type and the specific methods and variables used, reduces the use of template classes, reduces the expansion of template classes during compilation, reduces the occupancy of compilation memory, and reduces the redundant use of template classes, reduces the expansion of application code during compilation, reduces the occupancy of compilation memory, and saves system resources by shortening the inheritance path of template classes, instantiating template functions, converting template classes into template functions, and optimizing the use of template classes in function parameters. In addition, after optimizing the use of templates, the use of redundant C++ templates is reduced, the memory occupied by template class expansion during compilation is reduced, the occupancy of system memory during compilation is reduced, and the compilation efficiency is improved.
[0092] It should be understood that the device embodiment and the method embodiment may correspond to each other, and descriptions with similar templates may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.
[0093] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
[0094] Figure 3 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:
[0095] The memory 301 and the processor 302, the memory 301 is used to store the computer program and transmit the program code to the processor 302. In other words, the processor 302 can call and run the computer program from the memory 301 to implement the method in the embodiment of the present application.
[0096] For example, the processor 302 may be configured to execute the above method embodiments according to instructions in the computer program.
[0097] In some embodiments of the present application, the processor 302 may include but is not limited to:
[0098] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0099] In some embodiments of the present application, the memory 301 includes but is not limited to:
[0100] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0101] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0102] like Figure 3 As shown, the electronic device may also include:
[0103] The transceiver 303 may be connected to the processor 302 or the memory 301 .
[0104] The processor 302 may control the transceiver 303 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 303 may include a transmitter and a receiver. The transceiver 303 may further include an antenna, and the number of antennas may be one or more.
[0105] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0106] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
[0107] When software is used for implementation, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state disk (solid state disk, SSD)), etc.
[0108] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0109] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0110] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. The first part or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0111] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / t> < / t> < / t> < / t>
Claims
1. A data processing method, It is characterized in that include: Get the program to be compiled; Arranging the program to be compiled to obtain a target program; The target program is compiled.
2. The method according to claim 1, It is characterized in that Arranging the program to be compiled includes: Obtaining a second template class in the program to be compiled, which references the first template class but uses only a first portion of functions in the first template class; The reference relationship between the second template class and the first template class is released, and the first partial function is adjusted to a function in the second template class.
3. The method according to claim 1, It is characterized in that Arranging the program to be compiled includes: When, in the program to be compiled, there is a situation where the third template class references the fourth template class, and the fourth template class references the fifth template class, if the third template class only references methods and / or member variables in the fifth template class after instantiation, the third template class references the fourth template class, and the fourth template class references the fifth template class, and is directly adjusted to the third template class reference the fifth template class.
4. The method according to claim 1, It is characterized in that Arranging the program to be compiled includes: When in the program to be compiled, there is a parameter of the second part function which is a member variable of the sixth template class, the data type to which the member variable belongs is used as the parameter of the second part function.
5. The method according to claim 1, It is characterized in that Arranging the program to be compiled includes: When, in the program to be compiled, among all the functions included in the seventh template class, only some functions are template functions of the seventh template class, the seventh template class is adjusted to a non-template class, and the some functions are adjusted to functions with template declarations of the seventh template class.
6. The method according to claim 1, It is characterized in that The method further comprises: In response to a tidying instruction for tidying the program to be compiled, the step of obtaining the program to be compiled is triggered.
7. The method according to claim 1, It is characterized in that The method further includes: displaying the target program.
8. A data processing device, It is characterized in that include: An acquisition unit, used for acquiring a program to be compiled; A collating unit, used for collating the program to be compiled to obtain a target program; A compiling unit is used to compile the target program.
9. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
