Software reusability analysis method based on statistical model

By designing a reuse statistical model and a BP neural network prediction model suitable for intelligent cabin and intelligent connected products, combined with Gerrit's automated data management, the problem of software reuse analysis is solved, and the efficient evaluation and quality of software modules is achieved. Forecasting provides valuable guidance for automotive software research and development.

CN119248254APending Publication Date: 2025-01-03YANGZHOU HANGSHENG TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411276529.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the process of software development, software reuse analysis is still in the exploration stage, and the lack of applicable and reliable reuse statistical models makes it difficult to improve the efficiency and quality of software reuse.

Method used

Designing a software reuse analysis method based on statistical models, including designing a reuse statistical model suitable for intelligent cabins and intelligent connected products, training a prediction model through BP neural network, combining enterprise IT systems and Gerrit's automated data management program, Collect and process related data to achieve prediction of software reuse.

Benefits of technology

Provide a more reference value for feasibility and quality evaluation method in the reuse process of software modules, solve the data source and management of reuse statistical model, realize fast and effective software reuse analysis, and serve as the automotive software research and development team. Provide guidance on selection and iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248254A_ABST
    Figure CN119248254A_ABST
Patent Text Reader

Abstract

The invention discloses a software reusability analysis method based on a statistical model. The method comprises the following steps: 1) designing a reusability statistical model suitable for intelligent cab and intelligent network series product projects; 2) designing and implanting an automatic data management program in an enterprise IT system and Gerrit, and counting project resume data in the Gerrit; and 3) training the prediction model through the BP neural network, and realizing software reusability analysis through the prediction model. The method comprises the following steps: designing a basic structure of a multiplexing statistical model according to the characteristics of a whole vehicle electronic framework, especially an intelligent cab and an intelligent network connection product; under the support of an enterprise IT system and Gerrit, a corresponding automatic data management program is designed, the problems of reuse of statistical model data sources and related automatic collection, storage and management are solved, and it is guaranteed that needed data vectors are generated rapidly and effectively; and based on the obtained multiplexing statistical model data vector set of the target, completing the training of a corresponding prediction model, and completing the analysis of the software multiplexing degree by using the prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software engineering, and in particular to a software reuse analysis method based on a statistical model. Background Art

[0002] With the rapid development of the automotive industry, "software-defined cars" have been seen as a key force in driving the automotive industry's transformation toward intelligence and networking. For vehicle manufacturers and related supply chains, software R&D costs, operating efficiency, and safety requirements are also increasing rapidly to cope with increasingly fierce market competition. Against this backdrop, the scale and complexity of automotive software are rapidly increasing, and the quality of automotive software is bound to face huge challenges.

[0003] There are many factors that affect software quality, among which software reuse is closely related to software quality. Software reuse refers to the use of completed and fully verified software components or modules to build new software systems during the software development process to improve development efficiency and software quality. Software reuse can reduce the cost of software development and maintenance, and is an important technology for improving software productivity and quality. Reusable software has more quality assurance than non-reusable software, because the increase in the degree of reuse means the improvement of efficiency, which also means that the scope of influence of the reused structure is expanded, and the requirements for its code quality will also be improved.

[0004] Therefore, whether from the perspective of cost or quality, software reuse is undoubtedly an extremely important component in the rapidly developing automotive electronics field. However, it is still very difficult to achieve real results in project practice and to effectively and reliably improve development efficiency and software quality. In particular, the industry is still in the exploratory stage in the analysis of "quality prediction of software module reuse in target projects" (hereinafter referred to as "software reuse degree").

[0005] In recent years, with the rapid development of artificial intelligence, the research and application of artificial neural network technology has also been developing continuously. Relying on neural networks such as BP to make software quality prediction possible, but there are still many challenges that hinder research in this field. The most important one is the design of the statistical model of the correlation data between software modules and the quality of actual project software (hereinafter referred to as "reuse statistical model"). Without a sufficiently comprehensive, reliable and analyzable reuse statistical model, the analysis of software reuse will become a rootless tree. Summary of the invention

