Automatic updating method and device of software function package, equipment and storage medium
By comprehensively evaluating the dependency and update importance of software function packages, calculating the update priority score, and automatically updating using priority queues and dynamic planning, the problem of insufficient update management efficiency and reliability in the existing technology is solved, and the problem of insufficient update management is realized. Automatic update of efficient and reliable software function packages.
Patent Information
- Application Number
- CN202411739251.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing technology lacks comprehensive evaluation and dynamic adjustment of update strategies in the update management of software function packages, resulting in insufficient update efficiency and reliability.
By scanning the software warehouse to obtain the function package dependency table and update description, calculate dependency, impact range, functionality, and security metrics, calculate update priority scores based on these metrics, and automatically update in combination with priority queues and dynamic programming.
The optimization of the automatic update process of the software function package is achieved, which significantly improves the efficiency and reliability of updates, and can dynamically adjust the update plan to adapt to system status and update importance.
Smart Images

Figure CN119396440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software updating, and in particular to a method, device, equipment and storage medium for automatically updating a software function package. Background Art
[0002] As software systems become increasingly complex and modular, the update management of software feature packages has become an important challenge. A software feature package usually refers to a collection of software components or modules that can be deployed and updated independently. In modern software development and maintenance, timely and secure updates of these feature packages are essential to maintaining system stability. Especially in the context of the rapid development of Industry 4.0 and the Internet of Things, software systems are often composed of multiple interdependent components that may come from different development teams or third-party suppliers. At the same time, in order to quickly respond to market demand and deal with security threats, software release cycles are constantly shortening and update frequency is constantly increasing. These trends make the automatic update of software feature packages a key issue that needs to be addressed.
[0003] At present, there are some technical solutions in the industry that are used to update software feature packages. For example, the package manager provides automatic dependency resolution and update functions, which can automatically handle the dependencies between software packages. Containerization technology simplifies the software packaging and deployment process, making update operations more standardized and controllable. Configuration management tools provide automated software configuration and deployment capabilities, which can perform update operations on multiple systems simultaneously. In addition, some continuous integration / continuous deployment platforms integrate automated testing and deployment functions, which can automatically perform tests during the update process to reduce the risk of introducing bugs during updates.
[0004] However, these existing technologies still have limitations. Most of them only focus on the execution process of the update, lack a comprehensive evaluation of the update, and adopt a fixed update strategy, which cannot dynamically adjust the update plan according to the system status and update importance.
[0005] To this end, a method, device, equipment and storage medium for automatically updating a software function package are proposed. Summary of the invention
[0006] The purpose of the present invention is to provide a method, device, equipment and storage medium for automatically updating software function packages. First, the dependency table of installed function packages and the update instructions of the software function packages to be updated are obtained by scanning the software warehouse, and the dependency table of installed function packages and the update instructions are analyzed to obtain the latest function package dependency table; then, the dependency index is calculated according to the latest function package dependency table, and the function package dependency graph is constructed, the impact range index is calculated, and the functional index and security index are calculated according to the update instructions, and the update priority score is calculated based on all the indicators; finally, the optimal update time window is determined through the historical load data of the software system, and in the optimal update time window, automatic updating is performed according to the update priority score combined with priority queues and dynamic programming; the present invention realizes the optimization of the automatic update process of software function packages by comprehensively evaluating the impact of updates, which can significantly improve the efficiency and reliability of updates.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] The automatic update method of the software function package includes:
[0009] Setting an update cycle, scanning the software warehouse at the beginning of each update cycle to obtain a dependency table of installed function packages and a list to be updated;
[0010] Extracting update instructions of the software function packages to be updated according to the to-be-updated list;
[0011] Analyze the update description to extract dependency change information, new function information, and bug fix information;
[0012] The installed function package dependency table is updated according to the dependency change information to obtain the latest function package dependency table and calculate the dependency index of the software function package to be updated;
[0013] Construct a function package dependency graph according to the latest function package dependency table, and calculate the impact range index of the software function package to be updated;
[0014] Calculate the functional index and security index of the software function package to be updated according to the new function information and defect repair information;
[0015] Calculating an update priority score of the software function package to be updated according to the dependency index, the impact scope index, the functionality index and the security index;
[0016] Determine the optimal update time window based on the historical load data of the software system;
[0017] In the optimal update time window, construct an update priority queue according to the update priority score for automatic update;
[0018] Record the update log and the running status of the updated software system, and adjust subsequent automatic updates.
[0019] Preferably, constructing the function package dependency graph specifically includes: representing each software function package as a node in the graph, obtaining a graph node set V = {v1, v2, ..., v n},v n represents the nth node in the graph node set; when the i-th software function package directly depends on the j-th software function package, it is represented as node v i Points to node v j A directed edge; the direct dependency relationship between each two different software function packages is represented as a directed edge, and the graph edge set is obtained Represents the mth edge in the graph edge set; creates a directed graph based on the graph node set and the graph edge set to obtain the function package dependency graph G(V,E).
[0020] Preferably, the specific steps of calculating the impact scope index of the software function package to be updated include:
[0021] Define the influence function between two nodes in the dependency graph and calculate the influence probability; the influence function is as follows:
[0022]
[0023] Among them, P(v j ,v i ) represents node v j For node v i The probability of influence; E(v i ,v j ) represents the node v in the dependency graph i To node v j The path edge set corresponding to a path of i To node v j When unreachable represents the empty set; Indicates the path edge set pointing to node v q The directed edge of q ) represents node v q The average historical update frequency of
[0024] Extract the key path between two nodes; the key path is node v i To node v j Among all the paths in , the one with the largest number of edges;
[0025] According to the impact function and the key path, the impact range index of each function package to be updated is calculated:
[0026]
[0027] Wherein, W(u) represents the impact range indicator of node u; u represents the node corresponding to the software function package to be updated; represents the impact probability corresponding to the critical path from node a to node u; A represents the set of nodes reachable by node u,
[0028] Preferably, the dependency index, the functionality index and the security index of the software function package to be updated are calculated as follows:
[0029] The dependency index D=N d / N total ; Among them, N d Indicates the number of software function packages that directly depend on the software function package to be updated; N total Indicates the total number of software function packages in the software system;
[0030] The functional index F=(N f +N b ) / N max ; Among them, N f Indicates the number of new functions in the software function package to be updated; N b Indicates the number of defects fixed in the software function package to be updated; N max Indicates a predefined maximum reference value;
[0031] The security index S=CVSS_Score / 10; wherein CVSS_Score represents the severity level of the security vulnerability in the repair defect of the software function package to be updated.
[0032] Preferably, the specific steps of determining the optimal update time window according to the historical load data of the software system include:
[0033] Collect and pre-process the software system historical load data of N update cycles before the current update cycle to obtain N historical load time series data;
[0034] Constructing a comprehensive load index based on the historical load time series data and setting a comprehensive load index threshold;
[0035] Divide each of the historical load time series data into m time windows, and calculate the comprehensive load index of each time window;
[0036] Identify the time window where the comprehensive load index is lower than the comprehensive load index threshold, traverse N historical load time series data, retain the time window with an occurrence frequency greater than h, and obtain a low utilization time window set; h represents the occurrence frequency threshold;
[0037] Merging consecutive time windows in the low-usage time window set to obtain M candidate optimal update time windows;
[0038] Constructing a load data prediction model and training it using the historical load time series data;
[0039] Generate predicted load time series data of the current update period by using the trained load data prediction model;
[0040] According to the predicted load time series data, the comprehensive load index of each candidate optimal update time window is calculated, and the candidate optimal update time window with the lowest comprehensive load index is selected as the optimal update time window of the current update cycle.
[0041] Preferably, the specific steps of constructing the update priority queue for automatic updating according to the update priority score include:
[0042] S1. Calculate the update priority scores of all current software function packages to be updated, and create the update priority queue Q of the software function packages to be updated in descending order;
[0043] The update priority score calculation formula is as follows:
[0044] PS(k)=w1*I1(k)+w2*I2(k)+w3*I3(k)+w4*I4(k);
[0045] Wherein, I1(k), I2(k), I3(k) and I4(k) respectively represent the normalized values of the dependency index, the impact range index, the functional index and the security index of the kth software function package to be updated; w1, w2, w3 and w4 represent the weights of each index;
[0046] S2. Collect the current system resource status, determine the total available resources R, and estimate the required resources r(k) for each software function package to be updated;
[0047] S3. Construct constraints based on the total available resources and the required resources, apply a dynamic programming algorithm to maximize the objective function under the constraints, and divide the update priority queue into a selected priority queue and an unselected priority queue; the constraints are ∑ k∈Q (r(k)*x(k))≤R; the objective function is ∑ k∈Q(PS(k)*x(k)); wherein x(k) represents an indicator function, and the values of x(k) are 1 and 0, indicating the selection and non-selection of the kth software function package to be updated; the selected priority queue is composed of the software function packages to be updated whose values of x(k) are 1; the unselected priority queue is composed of the software function packages to be updated whose values of x(k) are 0;
[0048] S4. Update the function packages to be updated in the selected priority queue in order;
[0049] S5. When the optimal update time window has not ended and the unselected priority queue is not empty, replace the priority queue with the unselected priority queue and return to step S2; when the optimal update time window has ended and the unselected priority queue is not empty, the unupdated software function package to be updated is automatically updated in the optimal update time window of the next update cycle.
[0050] Preferably, the weight of each indicator in the update priority score is an adaptively adjusted weight, and the adjustment steps are as follows:
[0051] Assigning initial weight values to the dependency index, the impact range index, the functionality index, and the security index;
[0052] After each update cycle, calculate the update effect score; the update effect score is calculated based on the update log and the running status of the software system after the update;
[0053] After each of the C update cycles, the difference between the current update effect score and the historical update effect score is calculated to obtain the update effect score difference; the historical update effect score is the average update effect score of all the completed update cycles;
[0054] According to the difference in the update effect scores, the weight of each indicator is adjusted;
[0055] The adjusted weight is applied to the calculation of the update priority score in subsequent update cycles.
[0056] Automatic updater for software packages, including:
[0057] The information collection module scans the software warehouse to obtain the dependency list of installed function packages and the list to be updated, extracts the update instructions of the software function packages to be updated according to the list to be updated, and analyzes the update instructions to extract dependency change information, new function information and defect repair information;
[0058] A dependency analysis module, which obtains the latest function package dependency list and calculates the dependency index according to the dependency change information and the installed function package dependency list; constructs a function package dependency graph according to the latest function package dependency list, and calculates the impact range index of the function package to be updated;
[0059] A function analysis module, which calculates functional indicators according to the newly added function information and the defect repair information;
[0060] A security analysis module, which calculates security indicators based on the defect repair information;
[0061] An update planning module, comprising an update time planning unit and an update priority planning unit; the update time planning unit determines an optimal update time window according to historical load data of the software system; the update priority planning unit calculates an update priority score according to the dependency index, the impact range index, the functional index and the security index, and constructs an update priority queue according to the update priority score;
[0062] The update execution module automatically updates based on the update priority queue by applying dynamic programming in the optimal update time window.
[0063] A computer device comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the program is executed on the processor, the steps in the automatic update method of the software function package are implemented.
[0064] A storage medium stores computer program instructions, and when the computer program is executed by a processor, the steps in the automatic updating method of the software function package are implemented.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] 1. Evaluate the update priority of software function packages based on multiple indicators, including dependency indicators, impact scope indicators, functional indicators and security indicators. The dependency indicator takes into account direct dependencies and helps to identify key software function packages; the impact scope indicator is calculated by building a function package dependency graph and defining an impact function, which can accurately evaluate the potential impact of each software function package to be updated on the overall software system; the functional indicator combines the number of new functions and fixed defects to evaluate the impact of the software function package to be updated in terms of function improvement and stability; the security indicator focuses on the severity of the security vulnerabilities fixed by the software function package to be updated, and can evaluate the impact of the software function package to be updated in improving system security; the update priority score is calculated based on these indicators, which comprehensively considers all aspects of the update, can effectively identify and prioritize the update of key function packages, and provide a data basis for the automatic update of dynamically adjusted function packages.
[0067] 2. A method for intelligently selecting the best update time window is proposed. First, the system load data of multiple historical update cycles is collected and preprocessed to construct a comprehensive load index; then, by setting thresholds and analyzing frequencies, low-usage time windows are identified, and then candidate best update time windows are obtained to avoid updating when the software system is busy and reduce the impact of updates on the software system; then, the load data prediction model is used to generate predicted load data for the current update cycle; finally, the comprehensive load index of each candidate best update time window is calculated based on the predicted load data, and the best update time window for the current update cycle is determined, which improves the effectiveness of update time selection; this method can select the optimal time for update and realize dynamic adjustment of update time, which can improve the efficiency and success rate of updates while ensuring the stability of the software system.
[0068] 3. An automatic update execution strategy based on dynamic programming and update priority queue is proposed. First, the update priority queue is constructed according to the update priority score; then, the current system resource status is collected, the resources required for each package to be updated are estimated, and under the constraint of total available resources, the dynamic programming algorithm is applied to maximize the objective function, and the update queue is divided into a selection priority queue and an unselected priority queue; finally, the system updates the function packages in the selection priority queue in sequence; the automatic update execution strategy based on dynamic programming and update priority queue not only ensures the orderly progress of the update, but also improves the utilization of system resources, realizes the dynamic adjustment of global and local updates, and thus enhances the stability and efficiency of the entire update process. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of a flow chart of a method for automatically updating a software function package provided by an embodiment of the present invention;
[0070] Figure 2A schematic diagram of a portion of the structure of a function package dependency diagram provided by an embodiment of the present invention;
[0071] Figure 3 A schematic diagram of the structure of an automatic updating device for a software function package provided by an embodiment of the present invention;
[0072] Figure 4 A schematic diagram of the structure of a computer device for automatically updating a software function package provided in an embodiment of the present invention.
[0073] In the figure: 1. Computer device; 11. Communication bus; 12. Receiver; 13. Processor; 14. Memory; 15. Computer program. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] Automatic updates of software packages are essential to maintaining system security and stability. However, the complex dependencies between software packages pose a huge challenge to the automatic update process. An update of a package may affect other packages that depend on it, triggering a chain reaction that can lead to system instability or malfunction. Therefore, it is particularly necessary to accurately assess the importance of each package update before performing an update. The assessment not only needs to consider the content of the update itself, but also weigh its potential impact on the entire dependency table. Through a comprehensive assessment, the update order of software packages can be optimized to ensure that critical updates are prioritized, thereby achieving continuous improvement and optimization of the software while ensuring system stability.
[0076] The present invention proposes an automatic update method, device, equipment and storage medium for a software function package, which can calculate the priority of the update, automatically select the best update time, and reliably execute the update process, thereby improving the security, stability and maintenance efficiency of the software system. In order to illustrate the role of the present invention, the effectiveness of the present invention will be illustrated from the following examples.
[0077] Embodiment 1
[0078] like Figure 1 As shown, the automatic update method of a software function package applied to a back-end system of an e-commerce platform includes:
[0079] Setting an update cycle, scanning the software warehouse at the beginning of each update cycle to obtain a dependency table of installed function packages and a list to be updated;
[0080] Extracting update instructions of the software function packages to be updated according to the to-be-updated list;
[0081] Analyze the update description to extract dependency change information, new function information, and bug fix information;
[0082] The installed function package dependency table is updated according to the dependency change information to obtain the latest function package dependency table and calculate the dependency index of the software function package to be updated;
[0083] Construct a function package dependency graph according to the latest function package dependency table, and calculate the impact range index of the software function package to be updated;
[0084] Calculate the functional index and security index of the software function package to be updated according to the new function information and defect repair information;
[0085] Calculating an update priority score of the software function package to be updated according to the dependency index, the impact scope index, the functionality index and the security index;
[0086] Determine the optimal update time window based on the historical load data of the software system;
[0087] In the optimal update time window, construct an update priority queue according to the update priority score for automatic update;
[0088] Record the update log and the running status of the updated software system, and adjust subsequent automatic updates.
[0089] The automatic update method of software function packages first sets the update cycle and scans the software warehouse to obtain the dependency table of installed function packages and the list to be updated, thereby ensuring the regularity and systematicness of updates and reducing the risk of missing important updates; then, the update description of the software function package to be updated is extracted and analyzed, and the key information of the update can be accurately extracted to calculate the dependency index, impact range index, functional index and security index, providing a basis for subsequent decision-making, and the update priority score is calculated based on these indicators, making the update process more orderly and efficient, and ensuring that key function packages are updated first; in addition, the optimal update time window is automatically determined, which can minimize the impact of the update on the normal operation of the system; in the optimal update time window, an update priority queue is constructed according to the update priority score for automatic update, which realizes the automation of the update process and improves efficiency; finally, the update log and the running status of the software system are recorded, which helps to trace the details of the update process and achieve self-optimization, and continuously improve the update quality.
[0090] Furthermore, constructing the function package dependency graph specifically includes: representing each software function package as a node in the graph, obtaining a graph node set V = {v1, v2, ..., v n},v n represents the nth node in the graph node set; when the i-th software function package directly depends on the j-th software function package, it is represented as node v i Points to node v j A directed edge; the direct dependency relationship between each two different software function packages is represented as a directed edge, and the graph edge set is obtained Represents the mth edge in the graph edge set; creates a directed graph based on the graph node set and the graph edge set to obtain the function package dependency graph G(V,E).
[0091] The dependency relationships between software function packages are represented by graph data structures, which intuitively displays the software system structure, facilitates understanding and analysis, and more clearly reflects the dependency direction between function packages, helps identify key software function packages, and provides a basis for subsequent impact scope analysis and update decisions.
[0092] Table 1 Function package dependency table
[0093] Feature package name Dependency package name Authentication Encryption library, database connector User Management Authentication, Notification Services Product Catalog Database Connector, Category Manager Order Processing Product catalog, payment system, inventory management, notification service Payment Systems Encryption library, bank interface, payment gateway Inventory Management Product Catalog, Database Connectors Notification Service Message Queue, Email Sender, SMS Sender Recommendation Engine User management, product catalog, machine learning library
[0094] In the embodiment of the present application, in the current update cycle, some dependencies in the dependency table of the latest function package of the back-end system of the e-commerce platform are shown in Table 1. Figure 2The corresponding functional package dependency diagram shows a partial structural diagram. There is an edge from the recommendation engine functional package node to the user management functional package node, the product catalog functional package node, and the machine learning library functional package node, and there is a path to the classification manager functional package node, the database connector functional package node, the notification service functional package node, the message queue functional package node, the SMS sender functional package node, and the email sender functional package node. There is a path from the product catalog functional package node to the database connector functional package node and the classification manager functional package node. There is an edge from the inventory management functional package node to the product catalog functional package node and the database connector functional package node, and there is a path to the classification manager functional package node. There is an edge from the user management functional package node to the authentication functional package node and the notification service functional package node, and there is a path to the encryption library functional package node, the database connector functional package node, the message queue functional package node, the SMS sender functional package node, and the email sender functional package node. There is an edge from the authentication functional package node to the encryption library functional package node and the database connector functional package node. There is one edge from the payment system function package node to the encryption library function package node, the bank interface function package node, and the payment gateway function package node. There is one edge from the order processing function package node to the product catalog function package node, the payment system function package node, the inventory management function package node, and the notification service function package node. There is one path to the encryption library function package node, the payment gateway function package node, the bank interface function package node, the message queue function package node, the SMS sender function package node, and the email sender function package node. There are two paths to the classification manager function package node, and there are three paths to the database connector function package node. There is one edge from the notification service function package node to the message queue function package node, the SMS sender function package node, and the email sender function package node.
[0095] Furthermore, the specific steps of calculating the impact scope index of the software function package to be updated include:
[0096] Define the influence function between two nodes in the dependency graph and calculate the influence probability; the influence function is as follows:
[0097]
[0098] Among them, P(v j ,v i ) represents node v j For node v i The probability of influence; E(v i ,v j ) represents the node v in the dependency graph i To node v j The path edge set corresponding to a path ofi To node v j When unreachable represents the empty set; Indicates the path edge set pointing to node v q The directed edge of q ) represents node v q The average historical update frequency of
[0099] Extract the key path between two nodes; the key path is node v i To node v j Among all the paths in , the one with the largest number of edges;
[0100] According to the impact function and the key path, the impact range index of each function package to be updated is calculated:
[0101]
[0102] Wherein, W(u) represents the impact range indicator of node u; u represents the node corresponding to the software function package to be updated; represents the impact probability corresponding to the critical path from node a to node u; A represents the set of nodes reachable by node u,
[0103] The impact function quantifies the impact relationship between software feature packages, and more accurately evaluates the impact scope of software feature package updates. By extracting the concept of critical path, it helps to discover the software feature packages with the widest impact. Calculating the impact scope index provides a more comprehensive impact assessment and helps optimize the update sequence.
[0104] Furthermore, the dependency index, the functionality index and the security index of the software function package to be updated are calculated as follows:
[0105] The dependency index D=N d / N total ; Among them, N d Indicates the number of software function packages that directly depend on the software function package to be updated; N total Indicates the total number of software function packages in the software system;
[0106] The functional index F=(N f +N b ) / N max ; Among them, N f Indicates the number of new functions in the software function package to be updated; N b Indicates the number of defects fixed in the software function package to be updated; N maxIndicates a predefined maximum reference value;
[0107] The security index S=CVSS_Score / 10; wherein CVSS_Score represents the severity level of the security vulnerability in the repair defect of the software function package to be updated.
[0108] The severity level of the fixed vulnerability ranges from 0 to 10, and is calculated through a vulnerability scoring system based on the detailed information of the security vulnerability. If the update of the software feature package does not fix the security vulnerability, the security index is 0.
[0109] It provides a method for calculating dependency, functionality and security indicators, quantifies various indicators, and enables multi-dimensional update evaluation to comprehensively measure the necessity of updates. Dependency indicators reflect the importance of functional packages and help prioritize updates of key packages. Functional indicators help evaluate the actual value of updates. Security indicators can evaluate the improvement of the overall security of the system by updates.
[0110] Furthermore, the specific steps of determining the optimal update time window according to the historical load data of the software system include:
[0111] Collect and pre-process the software system historical load data of N update cycles before the current update cycle to obtain N historical load time series data;
[0112] Constructing a comprehensive load index based on the historical load time series data and setting a comprehensive load index threshold;
[0113] Divide each of the historical load time series data into m time windows, and calculate the comprehensive load index of each time window;
[0114] Identify the time window where the comprehensive load index is lower than the comprehensive load index threshold, traverse N historical load time series data, retain the time window with an occurrence frequency greater than h, and obtain a low utilization time window set; h represents the occurrence frequency threshold;
[0115] Merging consecutive time windows in the low-usage time window set to obtain M candidate optimal update time windows;
[0116] Constructing a load data prediction model and training it using the historical load time series data;
[0117] Generate predicted load time series data of the current update period by using the trained load data prediction model;
[0118] According to the predicted load time series data, the comprehensive load index of each candidate optimal update time window is calculated, and the candidate optimal update time window with the lowest comprehensive load index is selected as the optimal update time window of the current update cycle.
[0119] In an embodiment of the present application, the comprehensive load index is the normalized weighted sum of the key load data of the software system; the key load data includes the number of active users, CPU utilization, memory utilization and network bandwidth utilization.
[0120] Historical data from multiple update cycles is taken into account, and the accuracy of selecting the optimal update time window is improved based on historical data and load data prediction models; low-usage time windows are selected to minimize the impact on the system; in addition, the load data prediction model considers future load changes, making the selection of the optimal update time window forward-looking.
[0121] Furthermore, the specific steps of constructing the update priority queue for automatic updating according to the update priority score include:
[0122] S1. Calculate the update priority scores of all current software function packages to be updated, and create the update priority queue Q of the software function packages to be updated in descending order;
[0123] The update priority score calculation formula is as follows:
[0124] PS(k)=w1*I1(k)+w2*I2(k)+w3*I3(k)+w4*I4(k);
[0125] Wherein, I1(k), I2(k), I3(k) and I4(k) respectively represent the normalized values of the dependency index, the impact range index, the functional index and the security index of the kth software function package to be updated; w1, w2, w3 and w4 represent the weights of each index;
[0126] S2. Collect the current system resource status, determine the total available resources R, and estimate the required resources r(k) for each software function package to be updated;
[0127] S3. Construct constraints based on the total available resources and the required resources, apply a dynamic programming algorithm to maximize the objective function under the constraints, and divide the update priority queue into a selected priority queue and an unselected priority queue; the constraints are ∑ k∈Q (r(k)*x(k))≤R; the objective function is ∑ k∈Q(PS(k)*x(k)); wherein x(k) represents an indicator function, and the values of x(k) are 1 and 0, indicating the selection and non-selection of the kth software function package to be updated; the selected priority queue is composed of the software function packages to be updated whose values of x(k) are 1; the unselected priority queue is composed of the software function packages to be updated whose values of x(k) are 0;
[0128] S4. Update the function packages to be updated in the selected priority queue in order;
[0129] S5. When the optimal update time window has not ended and the unselected priority queue is not empty, replace the update priority queue with the unselected priority queue and return to step S2; when the optimal update time window has ended and the unselected priority queue is not empty, the unupdated software function package to be updated is automatically updated in the optimal update time window of the next update cycle.
[0130] The calculation of the update priority score takes into account multiple factors and can achieve more scientific priority sorting of software feature packages. The dynamic programming algorithm is used to maximize the update benefits under resource constraints. The update process is made intelligent and automated through dynamic programming and update priority queues, which not only ensures the orderly progress of updates, but also improves the utilization efficiency of system resources, thereby enhancing the stability and efficiency of the entire update process.
[0131] Furthermore, the weight of each indicator in the update priority score is an adaptively adjusted weight, and the adjustment steps are as follows:
[0132] Assigning initial weight values to the dependency index, the impact range index, the functionality index, and the security index;
[0133] After each update cycle, calculate the update effect score; the update effect score is calculated based on the update log and the running status of the software system after the update;
[0134] After each of the C update cycles, the difference between the current update effect score and the historical update effect score is calculated to obtain the update effect score difference; the historical update effect score is the average update effect score of all the completed update cycles;
[0135] According to the difference in update effect scores, the weight of each indicator is adjusted, and the formula is as follows:
[0136] w′ i =w i +α*(|γ i | / ∑|γ i |-w i )*sign(ΔES);
[0137] Among them, w′ i and w i are the i-th weight after adjustment and the i-th weight before adjustment, i = 1, 2, 3, 4, corresponding to the four indicators used for updating priority calculation; α is the learning rate, which is used to control the amplitude of adjustment; γ i is the weight w i The Pearson correlation coefficient between the corresponding indicator in the update priority score and the update effect score; ΔES represents the difference in the update effect score; sign represents the sign function, when ΔES>0, sign is 1, when ΔES<0, sign is -1, and when ΔES=0, sign is 0;
[0138] The adjusted weight is applied to the calculation of the update priority score in subsequent update cycles.
[0139] Furthermore, the calculation steps of the Pearson correlation coefficient are as follows:
[0140] Get C weights w for C update cycles i The corresponding C indicators I i , and calculate the average
[0141] Get C update effect scores ES of C update cycles and calculate the average
[0142] Computation I i Covariance with ES Among them, I i,c Indicates the weight w in the cth update cycle i Corresponding indicator: ES c represents the update effect score of the cth update cycle;
[0143] Computation I i Standard Deviation and the standard deviation of ES
[0144] Calculate Pearson correlation coefficient
[0145] By continuously adjusting the weights, the calculation of update priority scores can better adapt to dynamic changes in the system, which helps to improve the long-term effect of automatic updates; adjusting weights according to actual update effects makes the update process more in line with actual operational needs, enhancing the stability and reliability of the system; adjusting weights according to differences in update effect scores can achieve self-optimization of the update process; and the Pearson correlation coefficient can reflect the degree of linear correlation between various indicators and update effect scores, and can accurately adjust weights in a targeted manner.
[0146] Embodiment 2
[0147] like Figure 3 As shown, the present invention also provides an automatic updating device for a software function package, comprising:
[0148] The information collection module scans the software warehouse to obtain the dependency list of installed function packages and the list to be updated, extracts the update instructions of the software function packages to be updated according to the list to be updated, and analyzes the update instructions to extract dependency change information, new function information and defect repair information;
[0149] A dependency analysis module, which obtains the latest function package dependency list and calculates the dependency index according to the dependency change information and the installed function package dependency list; constructs a function package dependency graph according to the latest function package dependency list, and calculates the impact range index of the function package to be updated;
[0150] A function analysis module, which calculates functional indicators according to the newly added function information and the defect repair information;
[0151] A security analysis module, which calculates security indicators based on the defect repair information;
[0152] An update planning module, comprising an update time planning unit and an update priority planning unit; the update time planning unit determines an optimal update time window according to historical load data of the software system; the update priority planning unit calculates an update priority score according to the dependency index, the impact range index, the functional index and the security index, and constructs an update priority queue according to the update priority score;
[0153] The update execution module automatically updates based on the update priority queue by applying dynamic programming in the optimal update time window.
[0154] Furthermore, constructing the function package dependency graph specifically includes: representing each software function package as a node in the graph, obtaining a graph node set V = {v1, v2, ..., v n},v n represents the nth node in the graph node set; when the i-th software function package directly depends on the j-th software function package, it is represented as node v i Points to node v j A directed edge; the direct dependency relationship between each two different software function packages is represented as a directed edge, and the graph edge set is obtained Represents the mth edge in the graph edge set; creates a directed graph based on the graph node set and the graph edge set to obtain the function package dependency graph G(V,E).
[0155] Furthermore, the specific steps of calculating the impact scope index of the software function package to be updated include:
[0156] Define the influence function between two nodes in the dependency graph and calculate the influence probability; the influence function is as follows:
[0157]
[0158] Among them, P(v j ,v i ) represents node v j For node v i The probability of influence; E(v i ,v j ) represents the node v in the dependency graph i To node v j The path edge set corresponding to a path of i To node v j When unreachable represents the empty set; Indicates the path edge set pointing to node v q The directed edge of q ) represents node v q The average historical update frequency of
[0159] Extract the key path between two nodes; the key path is node v i To node v j Among all the paths in , the one with the largest number of edges;
[0160] According to the impact function and the key path, the impact range index of each function package to be updated is calculated:
[0161]
[0162] Wherein, W(u) represents the impact range indicator of node u; u represents the node corresponding to the software function package to be updated; represents the impact probability corresponding to the critical path from node a to node u; A represents the set of nodes reachable by node u,
[0163] Furthermore, the dependency index of the software function package to be updated is calculated as follows: the dependency index D=N d / N total ; Among them, N d Indicates the number of software function packages that directly depend on the software function package to be updated; N total Represents the total number of software function packages in the software system.
[0164] Furthermore, the functional index of the software function package to be updated is calculated as follows: the functional index F=(N f +N b ) / N max ; Among them, N f Indicates the number of new functions in the function package to be updated; N b Indicates the number of defects fixed in the software function package to be updated; N max Indicates a predefined maximum reference value.
[0165] Furthermore, the security index of the software function package to be updated is calculated as follows: the security index S=CVSS_Score / 10; wherein CVSS_Score represents the severity level of the security vulnerability in the repair defect of the software function package to be updated.
[0166] Furthermore, the specific steps of determining the optimal update time window according to the historical load data of the software system include:
[0167] Collecting and preprocessing the software system historical load data of N update cycles before the current update cycle to obtain N historical load time series data;
[0168] Constructing a comprehensive load index based on the historical load time series data and setting a comprehensive load index threshold;
[0169] Divide each of the historical load time series data into m time windows, and calculate the comprehensive load index of each time window;
[0170] Identify the time window where the comprehensive load index is lower than the comprehensive load index threshold, traverse N historical load time series data, retain the time window with an occurrence frequency greater than h, and obtain a low utilization time window set; h represents the occurrence frequency threshold;
[0171] Merging consecutive time windows in the low-usage time window set to obtain M candidate optimal update time windows;
[0172] Constructing a load data prediction model and training it using the historical load time series data;
[0173] Generate predicted load time series data of the current update period by using the trained load data prediction model;
[0174] According to the predicted load time series data, the comprehensive load index of each candidate optimal update time window is calculated, and the candidate optimal update time window with the lowest comprehensive load index is selected as the optimal update time window of the current update cycle.
[0175] Further, calculating the update priority score and constructing the update priority queue according to the update priority score specifically includes: calculating the update priority scores of all current software function packages to be updated, and creating the update priority queue Q of the software function packages to be updated in descending order; the update priority score calculation formula is as follows:
[0176] PS(k)=w1·I1(k)+w2·I2(k)+w3·I3(k)+w4·I4(k);
[0177] Among them, I1(k), I2(k), I3(k) and I4(k) respectively represent the normalized values of the dependency index, the impact range index, the functional index and the security index of the kth software function package to be updated; w1, w2, w3 and w4 represent the weights of each index.
[0178] Furthermore, specific steps of automatically updating based on the update priority queue using dynamic programming include:
[0179] Collect the current system resource status, determine the total available resources R, and estimate the required resources r(k) for each software function package to be updated;
[0180] According to the total available resources and the required resources, a constraint condition is constructed, and a dynamic programming algorithm is applied to maximize the objective function under the constraint condition, and the update priority queue is divided into a selected priority queue and an unselected priority queue; the constraint condition is ∑ k∈Q (r(k)*x(k))≤R; the objective function is ∑ k∈Q (PS(k)*x(k)); wherein x(k) represents an indicator function, and the values of x(k) are 1 and 0, indicating the selection and non-selection of the kth software function package to be updated; the selected priority queue is composed of the software function packages to be updated whose values of x(k) are 1; the unselected priority queue is composed of the software function packages to be updated whose values of x(k) are 0;
[0181] Updating the to-be-updated function packages in the selected priority queue in order;
[0182] When the optimal update time window has not ended and the unselected priority queue is not empty, the update priority queue is replaced by the unselected priority queue and all steps are repeated; when the optimal update time window ends and the unselected priority queue is not empty, the unupdated software function package to be updated is automatically updated in the optimal update time window of the next update cycle.
[0183] Embodiment 3
[0184] like Figure 4 As shown, the present invention also provides a computer device 1, including a receiver 12, a processor 13 and a memory 14; the receiver 12, the processor 13 and the memory 14 communicate with each other through a communication bus 11; the receiver 12 is used to execute the commands of the processor 13, and the memory 14 is used to store computer programs. When the processor 13 executes the computer program, it implements the automatic update method of the software function package as any one of the embodiments in Example 1.
[0185] The receiver 12 obtains the dependency table of installed function packages and the list to be updated, and calculates the update priority score of the software function package to be updated by executing the computer program in the memory 14 through the processor 13; the receiver 12 obtains the historical load data of the software system, and determines the optimal update time window by executing the computer program in the memory 14 through the processor 13; in the optimal update time window, the receiver 12 obtains the update priority score through the communication bus 11, and automatically updates the software function package by executing the computer program in the memory 14 through the processor 13; the receiver 12 obtains the update log and the running status of the updated software system, and adjusts the subsequent updates by executing the computer program in the memory 14 through the processor 13.
[0186] The communication bus 11 mentioned in the computer device 1 can be a peripheral component interconnect standard (PCI) bus or an extended industrial standard architecture (EISA) bus. The communication bus 11 can be divided into an address bus, a data bus, a control bus, etc. Figure 4 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus;
[0187] The communication bus 11 is used for communication between the computer device 1 and other devices.
[0188] The memory 14 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or other media that can be used to carry or store the desired program code in the form of instructions or data structures and can be stored by the computer, but is not limited to these.
[0189] The processor 13 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, and separate hardware components.
[0190] Computer equipment 1 includes but is not limited to mobile terminals such as laptop computers and tablet computers (PADs), fixed terminals such as desktop computers, and servers in data centers. Figure 4 This is only an example and should not bring any limitation to the function and scope of use of this public embodiment.
[0191] Embodiment 4
[0192] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the automatic updating method of the software function package of the first embodiment is implemented; Figure 4 As shown, the computer-readable storage medium is a memory 14 , which is used to store a computer program 15 and is executed by a processor 13 .
[0193] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is implemented, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer or data center to another website site, computer or data center by wired (for example, but not limited to optical fiber, etc.) or wireless (for example, but not limited to infrared, wireless, etc.). The computer-readable storage medium can be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc. that includes one or more available media integration. Available media can be magnetic media (for example, but not limited to floppy disks, hard disks, etc.), optical media (for example, but not limited to DVDs), etc.
[0194] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for automatically updating a software function package, characterized in that: include: Setting an update cycle, scanning the software warehouse at the beginning of each update cycle to obtain a dependency table of installed function packages and a list to be updated; Extracting update instructions of the software function packages to be updated according to the to-be-updated list; Analyze the update description to extract dependency change information, new function information, and bug fix information; The installed function package dependency table is updated according to the dependency change information to obtain the latest function package dependency table and calculate the dependency index of the software function package to be updated; Construct a function package dependency graph according to the latest function package dependency table, and calculate the impact range index of the software function package to be updated; Calculate the functional index and security index of the software function package to be updated according to the new function information and defect repair information; Calculating an update priority score of the software function package to be updated according to the dependency index, the impact scope index, the functionality index and the security index; Determine the optimal update time window based on the historical load data of the software system; In the optimal update time window, construct an update priority queue according to the update priority score for automatic update; Record the update log and the running status of the updated software system, and adjust subsequent automatic updates.
2. The automatic updating method of a software function package according to claim 1, characterized in that: Constructing the function package dependency graph specifically includes: representing each software function package as a node in the graph, obtaining a graph node set V = {v1, v2, ..., v n },v n represents the nth node in the graph node set; when the i-th software function package directly depends on the j-th software function package, it is represented as node v i Points to node v j A directed edge; the direct dependency relationship between each two different software function packages is represented as a directed edge, and the graph edge set is obtained Represents the mth edge in the graph edge set; creates a directed graph based on the graph node set and the graph edge set to obtain the function package dependency graph G(V,E).
3. The automatic updating method of a software function package according to claim 1, characterized in that: The specific steps of calculating the impact scope index of the software function package to be updated include: Define the influence function between two nodes in the dependency graph and calculate the influence probability; the influence function is as follows: Among them, P(v j ,v i ) represents node v j For node v i The probability of influence; E(v i ,v j ) represents the node v in the dependency graph i To node v j The path edge set corresponding to a path of i To node v j When unreachable represents the empty set; Indicates the path edge set pointing to node v q The directed edge of q ) represents node v q The average historical update frequency of Extract the key path between two nodes; the key path is node v i To node v j Among all the paths in , the one with the largest number of edges; According to the impact function and the key path, the impact range index of each function package to be updated is calculated: Wherein, W(u) represents the impact range indicator of node u; u represents the node corresponding to the software function package to be updated; represents the impact probability corresponding to the critical path from node a to node u; A represents the set of nodes reachable by node u, 4. The automatic updating method of a software function package according to claim 1, characterized in that: The dependency index, functionality index and security index of the software function package to be updated are calculated as follows: The dependency index D=N d / N total ; Among them, N d Indicates the number of software function packages that directly depend on the software function package to be updated; N total Indicates the total number of software function packages in the software system; The functional index F=(N f +N b ) / N max ; Among them, N f Indicates the number of new functions in the software function package to be updated; N b Indicates the number of defects fixed in the software function package to be updated; N max Indicates a predefined maximum reference value; The security index S=CVSS_Score / 10; wherein CVSS_Score represents the severity level of the security vulnerability in the repair defect of the software function package to be updated.
5. The automatic updating method of a software function package according to claim 1, characterized in that: The specific steps of determining the optimal update time window according to the historical load data of the software system include: Collect and pre-process the software system historical load data of N update cycles before the current update cycle to obtain N historical load time series data; Constructing a comprehensive load index based on the historical load time series data and setting a comprehensive load index threshold; Divide each of the historical load time series data into m time windows, and calculate the comprehensive load index of each time window; Identify the time window where the comprehensive load index is lower than the comprehensive load index threshold, traverse N historical load time series data, retain the time window with an occurrence frequency greater than h, and obtain a low utilization time window set; h represents the occurrence frequency threshold; Merging consecutive time windows in the low-usage time window set to obtain M candidate optimal update time windows; Constructing a load data prediction model and training it using the historical load time series data; Generate predicted load time series data of the current update period by using the trained load data prediction model; According to the predicted load time series data, the comprehensive load index of each candidate optimal update time window is calculated, and the candidate optimal update time window with the lowest comprehensive load index is selected as the optimal update time window of the current update cycle.
6. The automatic updating method of a software function package according to claim 1, characterized in that: The specific steps of constructing the update priority queue for automatic updating according to the update priority score include: S1. Calculate the update priority scores of all current software function packages to be updated, and create the update priority queue Q of the software function packages to be updated in descending order; The update priority score calculation formula is as follows: PS(k)=w1*I1(k)+w2*I2(k)+w3*I3(k)+w4*I4(k); Wherein, PS(k) represents the update priority score; I1(k), I2(k), I3(k) and I4(k) respectively represent the normalized values of the dependency index, the impact range index, the functional index and the security index of the kth software function package to be updated; w1, w2, w3 and w4 represent the weights of each index; S2. Collect the current system resource status, determine the total available resources R, and estimate the required resources r(k) for each software function package to be updated; S3. Construct constraints based on the total available resources and the required resources, apply a dynamic programming algorithm to maximize the objective function under the constraints, and divide the update priority queue into a selected priority queue and an unselected priority queue; the constraints are / k∈Q (r(k)*x(k))≤R; the objective function is ∑ k∈Q (PS(k)*x(k)); wherein x(k) represents an indicator function, and the values of x(k) are 1 and 0, indicating the selection and non-selection of the kth software function package to be updated; the selected priority queue is composed of the software function packages to be updated whose values of x(k) are 1; the unselected priority queue is composed of the software function packages to be updated whose values of x(k) are 0; S4. Update the function packages to be updated in the selected priority queue in order; S5. When the optimal update time window has not ended and the unselected priority queue is not empty, replace the update priority queue with the unselected priority queue and return to step S2; when the optimal update time window has ended and the unselected priority queue is not empty, the unupdated software function package to be updated is automatically updated in the optimal update time window of the next update cycle.
7. The automatic updating method of a software function package according to claim 6, characterized in that: The weight of each indicator in the update priority score is the weight of adaptive adjustment, and the adjustment steps are as follows: Assigning initial weight values to the dependency index, the impact range index, the functionality index, and the security index; After each update cycle, calculate the update effect score; The update effect score is calculated based on the update log and the running status of the software system after the update; After each of the C update cycles, the difference between the current update effect score and the historical update effect score is calculated to obtain the update effect score difference; the historical update effect score is the average update effect score of all the completed update cycles; According to the difference in the update effect scores, the weight of each indicator is adjusted; The adjusted weight is applied to the calculation of the update priority score in subsequent update cycles.
8. An automatic updating device for a software function package, characterized in that: include: The information collection module scans the software warehouse to obtain the dependency list of installed function packages and the list to be updated, extracts the update instructions of the software function packages to be updated according to the list to be updated, and analyzes the update instructions to extract dependency change information, new function information and defect repair information; A dependency analysis module, which obtains the latest function package dependency list and calculates the dependency index according to the dependency change information and the installed function package dependency list; Building a function package dependency graph according to the latest function package dependency list, and calculating an impact range index of the function package to be updated; A function analysis module, which calculates functional indicators according to the newly added function information and the defect repair information; A security analysis module, which calculates security indicators based on the defect repair information; An update planning module, comprising an update time planning unit and an update priority planning unit; the update time planning unit determines an optimal update time window according to historical load data of the software system; The update priority planning unit calculates an update priority score according to the dependency index, the impact range index, the functionality index and the security index, and constructs an update priority queue according to the update priority score; The update execution module automatically updates based on the update priority queue by applying dynamic programming in the optimal update time window.
9. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program that can be run on the processor, and when the program is executed on the processor, the steps in the automatic update method of the software function package as claimed in any one of claims 1 to 7 are implemented.
10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the automatic updating method of the software function package according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Software function package version update management method, electronic equipment and storage medium
CN117289986A
Running program remote dynamic updating method
CN117971271A
Method and system for automatically upgrading operating system patch
CN118963779A
System and method for analyzing and remediating computer application vulnerabilities via multidimensional correlation and prioritization
US20200394310A1
Software package update handling
US20230305827A1
Cited By
Modular development life cycle management method, system and equipment based on hot update
CN121233155A
Fault detection method, computing device, storage medium and program product
CN121233440A
Fault detection method, computing device, storage medium, and program product
CN121233440B