Project file processing method, device and equipment

By identifying the model type and calling the code generation interface of Targetlink and Simulink, the problem of the Targetlink module being unable to automatically generate code in the existing technology is solved, and efficient one-stop project integration and model adjustment are achieved.

CN120631355APending Publication Date: 2025-09-12CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510792269.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

In the existing technology, some modules that do not support Targetlink cannot automatically generate code files, resulting in low project integration efficiency.

Method used

By identifying the model type and calling the corresponding modeling tool interface to generate code files, it supports code generation for both Targetlink and Simulink models, achieving one-stop integration.

Benefits of technology

It improves the efficiency of code generation and the convenience of visual operations in project integration, simplifies model adjustment and observation configuration, and improves the efficiency and accuracy of project integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631355A_ABST
    Figure CN120631355A_ABST
Patent Text Reader

Abstract

The invention relates to a project file processing method, device and equipment, and the method comprises the steps: determining a to-be-processed first model in a plurality of models included in a target project based on an operation on a first display interface; identifying a target model type of the first model, wherein the target model type comprises a first type for the first modeling tool and / or a second type for the first modeling tool; and receiving and responding to the generation operation, and processing the to-be-processed first model based on the target model type to obtain a code file of the first model. According to the scheme, the first models of the first type and the second type in the target project can be jointly processed, the code files of the first models of the two types are generated, and the code generation efficiency in project integration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of file processing technology, and in particular to a method, device and equipment for processing file of a project. Background Art

[0002] In the process of target integration, it is generally necessary to first involve various models through Targetlink or Simulink, and then perform project integration. During the project integration process, code files for each model need to be generated.

[0003] In related technologies, model code files are typically obtained directly through TargetLink. This prevents automatic code generation for modules that don't support TargetLink, reducing project integration efficiency. Summary of the Invention

[0004] One of the purposes of this application is to provide at least one project file processing method, device and equipment, which can jointly process the first model of the first type and the second type in the target project, generate code files of the two types of first models, and improve the efficiency of code generation in project integration.

[0005] In order to achieve the above objectives, the technical solutions adopted in this application are as follows:

[0006] In a first aspect, the present application provides a file processing method for a project, the method comprising: determining a first model to be processed among multiple models included in a target project based on an operation on a first display interface; identifying a target model type of the first model, the target model type comprising a first type for target linking a first modeling tool and / or a second type for simulation linking a second modeling tool; receiving and responding to a generation operation, processing the first model to be processed based on the target model type, and obtaining a code file of the first model.

[0007] Based on the above technical means, the first model to be processed is first determined in the target project. Then, the type of the first model is identified. Different processing methods are invoked based on the different types to process the first model to obtain a code file for the first model. This allows code generation to be performed for both first models of the first and second types, improving the efficiency of code generation. Furthermore, both determining the first model and generating the code file are performed based on operations on the first display interface, making the process visual and simple to operate.

[0008] In one possible implementation, the first model to be processed is processed based on the target model type to obtain a code file of the first model, including: when the target model type includes the first type, calling a first code generation interface in a first modeling tool to process the first model of the first type to obtain the code file of the first model of the first type; when the target model type includes the second type, calling a second code generation interface in a second modeling tool to process the first model of the second type to obtain the code file of the first model of the second type.

[0009] Based on the above technical means, for the first type of model, the code file is generated by calling the first code generation interface in the first modeling tool, and for the second type of model, the code file is generated by calling the second code generation interface in the second modeling tool. This can meet the two types of code generation requirements without affecting each other; it is convenient and efficient.

[0010] In one possible implementation, identifying the target model type of the first model includes: reading a type identifier in the first model; the type identifier is used to indicate the target model type of the first model; when the type identifier is a first identifier, determining that the target model type is the first type; when the type identifier is a second identifier, determining that the target model type is the second type.

[0011] Based on the above technical means, the target model type of the first model is determined by type identification, and the implementation process is convenient and reliable.

[0012] In one possible embodiment, based on an operation on a first display interface, a first model to be processed is determined among multiple models included in a target project, including: receiving a first operation on a first control on the first display interface, and opening a project file in response to the first operation; the first operation is used to indicate opening a project file; displaying an identifier of at least one project on the first display interface; receiving a second operation on the first display interface, and determining a target project from at least one project in response to the second operation; the second operation is used to select an identifier of the target project from among the identifiers of at least one project displayed; obtaining multiple models included in the target project and displaying them on the first display interface; receiving a third operation on the first display interface, and determining a first model from multiple models in response to the third operation; and the third operation is used to select the first model from among the multiple models displayed.

[0013] Based on the above technical means, when determining the first model, the target project is determined first, and then the first model is determined. The logic is clear and the implementation is convenient. The determination process is determined based on the user's input operation on the display interface, which can meet the user's actual needs, has high flexibility and good experience.

[0014] In one possible embodiment, determining a first model among multiple models in response to a third operation includes: determining a target control on which the third operation acts; when the target control is used to indicate all models of the target item, determining that the first model includes all models of the target item; when the target control is used to indicate partial models of the target item, determining that the first model includes partial models of the target item.

[0015] Based on the above technical means, the first model to be processed can be selected in the target project based on the user's operation. For example, all models or part of the models can be selected, which is convenient and flexible.

[0016] In a possible embodiment, the method also includes: receiving a fourth operation on the first display interface, and in response to the fourth operation, reading the value of the observation parameter in the observation configuration information; the observation configuration information includes the observation parameters of the target project and the second model to which the observation parameters belong; based on the value of the observation parameter, adjusting the model in the target project.

