Workload prediction method, device and electronic equipment

By using the K-means clustering analysis algorithm to divide the case data set into project difficulty groups, and the reference workload set is generated based on the parameters of the project to be predicted, which solves the problem of inaccurate workload prediction in the information technology innovation project, and improves the accuracy of prediction and the rationality of resource allocation.

CN119740851APending Publication Date: 2025-04-01HUAWEI MARINE NETWORKS CO LTD

Patent Information

Application Number
CN202510245997.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Due to the involvement of new industrial technologies, the software development team lacks relevant experience, which leads to lack of clear standards and sufficient historical basis when assigning workload weights to functional points, resulting in inaccurate workload prediction.

Method used

Provide a workload prediction method. By obtaining case data sets, using the K-means clustering analysis algorithm to divide the data set into project difficulty groups of different difficulty levels, and match the groups according to the target project parameters of the project to be predicted, a reference workload set is generated, and the predicted workload of the project to be predicted is finally determined.

Benefits of technology

It improves the accuracy of workload prediction, provides a reference for predicting workload, and helps to reasonably allocate project resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740851A_ABST
    Figure CN119740851A_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and specifically to a workload prediction method, device and electronic device. The method includes: obtaining a case data set, the case data set includes sample project parameters and sample project workload; using the K-means clustering analysis algorithm to divide the case data set into k project difficulty groups, each project difficulty group includes a cluster center; calculating the distance between the target project parameters of the project to be predicted and all cluster centers to obtain the target project difficulty group corresponding to the project to be predicted; generating a reference workload set according to the sample project workload in the target project difficulty group; determining the predicted workload of the project to be predicted according to the reference workload set, and allocating project resources of the project to be predicted based on the predicted workload. The technical solution provided by the present application can use the sample project workload of the case data set as a reference basis to predict the workload of the project to be predicted in multiple dimensions, thereby improving the accuracy of workload prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a workload prediction method, device and electronic equipment. Background Art

[0002] The ICT project is an information technology application innovation project that involves multiple fields such as basic hardware, basic software, application software and information security. Due to the high complexity of the ICT project, it is very important to accurately predict the workload of the project. By accurately predicting the workload of the project, it can help customers analyze the number of personnel and equipment resources required at each stage, help estimate the system's launch time, and evaluate the budget. Most of the current ICT projects rely on the overall experience and capabilities of the software development team to predict the workload. According to the functional requirements of the ICT project, analyze the complexity of each functional point, assign workload weights to the functional points, and then calculate the workload.

[0003] Since the ICT projects involve new industrial technologies, the software development team lacks relevant experience in ICT work. Therefore, there is a lack of clear standards and sufficient historical basis in the process of allocating workload weights to functional points, which leads to inaccurate predicted workload. Summary of the invention

[0004] In order to solve the above problems, the present application provides a workload prediction method, device and electronic device, which can use the sample project workload of the case data set as a reference basis to predict the workload of the project to be predicted in multiple dimensions, thereby improving the accuracy of workload prediction.

[0005] In order to achieve the above-mentioned purpose, in the first aspect, the present application provides a workload prediction method, comprising: obtaining a case data set, the case data set comprising sample project parameters, and sample project workload corresponding to the sample project parameters; using a K-means clustering analysis algorithm to divide the case data set into k project difficulty groups, where k is a positive integer greater than 0; the project difficulty group is used to characterize the difficulty classification of the sample project parameters; each project difficulty group comprises a cluster center; calculating the distance between the target project parameters of the project to be predicted and all cluster centers to obtain the target project difficulty group corresponding to the project to be predicted; generating a reference workload set based on the sample project workload in the target project difficulty group; determining the predicted workload of the project to be predicted based on the reference workload set, and allocating project resources for the project to be predicted based on the predicted workload.

[0006] The workload prediction method provided in the present application can use the sample project parameters and sample project workload of the sample project as the case data set, and use the K-means cluster analysis algorithm to divide the case data set into project difficulty groups of different difficulty levels, and match the groups of the projects to be predicted according to the target project parameters of the projects to be predicted, so as to obtain the difficulty of the projects to be predicted. Then, according to the average of the sample project workload in the project difficulty group where the projects to be predicted are located, the predicted workload of the projects to be predicted is calculated, so as to realize the prediction of the workload. The workload prediction method provided in the present application can improve the accuracy of workload prediction, and provides a reference basis for the calculated predicted workload, which helps to reasonably allocate project resources for the projects to be predicted.

[0007] In an optional implementation, the case data set is divided into k project difficulty groups using the K-means clustering analysis algorithm, including: using a vector space model to generate sample feature vectors corresponding to sample project parameters, the sample project parameters include one or more of hardware architecture information, operating system information, database information, programming language information, middleware information and network information; using the K-means clustering analysis algorithm to mark the k sample feature vectors as cluster centers, and marking the remaining sample feature vectors in the case data set as samples to be grouped; generating k cluster groups with the k cluster centers as the center positions; calculating the distance between each sample to be grouped and the k cluster centers to add the sample to be grouped to the cluster group; marking the cluster centers and samples to be grouped in the same cluster group as the same project difficulty group to obtain k project difficulty groups. In this way, the case data set can be grouped according to the difficulty of the sample projects, providing a basis for the subsequent matching of the groups of the projects to be predicted.