[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a software reuse analysis method based on statistical models. According to the characteristics of the whole vehicle electronic architecture, especially the intelligent cockpit and intelligent network products, an applicable and reliable basic structure of the reuse statistical model is designed; with the support of the enterprise IT system and Gerrit, a corresponding automatic data management program is designed to solve the data source of the reuse statistical model, as well as related automatic collection, storage, and management problems, to ensure that the required data vectors are generated quickly and effectively; finally, based on the above process, the target reuse statistical model data vector set is obtained, the corresponding prediction model is trained, and the prediction model is used to complete the analysis of software reuse.

[0007] The object of the present invention is achieved by: a software reuse analysis method based on a statistical model, comprising the following steps:

[0008] 1) Design a reused statistical model suitable for smart cockpit and smart network series product projects;

[0009] 2) Design and embed automated data management programs in the enterprise IT system and Gerrit, and compile statistics on project history data in Gerrit;

[0010] 3) Train the prediction model through BP neural network and realize software reuse analysis through the prediction model.

[0011] Further, the step 1) specifically includes: determining the core element data in the reused statistical model based on project experience and project historical data; collecting eight core element data by two means: automatic tool collection and project information collection. The automatic tool collection is automatically implemented by the tool, and five core element data are collected in units of "modules"; the project information collection is manually implemented, and three core element data are collected in units of "projects";

[0012] Furthermore, the five core element data include module reuse degree, number of module code change lines, module code change cycle, module code failure rate and module process completion; the three core elements include product project type, degree of software requirement change and degree of software architecture change.

[0013] Furthermore, the step 2) specifically includes: designing a data management program through Gerrit query and Python; the user inputs option parameters representing the project and time parameters in a fixed format, and the parameters are passed through the Python script. The Gerritquery command obtains relevant parameters and executes the command line to query the Gerrit database, and returns Json format data {X}. The Python script processes the Json data and exports the Excel data table according to the template format.

[0014] Furthermore, the Gerrit query command uses the Updated time Tupdated in the changes database as the query standard. The Gerrit changes database records all operations on the submitted content in the Gerrit page and records the page operation time; when the Gerrit page performs a Merge operation on a single submission, i.e., Submit it to the database, the Gerrit changes database uses the typical characters of "Change has been successfully merged", i.e., MMerged to mark the Merge operation and record the operation time Mtime; by extracting the Mtime in the database, if Mtime∈[Sincetime, Beforetime], the single Merged state data is valid data.

[0015] Furthermore, the step 3) specifically includes:

[0016] 3-1) Calculate the weights of the multiplexed statistical elements, divide the evaluation levels of each multiplexed statistical element according to the requirements, test the average values ​​or variances calculated from different samples, and normalize the data that have completed the consistency test;

[0017] 3-2) Establishment of reuse prediction model: Fuzzify the data and classify the software reuse degree into five types: relatively high, high, medium, low and relatively low. Use fuzzy comprehensive evaluation to normalize the criterion layer of the reuse index system, and then input the fuzzified sample data into the BP neural network by establishing self-learning data samples. Use the BP neural network to establish an autonomous learning model for data training.

[0018] Furthermore, the step 3-1) specifically includes:

[0019] First, the evaluation levels of each reused statistical element are divided according to the following table:

[0020] grade definition 1 X is as important as Y 3 X is slightly more important than Y 5 X is more important than Y 7 X is much more important than Y 9 X is definitely more important than Y 2、4、6、8 Between the above judgments

[0021] The evaluator compares the indicators to obtain the judgment matrix A at the criterion level;

[0022]

[0023] Among them, n is the number of indicators in the criterion layer of the indicator system, a ij It is the importance level obtained by comparing two indicators. Similarly, the judgment matrix of the criterion layer and the solution layer can also be obtained through this calculation;

[0024] Calculate the maximum eigenvalue and corresponding eigenvector of all judgment matrices, and then perform consistency check on each judgment matrix obtained;

[0025] By formula The result of the consistency contrast ratio CR is calculated to test the consistency of the matrix; where λ max is the maximum eigenvalue, n is the matrix dimension, CI is the consistency index, RI is the average random consistency index, and the value range of the RI index is shown in the following table:

[0026] n 1 2 3 4 5 6 7 R1 0 0 0.58 0.89 1.12 1.24 1.32

[0027] If CR < 0.1, the consistency test requirement is passed. Otherwise, a new judgment matrix needs to be reconstructed to meet the consistency test.