[0017] Based on the above technical means, the values ​​of the observation parameters in the observation configuration information can be read, and then the model in the target project can be adjusted based on the values ​​of the observation parameters, thereby improving the efficiency of model adjustment and project integration.

[0018] In one possible embodiment, the method also includes: receiving a fifth operation for the first display interface, and obtaining observation configuration information in response to the fifth operation; displaying the observation configuration information on the first display interface; receiving a sixth operation for the first display interface, and modifying the observation configuration information displayed on the first display interface in response to the sixth operation.

[0019] Based on the above technical means, the observation configuration information can be modified based on user operations, thereby improving the accuracy of the observation configuration information, improving the accuracy of model adjustment, and improving the efficiency and accuracy of project integration.

[0020] In one possible embodiment, the method also includes: determining the observation parameters to be added and the second model to which the observation parameters belong in the target project; adding the observation parameters to the second model in response to the seventh operation on the second model on the first display interface; and generating observation configuration information based on the second model after adding the observation parameters.

[0021] Based on the above technical means, the seventh operation can be used to add observation parameters to the model that needs to add observation parameters, and then generate observation configuration information. This enables editing, clear logic, flexibility and reliability.

[0022] In a second aspect, the present application provides a project file processing device, the device comprising:

[0023] a determining unit, configured to determine a first model to be processed from a plurality of models included in the target project based on an operation on the first display interface;

[0024] an identification unit for identifying a target model type of the first model, the target model type comprising a first type for target linking with the first modeling tool and / or a second type for simulation linking with the second modeling tool;

[0025] The processing unit is configured to receive and respond to a generation operation, process a first model to be processed based on a target model type, and obtain a code file of the first model.

[0026] In a third aspect, the present application further provides an electronic device, which includes a processor and a memory, wherein a computer program or instruction is stored in the memory, and when the computer program or instruction is executed by the processor, the method provided in the first aspect is implemented.

[0027] In a fourth aspect, the present application further provides a storage medium storing a computer program or instruction, which, when executed by a processor, implements the method provided in the first aspect.

[0028] In a fifth aspect, the present application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the method provided in the first aspect is implemented.

[0029] It should be noted that the technical effects of the second to fifth aspects can refer to the detailed description of the first aspect above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a first optional flow chart of a method for processing project files provided in an embodiment of the present application;

[0031] Figure 2 A second optional flow chart of the method for processing project files provided in the embodiment of the present application;

[0032] Figure 3 A third optional flow chart of the method for processing project files provided in the embodiment of the present application;

[0033] Figure 4 A fourth optional flow chart of the method for processing project files provided in the embodiment of the present application;

[0034] Figure 5 A fifth optional flow chart of the file processing method for a project provided in an embodiment of the present application;

[0035] Figure 6 A sixth optional flow chart of the method for processing project files provided in an embodiment of the present application;

[0036] Figure 7 A seventh optional flow chart of the method for processing project files provided in an embodiment of the present application;

[0037] Figure 8 This is a schematic diagram of an eighth optional flow chart of the file processing method for a project provided in an embodiment of the present application;

[0038] Figure 9 An optional flowchart of the project file processing process provided in the embodiment of the present application;

[0039] Figure 10 An optional flowchart of the integrated functions provided in the embodiments of the present application;

[0040] Figure 11 An optional flowchart of the integration process provided in the embodiment of the present application;

[0041] Figure 12 An optional flow chart of the integrated display interface provided in the embodiment of the present application;

[0042] Figure 13 A schematic diagram of an optional structure of a file processing device for a project provided in an embodiment of the present application;

[0043] Figure 14 This is a schematic diagram of an optional structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.

[0045] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0046] In the following description, the terms "first, second, and third" are used merely as examples to distinguish between different objects and do not represent a specific order or precedence for the objects. It is understood that the specific order or precedence of "first, second, and third" can be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0048] Embodiments of the present application provide a project file processing method, apparatus, device, computer storage medium, and computer program product. The project file processing method is executed by a project file processing device, which can be deployed in an electronic device. The following describes various embodiments of the project file processing method, apparatus, device, computer storage medium, and computer program product provided in the embodiments of the present application.

[0049] In a first aspect, an embodiment of the present application provides a method for processing project files. The method is described below using an electronic device as an example.

[0050] refer to Figure 1 As shown in the content, the process may include but is not limited to S101 to S103.

[0051] A project may require multiple models. During the design phase, multiple models are designed. These models may be designed for different functions by different departments. Consequently, multiple models within a project may be designed using different software tools. For example, some models within a project may be designed using the TargetLink tool, while others may be designed using the Simulink tool. Therefore, during project integration, it's impossible to follow a single, unified set of rules.

[0052] Based on the above considerations, a program code is provided in the embodiment of the present application, which can process different types of models. For example, the program code here is a matlab code.

[0053] Based on the above considerations, when generating a code file, it is necessary to first determine the target project and then determine the first model to be processed. The first model here refers to the model of the code file to be generated.

[0054] S101. The electronic device determines a first model to be processed from a plurality of models included in a target project based on an operation on a first display interface.

[0055] The target project refers to the project to be processed. The first model refers to the model in the target project to which the code file is to be generated.

[0056] The first display interface refers to the display interface used for project file processing in the program developed in the embodiments of this application. The layout of the first display interface can be configured according to actual needs. The embodiments of this application do not limit the content included in the first display interface, and can be configured according to actual needs. For example, multiple control buttons can be configured on the first display interface. Clicking different control buttons will call different interface programs to achieve different functions.