[0008] In an optional implementation, the distance between each sample to be grouped and k cluster centers is calculated to add the sample to be grouped to the cluster grouping, including: for each sample to be grouped, the Euclidean distance between the sample to be grouped and the k cluster centers is calculated respectively, and the first distance set corresponding to each sample to be grouped is obtained, and the first distance set includes k Euclidean distances, and the Euclidean distances are associated with the cluster centers and the sample to be grouped; in the first distance set corresponding to each sample to be grouped, the cluster center corresponding to the smallest Euclidean distance is obtained as the cluster center of the same group corresponding to the sample to be grouped; for each sample to be grouped, the cluster center of the same group corresponding to the sample to be grouped is obtained, and the sample to be grouped is added to the cluster grouping where the cluster center of the same group is located. In this way, the difficulty similarity of the sample items in the same cluster grouping is high, which improves the accuracy of grouping.

[0009] In an optional implementation, after the case data set is divided into k project difficulty groups using the K-means clustering analysis algorithm, it also includes: obtaining a second distance set corresponding to the cluster center of the same group in each project difficulty group, the second distance set includes at least one second distance, and the second distance is the Euclidean distance between the cluster center of the same group and each sample to be grouped; calculating the clustering error according to the second distance set, the clustering error is the sum of the squares of all second distances in the second distance set; when the clustering error is greater than the preset clustering error, updating the cluster center of the same group according to the average value of the sample to be grouped and the cluster center of the same group until the clustering error is less than or equal to the preset clustering error. In this way, by updating the cluster center, the wrong classification is corrected, thereby improving the accuracy of clustering.

[0010] In an optional implementation, the distance between the target project parameter of the project to be predicted and all the cluster centers is calculated to obtain the target project difficulty group corresponding to the project to be predicted, including: obtaining the target project parameter of the project to be predicted, and using the vector space model to generate the target feature vector corresponding to the target project parameter; respectively calculating the Euclidean distance between the target feature vector and k cluster centers to obtain a third distance set, the third distance set includes k Euclidean distances, and the Euclidean distance has an associated relationship with the cluster center and the target feature vector; obtaining the cluster center corresponding to the Euclidean distance with the smallest value in the third distance set as a reference cluster center, and taking the project difficulty group where the reference cluster center is located as the target project difficulty group corresponding to the project to be predicted. In this way, by calculating the Euclidean distance between the target feature vector and all the cluster centers, the project difficulty group with the most similar difficulty to the project to be predicted is matched.

[0011] In an optional embodiment, generating a reference workload set according to the sample project workload in the target project difficulty group includes: obtaining the sample project workload in the target project difficulty group to obtain a workload set; obtaining the sample project workload from the workload set according to a preset quantile to obtain a reference workload set; the reference workload set includes at least one sample project workload; the preset quantile is used to characterize the numerical value of the sample project workload data range in the workload set. In this way, valid data extracted from the sample project workload can be used as a reference workload set, thereby enhancing the reliability of the workload prediction result.

[0012] In an optional implementation, determining the predicted workload of the project to be predicted based on the reference workload set includes: calculating the average workload of the sample projects in the reference workload set to obtain the predicted workload. In this way, the workload of the project to be predicted can be comprehensively predicted based on the average workload of the sample projects, thereby improving the accuracy of workload prediction.

[0013] In an optional implementation, the workload prediction method further includes: determining the maximum predicted workload of the project to be predicted based on the maximum value of the workload of the sample project in the reference workload set, the maximum predicted workload being a reference basis for the maximum value of the predicted workload; determining the minimum predicted workload of the project to be predicted based on the minimum value of the workload of the sample project in the reference workload set, the minimum predicted workload being a reference basis for the minimum value of the predicted workload; determining the prediction score of the predicted workload based on the variance of the workload of the sample project in the reference workload set, the prediction score being used to characterize the evaluation accuracy of the predicted workload. In this way, the maximum value, minimum value and prediction score of the workload of the project to be predicted can be predicted based on the workload of the sample project in the reference workload set, providing a reliable data basis for workload prediction.

[0014] In the second aspect, the present application provides a workload prediction device, including: a data acquisition module, configured to: obtain a case data set, the case data set includes sample project parameters, and the sample project workload corresponding to the sample project parameters. A clustering grouping module, configured to: divide the case data set into k project difficulty groups using the K-means clustering analysis algorithm, k is a positive integer greater than 0; the project difficulty group is used to characterize the difficulty classification of the sample project parameters; each project difficulty group includes a cluster center; and, calculate the distance between the target project parameters of the project to be predicted and all cluster centers to obtain the target project difficulty group corresponding to the project to be predicted. A prediction allocation module, configured to: generate a reference workload set based on the sample project workload in the target project difficulty group; and, determine the predicted workload of the project to be predicted based on the reference workload set, and allocate project resources for the project to be predicted based on the predicted workload.

[0015] In a third aspect, the present application provides an electronic device comprising: one or more processors; a memory configured to: store one or more programs; wherein, when the one or more programs are executed by one or more processors, the one or more processors implement the workload prediction method provided according to the first aspect.

[0016] It can be understood that the workload prediction device and electronic device provided in the second and third aspects are applied to the workload prediction method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the workload prediction method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 A schematic diagram of the steps of a workload prediction method provided in an embodiment of the present application; Figure 2 A schematic diagram of a step for dividing project difficulty groups provided in an embodiment of the present application; Figure 3 A schematic diagram of a step of adding a sample to be grouped into a cluster grouping provided in an embodiment of the present application; Figure 4 A schematic diagram of the steps for updating the cluster center provided in an embodiment of the present application; Figure 5 An example diagram of obtaining a reference workload set provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of a workload prediction device provided in an embodiment of the present application; Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be described clearly below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, other embodiments obtained by ordinary technicians in this field without making creative work all belong to the protection scope of the present application.