[0028] Normalization processing: convert the data into a decimal between 0 and 1, and calculate the maximum eigenvalue of each layer from the bottom layer to the top layer according to the hierarchical order of the above reusability evaluation system according to the judgment matrix, and then perform a consistency test. After the test, normalize it to obtain the weight coefficient of each level.

[0029] Furthermore, the data fuzzification process in step 3-2) specifically includes:

[0030] Establish fuzzy sets: According to the factors affecting software reuse, establish a reusability evaluation index set U = {u1,u2,…,u n} and the evaluation set V of the index = {v1,v2,…,v m};

[0031] Establish a membership matrix: If there are a experts on the indicator set U = {u1,u2,…,u n} for comprehensive evaluation, among which b experts evaluate u i , i=1,2,…n give the same evaluation level as v i , then its membership degree is considered to be Among them, i and j refer to the element location of the matrix respectively. The value range of i is 1-n, and the value range of j is 1-m, so the membership matrix

[0032] Establish a weight set: The weight set W = {ω1,ω2,…,ω m};

[0033] Calculate the comprehensive membership vector: by formula The comprehensive membership vector is calculated, where ω jRepresents the j-th set element corresponding to the weight set W, which is substituted into the formula for calculation and used as the input layer data of the BP neural network.

[0034] Furthermore, the BP neural network described in step 3-2) includes: an input layer, a hidden layer and an output layer; the weight calculated by the reuse index is input into the input layer, then forward propagated to the hidden layer, and then transmitted to the output layer after data processing.

[0035] Furthermore, the step 3-2) of using the BP neural network to establish an autonomous learning model for data training specifically includes: selecting a function As the activation function, according to the solution layer of the software reuse evaluation index, x1, x2, ..., x n As the input layer neuron, then adjust the weight of each input proportion, and choose the most convenient linear weighted summation method to get the neuron net input Then substitute Net into the sigmoid activation function to get the activation function of the jth neuron: where θ j For the threshold, the weights of each neuron are constantly modified to find the best activation function;

[0036] By Kolmogorov theorem To calculate the number of neurons in the hidden layer, m is the number of neurons in the input layer, n is the number of neurons in the output layer, and α is a constant between 1 and 10. During the training process, the gradient descent training function is used to continuously adjust the weights and thresholds of the neural network along the negative gradient direction of the parameters. Through multiple data training, the best convergence network is obtained for prediction.

[0037] Compared with the prior art, the present invention adopts the above technical solution, and has the following beneficial effects: (1) a reuse statistical model more suitable for smart cockpit and smart network series product projects is designed, which provides a valuable reference method for evaluating the feasibility, quality, cost and other factors of software modules during reuse;

[0038] (2) Design corresponding automated data management programs in the enterprise IT system and Gerrit to solve the problems of reusing statistical model data sources and related automated collection, storage, and management, and ensure that the required data vectors are generated quickly and effectively; used to solve management problems such as the timeliness and reliability of data sources.

[0039] (3) Based on the above process, the target reuse statistical model data vector set is obtained, the corresponding prediction model is trained, and the prediction model is used to analyze the software reuse degree, providing valuable guidance for the automotive software R&D team on the selection, iteration, and even reconstruction of software modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is the multiplexing statistical model in the present invention.

[0041] Figure 2 This is the overall framework diagram of the resume data statistics tool in the present invention.

[0042] Figure 3 This is a statistical principle diagram of the resume data statistical tool in the present invention.

[0043] Figure 4 This is a schematic diagram of the error situation that occurs during the statistical process of the present invention.

[0044] Figure 5 This is the structural diagram of the BP neural network of the present invention.

[0045] Figure 6 The figure is a flow chart of the statistical algorithm of the resume data statistical tool of the present invention. DETAILED DESCRIPTION

[0046] A software reuse analysis method based on a statistical model, characterized by comprising the following steps:

[0047] 1) Design a reuse statistical model suitable for smart cockpit and smart network series product projects; determine the core element data in the reuse statistical model based on project experience and project historical data; collect eight core element data through two means: automated tool collection and project information collection. The automated tool collection is automatically implemented through the tool, and five core element data are collected in units of "modules"; the project information collection is manually implemented, and three core element data are collected in units of "projects"; the five core element data include module reuse degree, module code change line number, module code change cycle, module code failure rate and module process completion; the three core elements include product project type, software requirement change degree and software architecture change degree; such as Figure 1 As shown;