[0057] S101 can be implemented as follows: the electronic device first determines a target item based on an operation on the first display interface, and then, based on the operation on the first display interface, determines a first model to be processed from among multiple models included in the target item. The operation type is not limited here and can be configured according to actual needs. For example, the operation here can be a click, touch, or input operation on different control buttons.

[0058] S102: The electronic device identifies a target model type of the first model.

[0059] The target model type refers to the type to which the first model belongs. The first model here may be one model or multiple models. Therefore, the target model type may include one type or multiple types.

[0060] The target model type includes a first type for a first modeling tool and / or a second type for a second modeling tool, Simulink. For example, the first modeling tool may be a Targetlink modeling tool. The second modeling tool may be a Simulink modeling tool.

[0061] In a possible implementation, S102 may be implemented as: the electronic device identifies the target model type of the first model through a self-defined identifier.

[0062] In another possible implementation, S102 may be implemented as follows: the electronic device may identify the target model type of the first model based on the file type, naming method, etc. of the first model.

[0063] In another possible implementation, S102 may be implemented as follows: the electronic device may identify the target model type of the first model based on parameters in the first model. For example, Function module parameters correspond to the first type, and Trigger module parameters correspond to the second type.

[0064] S103: The electronic device receives and responds to the generating operation, processes the first model to be processed based on the target model type, and obtains a code file of the first model.

[0065] The generate operation is used to instruct the generation of a code file for the first model. The embodiment of the present application does not limit the type of code file generated and can be configured according to actual needs. For example, the code file here can include but is not limited to one or more of the following: C code file, S19 code file, A2L code file.

[0066] Here, you can configure a button control to generate a code file based on a code file. That is, click a button control to generate a C code file, then click another button control to generate an S19 code file, and then click another button control to generate an A2L code file. Alternatively, you can click only one button control to generate a C code file, an S19 code file, and an A2L code file in that order.

[0067] S103 can be implemented as follows: the electronic device receives a generation operation for the first display interface, and in response to the generation operation, based on the target model type, calls a generation code algorithm corresponding to the target model type, and processes the first model by calling the generation code algorithm corresponding to the target model type to obtain a code file of the first model.

[0068] If there are multiple first models, the processing for each first model is similar.

[0069] In this embodiment, the method includes: based on the operation of the first display interface, determining the first model to be processed among the multiple models included in the target project; identifying the target model type of the first model, the target model type including a first type for target linking the first modeling tool and / or a second type for simulation linking the second modeling tool; receiving and responding to the generation operation, processing the first model to be processed based on the target model type to obtain the code file of the first model.

[0070] Based on the above technical means, the first model to be processed is first determined in the target project. Then, the type of the first model is identified. Different processing methods are invoked based on the different types to process the first model to obtain a code file for the first model. This allows code generation to be performed for both first models of the first and second types, improving the efficiency of code generation. Furthermore, both determining the first model and generating the code file are performed based on operations on the first display interface, making the process visual and simple to operate.

[0071] Next, the process in S103 where the electronic device receives and responds to the generating operation, processes the first model to be processed based on the target model type, and obtains the code file of the first model will be described.

[0072] refer to Figure 2 The process may include but is not limited to the following S1031 and / or S1032.

[0073] S1031: When the target model type includes the first type, the electronic device calls a first code generation interface in a first modeling tool to process a first model of the first type to obtain a code file of the first model of the first type.

[0074] The first type, ie the type used for target linking the first modeling tool, can also be understood as a model developed based on the first modeling tool.

[0075] S1031 may be implemented as follows: when the target model type includes the first type, since the first model is a model developed based on a first modeling tool, the electronic device calls a first code generation interface in the first modeling tool to process the first model of the first type, thereby obtaining a code file for the first model of the first type. The first code generation interface is used to call a code generation function in the first modeling tool.

[0076] S1032: When the target model type includes the second type, the electronic device calls a second code generation interface in a second modeling tool to process the first model of the second type to obtain a code file of the first model of the second type.

[0077] The second type, namely the type used for simulation linking the second modeling tool, can also be understood as a model developed based on the second modeling tool.

[0078] S1032 may be implemented as follows: when the target model type includes the second type, since the first model is a model developed based on the second modeling tool, the electronic device calls a second code generation interface in the second modeling tool to process the first model of the second type, thereby obtaining a code file for the first model of the second type. The second code generation interface is used to call a code generation function in the second modeling tool.

[0079] Based on the above technical means, for the first type of model, the code file is generated by calling the first code generation interface in the first modeling tool, and for the second type of model, the code file is generated by calling the second code generation interface in the second modeling tool. This can meet the two types of code generation requirements without affecting each other; it is convenient and efficient.

[0080] Next, the process of the electronic device identifying the target model type of the first model in S102 is described.

[0081] refer to Figure 3 The process may include but is not limited to the following S301 to S303.

[0082] S301: The electronic device reads a type identifier in a first model.

[0083] The type identifier is used to indicate the target model type of the first model. The type identifier here is a self-defined identifier used to indicate the model type. The embodiment of the present application does not limit the composition and storage location of the type identifier, and can be configured according to actual needs.

[0084] For example, during the model design phase, models developed by different tools can be marked with type identifiers. The type identifier here can be inside the file of the first model (for example, by adding a type identifier to the configuration information of the first model) or outside the file of the first model (for example, by reflecting the type of the first model through the naming of the first model). S301 can be implemented as follows: the electronic device reads the file in the first model used to represent the type identifier, and reads the type identifier from the file.

[0085] The embodiment of the present application does not limit the value of the type identifier, and can be configured according to actual needs. Different type identifier values ​​represent different types.

