Performance data acquisition method and device, electronic equipment and storage medium
The XGBoost model automates performance data acquisition for composite materials, addressing inefficiencies in manual methods by predicting key properties with reduced time and enhanced stability.
Patent Information
- Application Number
- CN202411687030.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The acquisition process of performance data for composite materials is cumbersome and inefficient due to manual methods that are time-consuming and prone to human error, hindering the improvement of data acquisition efficiency.
A performance data acquisition method utilizing an XGBoost model to predict tensile strength, maximum elongation, and elongation at break by training on sample data, with a loss value-based stopping criterion to ensure accuracy, allowing automated data input and output without human intervention.
Reduces the time required for performance data acquisition and enhances the stability of the data by eliminating human factor influence, improving efficiency and accuracy.
Smart Images

Figure CN119181453A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device and storage medium for acquiring performance data. Background Art
[0002] The composition and structure of composite materials can be flexibly designed according to specific needs. By adjusting the proportion, shape and arrangement of different components, composite materials with different performance characteristics can be prepared to meet various complex and diverse application requirements.
[0003] However, the acquisition process of the performance data of existing composite materials is cumbersome, which is not conducive to improving the efficiency of performance data acquisition. The reason is that the existing technology mainly adopts manual acquisition to obtain the performance data of composite materials, and the manual acquisition method requires a large amount of data comparison, which is not only time-consuming and labor-intensive, but also easily affected by human factors, and is therefore not conducive to improving the efficiency of performance data acquisition. Summary of the invention
[0004] The embodiments of the present application provide a performance data acquisition method, device, electronic device and storage medium to solve the technical problem that the performance data acquisition process of the above-mentioned existing composite materials is cumbersome and is not conducive to improving the efficiency of performance data acquisition. In a first aspect, an embodiment of the present application provides a performance data acquisition method, which is applied to an electronic device, wherein the electronic device stores an XGBoost model, and the performance data acquisition method includes: Acquiring sample data of a composite material, the sample data comprising a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; Training the XGBoost model based on the sample data, and obtaining prediction performance data output by the XGBoost model based on the sample data; Obtaining the predicted tensile strength, predicted maximum elongation, and predicted elongation at break from the predicted performance data, and obtaining the preset tensile strength, preset maximum elongation, and preset elongation at break from the preset performance data; Obtaining a first loss value between the predicted tensile strength and the preset tensile strength, obtaining a second loss value between the predicted maximum elongation and the preset maximum elongation, and obtaining a third loss value between the predicted elongation at break and the preset elongation at break; Generate a model based on the first loss value, the second loss value, the third loss value and a preset overall loss value to generate an overall loss value for the predicted performance data, and determine whether the overall loss value is less than a preset loss value; When the overall loss value is less than the preset loss value, stop training the XGBoost model and save the trained XGBoost model; The current stretching rate of the composite material is obtained, the current stretching rate is input into the trained XGBoost model, and current performance data output by the trained XGBoost model based on the current stretching rate is obtained.
[0005] In a possible implementation manner of the first aspect, training the XGBoost model based on the sample data, and obtaining prediction performance data output by the XGBoost model based on the sample data, includes: Obtaining a feature vector of the sample data, and inputting the feature vector into the XGBoost model; The prediction performance data output by the XGBoost model based on the feature vector is obtained.
[0006] Exemplarily, the overall loss value generation model is: S = K1 × S1 + K2 × (S2 + S3); Among them, S is the overall loss value, S1 is the first loss value, S2 is the second loss value, S3 is the third loss value, K1 is a preset first proportional coefficient, and K2 is a preset second proportional coefficient.
[0007] Among them, the overall loss value is used to describe the degree of difference between the preset performance data and the predicted performance data; the larger the overall loss value, the greater the degree of difference between the preset performance data and the predicted performance data; the smaller the overall loss value, the smaller the degree of difference between the preset performance data and the predicted performance data.
[0008] Among them, the overall loss value generation model is the generation model of the overall loss value.
[0009] In a possible implementation manner of the first aspect, when the overall loss value is less than the preset loss value, stopping training the XGBoost model and saving the trained XGBoost model include: When the overall loss value is less than the preset loss value, stop training the XGBoost model; Obtain a preset save instruction, and save the trained XGBoost model by executing the save instruction.
[0010] In a possible implementation manner of the first aspect, obtaining a current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining current performance data output by the trained XGBoost model based on the current stretching rate includes: Connect an input device, obtain the current stretching rate of the composite material through the input device, input the current stretching rate into the trained XGBoost model, and obtain current performance data output by the trained XGBoost model based on the current stretching rate.
[0011] In a possible implementation of the first aspect, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: Obtaining the current tensile strength, the current maximum elongation, and the current elongation at break from the current performance data; A preset display area is obtained, and the current tensile strength, the current maximum elongation, and the current elongation at break are displayed in the display area.
[0012] In a possible implementation of the first aspect, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: A preset storage area is obtained, and the current performance data is stored in the storage area.
[0013] In a possible implementation of the first aspect, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: The fuel name of the composite material is obtained, and the fuel name and the current performance data are uploaded to a preset server.
[0014] In a second aspect, an embodiment of the present application provides a performance data acquisition device, which is applied to an electronic device, wherein the electronic device stores an XGBoost model, including: A first acquisition module, configured to acquire sample data of a composite material, wherein the sample data includes a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; A second acquisition module is used to train the XGBoost model based on the sample data and acquire prediction performance data output by the XGBoost model based on the sample data; A third acquisition module is used to acquire the predicted tensile strength, predicted maximum elongation, and predicted elongation at break in the predicted performance data, and to acquire the preset tensile strength, preset maximum elongation, and preset elongation at break in the preset performance data; a fourth acquisition module, configured to acquire a first loss value between the predicted tensile strength and the preset tensile strength, acquire a second loss value between the predicted maximum elongation and the preset maximum elongation, and acquire a third loss value between the predicted elongation at break and the preset elongation at break; A judgment module, configured to generate a model according to the first loss value, the second loss value, the third loss value and a preset overall loss value, generate an overall loss value of the predicted performance data, and judge whether the overall loss value is less than a preset loss value; A saving module, used for stopping training the XGBoost model and saving the trained XGBoost model when the overall loss value is less than the preset loss value; The fifth acquisition module is used to obtain the current stretching rate of the composite material, input the current stretching rate into the trained XGBoost model, and obtain the current performance data output by the trained XGBoost model based on the current stretching rate.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the performance data acquisition method of any one of the above-mentioned first aspects is implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the performance data acquisition method of any one of the above-mentioned first aspects is implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the performance data acquisition method described in any one of the above-mentioned first aspects.
[0018] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the current stretching rate of the composite material is obtained, and the current stretching rate is input into the trained XGBoost model to obtain the current performance data output by the trained XGBoost model based on the current stretching rate. Since manual acquisition is not required, the time for obtaining the performance data of the composite material is reduced, which is beneficial to improving the efficiency of obtaining the performance data of the composite material. On the other hand, since the XGBoost model will not be affected by human factors, it is beneficial to improve the stability of the performance data of the composite material obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 An application scenario diagram of the performance data acquisition method provided in an embodiment of the present application; Figure 2 is a flow chart of a method for obtaining performance data provided in an embodiment of the present application; Figure 3 A flowchart of saving the XGBoost model provided in an embodiment of the present application; Figure 4 A schematic block diagram of a performance data acquisition device provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0022] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0023] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0024] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0025] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0026] The performance data acquisition method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0027] See also Figure 1 , Figure 1 The application scenario diagram of the performance data acquisition method provided in the embodiment of the present application is described in detail as follows: The electronic device is connected to the server via a preset network, and obtains the sample data of the composite material via the server. The preset network includes one or a combination of Ethernet, WIFI network, 4G network, and 5G network.
[0028] WIFI network is Wireless Fidelity network.
[0029] 4G network is the fourth generation of mobile communication technology network.
[0030] 5G network is the fifth generation of mobile communication technology network.
[0031] The electronic device sends a data acquisition request and a sample quantity to the server, and receives sample data returned by the server according to the data acquisition request and the sample quantity.
[0032] The number of samples is preset by the user or by the system and is not limited here.
[0033] The electronic device stores the XGBoost model.
[0034] Among them, the Chinese full name of the XGBoost model is: extreme gradient boosting model, and the English full name of the XGBoost model is: eXtreme Gradient Boosting. XGBoost is an integrated learning algorithm based on gradient boosting trees.
[0035] For ease of explanation, the details are as follows: (1) Objective function of the XGBoost model: The objective function of the XGBoost model is a carefully designed combination of a regularization term and a loss function.
[0036] The loss function is used to measure the degree of deviation between the model's prediction and the true value. For example, the squared loss function calculates the sum of the squares of the difference between the predicted value and the true value; for example, the logarithmic loss function evaluates the performance of the model based on the probability distribution.
[0037] The introduction of regularization terms is to constrain the complexity of the model and avoid overfitting. Regularization terms usually include penalties on the number of leaf nodes to prevent the model from generating an overly complex tree structure, as well as L2 norm constraints on leaf node scores to limit the size of node scores.
[0038] (2) Gradient calculation: In each iteration, the XGBoost model accurately calculates the first and second derivatives of the loss function with respect to the current model prediction.
[0039] The first-order derivative is usually called the gradient in multivariate functions. The value and direction of the gradient clearly reflect the error trend and size of the current model on each sample. By making full use of this gradient information, the XGBoost model can clearly identify the direction and strength of the model that needs to be improved.
[0040] The second-order derivative is the Hessian matrix. The full name of the Hessian matrix in Chinese is: Hessian matrix, and the full name of the Hessian information in English is: Hessian Matrix.
[0041] (3) Tree construction: Based on the calculated gradient information, the XGBoost model starts to build a new decision tree. During the tree construction process, each feature is deeply analyzed and evaluated to explore possible split points. The selection criteria for split points are mainly based on gradients and Hessian matrices, and an evaluation metric called gain is used to measure the reduction in the objective function that can be brought about by different split points.
[0042] Specifically, the calculation of the gain takes into account the gradient and Hessian matrix of the left and right subtrees after the split, as well as the increased structural complexity caused by the split. By traversing all possible features and split points, the XGBoost model can find the optimal split method so that the newly constructed tree optimizes the objective function to the greatest extent.
[0043] (4) Leaf node score calculation: In order to minimize the objective function, the XGBoost model cleverly uses the second-order derivative information to accurately calculate the leaf node scores of the new tree. This calculation method ensures that the values of the leaf nodes can compensate for the prediction error of the model in the current state to the greatest extent, thereby effectively improving the performance and accuracy of the model.
[0044] (5) Model integration: As the iterations proceed, the newly constructed trees are added one by one to the existing model set to form a powerful ensemble model. Each newly added tree contributes a unique part to the overall predictive power of the model.
[0045] The actual contribution of each tree is determined by the score of its corresponding leaf node and a weight. The determination of this weight is based on the optimization of the objective function to ensure that the addition of new trees can most effectively improve the performance of the model.
[0046] (6) Handling missing values: The XGBoost model shows a high degree of intelligence and adaptability when dealing with missing values in features. When splitting a node, it considers the case of assigning samples with missing values to the left subtree or the right subtree, and selects the optimal allocation method through a specific strategy.
[0047] This flexible processing method enables the XGBoost model to build an effective model even when there is missing data, without the need to perform tedious filling or processing of missing values in advance.
[0048] (7) Parallelization and cache optimization: In order to meet the training needs of large-scale data, the XGBoost model adopts a series of efficient technical means. Parallel computing is performed at the feature granularity, making full use of the computing power of multi-core processors to speed up the training of the model.
[0049] At the same time, through the carefully designed data cache structure, the repeated reading and calculation of data are effectively reduced, further improving the training efficiency, enabling the XGBoost model to process massive amounts of data in a shorter time and generate high-quality models.
[0050] (8) After each addition of a new tree, the XGBoost model uses a strategy called shrinkage to scale the prediction results of the new tree, for example, by multiplying it by a coefficient less than 1. The magnitude of the model update will decrease accordingly after each iteration. This process is similar to the learning rate adjustment in stochastic gradient descent, which helps to smooth the model update process and avoid drastic fluctuations in the model due to excessive influence of individual trees.
[0051] Among them, the performance of the XGBoost model depends on the reasonable setting of parameters. The Sparrow algorithm can automatically search and optimize the parameters of the XGBoost model to find the optimal parameter combination, thereby improving the prediction accuracy and generalization ability of the XGBoost model.
[0052] For ease of explanation, the basic process of optimizing the XGBoost model using the Sparrow algorithm is as follows: (1) Data preprocessing: Data cleaning is a key step, which requires processing missing values, outliers, and duplicate data. Data normalization can unify feature values of different magnitudes and ranges to a similar scale, which helps model training and convergence.
[0053] (2) Initialize the XGBoost model: The XGBoost model has multiple hyperparameters that need to be set, which can be set based on experience or some default values at the beginning. Common hyperparameters such as the learning rate determines the step size of the model learning, the depth of the tree controls the complexity of the tree, and the number of trees affects the model's fitting ability.
[0054] (3) Define the fitness function: The fitness function is used to evaluate the quality of each hyperparameter combination. For XGBoost models, the predictive performance index of the model is usually calculated on an independent validation set as the fitness. For example, for regression problems, the mean square error can be used. The smaller the mean square error value, the better the corresponding hyperparameter combination. For example, for classification problems, the accuracy rate, F1 value, etc. can be used. The larger the accuracy rate and F1 value, the better the corresponding hyperparameter combination. The F1 value is an indicator used to evaluate the performance of classification models. It is the harmonic mean of precision and recall.
[0055] (4) Initialize the sparrow population: The sparrow individuals in the sparrow algorithm represent different hyperparameter combinations of the XGBoost model. A certain number of sparrow individuals are randomly generated, and each individual has a specific set of hyperparameter values in a specific search space, that is, the possible range of hyperparameter values.
[0056] (5) Iterative optimization: Calculate the fitness value of each individual sparrow: Apply the hyperparameters represented by each individual sparrow to the XGBoost model and calculate the fitness value on the validation set.
[0057] Update the positions of discoverers and joiners: Sparrows with better fitness are used as discoverers, and the discoverers will guide the population to search for better areas. Sparrows with poorer fitness are used as joiners, and the joiners will follow the discoverers or search randomly within a certain range.
[0058] Consider the early warning mechanism: When the fitness has not improved significantly for a long time or reaches a certain number of iterations, the early warning mechanism is triggered to make special adjustments to the positions of individual sparrows to increase the diversity of the search and avoid falling into the local optimum.
[0059] (6) Select optimal hyperparameters: After multiple iterations, the hyperparameter combination corresponding to the sparrow individual with the best fitness value is considered to be the optimal hyperparameter combination. This set of hyperparameters enables the XGBoost model to perform best on the validation set.
[0060] (7) Training the XGBoost model: The optimized hyperparameter combination is used to retrain the XGBoost model, this time using all available data including the training set and the validation set.
[0061] (8) Model evaluation: Evaluate the trained XGBoost model on an independent test set and calculate the final performance indicators, such as accuracy, recall, mean square error, etc., to determine the generalization ability of the model on new data and its actual application effect.
[0062] In the embodiments of the present application, the XGBoost model can capture complex patterns and relationships in sample data, thereby achieving high-precision predictions.
[0063] See also Figure 2 , Figure 2 It is a flow chart of a performance data acquisition method provided in an embodiment of the present application. The method can be applied to an electronic device storing an XGBoost model.
[0064] like Figure 2As shown, the performance data acquisition method provided in the embodiment of the present application includes the following steps, which are described in detail as follows: S201, acquiring sample data of a composite material, wherein the sample data includes a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; Wherein, sample data of the composite material is obtained through a local data set, and the sample data includes a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate.
[0065] The preset stretching rate refers to the rate of material stretching that is preset on the testing machine before the start of the tensile test according to the test requirements or material properties. This rate describes the length or strain of the composite material being stretched per unit time.
[0066] S202, training the XGBoost model based on the sample data, and obtaining prediction performance data output by the XGBoost model based on the sample data; The step of training the XGBoost model based on the sample data and obtaining the prediction performance data output by the XGBoost model based on the sample data includes: Obtaining a feature vector of the sample data, and inputting the feature vector into the XGBoost model; The prediction performance data output by the XGBoost model based on the feature vector is obtained.
[0067] S203, obtaining the predicted tensile strength, predicted maximum elongation, and predicted elongation at break from the predicted performance data, and obtaining the preset tensile strength, preset maximum elongation, and preset elongation at break from the preset performance data; Among them, the preset tensile strength is the preset tensile strength, which is also called the strength limit or tensile strength. It is the maximum stress value that the composite material can withstand during the tensile process, that is, the maximum tensile stress that the specimen is subjected to until it breaks in the tensile test.
[0068] Among them, the preset maximum elongation is the preset maximum elongation, which is also called elongation. It is a measure of the maximum plastic deformation that a composite material can withstand before breaking during the stretching process. This parameter is obtained by calculating the ratio of the total elongation of the specimen when stretched to fracture to the original length of the specimen, usually expressed as a percentage.
[0069] The preset elongation at break is a preset elongation at break, and the elongation at break refers to the ratio of the elongated length of the composite material after being stretched to break by an external force to the original length before stretching, expressed as a percentage.
[0070] Here, Predicted Tensile Strength is the predicted tensile strength.
[0071] Here, predicted maximum elongation is the predicted maximum elongation.
[0072] Here, the predicted elongation at break is the predicted elongation at break.
[0073] S204, obtaining a first loss value between the predicted tensile strength and the preset tensile strength, obtaining a second loss value between the predicted maximum elongation and the preset maximum elongation, and obtaining a third loss value between the predicted elongation at break and the preset elongation at break; Through the square loss function or the logarithmic loss function, a first loss value between the predicted tensile strength and the preset tensile strength is obtained, a second loss value between the predicted maximum elongation and the preset maximum elongation is obtained, and a third loss value between the predicted breaking elongation and the preset breaking elongation is obtained.
[0074] S205, generating a model according to the first loss value, the second loss value, the third loss value and a preset overall loss value, generating an overall loss value of the predicted performance data, and determining whether the overall loss value is less than a preset loss value; Exemplarily, the overall loss value generation model is: S = K1 × S1 + K2 × (S2 + S3); Among them, S is the overall loss value, S1 is the first loss value, S2 is the second loss value, S3 is the third loss value, K1 is a preset first proportional coefficient, and K2 is a preset second proportional coefficient.
[0075] Among them, the overall loss value is used to describe the degree of difference between the preset performance data and the predicted performance data; the larger the overall loss value, the greater the degree of difference between the preset performance data and the predicted performance data; the smaller the overall loss value, the smaller the degree of difference between the preset performance data and the predicted performance data.
[0076] Among them, the overall loss value generation model is the generation model of the overall loss value.
[0077] For the sake of illustration, an example is given below: For example, K1 is 0.5, K1 is 0.5, S1 is 5, S2 is 3, and S3 is 6. At this time, the overall loss value generation model is; S=0.5×5+ 0.5×(3+6)=7; For example, K1 is 0.3, K2 is 0.7, S1 is 15, S2 is 13, and S3 is 6. At this time, the overall loss value generation model is: S=0.3×15+ 0.7×(13+6)=17.8.
[0078] S206, when the overall loss value is less than the preset loss value, stop training the XGBoost model and save the trained XGBoost model; Among them, the preset loss value is set by the user or by the system default, and is not restricted here.
[0079] For the sake of illustration, an example is given below: For example, when the overall loss value is 7 and the preset loss value is 15, the overall loss value is less than the preset loss value, the training of the XGBoost model is stopped, and the trained XGBoost model is saved.
[0080] For example, when the overall loss value is 8 and the preset loss value is 10, the overall loss value is less than the preset loss value, the training of the XGBoost model is stopped, and the trained XGBoost model is saved.
[0081] S207, obtaining a current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining current performance data output by the trained XGBoost model based on the current stretching rate.
[0082] Wherein, the obtaining of the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, comprises: Connect an input device, obtain the current stretching rate of the composite material through the input device, input the current stretching rate into the trained XGBoost model, and obtain current performance data output by the trained XGBoost model based on the current stretching rate.
[0083] Wherein, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: Step A, obtaining the current tensile strength, the current maximum elongation, and the current elongation at break from the current performance data; A preset display area is obtained, and the current tensile strength, the current maximum elongation, and the current elongation at break are displayed in the display area.
[0084] Wherein, CurrentTensileStrength is the current tensile strength.
[0085] Wherein, current maximum elongation is the current maximum elongation.
[0086] Here, current elongation at break is the current elongation at break.
[0087] Wherein, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: Step B: obtaining a preset storage area, and storing the current performance data in the storage area.
[0088] Wherein, after obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: Step C, obtaining the fuel name of the composite material, and uploading the fuel name and the current performance data to a preset server.
[0089] Among them, step C can be executed before or after step A and step B, step A can be executed before or after step C and step B, step B can be executed before or after step C and step A, and step C can also be executed simultaneously with step A and step B. The specific execution order is not limited here.
[0090] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the current stretching rate of the composite material is obtained, and the current stretching rate is input into the trained XGBoost model to obtain the current performance data output by the trained XGBoost model based on the current stretching rate. Since manual acquisition is not required, the time for obtaining the performance data of the composite material is reduced, which is beneficial to improving the efficiency of obtaining the performance data of the composite material. On the other hand, since the XGBoost model will not be affected by human factors, it is beneficial to improve the stability of the performance data of the composite material obtained.
[0091] See also Figure 3 , Figure 3 The flowchart of saving the XGBoost model provided in the embodiment of the present application is described in detail as follows: S301, when the overall loss value is less than the preset loss value, stop training the XGBoost model; Among them, the preset loss value is preset by the user or by the system default and is not restricted here.
[0092] S301, obtaining a preset saving instruction, and saving the trained XGBoost model by executing the saving instruction.
[0093] In an embodiment of the present application, the trained XGBoost model is saved to facilitate repeated calling of the XGBoost model at any time in the future. Since there is no need to retrain the XGBoost model, computing resources are saved and the repeatability of the XGBoost model is ensured.
[0094] For the performance data acquisition method described in the above embodiment, please refer to Figure 4 , Figure 4 A schematic block diagram of a performance data acquisition device provided in an embodiment of the present application, Figure 4 The performance data acquisition device 400 shown can be applied to Figure 1 The electronic device in the application scenario diagram shown below takes the electronic device as an example. Figure 4 The performance data acquisition device 400 shown is described in detail. The performance data acquisition device 400 may include a first acquisition module 401, a second acquisition module 402, a third acquisition module 403, a fourth acquisition module 404, a judgment module 405, a storage module 406, and a fifth acquisition module 407.
[0095] A first acquisition module 401 is used to acquire sample data of a composite material, wherein the sample data includes a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; A second acquisition module 402 is used to train the XGBoost model based on the sample data and acquire prediction performance data output by the XGBoost model based on the sample data; The third acquisition module 403 is used to acquire the predicted tensile strength, predicted maximum elongation, and predicted elongation at break in the predicted performance data, and to acquire the preset tensile strength, preset maximum elongation, and preset elongation at break in the preset performance data; A fourth acquisition module 404 is used to acquire a first loss value between the predicted tensile strength and the preset tensile strength, acquire a second loss value between the predicted maximum elongation and the preset maximum elongation, and acquire a third loss value between the predicted elongation at break and the preset elongation at break; A judgment module 405 is used to generate a model according to the first loss value, the second loss value, the third loss value and a preset overall loss value, generate an overall loss value of the predicted performance data, and judge whether the overall loss value is less than a preset loss value; A saving module 406 is used to stop training the XGBoost model and save the trained XGBoost model when the overall loss value is less than the preset loss value; The fifth acquisition module 407 is used to obtain the current stretching rate of the composite material, input the current stretching rate into the trained XGBoost model, and obtain the current performance data output by the trained XGBoost model based on the current stretching rate.
[0096] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0097] The beneficial effects of the embodiments of the present application lie in two aspects. On the one hand, the current stretching rate of the composite material is obtained, and the current stretching rate is input into the trained XGBoost model to obtain the current performance data output by the trained XGBoost model based on the current stretching rate. Since manual acquisition is not required, the time for obtaining the performance data of the composite material is reduced, which is beneficial to improving the efficiency of obtaining the performance data of the composite material. On the other hand, since the XGBoost model will not be affected by human factors, it is beneficial to improve the stability of the performance data of the composite material obtained.
[0098] See also Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0099] like Figure 5 As shown, Figure 5 The electronic device 2 includes: at least one processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, and when the processor 20 executes the computer program 22, the steps in any of the above-mentioned method embodiments are implemented.
[0100] The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 2 and does not constitute a limitation on the electronic device 2. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0101] The processor 20 is used to run the computer program 22 stored in the memory 21, and implement the following steps when executing the computer program 22: Acquiring sample data of a composite material, the sample data comprising a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; Training the XGBoost model based on the sample data, and obtaining prediction performance data output by the XGBoost model based on the sample data; Obtaining the predicted tensile strength, predicted maximum elongation, and predicted elongation at break from the predicted performance data, and obtaining the preset tensile strength, preset maximum elongation, and preset elongation at break from the preset performance data; Obtaining a first loss value between the predicted tensile strength and the preset tensile strength, obtaining a second loss value between the predicted maximum elongation and the preset maximum elongation, and obtaining a third loss value between the predicted elongation at break and the preset elongation at break; A model is generated according to the first loss value, the second loss value, the third loss value and a preset overall loss value, an overall loss value of the predicted performance data is generated, and it is determined whether the overall loss value is less than the preset loss value; when the overall loss value is less than the preset loss value, training of the XGBoost model is stopped, and the trained XGBoost model is saved; a current stretching rate of the composite material is obtained, the current stretching rate is input into the trained XGBoost model, and current performance data output by the trained XGBoost model based on the current stretching rate is obtained.
[0102] In some embodiments, the processor 20 is configured to implement: Obtaining a feature vector of the sample data, and inputting the feature vector into the XGBoost model; The prediction performance data output by the XGBoost model based on the feature vector is obtained.
[0103] In some embodiments, the processor 20 is configured to implement: When the overall loss value is less than the preset loss value, stop training the XGBoost model; Obtain a preset save instruction, and save the trained XGBoost model by executing the save instruction.
[0104] In some embodiments, the processor 20 is configured to implement: Connect an input device, obtain the current stretching rate of the composite material through the input device, input the current stretching rate into the trained XGBoost model, and obtain current performance data output by the trained XGBoost model based on the current stretching rate.
[0105] In some embodiments, the processor 20 is configured to implement: Obtaining the current tensile strength, the current maximum elongation, and the current elongation at break from the current performance data; A preset display area is obtained, and the current tensile strength, the current maximum elongation, and the current elongation at break are displayed in the display area.
[0106] In some embodiments, the processor 20 is configured to implement: A preset storage area is obtained, and the current performance data is stored in the storage area.
[0107] In some embodiments, the processor 20 is configured to implement: The fuel name of the composite material is obtained, and the fuel name and the current performance data are uploaded to a preset server.
[0108] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0109] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the electronic device 2. The memory 21 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0110] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0111] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0112] The computer-readable storage medium stores program codes, which can be called by a processor to execute the performance data acquisition method described in the above method embodiment.
[0113] The computer-readable storage medium has a storage space for program codes.
[0114] The program code includes the code of any step in the performance data acquisition method described in the above method embodiment.
[0115] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0116] The computer-readable storage medium may also be an external storage device of the performance data acquisition device or the electronic device, for example, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium), etc., equipped on the performance data acquisition device or the electronic device.
[0117] Since the computer program stored in the computer-readable storage medium can execute any one of the performance data acquisition methods provided in the embodiments of the present application, the computer-readable storage medium can achieve the beneficial effects that can be achieved by any one of the performance data acquisition methods provided in the embodiments of the present application. Please see the previous embodiments for details and will not be repeated here.
[0118] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the above-mentioned performance data acquisition method.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0120] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0121] Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0122] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0123] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for acquiring performance data, characterized in that: Applied to an electronic device, the electronic device stores an XGBoost model, and the performance data acquisition method includes: Acquiring sample data of a composite material, the sample data comprising a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; Training the XGBoost model based on the sample data, and obtaining prediction performance data output by the XGBoost model based on the sample data; Obtaining the predicted tensile strength, predicted maximum elongation, and predicted elongation at break from the predicted performance data, and obtaining the preset tensile strength, preset maximum elongation, and preset elongation at break from the preset performance data; Obtaining a first loss value between the predicted tensile strength and the preset tensile strength, obtaining a second loss value between the predicted maximum elongation and the preset maximum elongation, and obtaining a third loss value between the predicted elongation at break and the preset elongation at break; Generate a model based on the first loss value, the second loss value, the third loss value and a preset overall loss value to generate an overall loss value for the predicted performance data, and determine whether the overall loss value is less than a preset loss value; When the overall loss value is less than the preset loss value, stop training the XGBoost model and save the trained XGBoost model; The current stretching rate of the composite material is obtained, the current stretching rate is input into the trained XGBoost model, and current performance data output by the trained XGBoost model based on the current stretching rate is obtained.
2. The method for obtaining performance data according to claim 1, characterized in that: The step of training the XGBoost model based on the sample data and obtaining prediction performance data output by the XGBoost model based on the sample data includes: Obtaining a feature vector of the sample data, and inputting the feature vector into the XGBoost model; The prediction performance data output by the XGBoost model based on the feature vector is obtained.
3. The method for obtaining performance data according to claim 1, characterized in that: When the overall loss value is less than the preset loss value, stopping training the XGBoost model and saving the trained XGBoost model include: When the overall loss value is less than the preset loss value, stop training the XGBoost model; Obtain a preset save instruction, and save the trained XGBoost model by executing the save instruction.
4. The method for obtaining performance data according to claim 1, characterized in that: The step of obtaining a current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining current performance data output by the trained XGBoost model based on the current stretching rate includes: Connect an input device, obtain the current stretching rate of the composite material through the input device, input the current stretching rate into the trained XGBoost model, and obtain current performance data output by the trained XGBoost model based on the current stretching rate.
5. The method for obtaining performance data according to any one of claims 1 to 4, characterized in that: After obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: Obtaining the current tensile strength, the current maximum elongation, and the current elongation at break from the current performance data; A preset display area is obtained, and the current tensile strength, the current maximum elongation, and the current elongation at break are displayed in the display area.
6. The method for acquiring performance data according to any one of claims 1 to 4, characterized in that: After obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: A preset storage area is obtained, and the current performance data is stored in the storage area.
7. The method for acquiring performance data according to any one of claims 1 to 4, characterized in that: After obtaining the current stretching rate of the composite material, inputting the current stretching rate into the trained XGBoost model, and obtaining the current performance data output by the trained XGBoost model based on the current stretching rate, the performance data acquisition method includes: The fuel name of the composite material is obtained, and the fuel name and the current performance data are uploaded to a preset server.
8. A performance data acquisition device, characterized in that: Applied to an electronic device, the electronic device stores an XGBoost model, including: A first acquisition module, configured to acquire sample data of a composite material, wherein the sample data includes a preset stretching rate of the composite material and preset performance data of the composite material at the preset stretching rate; A second acquisition module is used to train the XGBoost model based on the sample data and acquire prediction performance data output by the XGBoost model based on the sample data; A third acquisition module is used to acquire the predicted tensile strength, predicted maximum elongation, and predicted elongation at break in the predicted performance data, and to acquire the preset tensile strength, preset maximum elongation, and preset elongation at break in the preset performance data; a fourth acquisition module, configured to acquire a first loss value between the predicted tensile strength and the preset tensile strength, acquire a second loss value between the predicted maximum elongation and the preset maximum elongation, and acquire a third loss value between the predicted elongation at break and the preset elongation at break; A judgment module, configured to generate a model according to the first loss value, the second loss value, the third loss value and a preset overall loss value, generate an overall loss value of the predicted performance data, and judge whether the overall loss value is less than a preset loss value; A saving module, used for stopping training the XGBoost model and saving the trained XGBoost model when the overall loss value is less than the preset loss value; The fifth acquisition module is used to obtain the current stretching rate of the composite material, input the current stretching rate into the trained XGBoost model, and obtain the current performance data output by the trained XGBoost model based on the current stretching rate.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the performance data acquisition method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the performance data acquisition method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Acoustic model training method and device, computer equipment and storage medium
CN111128137A
Estimation of state of charge of lithium ion battery based on XGBoost model
CN111812515A
Data processing method and device, electronic equipment and storable medium
CN116597216A
Paste yield stress prediction method and device based on XGBoost model
CN117010266A
Machine learning model training method and apparatus, server, and storage medium
US20190318202A1
Cited By
Foil elongation prediction method and prediction device
CN121475875A
