Risk early warning method and device, computer program product and electronic equipment
By preprocessing the associated data during the computer software production process and inputting the trained target model for prediction, the problem of difficulty in accurately assessing the production risk when the software is put into production is solved, and a comprehensive and objective assessment of the production risk is achieved, and the accuracy of risk prediction is improved.
Patent Information
- Application Number
- CN202411917881.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
AI Technical Summary
It is difficult to accurately assess the risk of production during the version of the computer software, resulting in possible system failures or downtime.
By obtaining the data associated with the target service under the target version of the target application, including application statistics and version process data, preprocessing and inputting it into the target model for processing, predicting the probability of production problems in the target service of the target version during the production process. The target model is obtained by training the initial model based on the training data set, including statistical data and version process data of historical applications, as well as risk label data.
It provides a comprehensive and objective assessment of risk assessment during the software production process, improves the accuracy of risk prediction, and reduces the possibility of system failure.
Smart Images

Figure CN119784156A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a risk warning method, device, computer program product, and electronic device. Background Art
[0002] With the continuous development of computer software development, the scale and complexity of software systems are increasing. Especially in modern distributed system architectures, software function updates and bug fixes are usually carried out through version iterations, a process called version production. However, during the version production process, due to factors such as imperfect design, insufficient testing, or environmental differences, problems may occur in the production system, and even cause serious system failures or downtime accidents.
[0003] At present, the management of production risks mainly relies on manual experience and judgment. Specifically, production assessment is usually based on code change information and related document data, and the development and testing teams infer risk points through experience. However, this method has obvious limitations. Manual judgment is often limited by personal ability and experience, making it difficult to comprehensively and objectively assess risks.
[0004] With regard to the problem in related technologies that it is difficult to accurately assess the risks of putting computer software into production, no effective solution has been proposed so far. Summary of the invention
[0005] The main purpose of this application is to provide a risk warning method, device, computer program product and electronic device to solve the problem in the related technology that it is difficult to accurately assess the production risk during the production process when computer software is put into production.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a risk warning method is provided. The method comprises: obtaining data associated with a target service under a target version of a target application, wherein the data associated with the target service at least includes application statistical data and version process data; preprocessing the data associated with the target service to obtain preprocessed data; inputting the preprocessed data into a target model, and processing to obtain the probability of a production problem occurring in the production process of the target service of the target version, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data comprises data associated with historical services under historical versions of the target application and risk label data, wherein the data associated with historical services comprises historical application statistical data and historical version process data, and the risk label data comprises: the service has had production problems, and the service has not had production problems.
[0007] Optionally, the target model is obtained in the following manner: collecting historical statistical data and historical version process data of different services of different versions of the target application; performing data preprocessing on the historical statistical data and historical version process data; determining the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; using the training data set to train the initial model to obtain the target model.
[0008] Optionally, obtaining data associated with a target service under a target version of a target application includes: counting application information of the target application to obtain application statistics of the target application; counting personnel information, process information, and service information under the target service of the target version, and determining at least one of the personnel information, process information, and service information as version process data of the target application, wherein the personnel information includes personnel information of developers and testers, and the process information includes problem discovery information and requirement information during testing; and determining the application statistics data and version process data of the target application as data associated with the target service under the target version of the target application.
[0009] Optionally, the data associated with the target service is preprocessed to obtain the preprocessed data including: determining discrete features and continuous features in application statistical data and version process data; one-hot encoding the discrete features to obtain preprocessed first-category data; normalizing the continuous features to compress the values of the continuous features to a range of 0 to 1 to obtain preprocessed second-category data; and determining the first-category data and the second-category data as the preprocessed data.
[0010] Optionally, the target model is a neural network model, which includes an input layer, at least one hidden layer and an output layer, wherein the hidden layer of the neural network model is constructed using an activation function, the number of neurons in the hidden layer is smaller than the number of neurons in the input layer, and the output layer uses a soft attention mechanism to assign different weights to historical statistical data and historical version process data of the neural network model.
[0011] Optionally, the initial model is trained using the training data set to obtain the target model, including: iteratively training the initial model using the training data set, and calculating the cross-entropy loss function of the model after each round of training; when the cross-entropy loss function is greater than a threshold, back-propagating the gradient descent method to update the model parameters of the trained model, and training the model again until the cross-entropy loss function of the re-trained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a model training method is provided, which includes: collecting historical statistical data and historical version process data of different services of different versions of the target application; performing data preprocessing on the historical statistical data and historical version process data; determining the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; using the training data set to train the initial model to obtain the target model.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a risk warning device is provided. The device includes: a data acquisition module, which is used to obtain the data associated with the target service under the target version of the target application, wherein the data associated with the target service at least includes application statistical data and version process data; a data preprocessing module, which is used to preprocess the data associated with the target service to obtain the preprocessed data; a risk prediction module, which is used to input the preprocessed data into the target model, and process to obtain the probability of production problems occurring in the target service of the target version during the production process, wherein the target model is obtained by training the initial model based on the training data set, wherein each sample data includes the historical service-related data under the historical version of the target application and the risk label data, the historical service-related data includes the historical application statistical data and the historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is provided, which includes: a non-volatile computer-readable storage medium storing a computer program, and the computer program implements the risk early warning method when executed by a processor.
[0015] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided. The device includes: a memory storing a computer program, and a processor configured to execute a risk early warning method through the computer program.
[0016] In an embodiment of the present application, data associated with a target service under a target version of a target application is obtained, wherein the data associated with the target service includes at least application statistical data and version process data; the data associated with the target service is preprocessed to obtain preprocessed data; the preprocessed data is input into a target model, and the probability of a target service of the target version having a production problem during production is obtained by processing, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data includes historical service-associated data under a historical version of the target application and risk label data, and the historical service-associated data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems. By comprehensively analyzing the application historical statistical data and version process data, the purpose of providing a comprehensive and objective production risk assessment is achieved, thereby solving the problem in the related technology that it is difficult to accurately assess the production risk during production when computer software is put into production. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a risk early warning method;
[0019] Figure 2 is a flow chart of a risk warning method provided according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a target model provided according to an embodiment of the present application;
[0021] Figure 4 is a flow chart of a model training method provided according to an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of a risk warning device provided according to an embodiment of the present application;
[0023] Figure 6 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] First of all, some nouns or terms that appear in the process of describing the embodiments of the present application are subject to the following explanations: It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process is entered.
[0027] Example 1
[0028] According to an embodiment of the present application, a method embodiment of risk warning is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1This is a hardware structure diagram of a computer terminal used to implement a risk early warning method. Figure 1 As shown, the computer terminal 10 may include one or more ( Figure 1 The system includes a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (MCU, Microcontroller Unit) or a programmable logic device (FPGA, Field-Programmable Gate Array)), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface, Input / Output interface), a universal serial bus (USB, Universal Serial Bus) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the risk warning method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above-mentioned risk warning method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0033] The display may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0034] Under the above operating environment, this application provides Figure 2 The risk warning method shown. Figure 2 It is a flow chart of a risk warning method provided according to an embodiment of the present application.
[0035] Step S201, obtaining data associated with a target service under a target version of a target application, wherein the data associated with the target service at least includes application statistical data and version process data.
[0036] Specifically, the target application refers to the specific software that is currently undergoing version iteration, and is the object of risk assessment in the embodiments of the present application; the target version refers to the updated version of the target application completed in a specific development cycle. Each time a function is added, repaired, or performance optimized, a new software version, namely the target version, is formed; the target service refers to the service function that can be implemented by the target application, and the target service can be associated with various data of the target application.
[0037] Among them, in the data associated with the target service, the application statistical data is relatively fixed, while the version process data will change accordingly with each version of the application. Both types of data are obtained through statistical methods.
[0038] Step S202: pre-process the data associated with the target service to obtain pre-processed data.
[0039] Specifically, preprocessing includes: one-hot encoding of discrete features and normalization of continuous features. One-hot encoding is an encoding method that converts categorical data into numerical values. Features such as "whether the application is being refactored" will be converted into binary values. If the application is being refactored in the application statistics, it will be recorded as 1, otherwise it will be recorded as 0; normalization is used to scale continuous features to the interval [0,1]. Version process data can be normalized. For example, after the number of lines of code is normalized, the scale differences in the data can be eliminated, which is convenient for neural network training. The target model uses the preprocessed data for prediction, which can more accurately output the probability of production problems.
[0040] Step S203, input the preprocessed data into the target model, and process it to obtain the probability of production problems occurring in the target service of the target version during the production process, wherein the target model is obtained by training the initial model based on the training data set, and each sample data includes historical service-related data and risk label data under the historical version of the target application, the historical service-related data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
[0041] Specifically, the initial model can be a neural network model that has only built a model framework but has not been trained. The target model can be a trained neural network model that has learned how to identify potential risks from input data through the training process. The training data set contains sample data, and the historical statistical data and risk labels in the sample data will be used as the content of model training. Historical statistical data can include relevant information of the target application at different times, and historical version process data can include data from the development and testing process of a specific version. Risk label data can refer to the label of each historical service, which is used to indicate whether the service has had production problems in history.
[0042] In an embodiment of the present application, data associated with a target service under a target version of a target application is obtained, wherein the data associated with the target service includes at least application statistical data and version process data; the data associated with the target service is preprocessed to obtain preprocessed data; the preprocessed data is input into a target model, and the probability of a target service of the target version having a production problem during production is obtained by processing, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data includes historical service-associated data under a historical version of the target application and risk label data, and the historical service-associated data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems. By comprehensively analyzing the application historical statistical data and version process data, the purpose of providing a comprehensive and objective production risk assessment is achieved, thereby solving the problem in the related technology that it is difficult to accurately assess the production risk during production when computer software is put into production.
[0043] The target model needs to be trained in advance. Optionally, in the risk warning method provided in the embodiment of the present application, the target model is obtained in the following manner: collecting historical statistical data and historical version process data of different services of different versions of the target application; performing data preprocessing on the historical statistical data and historical version process data; determining the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; using the training data set to train the initial model to obtain the target model.
[0044] Specifically, the historical statistical data of different services of different versions of the target application may include relevant information of the target application at different periods, such as the cumulative number of production problems, the number of lines of code, and the number of servers; the historical version process data of different services of different versions of the target application may include data in the development and testing process of the specific version, such as the number of developers, the number of code submissions, and the number of problems found in the test. In different historical versions, these data will change with the version update, such as increasing the number of developers or the cumulative number of code submissions. The preprocessing operation makes the data more consistent and standardized, which is conducive to the training of the model. The risk label data of each historical service is combined with its associated historical statistical data and historical version process data to determine a complete sample data. The risk label data is used to indicate whether the historical service has had problems in the past production process. The sample data set constitutes a training data set. The initial model is trained using the training data set to obtain a target model that can determine the probability of production problems occurring in the target service of the target version during the production process based on the data of the target service of the target version.
[0045] The embodiment of the present application utilizes a training data set to train an initial model, and ultimately obtains a target model through repeated iterations and parameter optimization, thereby improving the ability to predict production problems.
[0046] In order to accurately assess the probability of production problems occurring in the target service under the target version during the production phase, it is necessary to reasonably determine the data used for risk assessment. Optionally, in the risk warning method provided in the embodiment of the present application, obtaining data associated with the target service under the target version of the target application includes: counting application information of the target application to obtain application statistical data of the target application; counting personnel information, process information, and service information under the target service of the target version, and determining at least one of the personnel information, process information, and service information as version process data of the target application, wherein the personnel information includes personnel information of developers and testers, and the process information includes test discovery problem information and demand information; determining the application statistical data and version process data of the target application as data associated with the target service under the target version of the target application.
[0047] Among them, application statistics are relatively fixed, while version process data will change with each version of the application. Specifically, application statistics include at least application information: whether it is being refactored, whether it is a core application, the number of application services, the cumulative number of production problems that have occurred in the application, the cumulative number of lines of code in the application, the number of application data tables, whether cache is used, whether it is connected to the operation monitoring platform, the application level, and the number of application servers. Version process data includes at least: personnel information: the number of developers, the working years of developers, the number of testers, the working years of testers, the number of backbone personnel, and the ratio of development and testing personnel; process information: the number of problems found in functional testing, the number of problems found in stress testing, the number of problems found in simulation testing, the number of overdue requirements / total number of requirements, the total number of requirements, and the total number of code submissions; service information: whether a new service is added, the number of lines of code modified, the number of service modifications, the cumulative number of production problems that have occurred in the service, whether it is a core service, the number of service callers, the number of service code lines, whether it is an account-related service, the number of service input parameters, and the number of service output parameters.
[0048] The embodiment of the present application obtains application statistical data and version process data by counting data associated with the target service, and these data provide basic data for model training.
[0049] In order to enable the model to process the data associated with the target service, optionally, in the risk warning method provided in the embodiment of the present application, the data associated with the target service is preprocessed to obtain the preprocessed data including: determining discrete features and continuous features in the application statistical data and version process data; performing one-hot encoding on the discrete features to obtain the preprocessed first category data; normalizing the continuous features to compress the values of the continuous features to the range of 0 to 1 to obtain the preprocessed second category data; and determining the first category data and the second category data as the preprocessed data.
[0050] Specifically, discrete features may include "whether the application is being reconstructed" and "application level", which are one-hot encoded. One-hot encoding can convert categorical data into numerical values. In the embodiment of the present application, features such as "whether the application is being reconstructed" will be converted into binary values. For example, the classification of an application can be represented as a vector, and the corresponding classification value is 1 and the rest are 0. Table 1 is an example of one-hot encoding, where application A is a level 4 application and application B is a level 3 application:
[0051] Table 1
[0052]
[0053] Continuous features can include the cumulative number of application codes, which are normalized. Normalization is used to scale continuous features to the interval [0, 1]. For example, after the number of lines of code is normalized, the scale difference in the data can be eliminated, which is convenient for model processing. Table 2 is an example of normalization. Application A and Application B have the most and least lines of code respectively:
[0054] Table 2
[0055] application Lines of code After normalization Application A 2000 0.00 Application B 202000 1.00 Application C 5000 0.025
[0056] The first and second types of data are determined as preprocessed data and input into the neural network as input vectors for processing. Table 3 shows some features of an input use case:
[0057] Table 3
[0058]
[0059] The embodiment of the present application preprocesses the data associated with the target service to obtain preprocessed data, thereby ensuring that the risk warning model can accurately extract effective information from the input data and improve the accuracy of risk prediction.
[0060] In order to construct a hierarchically designed neural network model, optionally, in the risk warning method provided in the embodiment of the present application, the target model is a neural network model, and the neural network model includes an input layer, at least one hidden layer and an output layer, wherein the hidden layer of the neural network model is constructed using an activation function, the number of neurons in the hidden layer is smaller than the number of neurons in the input layer, and the output layer uses a soft attention mechanism to assign different weights to the historical statistical data and historical version process data of the neural network model.
[0061] Figure 3 is a schematic diagram of a target model provided according to an embodiment of the present application, such as Figure 3 As shown: The target model is divided into an input layer, at least one hidden layer and an output layer.
[0062] The function of the input layer is to accept external data and pass the preprocessed features to the model. The input data can include historical statistics of the application and version process data. A single prepared data can be represented as an input vector as X = [x1, x2, x3, x4, x5...], and each input vector is a 1*n-dimensional matrix, where n is the number of feature dimensions.
[0063] The hidden layer is a j*m dimensional matrix, where m is the number of neurons in each layer and j is the number of layers in the network. The role of the hidden layer is to perform deep abstraction and combination of features, and to gradually extract more complex and abstract features from simple features. For production risk prediction, there may be nonlinear relationships between input features. The hidden layer can perform nonlinear transformations on input data through activation functions to capture these complex relationships. The matrix operation formula from the input layer to the hidden layer can be expressed as H=α(WX+B), and the formula from the hidden layer to the output layer can be expressed as Y=α(HW+B). Among them, W is the parameter of the network, which needs to be generated by training; B is the bias value in the linear function, and α is the activation function, which is used to transform the result of the matrix operation from linear to nonlinear, thereby enhancing the network's ability to fit the input features.
[0064] The function of the output layer is to map the abstract features in the hidden layer to specific outputs. For risk prediction, the output layer can output the probability of production problems in the target application during the production process. The soft attention mechanism can assign different weights to different types of data to better reflect the importance of the data in the current scenario. For example, for some versions, historical statistical data is more important, while for other versions, historical version process data has a greater impact on the current risk assessment. The weight matrix is multiplied by the node values layer by layer, propagated to the next layer of network nodes, and finally converged to the output layer to output the probability of production problems.
[0065] It should be noted that the number of neurons in the hidden layer can be set to two-thirds of the dimension of the input layer. The hidden layer uses the Sigmoid function as the activation function. The calculation formula of the Sigmoid function is as follows:
[0066]
[0067] Sx is the output of the Sigmoid function for the input value x, e is a natural constant, approximately 2.718, and x is the input variable, which can be any real number.
[0068] The output layer uses the Softmax function to make the sum of the final output of the model equal to 1, so that the result can be expressed as a probability. The calculation formula of the Softmax function is as follows:
[0069]
[0070] Sj represents the probability of a certain category, and the sum of the probabilities of all categories is equal to 1, and e is a natural constant.
[0071] The embodiment of the present application divides the neural network into an input layer, a hidden layer and an output layer, and utilizes a soft attention mechanism so that the model can gradually extract effective feature information from the original data.
[0072] Optionally, in the risk warning method provided in an embodiment of the present application, the initial model is trained using a training data set to obtain a target model, including: iteratively training the initial model using the training data set, and calculating the cross-entropy loss function of the model after each round of training; when the cross-entropy loss function is greater than a threshold, using the gradient descent method to back-propagate and update the model parameters of the trained model, and training the model again until the cross-entropy loss function of the re-trained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions.
[0073] Specifically, the cross entropy loss function can guide the model to optimize parameters by measuring the difference between the predicted distribution and the true distribution of the model output, thereby improving the classification accuracy. The expression formula of the cross entropy loss function is:
[0074]
[0075] In the binary classification problem, n=2, which means two categories: positive and negative. i Represents the label of the sample, 1 for positive class and 0 for negative class, p i The probability value of the sample output.
[0076] Gradient Descent can improve the performance of the model by iteratively updating the model parameters and minimizing the loss function. Loss function: measures the error between the model's predicted value and the true value. The goal is to find a set of parameters that minimizes the value of the loss function. The gradient is the partial derivative of the loss function with respect to the model parameters, which indicates the direction and rate of change of the loss function at the current parameter point. The gradient descent method repeatedly adjusts the parameters and moves in the direction where the loss function value decreases fastest (i.e., the negative gradient direction) until the optimal solution (or local optimal solution) is found. The closer the value of the cross entropy loss function is to 0, the better the model parameters are and the better the prediction effect is, until the cross entropy loss function converges and the model training ends.
[0077] The process of training the target model and the calculation method used in the embodiments of the present application ensure that the model prediction results are obtained by a high-precision algorithm, thereby improving the accuracy of the model prediction.
[0078] According to another aspect of the embodiment of the present application, a model training method is provided. Figure 4 is a flow chart of a model training method provided according to an embodiment of the present application, such as Figure 4 As shown, the method includes:
[0079] Step S401 : collecting historical statistical data and historical version process data of different services of different versions of a target application.
[0080] Specifically, the target application refers to the specific software that is currently undergoing version iteration, which is the subject of risk assessment in the embodiment of this application; historical statistical data and historical version process data are obtained by statistical means. Historical statistical data may include relevant information of the target application at different times, such as the cumulative number of production problems, number of lines of code, and number of servers; historical version process data may include data from the development and testing process of a specific version, such as the number of developers, number of code submissions, and number of problems found in testing.
[0081] Step S402: pre-process the historical statistical data and the historical version process data.
[0082] Specifically, the preprocessing operation makes the data more consistent and standardized, which is conducive to the training of the neural network. The preprocessing operation may include: determining the discrete features and continuous features in the historical statistical data and the historical version process data; performing one-hot encoding on the discrete features; normalizing the continuous features and compressing the values of the continuous features to the range of 0 to 1; and determining the processed discrete features and continuous features as the preprocessed data.
[0083] Step S403: determine the risk label data of each historical service and the associated historical statistical data and historical version process data as a piece of sample data, and all the sample data constitute a training data set.
[0084] Specifically, historical statistical data may include relevant information of the target application at different times, such as the cumulative number of production problems, number of lines of code, and number of servers; historical version process data may include data during the development and testing of a specific version, such as the number of developers, number of code submissions, and number of problems found in testing. Risk label data is used to indicate whether a historical service has had problems in the past production process. The sample data set constitutes a training data set, which reflects the relationship between different features and production risks.
[0085] Step S404: train the initial model using the training data set to obtain a target model.
[0086] Specifically, the initial model is iteratively trained using the training data set, and the cross entropy loss function of the model after each round of training is calculated; when the cross entropy loss function is greater than a threshold, the model parameters of the trained model are updated by back propagation using the gradient descent method, and the model is trained again until the cross entropy loss function of the retrained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions. Among them, the gradient descent method is used to iteratively update the model parameters and minimize the loss function, thereby improving the performance of the model.
[0087] It should be noted that after randomly shuffling the order of all sample data, 80% can be selected as a training data set to train the neural network, and 20% can be selected as a test data set to verify the model effect.
[0088] The embodiment of the present application collects historical statistical data and historical version process data of different services of different versions of the target application; performs data preprocessing on the historical statistical data and historical version process data; determines the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; uses the training data set to train the initial model to obtain the target model, and uses the target model to predict risks in the software iteration process. The purpose of providing a comprehensive and objective production risk assessment is achieved, thereby solving the problem in the related technology that it is difficult to accurately assess the production risk during the production process when the computer software is put into production.
[0089] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0090] Example 2
[0091] The embodiment of the present application also provides a risk warning device. It should be noted that the risk warning device of the embodiment of the present application can be used to execute the risk warning method provided in the embodiment of the present application. The risk warning device provided in the embodiment of the present application is introduced below.
[0092] According to an embodiment of the present application, a device for implementing the above risk warning method is also provided. Figure 5 is a schematic diagram of a risk warning device provided according to an embodiment of the present application, such as Figure 5 As shown, the device comprises:
[0093] The data acquisition module 501 is used to acquire data associated with a target service under a target version of a target application, wherein the data associated with the target service at least includes application statistical data and version process data.
[0094] The data preprocessing module 502 is used to preprocess the data associated with the target service to obtain preprocessed data.
[0095] The risk prediction module 503 is used to input the preprocessed data into the target model to obtain the probability of production problems occurring in the target service of the target version during the production process, wherein the target model is obtained by training the initial model based on the training data set, and each sample data includes the data associated with the historical service under the historical version of the target application and the risk label data, the data associated with the historical service includes the historical application statistical data and the historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
[0096] In the embodiment of the present application, the data acquisition module 501 acquires the data associated with the target service under the target version of the target application, wherein the data associated with the target service includes at least application statistical data and version process data; the data acquisition module 501 preprocesses the data associated with the target service to obtain the preprocessed data; the risk prediction module 503 inputs the preprocessed data into the target model, and processes to obtain the probability of the target service of the target version having production problems during the production process, wherein the target model is obtained by training the initial model based on the training data set, wherein each sample data includes the historical service-related data under the historical version of the target application and the risk label data, the historical service-related data includes the historical application statistical data and the historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems. By comprehensively analyzing the application historical statistical data and the version process data, the purpose of providing a comprehensive and objective production risk assessment is achieved, thereby solving the problem in the related technology that it is difficult to accurately assess the production risk during the production process when the computer software is put into production.
[0097] Optionally, in the risk warning device provided in the embodiment of the present application, the data acquisition module 501 includes: a collection module, used to collect historical statistical data and historical version process data of different services of different versions of the target application; a preprocessing module, used to perform data preprocessing on the historical statistical data and historical version process data; a sample data determination module, used to determine the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; a training module, used to train the initial model using the training data set to obtain a target model.
[0098] Optionally, in the risk warning device provided in the embodiment of the present application, the data acquisition module 501 includes: an application information statistics module, which is used to count the application information of the target application and obtain application statistics of the target application; a personnel information and process information module, which is used to count the personnel information, process information, and service information under the target service of the target version, and determine at least one of the personnel information, process information, and service information as the version process data of the target application, wherein the personnel information includes the personnel information of developers and testers, and the process information includes test problem discovery information and requirement information; a determination module, which is used to determine the application statistics data and version process data of the target application as data associated with the target service under the target version of the target application.
[0099] Optionally, in the risk warning device provided in the embodiment of the present application, the data preprocessing module 502 includes: a feature determination module, used to determine discrete features and continuous features in application statistical data and version process data; a one-hot encoding module, used to one-hot encode discrete features to obtain preprocessed first-category data; a normalization module, used to normalize continuous features, compress the values of continuous features to the range of 0 to 1, and obtain preprocessed second-category data; the first-category data and the second-category data are determined as preprocessed data.
[0100] Optionally, in the risk warning device provided in the embodiment of the present application, the training module includes: a hidden layer training module, which is used to construct a hidden layer of a neural network model using an activation function, wherein the number of neurons in the hidden layer is smaller than the number of neurons in the input layer, and an output layer that uses a soft attention mechanism to assign different weights to historical statistical data and historical version process data of the neural network model.
[0101] Optionally, in the risk warning device provided in the embodiment of the present application, the risk prediction module 503 includes: a first training submodule, used to iteratively train the initial model using the training data set, and calculate the cross-entropy loss function of the model after each round of training; a gradient descent module, used to use the gradient descent method to back-propagate and update the model parameters of the trained model when the cross-entropy loss function is greater than a threshold, and train the model again until the cross-entropy loss function of the re-trained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions.
[0102] It should be noted that the above data acquisition module 501, data preprocessing module 502 and risk prediction module 503 correspond to steps S201 to S203 in Example 1, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0103] Example 3
[0104] An embodiment of the present application may provide an electronic device, Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6(only one is shown) processor 602, memory 604, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0105] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0106] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain the data associated with the target service under the target version of the target application, wherein the data associated with the target service includes at least application statistical data and version process data; preprocess the data associated with the target service to obtain preprocessed data; input the preprocessed data into the target model, and process the data to obtain the probability of production problems occurring in the target service of the target version during the production process, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data includes historical service-associated data and risk label data under historical versions of the target application, wherein the historical service-associated data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
[0107] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: the target model is obtained in the following manner: collecting historical statistical data and historical version process data of different services of different versions of the target application; performing data preprocessing on the historical statistical data and historical version process data; determining the risk label data and associated historical statistical data and historical version process data of each historical service as a sample data, and all the sample data constitute a training data set; using the training data set to train the initial model to obtain the target model.
[0108] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: obtaining the data associated with the target service under the target version of the target application, including: counting the application information of the target application to obtain application statistics of the target application; counting the personnel information, process information, and service information under the target service of the target version, and determining at least one of the personnel information, process information, and service information as the version process data of the target application, wherein the personnel information includes the personnel information of developers and testers, and the process information includes test problem discovery information and requirement information; determining the application statistics data and version process data of the target application as the data associated with the target service under the target version of the target application.
[0109] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: preprocess the data associated with the target service to obtain the preprocessed data including: determining the discrete features and continuous features in the application statistical data and version process data; performing one-hot encoding on the discrete features to obtain the preprocessed first category data; normalizing the continuous features and compressing the values of the continuous features to the range of 0 to 1 to obtain the preprocessed second category data; determining the first category data and the second category data as the preprocessed data.
[0110] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: the target model is a neural network model, the neural network model includes an input layer, at least one hidden layer and an output layer, wherein the hidden layer of the neural network model is constructed using an activation function, the number of neurons in the hidden layer is less than the number of neurons in the input layer, and the output layer uses a soft attention mechanism to assign different weights to the historical statistical data and historical version process data of the neural network model.
[0111] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: train the initial model using the training data set to obtain the target model, including: iteratively train the initial model using the training data set, and calculate the cross-entropy loss function of the model after each round of training; when the cross-entropy loss function is greater than a threshold, use the gradient descent method to back-propagate and update the model parameters of the trained model, and train the model again until the cross-entropy loss function of the re-trained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions.
[0112] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: collect historical statistical data and historical version process data of different services of different versions of the target application; perform data preprocessing on the historical statistical data and historical version process data; determine the risk label data of each historical service and the associated historical statistical data and historical version process data as a sample data, and all the sample data constitute a training data set; use the training data set to train the initial model to obtain the target model.
[0113] In an embodiment of the present application, data associated with a target service under a target version of a target application is obtained, wherein the data associated with the target service includes at least application statistical data and version process data; the data associated with the target service is preprocessed to obtain preprocessed data; the preprocessed data is input into a target model, and the probability of a target service of the target version having a production problem during production is obtained by processing, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data includes historical service-associated data under a historical version of the target application and risk label data, and the historical service-associated data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems. By comprehensively analyzing the application historical statistical data and version process data, the purpose of providing a comprehensive and objective production risk assessment is achieved, thereby solving the problem in the related technology that it is difficult to accurately assess the production risk during production when computer software is put into production.
[0114] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only, and the electronic device may also be a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), a PAD or other terminal device. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations are shown.
[0115] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0116] Example 4
[0117] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the risk warning method provided in the first embodiment.
[0118] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0119] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of the risk warning method.
[0120] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0121] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0122] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0125] 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. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0126] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A risk early warning method, characterized in that: include: Acquire target service-associated data under a target version of a target application, wherein the target service-associated data at least includes application statistical data and version process data; Preprocessing the data associated with the target service to obtain preprocessed data; The preprocessed data is input into the target model, and the probability of production problems occurring in the target service of the target version during the production process is obtained through processing, wherein the target model is obtained by training an initial model based on a training data set, and each sample data includes data associated with historical services under historical versions of the target application and risk label data, wherein the data associated with historical services includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
2. The risk warning method according to claim 1, characterized in that: The target model is obtained by: Collect historical statistical data and historical version process data of different services of different versions of the target application; Performing data preprocessing on the historical statistical data and the historical version process data; Determine the risk label data of each historical service and the associated historical statistical data and the historical version process data as a piece of sample data, and form a training data set with all the sample data; The initial model is trained using the training data set to obtain the target model.
3. The risk early warning method according to claim 1 is characterized in that: The data associated with the target service under the target version of the target application includes: Collecting application information of the target application to obtain application statistics of the target application; Collecting statistics on personnel information, process information, and service information under the target service of the target version, and determining at least one of the personnel information, the process information, and the service information as version process data of the target application, wherein the personnel information includes personnel information of developers and testers, and the process information includes test discovery problem information and requirement information; The application statistics data and the version process data of the target application are determined as data associated with a target service under a target version of the target application.
4. The risk early warning method according to claim 1 is characterized in that: Preprocessing the data associated with the target service to obtain the preprocessed data includes: Determine discrete features and continuous features in the application statistical data and the version process data; Performing one-hot encoding on the discrete features to obtain the first category of preprocessed data; Normalizing the continuous feature, compressing the value of the continuous feature to a range of 0 to 1, and obtaining the preprocessed second type of data; The first category of data and the second category of data are determined as the preprocessed data.
5. The risk warning method according to claim 2, characterized in that: The target model is a neural network model, which includes an input layer, at least one hidden layer and an output layer, wherein the hidden layer of the neural network model is constructed using an activation function, the number of neurons in the hidden layer is smaller than the number of neurons in the input layer, and the output layer of the neural network model is configured to assign different weights to the historical statistical data and the historical version process data using a soft attention mechanism.
6. The risk early warning method according to claim 1, characterized in that: Using the training data set to train the initial model to obtain the target model includes: Iteratively train the initial model using the training data set, and calculate the cross entropy loss function of the model after each round of training; When the cross entropy loss function is greater than a threshold, the model parameters of the trained model are updated by back propagation using the gradient descent method, and the model is trained again until the cross entropy loss function of the retrained model is less than or equal to the threshold, or until a preset number of iterations is reached, wherein the model parameters include at least one of the following: network parameters, bias values in linear functions.
7. A model training method, characterized in that: include: Collect historical statistics and historical version process data of different services of different versions of the target application; Performing data preprocessing on the historical statistical data and the historical version process data; Determine the risk label data of each historical service and the associated historical statistical data and the historical version process data as a piece of sample data, and form a training data set with all the sample data; The initial model is trained using the training data set to obtain a target model.
8. A risk warning device, characterized in that: include: A data acquisition module, used to acquire data associated with a target service under a target version of a target application, wherein the data associated with the target service at least includes application statistical data and version process data; A data preprocessing module, used to preprocess the data associated with the target service to obtain preprocessed data; A risk prediction module is used to input the preprocessed data into a target model to obtain the probability of production problems occurring in the target service of the target version during production, wherein the target model is obtained by training an initial model based on a training data set, wherein each sample data includes historical service-associated data under a historical version of the target application and risk label data, wherein the historical service-associated data includes historical application statistical data and historical version process data, and the risk label data includes: the service has had production problems, and the service has not had production problems.
9. A computer program product, characterized in that It comprises a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the risk warning method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the risk warning method according to any one of claims 1 to 7 through the computer program.