[0048] Module reuse degree: the total number of times a module is reused by various projects. In theory, the more times a module is reused (number of projects), the higher the software reuse degree of the module will be.

[0049] Module code change lines: the average number of code changes that a module undergoes during reuse by various projects. In theory, the higher the average number of code changes that a module undergoes during reuse, the lower the software reuse of the module.

[0050] Module code change cycle: the average code change cycle that a module goes through during reuse by various projects. In theory, the longer the average code change cycle generated by a module during reuse, the lower the software reuse of the module. The calculation of this cycle starts from the time the module is reused by a project and ends when the module is frozen in the project's software.

[0051] Module code failure rate: This is the average failure rate per thousand lines of code that is calculated when the module is reused in various projects. In theory, the higher the average failure rate of the code generated by the module during reuse, the lower the software reuse of the module.

[0052] Module process completion: that is, the degree of achievement (including review) of project processes of various types and stages during the project process. The project process includes but is not limited to software module architecture design, software detailed design, software integration / unit verification, software qualification testing, etc., which are reflected through standard process documents. The completion of the process document (after review) represents the process compliance of the module. The higher the completion, the higher the software reuse of the module.

[0053] Product project type: The hardware platform mainly refers to the electronic and electrical architecture of the whole vehicle, as well as the main ECU components selected, including SOC, MCU, DSP, etc. The software platform mainly refers to the software operating system running in each ECU component, such as Linux, Android, QNX, etc. commonly used in SOC.

[0054] Automotive electronics projects can generally be divided into the following four types based on platform differences:

[0055] Type 1: Derivatives of projects on the same platform. The same platform refers to the target project for software module reuse, which is on the same software and hardware platform as the original project that develops or carries the software module. In addition, since the target project is only a derivative of the original project, the software requirements will mainly be expanded, the scale of demand changes is often relatively limited, and the software architecture will generally not have a significant impact. Therefore, the software reuse rate of this type of product is theoretically the highest.

[0056] Type 2: Same platform across projects. The same platform has the same characteristics as type 1. However, since they are different projects, there may be significant changes in software requirements and software architecture. Therefore, although the software reuse of this type of product has a high theoretical possibility, it still needs to be specifically evaluated in combination with demand and architecture changes.

[0057] Type 3: Cross-platform same project. Cross-platform means that the software and hardware platforms are different, which will often require a lot of adaptation work before the software module can be reused, and it may even be completely impossible to reuse. The same project means that the main requirements of the project are basically the same. This situation is very common in the automotive electronics industry. For example, the IVI system of the same model may have a difference between high and low configurations, and the hardware platforms used by different grades of configuration will differ according to the cost.

[0058] Type 4: Cross-platform and cross-project. This type means that the software and hardware platforms of the product are different, and the software requirements and software architecture are also quite different. The software reuse of this type of product is usually the lowest.

[0059] Degree of change in software requirements: In new projects that intend to reuse software modules, changes in software requirements are usually inevitable, whether they are additions, modifications, or deletions. In theory, the higher the degree of change in requirements, the lower the software reuse of the module.

[0060] The evaluation level of software requirement changes is usually output by the core developers of the module. The reference standard is: the ratio of the man-hours required to adapt to the new requirements to the original total development hours of the module.

[0061] Degree of software architecture change: In new projects that intend to reuse software modules, there is a certain probability that changes will be made to the software architecture, such as the interaction between modules, communication mechanisms, interface definitions, etc. In theory, the higher the degree of architecture change, the lower the software reuse of the module.

[0062] The evaluation level of software architecture changes is usually output by the project's software architect or a similar functional role. The reference standard is: the ratio of the man-hours required to adapt to the new architecture to the original total development hours of the module.

[0063] 2) Design and embed automated data management programs in the enterprise IT system and Gerrit, and compile statistics on project history data in Gerrit;

[0064] like Figure 2 As shown, a data management program is designed through Gerrit query and Python; the user inputs option parameters representing the project (source code library set prefix Pjchar and branch Pjbranch) and fixed format time parameters (start time Sincetime and end time Beforetime), and the parameters are passed through the Python script. The Gerrit query command obtains relevant parameters and executes the command line to query the Gerrit database, returning Json format data {X}. The Python script processes the Json data and exports the Excel data table according to the template format.