[0020] In the following, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0021] In addition, in the present application, directional terms such as "upper", "lower", "inner" and "outer" are defined relative to the orientation of the components schematically placed in the drawings. It should be understood that these directional terms are relative concepts. They are used for relative description and clarification, and they can change accordingly according to the changes in the orientation of the components placed in the drawings.

[0022] To facilitate understanding of the solution, the following explains the relevant terms: Cluster: A collection of similar data objects that have high similarity in certain features or attributes but are significantly different from data objects in other clusters.

[0023] Cluster analysis: Divide the data set into different clusters based on the similarities between data objects, so that the data objects in the same cluster are as similar as possible, while the data objects in different clusters are as different as possible.

[0024] K-means algorithm: is a clustering algorithm that divides a given set of data objects into K different clusters, where K is a predetermined positive integer representing the number of clusters to be divided. The K-means algorithm continuously iterates to minimize the sum of the distances from the data points in each cluster to the center of the cluster.

[0025] When applying the K-means algorithm for cluster analysis, you must first select K initial cluster centers (Centroids). These cluster centers can be randomly selected from the data set or determined based on prior knowledge. Calculate the distance from each data point in the data object set to these K cluster centers, and assign each data point to the cluster corresponding to the cluster center closest to it. After that, recalculate the cluster center of each cluster to update the cluster center. Repeat the steps of assigning data points and updating cluster centers until the preset maximum number of iterations is met or the cluster center no longer changes.

[0026] Cluster center: It is a data point representing the center position of a cluster. The cluster center is determined by calculating the average value of all points in the cluster in each dimension. The stability and rationality of the cluster center can be used as a reference indicator for evaluating the clustering effect. If the cluster center changes frequently and significantly during the clustering process, it indicates that the clustering algorithm has not converged or the data distribution is complex, and the clustering effect is not ideal.

[0027] Elbow rule: It is a method for determining the number of clusters. By observing the curve of clustering error changing with the number of clusters K, the elbow position of the curve is found. The K value corresponding to this position is considered to be the appropriate number of clusters. The number of clusters is the number of clusters obtained after executing the clustering algorithm. The clustering error is the sum of the squares of the distances from the data points in each cluster to the cluster center of the cluster to which it belongs. The elbow position is the turning point where the curve changes from a sharp decline to a gentle decline.

[0028] Workload: It is used to characterize the time spent by the project team throughout the entire life cycle of the project (including requirements analysis, design, coding, testing and maintenance stages). Workload is measured in time units, such as man-hours, man-days, man-months, etc. Man-hours refer to the workload of one person working for one hour; man-days refer to the workload of one person working for one day (generally calculated based on 8 hours of working time); man-months refer to the workload of one person working for one month (generally calculated based on 20 to 22 working days).

[0029] Trusted innovation projects are innovative projects in information technology applications, involving multiple fields such as basic hardware, basic software, application software, and information security. Due to the high complexity of trusted innovation projects, it is very important to accurately predict the workload of the project. By accurately predicting the workload of the project, it can help customers analyze the number of personnel and equipment resources required at each stage, help estimate the time to go online for the system, and evaluate the budget. The current workload forecasts for trusted innovation projects mostly rely on the overall experience and capabilities of the software development team (Independent Software Vendor, ISV). The ISV team analyzes the functional requirements of the trusted innovation project and the complexity of the functional points, assigns certain workload weights to the functional points, and then calculates the workload.

[0030] Since ICT projects involve new industrial technologies, ISV teams usually lack relevant experience in ICT projects. Therefore, in the process of predicting workload, ISV teams lack clear standards and sufficient historical basis, which leads to inaccurate workload prediction. In addition, ICT projects involve many project dimensions, such as system architecture, database, etc. Therefore, relying solely on ISV teams to predict workload will lead to a large difference between the predicted results and the actual results, which will have a negative impact on the implementation of the project.

[0031] In order to improve the accuracy and reliability of workload prediction, an embodiment of the present application provides a workload prediction method, which uses the sample project workload of the case data set as a reference, predicts the workload of the project to be predicted in multiple dimensions, and then allocates project resources for the project to be predicted according to the predicted workload.

[0032] In some embodiments, the workload prediction method can be applied to an electronic device. The electronic device implements workload prediction for a project to be predicted by executing the workload prediction method. Figure 1 , the workload prediction method provided by this application includes: Step S100: Obtain case data set.

[0033] In the embodiment of the present application, the case data set includes sample project parameters and sample project workload corresponding to the sample project parameters.

[0034] In some implementations, the electronic device generates a case data set based on past real sample projects, generates sample project parameters based on multi-dimensional information of the sample projects, and generates sample project workload based on completion time of the sample projects.

[0035] Exemplarily, the sample project parameters may include one or more parameters of the hardware architecture, operating system, database, programming language, middleware, and network involved in the implementation of the sample project.

[0036] The hardware architecture refers to the organizational structure and configuration of the hardware devices that support the running of the sample project. The hardware architecture can be a stand-alone architecture, a client-server architecture, a browser-server architecture, a distributed architecture, etc.