[0086] S302: When the type identifier is the first identifier, the electronic device determines that the target model type is the first type.

[0087] The embodiment of the present application does not limit the value of the first identifier and can be configured according to actual needs. For example, the first identifier can be configured as 001. S302 can be implemented as follows: after the electronic device reads the type identifier of the first model, if the type identifier is the first identifier, it determines that the target model type is the first type.

[0088] S303: When the type identifier is the second identifier, the electronic device determines that the target model type is the second type.

[0089] The embodiment of the present application does not limit the value of the second identifier and can be configured according to actual needs. For example, the second identifier can be configured as 002. S303 can be implemented as follows: after the electronic device reads the type identifier of the first model, if the type identifier is the second identifier, it determines that the target model type is the first type.

[0090] Based on the above technical means, the target model type of the first model is determined by type identification, and the implementation process is convenient and reliable.

[0091] The following describes a process in which the electronic device determines a first model to be processed from a plurality of models included in the target project based on an operation on the first display interface in S101.

[0092] refer to Figure 4 The process may include but is not limited to the following S401 to S405.

[0093] S401: The electronic device receives a first operation on a first control on a first display interface, and opens a project file in response to the first operation.

[0094] The first operation is used to instruct to open the project file. The first operation can be an operation such as clicking or touching.

[0095] The first control button may be named an open button.

[0096] S401 may be implemented as follows: the electronic device receives a first operation on a first control on a first display interface, calls a project opening function in response to the first operation, and opens all project files based on the project opening function.

[0097] S402: The electronic device displays an identifier of at least one item on a first display interface.

[0098] The electronic device displays the identifiers of all project files that can be opened on the first display interface, that is, displays the identifier of at least one project.

[0099] The project identifier is used to uniquely point to a project. The content of the project identifier is not limited in the implementation of this application and can be configured according to actual needs. For example, the project identifier here can be the name of the project, or the project number, etc.

[0100] S403: The electronic device receives a second operation on the first display interface, and determines a target item in at least one item in response to the second operation.

[0101] The second operation is used to select the identifier of a target item from the at least one displayed identifier. The second operation can be a click or touch operation on the identifier of the target item to indicate a selection. The second operation can also be an input operation, where the input content can be the identifier of the target item.

[0102] S403 can be implemented as follows: after displaying the identifier of at least one item on the first display interface, the electronic device receives a second operation on the first display interface, and in response to the second operation, determines the identifier pointed to by the second operation, and determines the project to which the identifier pointed to by the second operation belongs as the target project.

[0103] S404: The electronic device obtains multiple models included in the target project and displays them on the first display interface.

[0104] The electronic device opens the file of the target project, obtains multiple models included in the target project, and then displays the multiple models on the first display interface. The displayed multiple models may be identifiers of the multiple models.

[0105] S405: The electronic device receives a third operation on the first display interface, and determines a first model among multiple models in response to the third operation.

[0106] The third operation is used to select the first model from the displayed multiple models. For example, the third operation can be a click or touch operation on the first model. Alternatively, the third operation can be an input operation on the first model.

[0107] S405 may be implemented as follows: after the electronic device displays multiple models on the first display interface, it may perform operations on the multiple models, and determine the model pointed to by the third operation among the multiple models as the first model. For example, the first model may be selected by clicking the first model, or the first model may be determined by inputting an identifier.

[0108] Based on the above technical means, when determining the first model, the target project is determined first, and then the first model is determined. The logic is clear and the implementation is convenient. The determination process is determined based on the user's input operation on the display interface, which can meet the user's actual needs, has high flexibility and good experience.

[0109] Next, the process of the electronic device determining the first model among the multiple models in response to the third operation in S405 is described.

[0110] refer to Figure 5 The process may include but is not limited to the following S501 to S503.

[0111] S501: The electronic device determines a target control for a third operation.

[0112] For example, the first display interface may include multiple button controls for determining the first model of the code to be generated. For example, the first display interface may include a select all button control, a cancel all button control, and a custom selection button control. The multiple button controls are located at different positions on the first display interface to trigger different selection results.

[0113] The Cancel All button control can be used to cancel the operation of the Select All button control. For example, after selecting all, cancel the selection and then select again using the custom button control.

[0114] The electronic device determines a position corresponding to the third operation, and determines a target control corresponding to the third operation based on the position.

[0115] S502: In a case where the target control is used to indicate all models of the target item, the electronic device determines that the first model includes all models of the target item.

[0116] If the target control is a select all button control, it indicates that the selection result is all models of the target item, and the electronic device determines all models included in the target item as the first model.

[0117] S503: In a case where the target control is used to indicate a partial model of the target item, the electronic device determines that the first model includes the partial model of the target item.

[0118] If the target control is a custom selection button control, it indicates that the selection result is a custom selection result, and the electronic device obtains the custom input content and determines the model in the input content as the first model.

[0119] Based on the above technical means, the first model to be processed can be selected in the target project based on the user's operation. For example, all models or part of the models can be selected, which is convenient and flexible.

[0120] The file processing method for a project provided in an embodiment of the present application may further include a process of adjusting the model based on observation parameters.

[0121] refer to Figure 6 The process may include but is not limited to the following S601 and S602.

[0122] S601: The electronic device receives a fourth operation on the first display interface, and reads a value of an observation parameter in observation value configuration information in response to the fourth operation.

[0123] The observation configuration information includes the observation parameters of the target project and the second model to which the observation parameters belong. The present embodiment does not limit the expression of the observation configuration information and can be configured according to actual needs. For example, the observation configuration information here can be implemented in the form of a table. The table includes multiple second models and the observation parameters of each second model.