[0065] like Figure 3 As shown in the figure, the Gerrit query command uses the Updated time Tupdated in the changes database as the query standard. The Gerrit changes database records all operations on the submitted content in the Gerrit page and records the page operation time; when the Gerrit page performs a Merge operation on a single submission, that is, Submit it to the database, the Gerrit changes database will use the typical characters of "Change has been successfully merged", that is, MMerged to mark the Merge operation, and record the operation time Mtime; by extracting the Mtime in the database, if Mtime∈[Sincetime, Beforetime], the single Merged state data is valid data.

[0066] The Gerrit query command line uses the Updated time Tupdated in the changes database as the query standard. The Tupdated time changes with the change time of the operation, so the following errors often occur: Figure 4 In the situation shown, the data merged with Tago at time long ago is cherry picked at the current time Tnow, causing Tupdated time to be updated to Tnow. If the data is then queried by Tago time, the corresponding Tago time data will be lost because Tupdated time has been updated to Tnow.

[0067] 3) Train the prediction model through BP neural network and realize software reuse analysis through the prediction model;

[0068] 3-1) Calculate the weights of the multiplexed statistical elements, divide the evaluation levels of each multiplexed statistical element according to the requirements, test the average values ​​or variances calculated from different samples, and normalize the data that have completed the consistency test;

[0069] First, the evaluation levels of each reused statistical element are divided according to the following table:

[0070] grade definition 1 X is as important as Y 3 X is slightly more important than Y 5 X is more important than Y 7 X is much more important than Y 9 X is definitely more important than Y 2、4、6、8 Between the above judgments

[0071] The evaluator compares the indicators to obtain the judgment matrix A at the criterion level;

[0072]

[0073] Among them, n is the number of indicators in the criterion layer of the indicator system, a ijIt is the importance level obtained by comparing two indicators. Similarly, the judgment matrix of the criterion layer and the solution layer can also be obtained through this calculation;

[0074] Calculate the maximum eigenvalue and corresponding eigenvector of all judgment matrices, and then perform consistency check on each judgment matrix obtained;

[0075] By formula The result of the consistency contrast ratio CR is calculated to test the consistency of the matrix; where λ max is the maximum eigenvalue, n is the matrix dimension, CI is the consistency index, RI is the average random consistency index, and the value range of the RI index is shown in the following table:

[0076] n 1 2 3 4 5 6 7 R1 0 0 0.58 0.89 1.12 1.24 1.32

[0077] If CR < 0.1, the consistency test requirement is passed. Otherwise, a new judgment matrix needs to be reconstructed to meet the consistency test.

[0078] Normalization processing: convert the data into a decimal between 0 and 1, and calculate the maximum eigenvalue of each layer from the bottom layer to the top layer according to the hierarchical order of the above reusability evaluation system according to the judgment matrix, and then perform a consistency test. After the test, normalize it to obtain the weight coefficient of each level.

[0079] 3-2) Establishment of reuse prediction model: Fuzzify the data and classify the software reuse degree into five types: high, high, medium, low and low; normalize the criterion layer of the reuse index system using fuzzy comprehensive evaluation, and then input the fuzzified sample data into the BP neural network by establishing self-learning data samples; use the BP neural network to establish an autonomous learning model for data training;

[0080] The data fuzzification process specifically includes:

[0081] Establish fuzzy sets: According to the factors affecting software reuse, establish a reusability evaluation index set U = {u1,u2,…,u n} and the evaluation set V of the index = {v1,v2,…,v m};

[0082] Establish a membership matrix: If there are a experts on the indicator set U = {u1,u2,…,u n} for comprehensive evaluation, among which b experts evaluate u i , i=1,2,…n give the same evaluation level as v i , then its membership degree is considered to be Among them, i and j refer to the element location of the matrix respectively. The value range of i is 1-n, and the value range of j is 1-m, so the membership matrix

[0083] Establish a weight set: The weight set W = {ω1,ω2,…,ω m};

[0084] Calculate the comprehensive membership vector: by formula The comprehensive membership vector is calculated, where ω j Represents the j-th set element corresponding to the weight set W, which is substituted into the formula for calculation and used as the input layer data of the BP neural network.