[0037] The operating system is a collection of programs used to represent and manage computer hardware and software resources. It is the basic platform for the sample project to run. The operating system can be Windows, macOS, Linux, etc.

[0038] The database is used to represent a warehouse that organizes, stores and manages data according to a certain data structure, and is used to retrieve, insert, update and delete data used by the sample project during operation. The database can be a relational database, such as MySql, Oracle Database, etc.; it can also be a non-relational database, such as MongoDB, Redis, etc.

[0039] Programming language is used to represent the tool used to write computer programs in the sample project. The programming language can be a high-level programming language, such as Python, Java, C++, etc.; it can also be a scripting programming language, such as JavaScript, PHP, etc.

[0040] Middleware refers to the software layer in the sample project. Middleware provides a common service and programming object for building and integrating software systems. Middleware can be message middleware, such as RabbitMQ, Kafka, etc.; it can also be application server middleware, such as Tomcat, WebLogic, etc.

[0041] The network is used to represent the infrastructure that connects the various components in the sample project (such as servers, clients, databases, etc.) to achieve data transmission and communication. The network can be a local area network, a wide area network, the Internet, etc.

[0042] It should be understood that different sample projects have different sample project parameters, and the corresponding sample project workloads are also different. The sample project parameters and the sample project workload are associated. Generating a case data set based on the sample project parameters and sample project workloads corresponding to past real sample projects can make the case data set more in line with the actual scenario and reflect the real data distribution.

[0043] Step S200: using the K-means clustering analysis algorithm to divide the case data set into k project difficulty groups.

[0044] In an embodiment of the present application, the electronic device uses the K-means clustering analysis algorithm to analyze the project difficulty groups of the case data set. The number of project difficulty groups is k, k is a positive integer greater than 0, each project difficulty group includes at least one sample project parameter, the project difficulty group is used to characterize the difficulty classification of the sample project parameters, and each project difficulty group includes a cluster center.

[0045] Exemplarily, k is 3, and there are three groups of project difficulty, namely, high difficulty group, medium difficulty group and low difficulty group. Among them, the high difficulty group includes: the first sample project data, the fourth sample project data and the fifth sample project data, wherein the first sample project data is the cluster center of the high difficulty group. The medium difficulty group includes: the second sample project data and the third sample project data, wherein the second sample project data is the cluster center of the medium difficulty group. The low difficulty group includes: the seventh sample project data, the eighth sample project data and the ninth sample project data, wherein the seventh sample project data is the cluster center of the low difficulty group.

[0046] like Figure 2 As shown, the step of the electronic device using the K-means clustering analysis algorithm to divide the case data set into k project difficulty groups includes S201 to S204.

[0047] Step S201: Generate a sample feature vector corresponding to the sample item parameter using a vector space model.

[0048] In an embodiment of the present application, sample project parameters are used to describe multi-dimensional information of a sample project, and the sample project parameters include one or more of hardware architecture information, operating system information, database information, programming language information, middleware information, and network information.

[0049] The sample feature vectors corresponding to the sample item parameters are generated by constructing a vector space model, and then the sample item parameters are represented in the form of data points. The vector space model is a data model that converts text into vectors.

[0050] Step S202: Use the K-means clustering analysis algorithm to mark k sample feature vectors as cluster centers, and mark the remaining sample feature vectors in the case data set as samples to be grouped.

[0051] The electronic device uses the K-means clustering analysis algorithm to divide the sample feature vectors into two categories: cluster centers and samples to be grouped. The cluster center is used to characterize the central position of a set of data. According to the similarity between the samples to be grouped and the cluster center, the samples to be grouped are divided into the group where the cluster center is located.

[0052] The methods for marking cluster centers and samples to be grouped can be random initialization method, prior knowledge determination method and hierarchical clustering method. The random initialization method is to randomly specify k sample feature vectors as cluster centers. The prior knowledge determination method is to set cluster centers based on prior knowledge of the data. The hierarchical clustering method obtains a hierarchical clustering tree by running a hierarchical clustering algorithm, and selects k nodes from the hierarchical clustering tree as cluster centers.

[0053] Exemplarily, there are 100 sample feature vectors in the case data set, and the electronic device divides the case data set into three project difficulty groups. Three sample feature vectors are obtained as cluster centers, and the remaining 97 sample feature vectors are marked as samples to be grouped. The samples to be grouped are grouped by calculating the distance between the samples to be grouped and the cluster centers.

[0054] Step S203: generate k cluster groups with k cluster centers as center positions respectively.

[0055] In the embodiment of the present application, each cluster group includes only one cluster center, which is the central position of its corresponding cluster group, and k cluster groups are generated based on k cluster centers.

[0056] Step S204: Calculate the distance between each sample to be grouped and the k cluster centers to add the sample to be grouped into the cluster grouping.

[0057] In the embodiment of the present application, cluster centers and samples to be grouped form cluster groups, and the samples to be grouped in the same cluster group have similar difficulty levels to the corresponding cluster centers, but have greater differences in difficulty levels with the cluster centers in other cluster groups. By calculating the distance between each sample to be grouped and k cluster centers, the samples to be grouped are matched to their corresponding cluster groups.

[0058] like Figure 3 As shown, the process in which the electronic device adds the samples to be grouped into the cluster grouping includes steps S2041 to S2043.