[0124] The second model refers to the model to which the observed parameters in the target project belong.

[0125] A control button for reading observation parameters is configured on the first display interface. The electronic device receives a fourth operation on the control button for reading observation parameters on the first display interface, reads the observation configuration information in response to the fourth operation, and then locates the second model based on the observation parameters in the observation configuration information, and reads the values ​​of the observation parameters in the second model.

[0126] Observation parameters refer to the parameters displayed for reading. Here, the rationality of the model design can be determined based on the observation parameters. The embodiment of the present application does not limit the type of observation parameters and can be configured according to actual needs. For example, the observation parameters can be the output signal or intermediate signal of the second model.

[0127] S602: The electronic device adjusts the model in the target project based on the values ​​of the observed parameters.

[0128] After the electronic device reads the value of the observed parameter, it determines whether the value is consistent with the expected value. If it is inconsistent, the problem is located and the model related to the observed parameter in the project is adjusted. If it is consistent, it indicates that the model design is reasonable and no adjustment is made.

[0129] The values ​​of the observation parameters can also be updated and stored in the observation configuration information.

[0130] Based on the above technical means, the values ​​of the observation parameters in the observation configuration information can be read, and then the model in the target project can be adjusted based on the values ​​of the observation parameters, thereby improving the efficiency of model adjustment and project integration. The file processing method for the project provided by the implementation of this application can also include a modification process for the observation configuration information.

[0131] refer to Figure 7 The process may include but is not limited to the following S701 to S703.

[0132] S701: The electronic device receives a fifth operation on a first display interface, and obtains observation configuration information in response to the fifth operation.

[0133] A control button for reading observation quantity information is configured on the first display interface. The electronic device receives a fifth operation on the control button for reading observation quantity information on the first display interface, and obtains observation quantity configuration information in response to the fifth operation.

[0134] S702: The electronic device displays observation configuration information on the first display interface.

[0135] The first display interface includes a control button area and a display area. Here, the observation configuration information is displayed in the display area of ​​the first display interface.

[0136] S703: The electronic device receives a sixth operation on the first display interface, and modifies the observation configuration information displayed on the first display interface in response to the sixth operation.

[0137] The sixth operation is used to modify the observation configuration information.

[0138] Modifications here include, but are not limited to, deletion, updating, and addition. Deletion refers to deleting an observation parameter and its associated secondary model. Update refers to updating an observation parameter, its associated secondary model, or its value. Addition refers to adding a new observation parameter and its associated secondary model.

[0139] Based on the above technical means, the observation configuration information can be modified based on user operations, thereby improving the accuracy of the observation configuration information, improving the accuracy of model adjustment, and improving the efficiency and accuracy of project integration.

[0140] The file processing method for the project provided by the present application may further include a process of generating observation configuration information before adjusting the model based on the observation configuration information.

[0141] refer to Figure 8 The process may include but is not limited to the following S801 to S803.

[0142] S801: The electronic device determines, in a target project, an observation parameter to be added and a second model to which the observation parameter belongs.

[0143] Based on the principles and connection relationships of various models in the target project, the electronic device determines important signal parameters as observation parameters to be added, then determines which models these observation parameters are related to, and determines the related models as second models.

[0144] S802: The electronic device adds observation parameters to the second model in response to a seventh operation on the first display interface for the second model.

[0145] A space button for adding observation parameters is configured on the first display interface. The electronic device receives the seventh operation for the second model on the first display interface, inputs the observation parameters and the second model in response to the seventh operation, and stores the observation parameters and the second model correspondingly in the observation configuration information.

[0146] The observation parameters here correspond to the second model. Additions need to correspond to additions, and deletions also need to correspond to deletions.

[0147] If there are multiple observation parameters, add them one by one in the same way.

[0148] S803: The electronic device generates observation configuration information based on the second model after adding the observation parameters.

[0149] The electronic device obtains at least one added observation parameter and the second model to which each observation parameter belongs, and sorts the at least one observation parameter and the second model to which each observation parameter belongs based on the format of the observation configuration information to obtain observation configuration information.

[0150] Based on the above technical means, the seventh operation can be used to add observation parameters to the model that needs to add observation parameters, and then generate observation configuration information. This enables editing, clear logic, flexibility and reliability.

[0151] The following describes the file processing process of a project by taking an embodiment as an example.

[0152] The C source code generation method is simple to use, but the related technology lacks an interface and lacks strong visualization. There's also no one-stop integration tool for Targetlink and Simulink models, making it impossible to complete all integration tasks from a single control panel during project integration. You typically need to find the program and run it to complete the corresponding function. Customization is also necessary (for example, generating C code for only certain modules rather than the entire project model), requiring source code modification. Furthermore, with numerous integration tasks requiring both Simulink and Targetlink, functionality is fragmented and operations are overly complex.

[0153] This implementation provides a project automatic integration tool and interface, which can complete all integration work. This includes project initialization, automatic code generation, automatic executable file generation, automatic A2L generation, automatic acquisition of observation parameter values, and other functions, achieving one-stop integration.

[0154] As electronic devices continue to grow in complexity, traditional manual coding methods are no longer sufficient to meet design requirements. Consequently, model-based design approaches are becoming increasingly mainstream. This, in turn, complicates project integration tasks. Developing a one-stop integration tool could significantly improve engineer efficiency. However, existing integration methods remain fragmented.