[0085] like Figure 5 As shown in FIG, the BP neural network includes: an input layer, a hidden layer and an output layer; the weight calculated by the reuse index is input into the input layer, then forward propagated to the hidden layer, and then transmitted to the output layer after data processing.

[0086] Using BP neural network to establish an autonomous learning model for data training includes: selecting function As the activation function, according to the solution layer of the software reuse evaluation index, x1, x2, ..., x n As the input layer neuron, then adjust the weight of each input proportion, and choose the most convenient linear weighted summation method to get the neuron net input Then substitute Net into the sigmoid activation function to get the activation function of the jth neuron: where θ j For the threshold, the weights of each neuron are constantly modified to find the best activation function;

[0087] By Kolmogorov theorem To calculate the number of neurons in the hidden layer, m is the number of neurons in the input layer, n is the number of neurons in the output layer, and α is a constant between 1 and 10. During the training process, the gradient descent training function is used to continuously adjust the weights and thresholds of the neural network along the negative gradient direction of the parameters. Through multiple data training, the best convergence network is obtained for prediction.

[0088] Embodiment 1:

[0089] 1) Collect multiplexed statistical elements of training data;

[0090] According to the statistical principle in step 2), still taking the source code submission history data as an example, all the Merged data associated with the project are obtained through Gerritquery, and the relationship between the time parameters of the Merged operation in a single Merged data and the preset time interval is compared to extract the valid single Merged data. The algorithm principle is as follows Figure 6 shown.

[0091] The time content recorded in the Gerrit changes database is automatically converted to a timestamp. The timestamp associated with MMerged is Mstamp. When determining the time zone, Sincetime and Beforetime need to be converted to Sincestamp and Beforeetamp respectively. Use the Python built-in time library. The conversion code is as follows:

[0092] Start time conversion:

[0093] since_short=since.split('')[0]

[0094] sinceArray=time.strptime(since,"%Y-%m-%d%H:%M:%S")

[0095] Cut-off time conversion:

[0096] beforeArra=time.strptime(before,"%Y-%m-%d%H:%M:%S")

[0097] until_stamp=int(time.mktime(beforeArray))

[0098] The after option of Gerrit query requires a time parameter to obtain all the Merged data associated with the project in the Gerrit changes database when the command is executed. The parameter can use the project initialization time Pstart. The code for obtaining all the Merged data associated with the project is as follows:

[0099]

[0100]

[0101] All Merged data associated with the project are stored in the Json array {X}, and the array element is a single Merged data. Extract the Mstamp in the array element one by one, and determine the relationship between Mstamp and [Sincestamp, Beforestamp] to obtain valid array elements. Some codes are as follows:

[0102]

[0103] Statistical results: According to Figure 2 As shown in the overall structure, the tool passes parameters to the Gerritquery command line through a Python script, processes the returned data, and exports the valid data to an Excel data table according to the template format. The generated Excel table data contains Commit Message, source code library name (Repository), submission time (UploadTime), storage time (Submit), etc.

[0104] 2) Obtain the weight coefficient of each level through the fuzzy evaluation system:

[0105] According to the reuse statistical elements listed in step 1), the evaluator will conduct a comprehensive analysis based on the reuse statistical training data automatically collected in implementation 1, combined with project information such as product project type, degree of software requirement change, degree of software architecture change, etc. collected through project management and other channels to form the following judgment matrix:

[0106]

[0107] Based on the above judgment matrix, the eigenvalues ​​and eigenvectors are obtained by calculation:

[0108] import numpy as np

[0109] #Define the matrix

[0110] matrix=np.array([[1,5,3,1 / 3,1 / 5,5,3,3,3],

[0111] [1 / 5,1,1 / 3,1 / 5,1 / 5,1 / 3,3,3,1],

[0112] [1 / 3,3,1,1 / 3,1 / 3,1,3,3,5],

[0113] [3,5,3,1,1,5,3,3,3],

[0114] [5,5,3,1,1,5,3,5,3],

[0115] [1 / 5,3,1,1 / 5,1 / 5,1,1,1 / 3,1 / 3],

[0116] [1 / 3,1 / 3,1 / 3,1 / 3,1 / 3,1,1,3,1],

[0117] [1 / 3,1 / 3,1 / 3,1 / 3,1 / 5,3,1 / 3,1,3],

[0118] [1 / 3,1,1 / 5,1 / 3,1 / 3,3,1,3,1]])