[0059] Step S2041: For each sample to be grouped, respectively calculate the Euclidean distance between the sample to be grouped and the k cluster centers to obtain a first distance set corresponding to each sample to be grouped.

[0060] In the implementation of this application, the similarity between the samples to be grouped and the cluster center is determined by calculating the Euclidean distance between the samples to be grouped and the cluster center. The Euclidean distance is used to represent the straight-line distance between two data points. For example, for the samples to be grouped and cluster centers , the Euclidean distance between them The calculation formula is as follows: ; in, Indicates the first Sample project parameters, The cluster center sample project parameters, and n represents the number of sample project parameters.

[0061] By calculating the Euclidean distance between the sample to be grouped and the k cluster centers, a first distance set corresponding to each sample to be grouped is obtained, wherein the first distance set includes k Euclidean distances, and the Euclidean distance is associated with the cluster center and the sample to be grouped.

[0062] Exemplarily, the number of cluster centers is 3, namely the first vector, the second vector and the third vector. The fourth vector represents the sample to be grouped, the Euclidean distance between the fourth vector and the first vector is the first Euclidean distance, the Euclidean distance between the fourth vector and the second vector is the second Euclidean distance, and the Euclidean distance between the fourth vector and the third vector is the third Euclidean distance. The first Euclidean distance, the second Euclidean distance and the third Euclidean distance together constitute a first distance set.

[0063] Step S2042: In the first distance set corresponding to each sample to be grouped, the cluster center corresponding to the smallest Euclidean distance is obtained as the cluster center of the same group corresponding to the sample to be grouped.

[0064] In the embodiment of the present application, the Euclidean distance in the first distance set can be used to characterize the similarity between the sample to be grouped and the cluster center. The smaller the Euclidean distance between the sample to be grouped and the cluster center, the more similar the sample to be grouped and the cluster center are. The cluster center corresponding to the Euclidean distance with the smallest value in the first distance set is obtained as the cluster center of the same group corresponding to the sample to be grouped. The cluster center of the same group is the cluster center that is most similar to the sample to be grouped.

[0065] Step S2043: for each sample to be grouped, obtain the cluster center of the same group corresponding to the sample to be grouped, and add the sample to be grouped to the cluster group where the cluster center of the same group is located.

[0066] In an embodiment of the present application, a first distance set corresponding to each sample to be grouped is calculated, and the Euclidean distance with the smallest value is selected from the first distance set. According to the correlation between the Euclidean distance and the cluster center and the sample to be grouped, the cluster center of the same group corresponding to each sample to be grouped is determined, and then the sample to be grouped and the cluster center of the same group corresponding to the sample to be grouped are divided into the same cluster group.

[0067] Exemplarily, the first distance set corresponding to the samples to be grouped is [2, 1, 0.5], the cluster center corresponding to the distance of 0.5 is obtained as the cluster center of the same group, and the cluster group where the cluster center of the same group is located is the first cluster group, then the samples to be grouped are added to the first cluster group.

[0068] Step S205: Mark the cluster center and the samples to be grouped in the same cluster grouping as the same project difficulty group to obtain k project difficulty groups.

[0069] In the embodiment of the present application, the cluster center in the same cluster grouping and the project difficulty of the samples to be grouped are similar, so the cluster center in the same cluster grouping and the samples to be grouped are marked as the same project difficulty group. Since one cluster center corresponds to one cluster grouping, and one cluster grouping corresponds to one project difficulty grouping, k cluster centers correspond to k project difficulty groups.

[0070] In some embodiments, after the electronic device divides the case data set into k project difficulty groups using the K-means clustering analysis algorithm, it is also necessary to update the cluster center to improve the accuracy of the project difficulty group division. Figure 4 As shown, the step of updating the cluster center includes S2031 to S2033.

[0071] Step S2031: Obtain a second distance set corresponding to the cluster centers of the same group in each cluster grouping.

[0072] The second distance set includes at least one second distance, and the second distance is the Euclidean distance between the cluster center of the same group and each sample to be grouped. That is to say, in each project difficulty group, the Euclidean distance between the cluster center of the same group and each sample to be grouped is obtained, and then the second distance set corresponding to each cluster center of the same group is obtained.

[0073] Step S2032: Calculate clustering error according to the second distance set.

[0074] In an embodiment of the present application, the clustering error (Sum of Squared Error Within Clusters, SSE) is the sum of the squares of all second distances in the second distance set. The clustering error is used to characterize the degree of compactness within the project difficulty group, and the clustering error can reflect the quality of grouping. For example, a smaller clustering error indicates that within the cluster grouping, the samples to be grouped are tightly clustered around the cluster center of the same group, thereby indicating that the quality of grouping after clustering is high. On the contrary, a larger clustering error indicates that the positions of the samples to be grouped are more dispersed from the positions of the cluster centers of the same group, thereby indicating that the quality of grouping after clustering is low and the clustering effect is not ideal.

[0075] The clustering error is calculated as follows: ; Where k represents the number of difficulty groups of the project, Indicates Difficulty level of each project, Represents the feature vector of the samples to be grouped, Indicates The cluster centers in the difficulty groups of the items, Indicates the second distance.

[0076] Step S2033: When the clustering error is greater than the preset clustering error, the cluster centers of the same group are updated according to the average value of the samples to be grouped and the cluster centers of the same group until the clustering error is less than or equal to the preset clustering error.