[0155] To address these issues, this embodiment designs a one-stop integrated tool and interface for TargetLink and Simulink models. This includes model condition initialization, model opening, obtaining and displaying TargetLink model Function blocks or Simulink Trigger blocks, model checking and C code generation, custom module C code generation, and project S19 and A2L generation.

[0156] The tool is written in M ​​language and is deeply bound to MATLAB. It can be run directly in the MATLAB environment. The tool is not limited by the MATLAB version. Adding a tool path in MATLAB can directly call it from the command line, making it easy and quick to use.

[0157] The tool opens the project model by calling the Targetlink interface, and then calls the initialization file in the model source folder to initialize the project model; obtains all the functions or triggers of the project model and displays them on the interface, and then selects the modules to be compiled; generates C code by calling the Targetlink interface or Simulink interface, and supports generating C code for custom modules; generates S19 functions through WindRiver compilation and writing makefile scripts to generate S19; the A2L generation function configures the interface by calling the Targetlink interface to generate A2L.

[0158] After testing, this tool can realize the entire software integration work of the project engineering, which can effectively save the time of integration work. The tool is very convenient, greatly simplifies the operational difficulty of the staff during the integration process, and greatly reduces the learning cost.

[0159] refer to Figure 9 The processing process of the project file may include but is not limited to the following S901 to S907.

[0160] S901: Project initialization.

[0161] S902. Open the project model (equivalent to the above-mentioned target project).

[0162] S903: Load and display the functional module (equivalent to the above-mentioned model).

[0163] S904: Select the module to be compiled (equivalent to the above model).

[0164] S905: Generate C code.

[0165] S906: Generate S19 file.

[0166] S907: Generate an A2L file.

[0167] The implementation language used for the integration method and interface of this project is M language, and the interface creation is achieved through the UIControl function of Matlab.

[0168] Place the tool in the MATLAB installation directory and add the path. You can call it up from the command line. Use the Init and Runinit buttons to initialize the project configuration, and OpenModel to initialize the parameters. The execution order is Init, OpenModel, and Runinit. If the Init function is not executed before OpenModel, the system will prompt you and will not execute the relevant OpenModel functions. If the OpenModel function is not executed before Runinit, the system will prompt you and will not execute the relevant Runinit functions.

[0169] The load function (load_function) recognizes the Targetlink module and displays it on the interface. Before execution, you need to ensure that the Runinit function is executed, otherwise the system will prompt and will not execute the load_function related functions. The load_function scans the Targetlink model related flags in the model to obtain the path and module name of the Targetlink module, and then filters the modules according to the project and displays the filtered modules on the interface. This display function is implemented by creating a new table (table) module. The new table module is created and the relevant parameters of the table module are assigned and initialized to realize the display of the Targetlink module name.

[0170] Select All (SelectAll) selects all Targetlink modules for C code generation, No Select All (NOSelectAll) deletes all selected Targetlink modules for which C code generation is required, and Custom Selection (DIYSelect) allows you to custom select the Targetlink modules for which C code generation is required. This function implements module selection by assigning values ​​to the relevant parameters of the table module created in the early stage.

[0171] The Generate (Build) C button (equivalent to the above-mentioned generation operation) generates C code for the selected Targetlink module. C code is generated by reading the selection of related Targetlink modules in the interface table module. Model checking is automatically performed before C code generation. GenerateS19 compiles C code to generate S19 by linking WindRiver to write makefiles and batch files. GenerateA2L generates A2L by calling and configuring the Targetlink interface.

[0172] Before generating C code, some preparation is required, which is also completed in the interface. First, execute Init to set the project character encoding format. Then execute OpenModel to open the project model and search for the source files of each module. Run the initialization script of each module to initialize the parameters of each module. Then execute Runinit to run the project initialization script to initialize the entire project. Then run load_function to filter and extract the Targetlink modules, obtain the project path and module name of the filtered modules, and display the module name on the interface to facilitate engineers to view and select the modules for which C code generation is required. Then execute SelectAll / DIYSelect to select the Targetlink modules for which C code generation is required. The module names and their selection status displayed on the interface are made into a structure. By reading the corresponding parameters of the structure, the selected Targetlink modules are selected, and the module selection status is matched with the project path where the module is located to obtain the modules for which C code generation is required. Then execute the BuildC function to perform C code generation. This function calls the Targetlink interface and automatically configures the interface accordingly according to the module status of the module to generate C code. After generating C code, the generated C code files are automatically packaged and moved to the folder required to be scanned in the subsequent S19 generation.

[0173] Generate S19 and A2L: Generate S19 by calling the Windriver interface. If the application layer C code is not generated, a prompt will be displayed and the subsequent S19 generation functions will not be executed. If complete application layer code and underlying packages are available, they will be configured through the written batch file and makefile. The batch file is executed in the m script, and the S19 generation function is executed according to the makefile configuration by calling the Windriver interface. Generate A2L by calling and configuring the Targetlink interface. Different A2L generation methods are configured according to project requirements. The previously generated map, xml, identified modules to be compiled, and the preset target input script are used as input parameters to achieve A2L generation through different calling methods.

[0174] This integration method and interface achieves one-stop integration through the above methods, while adding prompts to enable integration staff to operate more clearly and realize the integration of the entire project.

[0175] The integrated functions can be referenced Figure 10 The content shown includes but is not limited to:

[0176] Module 1001: used for project initialization;

[0177] Module 1002: used to open the model and initialize the modules within the model.

[0178] Module 1003: used for model initialization.

[0179] Module 1004: used to obtain and filter the models that need to generate C code and display them.

[0180] Module 1005: used to select models displayed on all interfaces.

[0181] Module 1006: used to set all models to be unselected.