[0119] # Solve for eigenvalues ​​and eigenvectors

[0120] eigenvalues,eigenvectors=np.linalg.eig(matrix)

[0121] #Find the maximum eigenvalue and the corresponding eigenvector

[0122] max_eigenvalue_index=np.argmax(eigenvalues)

[0123] max_eigenvalue=eigenvalues[max_eigenvalue_index]

[0124] max_eigenvector=eigenvectors[:,max_eigenvalue_index]

[0125] print("Maximum eigenvalue:",max_eigenvalue)

[0126] print("Corresponding eigenvector:",max_eigenvector)

[0127] The maximum eigenvalue in the above calculation process is 10.528157232062686, the criterion level order is 9, and the calculated consistency contrast ratio result CR=0.169795248>0.1 does not meet the consistency test requirements. It is necessary to reconstruct a new judgment matrix to meet the consistency test until the contrast ratio result CR<0.1.

[0128] 3) Prediction model establishment:

[0129] The following are the main code examples:

[0130] (1) Define the Sigmoid activation function:

[0131]

[0132] (2) Define BP neural network:

[0133]

[0134]

[0135]

[0136] In order to simplify the training process, this training model only sets one hidden layer. It first uses forward propagation and then back propagation to update the weights and thresholds. Then, it repeatedly trains and finally outputs the predicted reuse degree.

[0137] The present invention proposes a software reuse analysis method based on a reuse statistical model. According to the characteristics of the whole vehicle electronic architecture, especially the intelligent cockpit and intelligent network products, an applicable and reliable basic structure of the reuse statistical model is designed; with the support of the enterprise IT system and Gerrit, a corresponding automatic data management program is designed to solve the data source of the reuse statistical model, as well as related automatic collection, storage, and management problems, to ensure that the required data vectors are generated quickly and effectively; finally, based on the above process, the target reuse statistical model data vector set is obtained, the corresponding prediction model is trained, and the prediction model is used to complete the analysis of software reuse, providing valuable guidance for the automotive software development team on the selection, iteration, and even reconstruction of software modules.

[0138] The present invention is not limited to the above-mentioned embodiments. On the basis of the technical solution disclosed in the present invention, technicians in this field can make some substitutions and deformations to some technical features therein according to the disclosed technical content without creative labor, and these substitutions and deformations are all within the protection scope of the present invention.

Claims

1. A software reuse analysis method based on a statistical model, characterized in that: The following steps are involved: 1) Design a reused statistical model suitable for smart cockpit and smart network series product projects; 2) Design and embed automated data management programs in the enterprise IT system and Gerrit, and compile statistics on project history data in Gerrit; 3) Train the prediction model through BP neural network and realize software reuse analysis through the prediction model.

2. The software reuse analysis method based on a statistical model according to claim 1, characterized in that: The step 1) specifically includes: determining the core element data in the reused statistical model based on project experience and project historical data; collecting eight core element data through two means: automated tool collection and project information collection. The automated tool collection is automatically implemented through the tool, and five core element data are collected in "module" units; the project information collection is manually implemented, and three core element data are collected in "project" units.

3. The software reuse analysis method based on a statistical model according to claim 2, characterized in that: The five core element data include module reuse degree, number of module code change lines, module code change cycle, module code failure rate and module process completion; the three core elements include product project type, degree of software requirement change and degree of software architecture change.

4. The software reuse analysis method based on a statistical model according to claim 1, characterized in that: The step 2) specifically includes: designing a data management program through Gerrit query and Python; the user inputs option parameters representing the project and time parameters in a fixed format, the parameters are passed through the Python script, the Gerrit query command obtains relevant parameters, executes the command line to query the Gerrit database, and returns Json format data {X}, the Python script processes the Json data, and exports the Excel data table according to the template format.

5. The software reuse analysis method based on a statistical model according to claim 4, characterized in that: The Gerrit query command uses the Updated time Tupdated in the changes database as the query standard. The Gerritchanges database records all operations on the submitted content in the Gerrit page and records the page operation time; when the Gerrit page performs a Merge operation on a single submission, that is, Submit to the database, the Gerrit changes database will use the typical characters of "Change has been successfully merged", that is, MMerged to mark the Merge operation, and record the operation time Mtime; by extracting the Mtime in the database, if Mtime∈[Sincetime, Beforetime], the single Merged state data is valid data.