[0077] It should be understood that the K-means algorithm is an iterative process, and the electronic device implements iteration by updating the cluster centers of the same group, thereby making the clustering error less than or equal to the preset clustering error, so that the clustering result reaches a convergent stable state. During the iterative process, the sample project data in the case data set will be re-divided according to the updated cluster centers of the same group, and then the cluster centers of the same group will continue to be updated according to the results of the new division until the clustering error continues to decrease and is less than or equal to the preset clustering error. In this way, a stable clustering result can be obtained, that is, k project difficulty groups are obtained.

[0078] In some embodiments, the electronic device uses the elbow rule to modify the value of k, thereby adjusting the number of project difficulty groups to more accurately divide the case data set. The elbow rule is a method for determining the number of clusters. The electronic device plots a curve of clustering error versus the number of clusters, finds the "elbow" position of the curve, and determines that the number of clusters corresponding to the "elbow" position is the number of project difficulty groups, that is, determines the k value.

[0079] Exemplarily, first set the range of the number of project difficulty groups, that is, the value of k. The k value can be from 1 to 10, that is, the k value starts from 1 and gradually increases to 10. For each k value, the case data set is grouped based on the K-means algorithm, and the clustering error corresponding to the k value is calculated. Then calculate the clustering error corresponding to each k value, and draw a curve with the k value as the horizontal axis and the clustering error as the vertical axis. At the beginning of the curve, the rate of decrease of the clustering error is relatively large, and as the k value increases, the rate of decrease of the clustering error decreases. Get the "elbow" position in the curve. The "elbow" position is the turning point where the downward trend of the curve changes from a sharp decline to a gentle decline. The k value corresponding to this turning point is the number of project difficulty groups. Then get the best grouping method.

[0080] In some embodiments, the electronic device may also modify the value of k by calculating a gap statistic, thereby adjusting the number of project difficulty groups to more accurately divide the case data set. The gap statistic is a statistic used to evaluate whether clustering is appropriate. The gap statistic can avoid selecting an inappropriate k value, thereby avoiding overfitting (k value is too large, resulting in too many project difficulty groups and each group is not representative) and underfitting (k value is too small and the data is not fully clustered).

[0081] Step S300: Calculate the distance between the target project parameter of the project to be predicted and all cluster centers to obtain the target project difficulty group corresponding to the project to be predicted.

[0082] In an embodiment of the present application, the electronic device obtains target project parameters of the project to be predicted, and generates a target feature vector corresponding to the target project parameters using a vector space model. The target project parameters of the project to be predicted may include one or more of hardware architecture information, operating system information, database information, programming language information, middleware information, and network information.

[0083] Further, the Euclidean distances between the target feature vector and the k cluster centers are calculated respectively to obtain a third distance set. The calculation method of the third distance set is the same as the calculation method of the first distance set, which is not repeated here. Among them, the third distance set includes k Euclidean distances, and the Euclidean distances are associated with the cluster centers and the target feature vector.

[0084] Furthermore, the cluster center corresponding to the smallest Euclidean distance in the third distance set is obtained as a reference cluster center, and the project difficulty group where the reference cluster center is located is used as the target project difficulty group corresponding to the project to be predicted.

[0085] In this way, the electronic device obtains a third distance set based on the Euclidean distance between the target feature vector and all cluster centers. The third distance set can be used to characterize the similarity between the item to be predicted and the cluster center. The item difficulty group corresponding to the item to be predicted is determined based on the third distance set, which can improve the accuracy of the difficulty division of the item to be predicted.

[0086] Step S400: Generate a reference workload set according to the workload of sample projects in the target project difficulty group.

[0087] In the embodiment of the present application, the electronic device obtains the sample project workload in the target project difficulty group to obtain a workload set. However, since there may be abnormal data in the workload set that is significantly deviated from other data, it is necessary to screen the sample project workload in the workload set to reduce the situation where the prediction accuracy is low due to data anomalies.

[0088] The electronic device obtains sample project workload from the workload set according to a preset quantile to obtain a reference workload set. The electronic device calculates the predicted workload of the project to be predicted based on the sample project workload in the reference workload set. The reference workload set includes at least one sample project workload; the preset quantile is used to characterize the value of the sample project workload data range in the workload set.

[0089] For example, the preset quantile is 95%, such as Figure 5 As shown, the sample project workloads in the workload set are arranged in order from small to large values, and the sample project workloads ranked in the top 95% are taken as the first set, and the sample project workloads ranked in the bottom 95% are taken as the second set. Among them, the first set includes the first sample project workload, the second sample project workload, the third sample project workload, the fourth sample project workload, and the nth sample project workload, etc. The second set includes the third sample project workload, the fourth sample project workload, the nth sample project workload, the n+1th sample project workload, and the mth sample project workload, etc. Among them, n and m are positive integers, which are used to characterize the sequence numbers of the sample project workloads. Obtain the sample project workloads that overlap the first set with the second set to generate a reference workload set, and the reference workload set includes the third sample project workload, the fourth sample project workload, and the nth sample project workload.

[0090] Step S500: determining the predicted workload of the project to be predicted according to the reference workload set, and allocating project resources of the project to be predicted based on the predicted workload.

[0091] In the embodiment of the present application, the electronic device calculates the average value of the workload of the sample projects in the reference workload set to obtain the predicted workload. Since the difficulty difference between projects in the same project difficulty group is small, the predicted workload of the project to be predicted is calculated based on the average value of the workload of the sample projects in the reference workload set, and the predicted workload of the project to be predicted can be evaluated based on actual cases as a reference, thereby improving the accuracy of the workload evaluation.