[0182] Module 1007: Used to customize the selection model.

[0183] Module 1008: used to generate C code for the selected model.

[0184] Module 1009: used to generate S19.

[0185] Module 1010: used to generate A2L.

[0186] The integration process can be referred to Figure 11 The content shown includes but is not limited to S1101 to S1114.

[0187] S1101. Project initialization.

[0188] S1102: Determine whether the project initialization is completed.

[0189] If yes, execute the following S1103; if no, execute the above S1101.

[0190] S1103. Open the model.

[0191] S1104: Determine whether the model opening process has been completed.

[0192] If yes, execute the following S1105; if no, execute the above S1103.

[0193] S1105: Model initialization.

[0194] S1106: Determine whether model initialization is complete.

[0195] If yes, execute the following S1107; if no, execute the above S1105.

[0196] S1107: Load the functional module.

[0197] S1108: Determine whether the loading function module has been completed.

[0198] If yes, execute the following S1109; if no, execute the above S1107.

[0199] S1109, select all.

[0200] S1110. Custom selection.

[0201] S1111. Generate C code.

[0202] S1112: Determine whether the complete application layer code is contained.

[0203] If so, execute the following S1113; if not, execute the above S1109 or S1110.

[0204] S1113, generate S19.

[0205] S1114. Generate A2L.

[0206] The integrated display interface (equivalent to the first display interface) can be referred to Figure 12 The content shown includes a first area 1201 and a second area 1202. The first area 1201 is used for display. The second area 1202 includes Project Initialization 12021, Open Model 12022, Model Initialization 12023, Load Function 12024, Select All 12025, Unselect All 12026, Customize 12027, Generate C (12028), Generate S19 (12029), Generate A2L (12010), and Observation 12011.

[0207] The corresponding functions can be achieved through the buttons for Initialize Item 12021, Open Model 12022, Initialize Model 12023, Load Function 12024, Select All 12025, Unselect All 12026, Customize 12027, Generate C (12028), Generate S19 (12029), Generate A2L (12010), and Observation 12011. Clicking the Observation 12011 button displays all button functions related to the observation. For example, this may include an Add button, a View button, a Modify button, and so on.

[0208] By identifying customizable parameters (such as the Function module parameters of targetlink and the Trigger module parameters of Simulink), the targetlink and Simulink modules to be compiled are intelligently identified and displayed in the visual interface. The identified modules are marked, and different code generation methods can be used to generate code during the code generation process.

[0209] Observation table management: By encapsulating a custom Targetlink / Simulink observation management module, configuring observation parameters, and adding the module during model building, double-click the module and enter the observation name in the input box. The tool can identify all observations that need to be added or have been added to the model (equivalent to the above-mentioned observation parameters) with one click, and write the observations and their addition status into a table for visual management. Visual management divides the observations into modules based on the module identification of innovation point one, allowing you to quickly locate which functional module the observation belongs to. At the same time, a new "whether to add observations" option has been added to the table. Based on this option, the tool can add and delete model observations with one click, achieving two-way matching between the table and the model.

[0210] In a second aspect, an embodiment of the present application provides a device for processing files of a project. The file processing of the project can be deployed in an electronic device. Figure 13 As shown in the content, the project file processing device 130 may include but is not limited to: a determination unit 1301, an identification unit 1302 and a processing unit 1303.

[0211] in:

[0212] A determining unit 1301 is configured to determine a first model to be processed from a plurality of models included in a target project based on an operation on the first display interface;

[0213] An identification unit 1302 is configured to identify a target model type of the first model, where the target model type includes a first type for a first modeling tool and / or a second type for a second modeling tool;

[0214] The processing unit 1303 is configured to receive and respond to the generating operation, process the first model to be processed based on the target model type, and obtain a code file of the first model.

[0215] In some embodiments, the processing unit 1303 is also used to: when the target model type includes the first type, call the first code generation interface in the first modeling tool to process the first model of the first type to obtain the code file of the first model of the first type; when the target model type includes the second type, call the second code generation interface in the second modeling tool to process the first model of the second type to obtain the code file of the first model of the second type.

[0216] In some embodiments, the identification unit 1302 is also used to: read the type identifier in the first model; the type identifier is used to indicate the target model type of the first model; when the type identifier is the first identifier, the target model type is determined to be the first type; when the type identifier is the second identifier, the target model type is determined to be the second type.

[0217] In some embodiments, the determination unit 1301 is also used to: receive a first operation on a first control on a first display interface, and open a project file in response to the first operation; the first operation is used to indicate the opening of a project file; display the identifier of at least one project on the first display interface; receive a second operation on the first display interface, and determine a target project from at least one project in response to the second operation; the second operation is used to select the identifier of the target project from the identifiers of at least one project displayed; obtain multiple models included in the target project and display them on the first display interface; receive a third operation on the first display interface, and determine a first model from multiple models in response to the third operation; the third operation is used to select the first model from the multiple models displayed.

[0218] In some embodiments, the determination unit 1301 is also used to: determine the target control on which the third operation acts; when the target control is used to indicate all models of the target item, determine that the first model includes all models of the target item; when the target control is used to indicate partial models of the target item, determine that the first model includes partial models of the target item.

[0219] In some embodiments, the file processing device 130 of the project may further include an adjustment unit, which is used to: receive a fourth operation for the first display interface, and in response to the fourth operation, read the value of the observation parameter in the observation configuration information; the observation configuration information includes the observation of the target project and the second model to which the observation belongs; based on the value of the observation parameter, adjust the model in the target project.