6. The software reuse analysis method based on a statistical model according to claim 1, characterized in that: The step 3) specifically includes: 3-1) Calculate the weights of the multiplexed statistical elements, divide the evaluation levels of each multiplexed statistical element according to the requirements, test the average values ​​or variances calculated from different samples, and normalize the data that have completed the consistency test; 3-2) Establishment of reuse prediction model: Fuzzify the data and classify the software reuse degree into five types: relatively high, high, medium, low and relatively low. Use fuzzy comprehensive evaluation to normalize the criterion layer of the reuse index system, and then input the fuzzified sample data into the BP neural network by establishing self-learning data samples. Use the BP neural network to establish an autonomous learning model for data training.

7. The software reuse analysis method based on statistical model according to claim 6, characterized in that: The step 3-1) specifically includes: First, the evaluation levels of each reused statistical element are divided according to the following table: The evaluator compares the indicators to obtain the judgment matrix A at the criterion level; Among them, n is the number of indicators in the criterion layer of the indicator system, a ij It is the importance level obtained by comparing two indicators. Similarly, the judgment matrix of the criterion layer and the solution layer can also be obtained through this calculation; Calculate the maximum eigenvalue and corresponding eigenvector of all judgment matrices, and then perform consistency check on each judgment matrix obtained; By formula The result of the consistency contrast ratio CR is calculated to test the consistency of the matrix; where λ max is the maximum eigenvalue, n is the matrix dimension, CI is the consistency index, RI is the average random consistency index, and the value range of the RI index is shown in the following table: If CR < 0.1, the consistency test requirement is passed. Otherwise, a new judgment matrix needs to be reconstructed to meet the consistency test. Normalization processing: convert the data into a decimal between 0 and 1, and calculate the maximum eigenvalue of each layer from the bottom layer to the top layer according to the hierarchical order of the above reusability evaluation system according to the judgment matrix, and then perform a consistency test. After the test, normalize it to obtain the weight coefficient of each level.

8. The software reuse analysis method based on statistical model according to claim 6, characterized in that: The data fuzzification process described in step 3-2) specifically includes: Establish fuzzy sets: According to the factors affecting software reuse, establish a reusability evaluation index set U = {u1,u2,…,u n } and the evaluation set V of the index = {v1,v2,…,v m }; Establish a membership matrix: If there are a experts on the indicator set U = {u1,u2,…,u n } for comprehensive evaluation, among which b experts evaluate u i , i=1,2,…n give the same evaluation level as v i , then its membership degree is considered to be Among them, i and j refer to the element location of the matrix respectively. The value range of i is 1-n, and the value range of j is 1-m, so the membership matrix Establish a weight set: The weight set W = {ω1,ω2,…,ω m }; Calculate the comprehensive membership vector: by formula The comprehensive membership vector is calculated, where ω j Represents the j-th set element corresponding to the weight set W, which is substituted into the formula for calculation and used as the input layer data of the BP neural network.

9. The software reuse analysis method based on statistical model according to claim 6, characterized in that: The BP neural network described in step 3-2) includes: an input layer, a hidden layer and an output layer; the weight calculated by the reuse index is input into the input layer, then forward propagated to the hidden layer, and then transmitted to the output layer after data processing.

10. The software reuse analysis method based on statistical model according to claim 6, characterized in that: Step 3-2) of using BP neural network to establish an autonomous learning model for data training specifically includes: selecting function As the activation function, according to the solution layer of the software reuse evaluation index, x1, x2, ..., x n As the input layer neuron, then adjust the weight of each input proportion, and choose the most convenient linear weighted summation method to get the neuron net input Then substitute Net into the sigmoid activation function to get the activation function of the jth neuron: where θ j For the threshold, the weights of each neuron are constantly modified to find the best activation function; By Kolmogorov theorem To calculate the number of neurons in the hidden layer, m is the number of neurons in the input layer, n is the number of neurons in the output layer, and α is a constant between 1 and 10. During the training process, the gradient descent training function is used to continuously adjust the weights and thresholds of the neural network along the negative gradient direction of the parameters. Through multiple data training, the best convergence network is obtained for prediction.