[0092] In an embodiment of the present application, the electronic device determines the maximum predicted workload of the project to be predicted based on the maximum value of the sample project workload in the reference workload set. And determines the minimum predicted workload of the project to be predicted based on the minimum value of the sample project workload in the reference workload set. Among them, the maximum predicted workload is the reference basis for the maximum value of the predicted workload, and the minimum predicted workload is the reference basis for the minimum value of the predicted workload. In this way, by calculating the maximum predicted workload and the minimum predicted workload, the span of the predicted workload of the project to be predicted can be reflected.

[0093] The electronic device also determines the prediction score of the predicted workload based on the variance of the workload of the sample items in the reference workload set, and the prediction score is used to characterize the evaluation accuracy of the predicted workload. In this way, the electronic device provides more basis for workload prediction by calculating the maximum predicted workload, the minimum predicted workload and the prediction score of the project to be predicted.

[0094] In an embodiment of the present application, the electronic device allocates project resources for the project to be predicted based on the predicted workload. Project resources may include: human resources, material resources, and financial resources. For example, for difficult projects, more time and financial budgets may be allocated. The present application allocates project resources based on the predicted workload to reduce idleness and waste of resources, thereby better planning project progress, controlling project costs, and improving project quality.

[0095] In the embodiment of the present application, the electronic device continuously updates the case data set by adding new sample project parameters and the sample project workload corresponding to the new sample project parameters to the case data set, thereby enriching the case data set and improving the reliability of workload prediction. For example, the newly added sample project parameters and the corresponding sample project workload can be the real project parameters and the real workload after the implementation of the project to be predicted is completed.

[0096] It can be seen from the above technical solution that the present application provides a workload assessment method, which can use the sample project parameters and sample project workload of the sample project as a case data set, and use the K-means clustering analysis algorithm to divide the case data set into project difficulty groups of different difficulty levels, and match the groups of the projects to be predicted according to the target project parameters of the projects to be predicted, thereby obtaining the difficulty of the projects to be predicted. Then, according to the workload of the sample projects in the project difficulty group where the projects to be predicted are located, the predicted workload of the projects to be predicted is calculated, thereby realizing the prediction of the workload. The workload prediction method provided in the present application can improve the accuracy of workload prediction, and provides a reference basis for the calculated predicted workload, thereby facilitating the reasonable allocation of project resources for the projects to be predicted.

[0097] Based on the workload prediction method provided in the above embodiment, some embodiments of the present application also provide a workload prediction device, see Figure 6 The workload prediction device includes: a data acquisition module 601, a clustering grouping module 602 and a prediction allocation module 603.

[0098] The data acquisition module 601 is configured to: acquire a case data set, where the case data set includes sample project parameters and sample project workload corresponding to the sample project parameters.

[0099] The clustering grouping module 602 is configured to: divide the case data set into k project difficulty groups using the K-means clustering analysis algorithm, where k is a positive integer greater than 0; the project difficulty groups are used to characterize the difficulty classification of sample project parameters; each project difficulty group includes a cluster center; and, calculate the distance between the target project parameters of the project to be predicted and all cluster centers to obtain the target project difficulty group corresponding to the project to be predicted.

[0100] The prediction allocation module 603 is configured to: generate a reference workload set according to the workload of sample projects in the target project difficulty group; and determine the predicted workload of the project to be predicted according to the reference workload set, and allocate project resources of the project to be predicted based on the predicted workload.

[0101] Some embodiments of the present application also provide an electronic device, comprising: one or more processors; and a memory configured to: store one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement a workload prediction method.

[0102] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device includes a processor 701, at least one communication bus 702, a user interface 703, at least one external communication interface 704 and a memory 705. Among them, the communication bus 702 is configured to realize the connection and communication between these components. The user interface 703 may include a display screen, and the external communication interface 704 may include a standard wired interface and a wireless interface. A computer program is stored in the memory 705. The processor 701 is used to execute the computer program stored in the memory 705.

[0103] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.

Claims

1. A workload prediction method, characterized in that: include: Acquire a case data set, the case data set including sample project parameters and sample project workload corresponding to the sample project parameters; The case data set is divided into k project difficulty groups using a K-means clustering analysis algorithm, where k is a positive integer greater than 0; the project difficulty groups are used to characterize the difficulty classification of the sample project parameters; each of the project difficulty groups includes a cluster center; Calculating the distance between the target project parameter of the project to be predicted and all the cluster centers to obtain the target project difficulty group corresponding to the project to be predicted; Generate a reference workload set according to the workload of the sample projects in the difficulty group of the target project; The predicted workload of the project to be predicted is determined according to the reference workload set, and project resources of the project to be predicted are allocated based on the predicted workload.

2. The workload prediction method according to claim 1, characterized in that: The case data set is divided into k project difficulty groups using the K-means clustering analysis algorithm, including: Generate a sample feature vector corresponding to the sample project parameter using a vector space model, wherein the sample project parameter includes one or more of hardware architecture information, operating system information, database information, programming language information, middleware information, and network information; Using the K-means clustering analysis algorithm, k sample feature vectors are marked as cluster centers, and the remaining sample feature vectors in the case data set are marked as samples to be grouped; Generating k cluster groups with the k cluster centers as center positions respectively; Calculating the distance between each of the samples to be grouped and the k cluster centers to add the samples to be grouped into the cluster grouping; The cluster center and the samples to be grouped in the same cluster grouping are marked as the same item difficulty group to obtain k item difficulty groups.

