Embedded operating system BSP intelligent development method based on QA mode
Through the intelligent development method of BSP for embedded operating system based on QA mode, the pre-trained model is used to match features, which solves the problem that the driver source code is difficult to find during the BSP adaptation process, and realizes efficient development process and continuously optimized model performance.
Patent Information
- Application Number
- CN202411431458.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-07
AI Technical Summary
During the BSP adaptation process, it is difficult for developers to quickly find the fully adapted driver source code, resulting in inefficient development.
The embedded operating system BSP intelligent development method based on QA mode is adopted, and feature matching is used to use pre-trained models (such as RoBERTa) to automatically convert from task book or requirement document to the corresponding BSP source code framework, and has self-learning function.
It realizes the direct conversion from task book or requirement document to BSP framework, significantly improves development efficiency, simplifies the development process, and continuously optimizes model performance through self-learning functions.
Smart Images

Figure CN119396371A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of artificial intelligence, and in particular relates to an embedded operating system BSP intelligent development method based on a QA mode. Background Art
[0002] In recent years, with the advancement of deep learning technology, artificial intelligence has developed rapidly. As an important part of the field of artificial intelligence, NLP (Natural Language Processing) has shown its excellent performance and has been widely used in various fields with the emergence of pre-trained models. Driven by the wave of localization, domestic chips have developed rapidly. Many manufacturers have proposed their own architectures, which have been widely used in various industries after adapting the corresponding BSP (Board Support Package). However, in the BSP adaptation process, due to differences in chip architectures, hardware, etc. and the lack of corresponding technical data support, BSP adaptation is difficult.
[0003] Text feature extraction is a basic task in NLP. The quality of feature extraction often directly determines the performance of subsequent tasks of the model. Therefore, many architectures have been proposed, such as the classic Transformer, and later the emergence of pre-trained models such as Bert, GPT, and Roberta. The feature extraction task has made great progress. At the same time, the existing domestic BSP development frameworks are mainly frameworks that manufacturers use to support their own products. Among them, Fudan Micro Procise is more convenient to use. After selecting the chip model, you can graphically drag and drop the hardware to automatically generate the driver source code corresponding to the hardware, which is very convenient for users.
[0004] Currently, the BSP source code development systems on the market are mainly designed by chip manufacturers for their own products. They cannot cover various types of chips, and most of them are manual selection methods, graphic drag methods, or have not yet integrated a complete BSP source code framework. Users are required to search for the corresponding driver source code from the manufacturer's BSP driver library according to their needs and build their own framework. Although these methods provide some convenience to users, they are still lacking in intelligence and convenience, which greatly reduces the development efficiency of basic software programmers.
[0005] Based on the above problems, the present invention proposes an embedded operating system BSP intelligent development method based on the QA mode. The system uses a pre-trained model to realize the conversion process from a task book or requirement document directly to the BSP source code framework that needs to be adapted in a feature matching manner, and has a "self-learning" function, which has greatly improved the intelligence and convenience. In addition, this BSP intelligent development library contains driver source codes for chip models of multiple manufacturers. Compared with existing driver development systems on the market, it covers a wider range and is more practical. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] The technical problem to be solved by the present invention is how to provide an embedded operating system BSP intelligent development method based on the QA mode to solve the problem that in the daily BSP adaptation process, it is difficult for developers to have a fully adapted driver for direct use.
[0008] (II) Technical solution
[0009] In order to solve the above technical problems, the present invention proposes an embedded operating system BSP intelligent development method based on the QA mode, which includes five stages: preprocessing and feature conversion, feature processing, feature matching, outputting the target source code framework, and iteratively improving the model performance;
[0010] Phase 1: Preprocessing and feature conversion: Use the BSP warehouse as a data set to fine-tune the RoBERTa feature matching model, and use the fine-tuned RoBERTa feature matching model to convert task books or requirement documents into feature matrices, and convert the source code labels of each driver in the BSP warehouse into feature matrices;
[0011] The second stage: feature processing; in this stage, the feature matrix of the task book or requirement document is processed to obtain the key feature matrix of the task book or requirement document;
[0012] The third stage: feature matching; in this stage, the similarity matching work of the key feature matrix of the task book or requirement document and the feature matrix of each driver source code label in the BSP warehouse is completed;
[0013] The fourth stage: output the target source code framework; according to the feature matching result mapping, the target BSP source code framework corresponding to the task book or requirement document is obtained;
[0014] Phase 5: Iterative improvement of model performance; the adapted BSP source code is stored back into the BSP warehouse, the amount of data used for fine-tuning the feature matching model is increased, and continuous iteration is carried out to improve performance.
[0015] (III) Beneficial effects
[0016] The present invention proposes an embedded operating system BSP intelligent development method based on the QA mode. The embedded operating system BSP intelligent development method based on the QA mode proposed by the present invention combines the pre-training model technology in artificial intelligence, realizes the conversion process of the task book or requirement document directly to the BSP framework, optimizes the development environment of programmers, and greatly improves the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 The present invention is a flow chart of the embedded operating system BSP intelligent development method based on the QA mode. DETAILED DESCRIPTION
[0018] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0019] In order to simplify the adaptation process, the present invention combines the NLP pre-training model and proposes an embedded operating system BSP intelligent development framework based on the QA (Question Answering) mode. The framework can automatically realize the conversion process from task books, requirement documents, etc. to BSP source code frameworks. Basic software developers only need to make some modifications to the converted source code framework and then they can directly apply it to the development board, which greatly simplifies the development process and provides convenience for basic software adaptation.
[0020] In the daily BSP adaptation process, since the embedded development board mostly provides customized services according to specific topics and project requirements, different project development boards have large differences in models and hardware matching, and it is difficult for developers to have fully adapted drivers for direct use. In most cases, BSP developers need to select the driver source code closest to the demand in the reference material for rewriting, and then adapt the complete BSP source code of different development boards. Based on this practical application scenario, the present invention proposes a kind of embedded operating system BSP intelligent development method based on QA mode. Under the premise of not limiting strong matching, the intelligent system automatically selects the BSP source code closest to the demand in the database for developers to use according to the task book or requirement document, which greatly improves the efficiency of BSP developers. After the developer is adapted, the adapted BSP source code can be re-added to the BSP warehouse, and the model performance will be further improved. In this way, the iterative model performance is continuously strengthened, and the developer efficiency is also continuously improved.
[0021] like Figure 1As shown in the , the intelligent development method of embedded operating system BSP based on QA mode is divided into five stages: preprocessing and feature conversion, feature processing, feature matching, output target source code framework, and iterative improvement of model performance. The entire system is in "self-learning" and the system performance will continue to improve as the usage increases.
[0022] (1) The first stage: preprocessing and feature conversion. Use the BSP warehouse as a data set to fine-tune the RoBERTa feature matching model, and use the fine-tuned RoBERTa feature matching model to convert task orders or requirement documents into feature matrices, and convert the driver source code labels in the BSP warehouse into feature matrices.
[0023] S11. Model selection is required before preprocessing. RoBERTa is a "robust optimization method for BERT" proposed by YinHan Liu et al. in 2019. The performance of BERT has been improved by longer training steps, larger batch sizes, more data, removal of NSP training targets, longer sequences, and changing static masks to dynamic masks. The model has shown superior performance in extracting text features, so RoBERTa is selected as the feature matching model and feature extraction module of this framework.
[0024] S12. Model fine-tuning: Use the BSP warehouse as a dataset to fine-tune the RoBERTa feature matching model. The dataset contains the adapted driver source code and its corresponding labels.
[0025] Dataset construction process: 2000 source codes of various driver programs were collected and sorted; 10 experts with BSP development experience were invited to label the data set. Since there are some comments in the driver source code, the labeling process is less time-consuming. The data set is divided into training set, validation set and test set. The size of the training set is 1600, the size of the validation set is 200, and the number of test set data is 200.
[0026] Fine-tuning process: Use the dataset label as input data to fine-tune the model to obtain a RoBERTa feature matching model that is more suitable for feature representation of BSP development task books or requirement documents.
[0027] S13. Using the QA mode, the user is prompted to enter a task order or requirement document. The task order or requirement document and the driver source code labels of the BSP warehouse are used as input data and passed to the fine-tuned RoBERTa feature matching model to obtain the feature matrix of the task order or requirement document and the feature matrix of the driver source code labels of the BSP warehouse.
[0028] (2) The second stage: feature processing. In this stage, the feature matrix of the task book or requirement document is processed to obtain the key feature matrix of the task book or requirement document.
[0029] Since the BSP warehouse label data contains less information, while the task book or requirement document data contains more information, after the RbBERTa feature conversion, the mismatch of the information between the two sides will cause errors in similarity calculation. In order to reduce this error, the present invention extracts key features from the task book or requirement document text data, which greatly reduces the noise in the features, making the method of the present invention more accurate. The specific algorithm is as follows:
[0030] The feature matrix formed by extracting features from the task book or requirement document through the RoBERTa feature matching model can be expressed as T = [t1,...,t n ], t i,i=1,...,n is the feature vector. The key feature vector after the key feature extraction algorithm can be expressed as K j , the key feature vectors are stacked to form a key feature matrix, which can be expressed as K = [K1, ..., K m ], using the approximate substitution method in mathematics, define t i The optimal linear estimate of The value of i is [1, n]. This estimated value is used to reconstruct the feature matrix of the task book or requirement document. Therefore, each reconstructed feature vector can be expressed as follows:
[0031]
[0032]
[0033] To approximate the parameters, according to (1) and (2), and when the reconstruction error E is minimized, the key feature matrix can be used to estimate the feature matrix of the task book or requirement document, K * is the estimated matrix of the key feature matrix, and the value of i is [1, n]:
[0034]
[0035] K * =argmin E(K)(4)
[0036] According to (4), we can get K when the reconstruction error E is minimum * Matrix, K * Approximately to the K matrix, we can use K * Instead of the K matrix,
[0037] The present invention provides another method. In actual use, K is regularized, so the optimization method can be simplified to SVD. The SVD standard formula is T = UWV T , W.V. T It can be understood that the task book or requirement document is extracted by the RoBERTa feature matching model to form an approximate representation of the feature matrix T, which is mapped to this method. You can use V T The first m vectors in V represent W. T This makes the approximate substitution method have the smallest error. Therefore, in actual use, SVD is directly performed on the feature matrix of the task book or requirement document to select V T The first m vectors in the stack are stacked to obtain the key feature matrix W is used as the weight of the key feature matrix.
[0038] (3) The third stage: feature matching. This stage mainly completes the similarity matching between the key feature matrix of the task book or requirement document after post-processing and the feature matrix of each driver source code label in the BSP warehouse.
[0039] The key feature matrix of the task book or requirement document and the feature matrix of each driver source code label in the BSP warehouse are mapped to the feature space. The distance between the two in the feature space represents the degree of similarity between the two. The set of data with the closest distance between the two is selected for matching, and then the BSP source code label that best matches the task book or requirement document is obtained.
[0040] (4) The fourth stage: output the target source code framework. This stage mainly completes the mapping of the feature matching results to obtain the target BSP source code framework corresponding to the task book or requirement document.
[0041] According to the BSP repository driver source code label that best matches the task book or requirement document obtained in the third stage, it is mapped to the BSP driver source code repository to obtain the target BSP source code framework corresponding to the task book or requirement document.
[0042] (5) The fifth stage: iterative improvement of model performance.
[0043] The performance of the deep learning model will improve with the increase of data volume. The same is true for the present invention. After the adaptation work is completed, the adapted BSP source code is stored back in the BSP warehouse, which increases the amount of data used for fine-tuning the feature matching model, improves the model matching capability, and also increases the BSP source code available for matching. After such iterations, as the usage of the intelligent system increases, the system performance is further optimized, realizing "self-learning".
[0044] Embodiment 1:
[0045] After the present invention was put into use by 1,000 target customers, the development time of basic software programmers was reduced by an average of 15%; compared with the prior art, the present intelligent system is not limited to a certain fixed manufacturer's chip, and does not require programmers to manually screen task books or requirement documents. The whole process is more intelligent, more programmer-friendly, and has a wider range of applications. After being put into use by 1,000 target customers, 99% of customers reported through questionnaire surveys that the present intelligent system is better than existing systems in terms of user intelligence and friendliness; the "self-learning" function in the intelligent system will promote continuous optimization of model performance. After being put into use by 1,000 target customers, 300 sets of newly adapted successfully BSP source codes were collected and put into the BSP warehouse. After optimization and upgrading, the model feature extraction ROUGE-F index was improved by 2 percentage points.
[0046] The present invention has the following 4 key points:
[0047] 1. The present invention combines the technology of pre-training models in artificial intelligence to achieve seamless conversion of task books or requirement documents to BSP code frameworks, greatly optimizing the development process of basic software programmers and improving development efficiency;
[0048] 2. In the feature conversion stage, a suitable model was selected and fine-tuned accordingly;
[0049] 3. In the feature processing stage, due to the imbalance of information, the key feature extraction algorithm is used to balance the information contained in the task book or requirement document and the BSP warehouse label data, making the matching results more accurate;
[0050] 4. The system proposed in the present invention has a "self-learning" function. The performance of the entire system will gradually improve with the frequency of use. As the performance improves, the effect of the intelligent system will also gradually improve.
[0051] The QA mode-based embedded operating system BSP intelligent development method proposed in the present invention combines the pre-training model technology in artificial intelligence, realizes the conversion process of task books or requirement documents directly to the BSP framework, optimizes the development environment of programmers, and greatly improves development efficiency.
[0052] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A QA-based embedded operating system BSP intelligent development method, characterized in that: The method includes five stages: preprocessing and feature conversion, feature processing, feature matching, outputting the target source code framework, and iteratively improving model performance; Phase 1: Preprocessing and feature conversion: Use the BSP warehouse as a data set to fine-tune the RoBERTa feature matching model, and use the fine-tuned RoBERTa feature matching model to convert task books or requirement documents into feature matrices, and convert the source code labels of each driver in the BSP warehouse into feature matrices; The second stage: feature processing; in this stage, the feature matrix of the task book or requirement document is processed to obtain the key feature matrix of the task book or requirement document; The third stage: feature matching; in this stage, the similarity matching work of the key feature matrix of the task book or requirement document and the feature matrix of each driver source code label in the BSP warehouse is completed; The fourth stage: output the target source code framework; according to the feature matching result mapping, the target BSP source code framework corresponding to the task book or requirement document is obtained; Phase 5: Iterative improvement of model performance; the adapted BSP source code is stored back into the BSP warehouse, the amount of data used for fine-tuning the feature matching model is increased, and continuous iteration is carried out to improve performance.
2. The QA-mode-based embedded operating system BSP intelligent development method according to claim 1, characterized in that: The first stage includes the following steps: S11. Select RoBERTa as the feature matching model. S12. Model fine-tuning: Use the BSP warehouse as a dataset to fine-tune the RoBERTa feature matching model. The dataset contains the adapted driver source code and its corresponding labels. S13. Using the QA mode, the user is prompted to enter a task order or requirement document. The task order or requirement document and the driver source code labels of the BSP warehouse are used as input data and passed to the fine-tuned RoBERTa feature matching model to obtain the feature matrix of the task order or requirement document and the feature matrix of the driver source code labels of the BSP warehouse.
3. The QA-mode-based embedded operating system BSP intelligent development method according to claim 2, characterized in that: In the S12, 2000 source codes of various driver programs are collected and sorted, and experts with BSP development experience are invited to label the data set, and the data set is divided into a training set, a validation set, and a test set.
4. The QA-mode-based embedded operating system BSP intelligent development method according to claim 3, characterized in that: The training set size is 1600, the validation set size is 200, and the test set data size is 200.
5. The QA-mode-based embedded operating system BSP intelligent development method according to claim 3, characterized in that: In S12, the dataset label is used as input data to fine-tune the model to obtain a RoBERTa feature matching model that is more suitable for feature representation of BSP development task books or requirement documents.
6. The QA-mode-based embedded operating system BSP intelligent development method according to any one of claims 2 to 5, characterized in that: In the second stage, The feature matrix formed by extracting features from the task book or requirement document through the RoBERTa feature matching model is expressed as T = [t1,...,t n ], t i,i=1,...,n is the feature vector, and the key feature vector after the key feature extraction algorithm is represented as K j , the key feature vectors are stacked to form a key feature matrix, expressed as K = [K1, ..., K m ]; Using the approximate substitution method in mathematics, define t i The optimal linear estimate of The value of i is [1, n]. This estimated value is used to reconstruct the feature matrix of the task book or requirement document. Therefore, each reconstructed feature vector has the following representation: To approximate the parameters, according to (1) and (2), and when the reconstruction error E is minimized, the key feature matrix is used to estimate the feature matrix of the task book or requirement document, K * is the estimated matrix of the key feature matrix, and the value of i is [1, n]: K * =argmin E(K)(4) According to (4), we can get K when the reconstruction error E is minimum. * Matrix, K * Approximately K matrix, use K * Instead of the K matrix, 7. The QA-mode-based embedded operating system BSP intelligent development method according to any one of claims 2 to 5, characterized in that: T=UWV T , W.V. T It is understood that the task book or requirement document is extracted by the RoBERTa feature matching model to form an approximate representation of the feature matrix T. Use V T The first m vectors in V represent W. T This minimizes the error of the approximate alternative method.
8. The QA-mode-based embedded operating system BSP intelligent development method according to claim 7, characterized in that: Directly perform SVD on the feature matrix of the task book or requirement document and select V T The first m vectors in the stack are stacked to obtain the key feature matrix W is used as the weight of the key feature matrix.
9. The QA-mode-based embedded operating system BSP intelligent development method according to claim 8, characterized in that: The third stage includes: mapping the key feature matrix of the task book or requirement document and the feature matrix of each driver source code label in the BSP warehouse to the feature space, the distance between the two in the feature space represents the degree of similarity between the two, selecting a group of data with the closest distance between the two for matching, and then obtaining the BSP source code label that best matches the task book or requirement document.
10. The QA-mode-based embedded operating system BSP intelligent development method according to claim 9, characterized in that: The fourth stage includes: mapping the BSP repository driver source code tag that best matches the task book or requirement document obtained in the third stage to the BSP driver source code repository to obtain the target BSP source code framework corresponding to the task book or requirement document.