[0220] In some embodiments, the adjustment unit is also used to: receive a fifth operation for the first display interface, and obtain observation configuration information in response to the fifth operation; display the observation configuration information on the first display interface; receive a sixth operation for the first display interface, and modify the observation configuration information displayed on the first display interface in response to the sixth operation.

[0221] In some embodiments, the file processing device 130 of the project may further include a configuration unit, which is used to: determine the observation parameters to be added and the second model to which the observation parameters belong in the target project; add the observation parameters to the second model in response to the seventh operation on the second model on the first display interface; and generate observation configuration information based on the second model after the observation parameters are added.

[0222] In a third aspect, the present application further provides an electronic device, a vehicle including a processor and a memory, wherein the memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, the method provided in the first aspect is implemented.

[0223] In one example, reference Figure 14As shown, electronic device 140 includes a processor 1401, at least one communication bus 1402, a user interface 1403, at least one external communication interface 1404, and memory 1405. Communication lines 1402 are configured to enable communication between these components. User interface 1403 may include a display screen, and external communication interface 1404 may include standard wired and wireless interfaces.

[0224] The memory 1405 is configured to store instructions and applications executable by the processor 1401, and can also cache data to be processed or processed by the processor 1401 and various modules in the electronic device (for example, image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0225] In a fourth aspect, an embodiment of the present application provides a storage medium, that is, a computer-readable storage medium, which stores a computer program or instructions. When the computer program or instructions are executed by a processor, the method provided in the first aspect above is implemented.

[0226] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the method provided in the first aspect is implemented.

[0227] It should be noted that the descriptions of the above storage medium, device, and program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, device, apparatus, and program product embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0228] It should be understood that “one embodiment” or “an embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, “in one embodiment” or “in some embodiments” appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0229] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0230] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0231] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0232] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0233] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0234] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0235] The above description is merely an embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A file processing method for a project, characterized in that: The method comprises: Based on an operation on the first display interface, determining a first model to be processed from a plurality of models included in the target project; identifying a target model type for the first model, the target model type comprising a first type for a first modeling tool and / or a second type for a second modeling tool; the first modeling tool being different from the second modeling tool; The generating operation is received and responded to, and the first model to be processed is processed based on the target model type to obtain a code file of the first model.

2. The method according to claim 1, characterized in that The processing of the first model to be processed based on the target model type to obtain a code file of the first model includes: In a case where the target model type includes a first type, calling a first code generation interface in a first modeling tool to process a first model of the first type to obtain a code file of the first model of the first type; In a case where the target model type includes a second type, a second code generation interface in a second modeling tool is called to process the first model of the second type to obtain a code file of the first model of the second type.

3. The method according to claim 1, characterized in that The identifying the target model type of the first model includes: Reading a type identifier in the first model; the type identifier is used to indicate a target model type of the first model; When the type identifier is the first identifier, determining that the target model type is the first type; When the type identifier is the second identifier, the target model type is determined to be the second type.

4. The method according to any one of claims 1 to 3, characterized in that The determining, based on the operation on the first display interface, a first model to be processed from a plurality of models included in the target project, includes: receiving a first operation on a first control on the first display interface, and opening a project file in response to the first operation; the first operation is used to instruct to open the project file; Displaying an identifier of at least one item on the first display interface; receiving a second operation on the first display interface, and determining the target item from the at least one item in response to the second operation; wherein the second operation is used to select an identifier of the target item from among the displayed identifiers of the at least one item; Acquire multiple models included in the target project and display them on the first display interface; A third operation is received on the first display interface, and the first model is determined from the multiple models in response to the third operation; the third operation is used to select the first model from the multiple models displayed.

5. The method according to claim 4, characterized in that Determining the first model among the plurality of models in response to the third operation includes: Determining a target control for the third operation; In a case where the target control is used to indicate all models of the target item, determining that the first model includes all models of the target item; In a case where the target control is used to indicate a partial model of the target item, it is determined that the first model includes the partial model of the target item.

6. The method according to any one of claims 1 to 3, characterized in that The method further comprises: receiving a fourth operation on the first display interface, and in response to the fourth operation, reading a value of an observation parameter in observation configuration information, wherein the observation configuration information includes the observation parameter of the target item and the second model to which the observation parameter belongs; Based on the values ​​of the observed parameters, the model in the target project is adjusted.

7. The method according to claim 6, characterized in that The method further comprises: receiving a fifth operation on the first display interface, and acquiring the observation configuration information in response to the fifth operation; Displaying the observation configuration information on the first display interface; A sixth operation on the first display interface is received, and in response to the sixth operation, the observation configuration information displayed on the first display interface is modified.

8. The method according to claim 6, characterized in that The method further comprises: Determining, in the target project, an observation parameter to be added and a second model to which the observation parameter belongs; In response to a seventh operation on the first display interface with respect to the second model, adding the observation parameter to the second model; The observation configuration information is generated based on the second model after the observation parameters are added.

9. A file processing device for a project, characterized in that: The device comprises: a determining unit, configured to determine a first model to be processed from a plurality of models included in the target project based on an operation on the first display interface; an identification unit, configured to identify a target model type of the first model, the target model type comprising a first type for target linking with a first modeling tool and / or a second type for simulation linking with a second modeling tool; The processing unit is configured to receive and, in response to a generation operation, process the first model to be processed based on the target model type to obtain a code file of the first model.

10. An electronic device, characterized in that: The device includes a memory and a processor, wherein a computer program or instruction is stored in the memory, and when the computer program or instruction is executed by the processor, the method according to any one of claims 1 to 8 is implemented.