Graphical code large model training method and device, equipment, storage medium and program product
By acquiring and preprocessing language model data, completing and adjusting the graphical code model to automatically generate code, the problems of low efficiency and poor quality of graphical code development in the existing technology are solved, and efficient and accurate graphical code big model training and intelligent development are achieved.
Patent Information
- Application Number
- CN202411768437.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
AI Technical Summary
The existing technology relies on manual code writing and manual adjustment of code interfaces in graphical code development, resulting in extended development cycles, wasted resources, low code quality and inability to adapt to rapidly changing development needs.
By obtaining language model and model preprocessing data, using the model preprocessing data to complete the model code data and adjust the language model to determine the graphical code model, and applying the model to automatically generate graphical code.
Significantly reduce development time and human resource consumption, reduce human errors, improve code quality, adapt to changing development needs, reduce development costs, improve project return on investment, and promote graphical code development toward intelligence and automation.
Smart Images

Figure CN119690414A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphical code development technology, and in particular to a graphical code large model training method, device, equipment, storage medium and program product. Background Art
[0002] With the improvement of automobile electronics level and the development of big model technology, more and more electronic control units in automobiles are beginning to use big model-based system engineering for code development. People usually apply big models to the field of code development, but rarely apply big models to graphical code development. Therefore, graphical code models can be used to more effectively help engineers with system design and code development.
[0003] At present, the existing practice relies on manual coding and manual adjustment of code interfaces. Developers need to use specific programming tools to build large models according to system requirements and manually write corresponding codes. However, the existing practice is not only time-consuming, but also cumbersome and error-prone, resulting in extended development cycles and waste of resources. It takes a lot of time to spend on a lot of repetitive work, which limits the improvement of development efficiency and code quality. It is also unable to adapt to rapidly changing development requirements and lacks flexibility and scalability. Therefore, how to efficiently and accurately train large graphical code models to apply to graphical code intelligent development has become an urgent problem to be solved.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a graphical code large model training method, device, equipment, storage medium and program product, aiming to solve the technical problem of how to efficiently and accurately train a graphical code large model to adapt to graphical code intelligent development.
[0006] To achieve the above purpose, the present application proposes a graphical code large model training method, the method comprising:
[0007] Obtain language model and model preprocessing data;
[0008] Completing the model code data based on the model preprocessing data adjusts the language model to determine a graphical code model;
[0009] The graphical code model is applied to automatically generate graphical code.
[0010] In one embodiment, the step of obtaining the language model and model preprocessing data includes:
[0011] Get a set of common models and graphical code domain datasets;
[0012] Training the general model set to determine a model scoring set;
[0013] selecting a language model based on the set of model scores;
[0014] The graphical code domain data set is subjected to data preprocessing to determine model preprocessing data, wherein the data preprocessing includes data cleaning, data labeling and data enhancement.
[0015] In one embodiment, the step of completing the model code data based on the model preprocessing data to adjust the language model and determine the graphical code model includes:
[0016] Get model code data;
[0017] Determine completion data by completing the model code data based on the model preprocessing data;
[0018] Generate an explanation text through a code interpreter based on the completion data;
[0019] A graphical code model is trained based on the interpreted text and the language model.
[0020] In one embodiment, the step of training the graphical code model based on the interpreted text and the language model includes:
[0021] Get the language model weight;
[0022] Fine-tuning the language model based on the interpreted text to determine an update weight;
[0023] The update weight and the language model weight are combined to determine the optimization weight;
[0024] The language model is adjusted based on the optimization weight to obtain a graphical code model.
[0025] In one embodiment, the step of automatically generating graphical code by applying the graphical code model includes:
[0026] Get the scoring item set;
[0027] Applying the graphical code model to test the scoring item set to verify the performance of the graphical code model and determine a test scoring set;
[0028] A graphical code optimization model is determined based on the graphical code model and the test score set to automatically generate graphical code.
[0029] In one embodiment, the step of determining a graphical code optimization model based on the graphical code model and the test score set to automatically generate graphical code includes:
[0030] Get the target test score set;
[0031] Adjusting model hyperparameters in the graphical code model based on the test score set and the target test score set to determine a graphical code optimization model;
[0032] Graphical code is automatically generated based on the graphical code optimization model.
[0033] In addition, to achieve the above purpose, the present application also proposes a graphical code large model training device, the graphical code large model training device comprising:
[0034] The acquisition module is used to obtain the language model and model preprocessing data;
[0035] A processing module, configured to adjust the language model completion model code data based on the model preprocessing data to determine a graphical code model;
[0036] An execution module is used to apply the graphical code model to automatically generate graphical code.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a graphical code large model training device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the graphical code large model training method as described above.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the graphical code large model training method described above are implemented.
[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the graphical code large model training method as described above.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] The present application proposes a method for training a large model of graphical code, which includes obtaining a language model and model preprocessing data; adjusting the language model to determine a graphical code model by completing the model code data based on the model preprocessing data; and automatically generating graphical code by applying the graphical code model. The present application obtains a language model and model preprocessing data, uses the model preprocessing data to complete the model code data and adjusts the language model to determine the graphical code model, thereby automatically generating graphical code, greatly reducing development time and human resource consumption, reducing human errors, improving code quality, better understanding and generating code that meets field requirements, and reducing development costs, improving the project's return on investment, adapting to changing development needs, and promoting the development of graphical code in the direction of intelligence and automation, and promoting technological innovation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A flowchart diagram of the first embodiment of the graphical code large model training method of the present application is provided;
[0045] Figure 2 A flow chart of the second embodiment of the graphical code large model training method of the present application;
[0046] Figure 3 This is a schematic diagram of the module structure of the graphical code large model training device according to an embodiment of the present application;
[0047] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the graphical code large model training method in the embodiment of the present application.
[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: obtaining a language model and model preprocessing data; adjusting the language model to determine a graphical code model based on the model preprocessing data to complete the model code data; and applying the graphical code model to automatically generate graphical code.
[0052] In this embodiment, for ease of description, the following description is made using a large model training device for identifying graphical codes as the execution subject.
[0053] Because existing technologies are not only time-consuming, but also cumbersome and error-prone, the development cycle is extended and resources are wasted. A lot of time needs to be spent on a lot of repetitive work, which limits the improvement of development efficiency and code quality. It is also unable to adapt to rapidly changing development needs and lacks flexibility and scalability.
[0054] The present application provides a solution, which includes obtaining a language model and model preprocessing data; adjusting the language model to determine a graphical code model by completing model code data based on the model preprocessing data; and applying the graphical code model to automatically generate graphical code.
[0055] It can be seen from the above embodiments that the present application obtains language models and model preprocessing data, uses the model preprocessing data to complete the model code data and adjusts the language model to determine the graphical code model, thereby automatically generating graphical code, greatly reducing development time and human resource consumption, reducing human errors, improving code quality, better understanding and generating code that meets domain requirements, and reducing development costs. It improves the project's return on investment, adapts to ever-changing development needs, and promotes the development of graphical code towards intelligence and automation, promoting technological innovation.
[0056] Based on this, the present application embodiment provides a graphical code large model training method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the graphical code large model training method of the present application.
[0057] In this embodiment, the graphical code large model training method includes steps S10 to S30:
[0058] Step S10, obtaining a language model and model preprocessing data;
[0059] It should be noted that the language model reflects the characteristics of the large model selected to identify the code language, and the model preprocessing data reflects the characteristics of the large model input data obtained after data preprocessing.
[0060] It can be understood that the language model representation is the largest model selected that is closest to the field of graphical code development, and the model preprocessing data representation is the trained data that is suitable for the field of graphical code development. Selecting a suitable language model in advance and preprocessing the training data can significantly improve the effect of fitting training of the large model and the quality of the final generated code, and reduce the workload of manual code writing and adjustment, shorten the development cycle, adapt to rapidly changing development needs, and have better flexibility and scalability.
[0061] For ease of understanding, obtaining a language model and model preprocessing data is taken as an example for explanation, wherein the information acquisition device is an information acquisition module, and the storage device is a memory.
[0062] The information acquisition module obtains a general model set, that is, obtains 20 general large models, trains the general model set to determine a model scoring set, that is, trains the 20 general large models to evaluate the large model performance, obtains 20 large model scores, selects a language model based on the model scoring set, and selects the large model with the highest score as the selected language model, that is, selects a high-quality general base language large model as the training starting point. At this time, the high-quality general base language large model has good language understanding and code generation capabilities. Then, MBSE domain experts select question-answer pairs to obtain a graphical code domain data set, that is, create a QA data set specific to the MBSE domain, and perform data preprocessing on the graphical code domain data set to determine the model preprocessing data, that is, perform data preprocessing on the QA data set. The data preprocessing includes data cleaning, data labeling and data enhancement, so as to obtain model preprocessing data, and perform subsequent processing based on the language model and the model preprocessing data.
[0063] In a feasible implementation, step S10 may include steps A11 to A14:
[0064] Step A11, obtaining a general model set and a graphical code domain data set;
[0065] It should be noted that the general model set reflects the characteristics of a general model set that can process code languages, and the graphical code domain data set reflects the characteristics of a data set screened based on code characteristics.
[0066] It can be understood that the general model set may include a variety of general base language large models for processing programming languages and code structures, and the graphical code domain dataset representation more accurately captures the data set for screening graphical code features, including structures and patterns unique to graphical code development, so that the trained large model can better understand and generate graphical code.
[0067] Step A12, training the general model set to determine a model scoring set;
[0068] It should be noted that the model scoring set reflects the characteristics of evaluating the performance of the large model.
[0069] It can be understood that the model scoring set includes the results of performance evaluation of multiple general large models, so as to quickly identify and select the large model that is most suitable for tasks in the field of graphical code development, thereby improving development efficiency and code quality.
[0070] Step A13, selecting a language model based on the model score set;
[0071] It should be noted that the language model reflects the characteristics of a high-quality universal base language model selected to be suitable for graphical code development.
[0072] It is understandable that since the language model is a multi-dimensional structure rather than a text-based one, an intermediate conversion medium is required, such as a code interpreter, which is a text-based medium used to convert the language model into a text-based QA dataset for large model training.
[0073] Step A14, performing data preprocessing on the graphical code domain data set to determine model preprocessing data, wherein the data preprocessing includes data cleaning, data labeling and data enhancement.
[0074] It should be noted that the model preprocessing data reflects the characteristics of preprocessing and converting the graphical code domain data set into data suitable for large model input.
[0075] It is understandable that data preprocessing can be performed using data cleaning, data labeling, and data boosting. Data cleaning can remove noise and inconsistencies in the data set, such as removing duplicate records and correcting erroneous labels. Data labeling can provide correct labels for samples in the data set for learning correct outputs. Data boosting can increase the diversity of the data set by creating data variants, which can be used to enable the large model to learn more generalized features and improve the generalization ability of the large model.
[0076] Step S20, completing the model code data based on the model preprocessing data, adjusting the language model and determining a graphical code model;
[0077] It should be noted that the graphical code model reflects the feature of using graphical blocks or dragged and connected elements to represent program logic.
[0078] It can be understood that the application of the graphical code model can automatically generate a graphical code module, which is a code graphic block that is different from the generated text. By dragging and connecting different code blocks, the program flow can be quickly constructed, code reuse and combination can be achieved, programming efficiency can be significantly improved, and development time can be saved.
[0079] For ease of understanding, an explanation is given by taking determining a graphical code model as an example, wherein the information collection device is an information collection module, the storage device is a memory, and the processing device is a processing module.
[0080] The information acquisition module obtains model code data and model preprocessing data, completes the model code data based on the model preprocessing data to determine the completion data, generates an explanation text through a code interpreter based on the completion data, that is, uses a text-based intermediate medium to convert the completion data into an explanation text, obtains a language model weight, uses LoRA technology to limit algorithm scheduling, and the LoRA technology is used to reduce the demand for video memory required to adjust the language model. The language model is fine-tuned based on the explanation text to determine the update weight, that is, fine-tuning is performed to train a large model in the MBSE field, and only the weight of the low-rank adaptive layer is updated, while the weight of the pre-trained large model is kept fixed, the update weight and the language model weight are merged to determine the optimization weight, that is, reasoning is performed, the update weight obtained by fine-tuning is merged with the language model weight, and the architecture of the original large model is kept unchanged to obtain the optimization weight, the language model is adjusted based on the optimization weight to obtain a graphical code model, that is, the language model is adjusted by reinforcement learning with artificial feedback, and a reward large model that accurately evaluates the output of the large model is obtained, thereby obtaining a graphical code model, and subsequent processing is performed based on the graphical code model.
[0081] Step S30: automatically generate graphical code using the graphical code model.
[0082] It can be understood that the graphical code model is suitable for graphical code development, and provides reusable graphic elements and function libraries. Users can directly use these elements to implement common functions without having to write code from scratch, thereby reducing the chance of errors and converting abstract programming concepts into visual graphical representations, which are more intuitive and easy to understand.
[0083] In addition, it should be noted that through automated code generation and assisted development, development time and human resource consumption can be greatly reduced, human errors can be reduced, code quality can be improved, and the efficiency of code development can be significantly improved.
[0084] For ease of understanding, an example of obtaining a graphical code model is used for explanation, wherein the information collection device is an information collection module, the storage device is a memory, and the execution device is an execution module.
[0085] The information acquisition module obtains a scoring item set. If there are 100 scoring items, the graphical code model is applied to test the scoring item set to verify the performance of the graphical code model and determine the test scoring set, that is, the MBSE large model is evaluated for effectiveness, and the 100 scoring items are scored to evaluate the accuracy, efficiency and maintainability of code generation, and 100 test results are obtained, that is, the target test scoring set is obtained. Based on the test scoring set and the target test scoring set, the model hyperparameters in the graphical code model are adjusted to determine the graphical code optimization model, and the graphical code is automatically generated based on the graphical code optimization model, that is, the evaluated MBSE large model is deployed to the actual MBSE code development environment to achieve automated code generation and assisted development.
[0086] In a feasible implementation, step S30 may include steps B11 to B13:
[0087] Step B11, obtaining a scoring item set;
[0088] It should be noted that the scoring item set reflects the characteristics of the test items for quantitatively evaluating the performance of the large model.
[0089] It is understandable that the scoring item set can convert various dimensions of the big model performance into measurable test items, which can include user ratings of items, item attributes and item characteristics, so as to comprehensively test the performance of the big model in actually automatically generating code.
[0090] Step B12, applying the graphical code model to test the scoring item set to verify the performance of the graphical code model and determine the test scoring set;
[0091] It should be noted that the test score set reflects the characteristics of the score set for evaluating the large model performance test items.
[0092] It can be understood that the test score set can verify the performance of the graphical code model, and evaluate the code generated by the large model in a quantitative manner, converting various aspects of code quality into measurable values for monitoring, thereby providing feedback on the performance of the large model in actual applications.
[0093] Step B13: determining a graphical code optimization model based on the graphical code model and the test score set to automatically generate graphical code.
[0094] It can be understood that through the feedback of the test score set, the performance of the graphical code model and the quality of the generated code are continuously improved and balanced to obtain the graphical code optimization model, thereby automatically generating higher quality graphical code, reducing manual intervention, improving development efficiency, and adapting to different development needs and scenarios, and improving its generalization ability.
[0095] In a feasible implementation manner, step B13 may include steps C11 to C13:
[0096] Step C11, obtaining a target test score set;
[0097] It should be noted that the target test score set reflects the characteristics of the score results of the large model performance items that are expected to be achieved.
[0098] It can be understood that the target test score set provides a benchmark for large model performance, which can be customized according to different application requirements and development goals, and is used to measure and compare the training performance of large graphical code models, so as to make targeted adjustments to model hyperparameters for optimization, so that the code generated by the graphical code model is more in line with the actual needs of users, significantly improving user satisfaction.
[0099] Step C12, adjusting the model hyperparameters in the graphical code model based on the test score set and the target test score set to determine a graphical code optimization model;
[0100] It should be noted that the graphical code optimization model reflects the characteristics of the optimized large model obtained by adjusting the model hyperparameters.
[0101] It is understandable that by adjusting the model hyperparameters to optimize the performance of large models, the accuracy, efficiency and maintainability of code generation can be improved to adapt to different development needs and optimization goals, generate higher quality code, reduce errors and improve code readability, shorten the development cycle and improve development efficiency.
[0102] Step C13: automatically generating graphical code based on the graphical code optimization model.
[0103] It can be understood that automatically generating graphical code based on the graphical code optimization model significantly improves the efficiency of code production, shortens the development cycle, reduces errors in human-written code, improves the reliability and stability of the code, facilitates maintenance and understanding, and can quickly adapt to new changes in requirements, thereby improving the flexibility of the development process.
[0104] The present embodiment proposes a graphical code large model training method, which includes obtaining a language model and model preprocessing data; adjusting the language model to determine a graphical code model based on the model preprocessing data to complete the model code data and adjust the large model; and automatically generating graphical code using the graphical code model. The present invention solves the technical problem of how to efficiently train a graphical code large model. Compared with the prior art, the present invention obtains a language model and model preprocessing data, uses the model preprocessing data to complete the model code data and adjust the large model, thereby determining the graphical code model and automatically generating graphical code. By automating the MBSE code development process, the development time and human resource consumption are greatly reduced. The natural language understanding and code generation capabilities of the large model are used to reduce human errors and improve code quality. The large model customized for the MBSE field can better understand and generate code that meets the requirements of the field, and supports continuous training and optimization of the MBSE large model to adapt to the ever-changing development needs. At the same time, automated MBSE code development can reduce development costs, improve the return on investment of the project, promote the MBSE field to develop in the direction of intelligence and automation, and promote technological innovation.
[0105] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated later.
[0106] In this embodiment, refer to Figure 2 , Figure 2 The flowchart provided for the second embodiment of the graphical code large model training method of the present application, step S20 specifically includes steps S21 to S24:
[0107] Step S21, obtaining model code data;
[0108] It should be noted that the model code data reflects the characteristics of the code and related large model information extracted from the existing large model project.
[0109] It can be understood that the model code data includes the large model code structure, interfaces, dependencies and related system engineering parameters, thereby ensuring that the large model can accurately understand and generate code that meets the specific requirements of the MBSE field, automatically extract and process code data from MBSE projects, reduce the workload of manual coding, and speed up the development process.
[0110] For ease of understanding, the acquisition of model code data is taken as an example for explanation, wherein the information acquisition device is the information acquisition module, the storage device is the memory, and the processing device is the processing module.
[0111] The information acquisition module obtains a general model set, that is, obtains 20 general large models, trains the general model set to determine a model scoring set, that is, trains the 20 general large models to evaluate the large model performance, obtains 20 large model scores, selects a language model based on the model scoring set, selects the large model with the highest score as the selected language model, that is, selects a high-quality general base language model as the training starting point. At this time, the high-quality general base language model has good language understanding and code generation capabilities, generates code that meets the specific requirements of the MBSE field based on the language model, automatically extracts and processes code data from the MBSE project, obtains model code data, and performs subsequent processing based on the model code data.
[0112] Step S22, completing the model code data based on the model preprocessing data to determine the completion data;
[0113] It should be noted that the completion data reflects the characteristics of the details required to complete the model code data to generate the graphical code.
[0114] It can be understood that by completing the incomplete or missing code data in the MBSE project, the completeness of the data set can be improved, which is suitable for the training of graphical code models and automatically generates higher quality graphical code modules.
[0115] For ease of understanding, the following description is given by taking determining the completed data as an example, wherein the information collection device is an information collection module, the storage device is a memory, and the processing device is a processing module.
[0116] The information acquisition module acquires model code data and model preprocessing data, determines the supplementary data by supplementing the model code data based on the model preprocessing data, that is, supplements the incomplete or missing code data in the MBSE project, and performs subsequent processing based on the supplementary data.
[0117] Step S23, generating an explanation text through a code interpreter based on the completion data;
[0118] It should be noted that the explanation text reflects the characteristics of converting the completed model code data into data in text form.
[0119] It can be understood that by converting and completing the data through the code interpreter to generate explanatory text, easy-to-process textual data is obtained, which enables the large model to have a deeper understanding of the logic and structure of the code, thereby improving the accuracy and reliability of the code generated by the large model, generating higher quality code, and improving training efficiency.
[0120] For ease of understanding, the generation of an explanation text is taken as an example for explanation, wherein the information collection device is an information collection module, the storage device is a memory, and the processing device is a processing module.
[0121] The information acquisition module obtains model code data and model preprocessing data, completes the model code data based on the model preprocessing data to determine the completion data, generates an explanation text through a code interpreter based on the completion data, that is, uses a text-type intermediate medium to convert the completion data into an explanation text, and performs subsequent processing based on the explanation text.
[0122] Step S24: training a graphical code model based on the explained text and the language model.
[0123] It can be understood that by using the interpreted text to train the language model, a graphical code model is obtained that can understand and generate MBSE domain-specific codes, thereby automatically generating graphical codes that meet domain requirements.
[0124] In addition, it should be noted that the use of automated graphical code models to generate code greatly reduces the workload of developers in manually writing code, shortens the development cycle, and the trained graphical code model can generate more accurate and consistent code, reduces human errors, improves code reliability and stability, and the generated graphical code is more in line with domain-specific specifications and standards, improving the applicability of code modules.
[0125] For ease of understanding, the acquisition of explanation text and language model is taken as an example for explanation, wherein the information acquisition device is the information acquisition module, the storage device is the memory, and the processing device is the processing module.
[0126] The information acquisition module obtains the explanation text and the language model, trains the graphical code model based on the explanation text and the language model, that is, uses the language model to obtain the language model weight, uses the LoRA technology to limit the algorithm scheduling, and the LoRA technology is used to reduce the demand for video memory required to adjust the language model. The language model is fine-tuned based on the explanation text to determine the update weight, that is, fine-tuning is performed to train a large model in the MBSE field, and only the weight of the low-rank adaptive layer is updated, while the weight of the pre-trained large model is kept fixed, and the update weight and the language model weight are merged to determine the optimization weight, that is, reasoning is performed, and the update weight obtained by fine-tuning is merged with the language model weight, and the architecture of the original large model is kept unchanged to obtain the optimization weight, and the language model is adjusted based on the optimization weight to obtain a graphical code model, that is, the language model is adjusted by reinforcement learning with artificial feedback, and a reward large model that accurately evaluates the output of the large model is obtained to obtain a graphical code model.
[0127] In a feasible implementation, step S24 may include steps D11 to D14:
[0128] Step D11, obtaining language model weight;
[0129] It should be noted that the language model weight reflects the characteristics of the parameters to be learned set during the training process of the large model.
[0130] It is understandable that language model weights are the core component of deep learning large models, which quantify the influence of input features on large model predictions. In large language models, language model weights not only contain vocabulary, grammar, and semantic information, but also contain information in the graphical code field, such as specific code structure and logic in the MBSE field.
[0131] Step D12, fine-tuning the language model based on the explained text to determine the update weight;
[0132] It should be noted that the updated weights reflect the characteristics of adjusting the weights of the pre-trained language model during the fine-tuning process.
[0133] It is understandable that the updated weights can make the large model better adapt to specific data distribution and task requirements, adapt to different development needs and scenarios, and improve the generalization ability of the large model, so as to more accurately understand and generate graphical code.
[0134] Step D13, fusing the updated weight and the language model weight to determine the optimized weight;
[0135] It should be noted that the optimized weights reflect the characteristics of fusing the initial weights of the pre-trained language model with the updated weights obtained after fine-tuning.
[0136] It is understandable that by integrating technologies such as LoRA technology, low-rank matrices are introduced to efficiently and lightweight adjust the weights of large pre-trained language models to adapt to graphical code development, thereby maintaining the generalization ability of large models, improving the generalization of large models, and preventing overfitting in scenarios with limited training data, so that large models can maintain excellent performance.
[0137] In addition, it should be noted that by using LoRA low-rank adaptation technology, the computational complexity and video memory usage in the large model training process are significantly reduced, so that effective large model fine-tuning can be performed even with limited resources.
[0138] Step D14: adjusting the language model based on the optimization weight to obtain a graphical code model.
[0139] It is understandable that the optimized weights are used to fine-tune the language model so that it is specifically optimized for graphical code development tasks, including optimizing the code structure, logic, and interaction with the graphical interface, so that the large model can better understand and generate graphical code. By optimizing for graphical code development, the quality and efficiency of graphical code development can be significantly improved, and the optimized large model can better adapt to different development environments and needs, providing higher flexibility and scalability.
[0140] This embodiment proposes a method for training a large graphical code model, which includes obtaining model code data; completing the model code data based on the model preprocessing data to determine the completed data; generating an explanation text through a code interpreter based on the completed data; and training the graphical code model based on the explanation text and the language model. The technical problem of accurately training a large graphical code model is solved. Compared with the prior art, this application obtains model code data, converts the completed model code data into explanation text using a code interpreter, and trains the graphical code model in combination with a pre-trained language model, which significantly improves the integrity and accuracy of data processing, improves the understanding and generation capabilities of the large model, thereby improving development efficiency and code quality, and promoting technological innovation in the field of MBSE.
[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the graphical code large model training method of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0142] This application also provides a graphical code large model training device, please refer to Figure 3 , the graphical code large model training device comprises:
[0143] An acquisition module 10 is used to acquire a language model and model preprocessing data;
[0144] A processing module 20, configured to adjust the language model completion model code data based on the model preprocessing data to determine a graphical code model;
[0145] The execution module 30 is used to apply the graphical code model to automatically generate graphical code.
[0146] The acquisition module 10 is also used to acquire a general model set and a graphical code domain data set;
[0147] Training the general model set to determine a model scoring set;
[0148] selecting a language model based on the set of model scores;
[0149] The graphical code domain data set is subjected to data preprocessing to determine model preprocessing data, wherein the data preprocessing includes data cleaning, data labeling and data enhancement.
[0150] The processing module 20 is also used to obtain model code data;
[0151] Determine completion data by completing the model code data based on the model preprocessing data;
[0152] Generate an explanation text through a code interpreter based on the completion data;
[0153] A graphical code model is trained based on the interpreted text and the language model.
[0154] The processing module 20 is also used to obtain the language model weight;
[0155] Fine-tuning the language model based on the interpreted text to determine an update weight;
[0156] The update weight and the language model weight are combined to determine the optimization weight;
[0157] The language model is adjusted based on the optimization weight to obtain a graphical code model.
[0158] The execution module 30 is also used to obtain a scoring item set;
[0159] Applying the graphical code model to test the scoring item set to verify the performance of the graphical code model and determine a test scoring set;
[0160] A graphical code optimization model is determined based on the graphical code model and the test score set to automatically generate graphical code.
[0161] The execution module 30 is also used to obtain a target test score set;
[0162] Adjusting model hyperparameters in the graphical code model based on the test score set and the target test score set to determine a graphical code optimization model;
[0163] Graphical code is automatically generated based on the graphical code optimization model.
[0164] The graphical code large model training device provided by the present application adopts the graphical code large model training method in the above embodiment, which can solve the technical problem of how to efficiently and accurately train the graphical code large model to apply to the graphical code intelligent development. Compared with the prior art, the beneficial effects of the graphical code large model training device provided by the present application are the same as the beneficial effects of the graphical code large model training method provided by the above embodiment, and the other technical features in the graphical code large model training device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0165] The present application provides a graphical code large model training device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the graphical code large model training method in the above-mentioned embodiment one.
[0166] Reference below Figure 4 , which shows a schematic diagram of the structure of a graphical code large model training device suitable for implementing the embodiment of the present application. The graphical code large model training device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The graphical code large model training device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0167] like Figure 4As shown, the graphical code large model training device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the graphical code large model training device are also stored in RAM1004. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the graphical code large model training device to communicate wirelessly or wired with other devices to exchange data. Although the graphical code large model training device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0168] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0169] The graphical code large model training device provided by the present application adopts the graphical code large model training method in the above embodiment, which can solve the technical problem of how to efficiently and accurately perform graphical code large model training to apply to graphical code intelligent development. Compared with the prior art, the beneficial effects of the graphical code large model training device provided by the present application are the same as the beneficial effects of the graphical code large model training method provided by the above embodiment, and the other technical features in the graphical code large model training device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0170] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0171] The above is only a specific implementation 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.
[0172] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the graphical code large model training method in the above-mentioned embodiment.
[0173] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0174] The computer-readable storage medium may be included in the graphical code large model training device; or may exist independently without being assembled into the graphical code large model training device.
[0175] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the graphical code large model training device, the graphical code large model training device: obtains a language model and model preprocessing data; adjusts the language model to determine a graphical code model based on the model preprocessing data to complete the model code data; and applies the graphical code model to automatically generate graphical code.
[0176] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0177] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0179] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned graphical code large model training method, and can solve the technical problem of how to efficiently and accurately train the graphical code large model to apply to the intelligent development of graphical code. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the graphical code large model training method provided in the above-mentioned embodiment, and will not be repeated here.
[0180] The present application also provides a computer program product, including a computer program, which implements the steps of the graphical code large model training method as described above when executed by a processor.
[0181] The computer program product provided by this application can solve the technical problem of how to efficiently and accurately train a large graphical code model to apply to the intelligent development of graphical code. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the large graphical code model training method provided by the above embodiment, which will not be repeated here.
[0182] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A graphical code large model training method, characterized in that: The method includes: Obtain language model and model preprocessing data; Completing the model code data based on the model preprocessing data adjusts the language model to determine a graphical code model; The graphical code model is applied to automatically generate graphical code.
2. The method according to claim 1, wherein The step of obtaining the language model and model preprocessing data includes: Obtain a general model set and a graphical code domain dataset; Training the general model set to determine a model scoring set; selecting a language model based on the set of model scores; The graphical code domain data set is subjected to data preprocessing to determine model preprocessing data, wherein the data preprocessing includes data cleaning, data labeling and data enhancement.
3. The method according to claim 1, wherein The step of completing the model code data based on the model preprocessing data, adjusting the language model and determining the graphical code model comprises: Get model code data; Determine completion data by completing the model code data based on the model preprocessing data; Generate an explanation text based on the completion data through a code interpreter; A graphical code model is trained based on the interpreted text and the language model.
4. The method according to claim 3, wherein The step of training the graphical code model based on the interpreted text and the language model includes: Get the language model weight; Fine-tuning the language model based on the interpreted text to determine updated weights; Fusing the updated weight and the language model weight to determine an optimized weight; The language model is adjusted based on the optimization weight to obtain a graphical code model.
5. The method according to claim 1, wherein The step of automatically generating graphical code by applying the graphical code model includes: Get the scoring item set; Applying the graphical code model to test the scoring item set to verify the performance of the graphical code model and determine a test scoring set; A graphical code optimization model is determined based on the graphical code model and the test score set to automatically generate graphical code.
6. The method according to claim 5, wherein The step of determining a graphical code optimization model based on the graphical code model and the test score set to automatically generate graphical code includes: Get the target test score set; Adjusting model hyperparameters in the graphical code model based on the test score set and the target test score set to determine a graphical code optimization model; Graphical code is automatically generated based on the graphical code optimization model.
7. A graphical code large model training device, characterized in that: The device comprises: Acquisition module, used to obtain language model and model preprocessing data; A processing module, configured to adjust the language model completion model code data based on the model preprocessing data to determine a graphical code model; An execution module is used to apply the graphical code model to automatically generate graphical code.
8. A graphical code large model training device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the graphical code large model training method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the graphical code large model training method as described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps of the graphical code large model training method according to any one of claims 1 to 6.
Citation Information
Cited By
Cloud task scheduling method and system based on reinforcement learning and evaluation model
CN120407203A