3. The workload prediction method according to claim 2, characterized in that: The calculating the distance between each of the samples to be grouped and the k cluster centers to add the samples to be grouped into the cluster grouping includes: For each of the samples to be grouped, respectively calculate the Euclidean distance between the sample to be grouped and the k cluster centers to obtain a first distance set corresponding to each of the samples to be grouped, wherein the first distance set includes k Euclidean distances, and the Euclidean distances are associated with the cluster centers and the samples to be grouped; In the first distance set corresponding to each of the samples to be grouped, the cluster center corresponding to the Euclidean distance with the smallest value is obtained as the cluster center of the same group corresponding to the samples to be grouped; For each of the samples to be grouped, the cluster center of the same group corresponding to the sample to be grouped is obtained, and the sample to be grouped is added to the cluster group where the cluster center of the same group is located.

4. The workload prediction method according to claim 3, characterized in that: After the case data set is divided into k project difficulty groups using the K-means clustering analysis algorithm, the method further includes: Obtaining a second distance set corresponding to the cluster centers of the same group in each of the difficulty groups of the project, wherein the second distance set includes at least one second distance, and the second distance is the Euclidean distance between the cluster center of the same group and each of the samples to be grouped; Calculating a clustering error according to the second distance set, where the clustering error is the sum of squares of all the second distances in the second distance set; When the clustering error is greater than a preset clustering error, the clustering centers of the same group are updated according to an average value of the samples to be grouped and the clustering centers of the same group until the clustering error is less than or equal to the preset clustering error.

5. The workload prediction method according to claim 2, characterized in that: The calculating the distance between the target project parameter of the project to be predicted and all the cluster centers to obtain the target project difficulty group corresponding to the project to be predicted includes: Acquire target project parameters of the project to be predicted, and generate target feature vectors corresponding to the target project parameters using the vector space model; Calculating the Euclidean distances between the target feature vector and the k cluster centers respectively to obtain a third distance set, wherein the third distance set includes the k Euclidean distances, and the Euclidean distances are associated with the cluster centers and the target feature vector; The cluster center corresponding to the Euclidean distance with the smallest value in the third distance set is obtained as a reference cluster center, and the project difficulty group where the reference cluster center is located is used as the target project difficulty group corresponding to the project to be predicted.

6. The workload prediction method according to claim 5, characterized in that: The step of generating a reference workload set according to the workload of the sample projects in the target project difficulty group includes: Obtaining the workload of the sample projects in the difficulty group of the target project to obtain a workload set; According to a preset quantile, the sample project workload is obtained from the workload set to obtain the reference workload set; the reference workload set includes at least one sample project workload; the preset quantile is used to characterize the numerical value that divides the sample project workload data range in the workload set.

7. The workload prediction method according to claim 6, characterized in that: The step of determining the predicted workload of the project to be predicted according to the reference workload set includes: The average value of the sample project workload in the reference workload set is calculated to obtain the predicted workload.

8. The workload prediction method according to claim 7, characterized in that: Also includes: Determine the maximum predicted workload of the project to be predicted according to the maximum value of the workload of the sample project in the reference workload set, wherein the maximum predicted workload is a reference basis for the maximum value of the predicted workload; Determine the minimum predicted workload of the project to be predicted according to the minimum value of the workload of the sample project in the reference workload set, wherein the minimum predicted workload is a reference basis for the minimum value of the predicted workload; A prediction score of the predicted workload is determined according to the variance of the sample project workload in the reference workload set, and the prediction score is used to characterize the evaluation accuracy of the predicted workload.

9. A workload prediction device, characterized in that: include: The data acquisition module is configured to: acquire a case data set, wherein the case data set includes sample project parameters and sample project workload corresponding to the sample project parameters; The clustering grouping module is configured to: divide the case data set into k project difficulty groups using a K-means clustering analysis algorithm, where k is a positive integer greater than 0; the project difficulty groups are used to characterize the difficulty classification of the sample project parameters; each of the project difficulty groups includes a cluster center; And, calculating the distance between the target project parameter of the project to be predicted and all the cluster centers to obtain the target project difficulty group corresponding to the project to be predicted; The prediction allocation module is configured to: generate a reference workload set based on the workload of the sample projects in the target project difficulty group; and determine the predicted workload of the project to be predicted based on the reference workload set, and allocate project resources of the project to be predicted based on the predicted workload.

10. An electronic device, characterized in that: include: one or more processors; A memory configured to: store one or more programs; Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the workload prediction method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Demand prediction system of construction materials of power distribution network

    CN106203701A

  • Project development workload estimation method based on dual-objective feature selection and optimization

    CN108090699A

  • Prediction method, prediction device, server and storage medium

    CN112825158A

  • Method and device for predicting concrete consumption of main control building of transformer substation

    CN114971092A

  • Power distribution network data preprocessing method and system based on particle swarm clustering algorithm

    CN117312894A

Cited By

  • Clinical test quality control method and system

    CN120032844A

  • Software workload assessment method, electronic equipment, device, medium and program product

    CN120315682A

  • Workload assessment method and device and electronic equipment

    CN121119834A