A running state monitoring method and system applied to a server cluster
By generating an initial dependency matrix, using differential privacy algorithms and homomorphic encryption, the problem of not being able to perform global risk assessment in cross-organizational server clusters is solved. This enables global risk assessment while protecting code privacy, avoids cascading effects, and ensures the stability and availability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN STONE TECH HLDG CO LTD
- Filing Date
- 2025-11-04
- Publication Date
- 2026-05-12
AI Technical Summary
In cross-organizational server clusters, the inability of organizations to share complete code dependency information makes it impossible to conduct global risk assessments, often leading to unexpected service interruptions or performance degradation. Existing technologies cannot achieve global risk assessments while protecting code privacy.
通过获取本地代码仓库的补丁变更数据,生成初始依赖关系矩阵,利用差分隐私算法添加噪声生成隐私保护的特征指纹向量,并进行同态加密,利用加密依赖图执行图传播算法,进行安全多方聚合,计算全局级联影响的风险等级。
It enables global risk assessment while protecting code privacy, avoids overlooking cascading effects, and ensures the stability and availability of the system.
Smart Images

Figure CN121093316B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed system monitoring technology, and more specifically, to a method and system for monitoring the operational status of server clusters. Background Technology
[0002] In modern internet service architectures, cross-organizational server clusters have become the infrastructure supporting large-scale business operations. When security patches need to be deployed to multiple interdependent services, organizations face a significant challenge: due to the trade secret nature of code implementation details, organizations cannot share complete code dependency information. This information isolation means that organizations can only assess the impact of patches based on local information, unable to anticipate the cascading effects of patches through complex inter-service call relationships. In actual deployments, this assessment blind spot often leads to unexpected service interruptions or performance degradation, severely impacting system stability and availability.
[0003] Traditional solutions either require all parties to share sensitive code structure information or can only perform isolated local assessments, neither of which can achieve global risk assessment while protecting code privacy. Summary of the Invention
[0004] This invention provides a method and system for monitoring the operational status of server clusters, which solves the technical problem of conducting global risk assessment while protecting code privacy.
[0005] This invention provides a method for monitoring the operational status of a server cluster, comprising: acquiring patch change data from a local code repository; extracting function call relationships and data flow dependency information through abstract syntax tree parsing to generate an initial dependency matrix; adding Laplace noise to the code structure features extracted from the dependency matrix using a differential privacy algorithm to generate a privacy-preserving feature fingerprint vector; homomorphically encrypting the feature fingerprint vector and the dependency matrix to generate encrypted dependency graph data; executing a graph propagation algorithm on the encrypted dependency graph in the ciphertext domain, and obtaining the encrypted patch impact propagation probability distribution by iteratively calculating the encrypted impact propagation vector; performing secure multi-party aggregation, weighting and summing the encrypted impact propagation probabilities of each organization in the ciphertext domain, and calculating the risk level of the global cascading impact; generating patch deployment recommendations based on the risk assessment results; wherein, the scale parameter of the Laplace noise is determined according to the ratio of the global sensitivity of the feature function to the privacy budget.
[0006] Furthermore, generating the initial dependency matrix includes:
[0007] Retrieve patch change history from the local code repository, including a list of modified files, function signature changes, and line of code changes;
[0008] The code files affected by the changes are parsed using an abstract syntax tree to extract function definition nodes, function call nodes, variable reference nodes, and control flow nodes.
[0009] A dependency matrix is generated based on the extracted dependency information, where the matrix elements represent the dependency strength between functions. The dependency strength is calculated by weighting the number of function calls and the number of data stream connections.
[0010] Furthermore, the process of using differential privacy algorithms to handle code structure features includes:
[0011] Extract node degree distribution, clustering coefficient, and path length distribution from the dependency matrix as code structure features;
[0012] For each feature dimension, a Laplacian mechanism is applied to add calibration noise, where the noise scale parameter is equal to the global sensitivity of the feature function divided by the privacy budget.
[0013] An adaptive privacy budget allocation strategy is adopted, which allocates a larger privacy budget to key features and a smaller privacy budget to non-key features;
[0014] The noise-added features are combined into a privacy-preserving code feature fingerprint vector.
[0015] Furthermore, the homomorphic encryption of the feature data includes:
[0016] Choose a fully homomorphic encryption scheme that supports addition and multiplication operations, and generate a public-private key pair;
[0017] Homomorphic encryption is performed on each element of the feature fingerprint vector and the dependency matrix to obtain the encrypted feature vector and the encrypted dependency matrix.
[0018] Organize the encrypted data into an encrypted dependency graph structure, including an encrypted set of node features and an encrypted set of edge weights;
[0019] The homomorphic encryption supports homomorphic operations on the ciphertext field, such that the result of homomorphic addition of two ciphertexts is equal to the encrypted result of adding the corresponding plaintexts, and the result of homomorphic multiplication of two ciphertexts is equal to the encrypted result of multiplying the corresponding plaintexts.
[0020] Furthermore, the execution of the graph propagation algorithm in the ciphertext domain includes:
[0021] Initialize the influence propagation vector on the cryptographic dependency graph, set the cryptographic value of the nodes directly affected by the patch to 1, and set the cryptographic value of other nodes to 0.
[0022] Construct an encrypted state transition matrix whose elements are homomorphic products of the elements of the encrypted adjacency matrix and the encrypted edge weight values;
[0023] In the ciphertext domain, the influence propagation calculation is performed iteratively. In each iteration, the normalized encrypted adjacency matrix is multiplied by the current encrypted influence propagation vector, and then homomorphically added to the initial influence vector.
[0024] An attenuation factor is introduced to simulate the effect of attenuation with propagation distance. The attenuation factor ranges from 0 to 1.
[0025] The iteration stops when the convergence criterion of the ciphertext field is less than the preset convergence threshold, and the probability distribution of the propagation of the encryption effect is output.
[0026] Furthermore, the normalized adjacency matrix is obtained by multiplying the product of the degree matrix raised to the power of -1 / 2 and the dependency matrix, and then multiplying the product of the degree matrix raised to the power of -1 / 2.
[0027] Furthermore, the secure multi-party aggregation includes:
[0028] Each organization sends the locally calculated probability of the propagation of encrypted effects to the aggregation server;
[0029] The aggregation server calculates the global impact distribution in the encrypted domain by weighted summation of the propagation probabilities of the encrypted impact of each organization, with the weight coefficients representing the relative importance of each organization.
[0030] Based on a preset risk threshold, a risk level score is calculated in the encrypted domain.
[0031] A Bayesian network is used to analyze the conditional probability of patch changes and service performance indicators in the encrypted domain, and an impact scoring matrix is generated. The Bayesian network includes patch change nodes, intermediate impact nodes, and performance indicator nodes, and data is transmitted between nodes through a conditional probability table.
[0032] Furthermore, the Bayesian network employs the expectation-maximization algorithm for parameter learning, optimizes by minimizing the negative log-likelihood function as the loss function, uses variational inference to approximate the posterior distribution, and continuously updates the network parameters based on new monitoring data.
[0033] Furthermore, the patch deployment recommendations generated based on the risk assessment results include:
[0034] The encrypted risk level score is securely decrypted to obtain the plaintext risk score.
[0035] Based on the risk score and the preset deployment strategy rules, a phased patch deployment sequence is generated;
[0036] Develop corresponding monitoring metrics and rollback trigger conditions for each deployment phase to form a complete deployment plan.
[0037] This invention provides a system for monitoring the operational status of a server cluster, comprising:
[0038] The code analysis module is used to obtain patch change data from the local code repository and generate an initial dependency matrix;
[0039] The privacy protection module is used to process code structure features using differential privacy algorithms;
[0040] The encryption module is used to perform homomorphic encryption on the feature data;
[0041] The propagation computation module is used to perform graph propagation algorithms in the ciphertext domain;
[0042] The aggregation module is used to perform secure multi-party aggregation calculations to assess global risks.
[0043] The deployment recommendation module is used to generate patch deployment recommendations based on risk assessment results.
[0044] The beneficial effects of this invention are as follows:
[0045] This invention adds calibration noise to code structure features using differential privacy technology, allowing the feature fingerprint vector to hide specific code implementation details while preserving statistical properties, thus overcoming the risk of code privacy leakage. Simultaneously, it utilizes homomorphic encryption to perform computation of dependency graph data in the ciphertext domain, enabling impact propagation analysis to be conducted without decryption, further protecting the trade secrets of various organizations. By executing graph propagation algorithms and secure multi-party aggregation in the ciphertext domain, it achieves cross-organizational global impact assessment, overcoming the cascading effect omission problem caused by relying solely on local assessments, thereby solving the technical problem of conducting global risk assessment while protecting code privacy. Attached Figure Description
[0046] Figure 1 This is a flowchart of a method for monitoring the operational status of a server cluster according to the present invention;
[0047] Figure 2 This is a heatmap of the function dependency matrix of the present invention;
[0048] Figure 3 This is a diagram illustrating the propagation and convergence process of the ciphertext domain influence in this invention.
[0049] Figure 4 This is a comparison diagram of the differential privacy processing features of the present invention;
[0050] Figure 5 This is a diagram showing the relationship between organizational weights and influence probabilities in this invention;
[0051] Figure 6 This is a diagram illustrating the path of patch impact propagation in this invention; Detailed Implementation
[0052] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0053] At least one embodiment of the present invention discloses a method for monitoring the operational status of a server cluster, such as... Figures 1-6 As shown, it includes the following steps:
[0054] Step 100: Obtain patch change data from the local code repository and generate an initial dependency matrix.
[0055] Step 101: Obtain the patch change history from the local code repository, including a list of modified files, function signature changes, and line of code changes;
[0056] Step 102: Perform abstract syntax tree parsing on the code files involved in the changes to extract function call relationships and data flow dependency information;
[0057] The aforementioned abstract syntax tree parsing algorithm takes the source code text of a code file as input and outputs a structured set of syntax tree nodes, which includes function definition nodes, function call nodes, variable reference nodes, and control flow nodes.
[0058] Furthermore, the specific implementation steps of the abstract syntax tree parsing include: Step 1021: Using a recursive descent parser to perform lexical analysis on the source code, decomposing the source code into lexical units such as identifiers, keywords, and operators; Step 1022: Performing syntax analysis based on context-free grammar rules, constructing the internal node structure of the syntax tree, where function definition nodes contain function names, parameter lists, and function bodies, and function call nodes contain callers, called function names, and parameter lists; Step 1023: Performing semantic analysis, managing the scope of variables and functions through a symbol table, and establishing the binding relationship between variable reference nodes and their definitions; Step 1024: Constructing a control flow graph, identifying control structures such as if-else, for, and while, generating control flow nodes and establishing predecessor and successor relationships between nodes, and outputting an abstract syntax tree containing dependency information.
[0059] Step 103: Generate an initial dependency matrix based on the extracted dependency information. , where matrix elements Representation function For functions Dependence strength;
[0060] It should be noted that the strength of dependency Calculated using the following formula:
[0061]
[0062] in, Representation function For functions The dependence strength, with a value range of [0,1]; The weighting coefficient represents the number of times the call is made. The weighting coefficients representing the number of data stream connections satisfy the following conditions: ; This represents the number of calls after Min-Max normalization, with a value range of [0,1]. This represents the number of data stream connections after Min-Max normalization, with a value range of [0,1].
[0063] The aforementioned data preprocessing uses the Min-Max normalization method:
[0064] ,
[0065] ;
[0066] Number of calls Number of data stream connections Normalization to the [0,1] interval eliminates the impact of magnitude differences on dependency strength calculation.
[0067] Furthermore, weighting coefficients and The value of is determined based on the characteristics of the code structure: for function call intensive systems, set For data-intensive systems, set For balanced systems, set This ensures that the dependency strength calculation results have a clear physical meaning in the [0,1] interval.
[0068] Step 200: Use the differential privacy algorithm to process code structure features and generate privacy-preserving feature fingerprint vectors.
[0069] Step 201: From the dependency matrix Code structure features were extracted, including node degree distribution, clustering coefficient, and path length distribution. Appropriate data preprocessing was applied to different types of features: logarithmic transformation was used to reduce numerical differences in node degree distribution; clustering coefficients were normalized to the [0,1] interval; and Z-score standardization was used for path length distribution.
[0070] Furthermore, the specific implementation steps for code structure feature extraction include: Step 2011: Calculate the node degree distribution features, for nodes... degree value ,in Represents a node The degree value represents the sum of the connection strengths of the nodes; The summation symbol is used to represent the summation symbol. From 1 to Indicates the index of all nodes; Represents a node To the node Dependence strength; To represent the total number of nodes, apply a logarithmic transformation. ,in This represents the degree value after logarithmic transformation; Represents the natural logarithm operator; This indicates that the degree value is incremented by 1 to avoid logarithmic calculation problems caused by zero values, and then the degree distribution histogram is calculated. ,in Histogram of degree distribution, with degree values of The number of nodes; The radix operator represents the number of elements in a set; This represents the floor function, which rounds the degree value to the nearest smaller integer. Integer values representing degree are used as feature vectors; Step 2012: Calculate clustering coefficient features for nodes. Local clustering coefficient ,in Represents a node The local clustering coefficients, with values ranging from [0,1]; Indicates a constant factor; Represents the multiplication operator; Represents a node The number of sides between neighbors; Represents a node The degree (number of neighboring nodes), the average clustering coefficient of the entire graph. ,in This represents the average clustering coefficient across the entire graph; Indicates the averaging factor; This represents the sum of the clustering coefficients of all nodes. From 1 to Represents the index of all nodes; Step 2013: Calculate the path length distribution characteristics, and use the Floyd-Warshall algorithm to calculate the shortest path for all pairs. Construct a path length histogram ,in This represents a path length histogram, where the distance is... The number of node pairs; Represents the set radix operator; Represents a pair of nodes; Represents a node To the node The shortest path length; The path length value is represented by Z-score normalization.
[0071]
[0072] in This represents the standardized path length histogram. Represents the original path length histogram; This represents the mean of the path length distribution. The standard deviation represents the distribution of path lengths.
[0073] Step 202: Apply the Laplacian mechanism to each feature dimension to add calibration noise. The noise parameters are determined according to the privacy budget. Sure;
[0074] The input to the aforementioned Laplace mechanism is the original eigenvalues. and privacy budget The output is the feature value after adding noise. ,in The scale parameter is represented as The Laplace-distributed random variable.
[0075] Step 203: Combine the noise-added features into a privacy-preserving code feature fingerprint vector. ;
[0076] It should be noted that the scale parameter of Laplace noise... The calculation formula is:
[0077]
[0078] in, The scale parameter representing Laplace noise; This represents the global sensitivity of the feature function; This represents the privacy budget parameter, with a range of values. .
[0079] Furthermore, privacy budget parameters The range of values is constrained as follows: ,in ( It belongs to an open interval ,express Values greater than 0 and less than or equal to 1 provide strong privacy protection. ( It belongs to an open interval ,express Values greater than 1 and less than or equal to 5 provide moderate privacy protection. ( It belongs to an open interval ,express Values greater than 5 and less than or equal to 10 provide weak privacy protection. Global sensitivity. Sensitivity to node degree distribution is determined based on feature type. Sensitivity of clustering coefficients Sensitivity to path length distribution This ensures a balance between the controllability of noise addition and the availability of features.
[0080] In this embodiment of the application, in order to balance the strength of privacy protection and feature availability, an adaptive privacy budget allocation strategy is adopted, which allocates a larger privacy budget to key features and a smaller privacy budget to non-key features.
[0081] Furthermore, the specific implementation method of the adaptive privacy budget allocation strategy includes: Step 2031: Calculate the importance score of each feature.
[0082]
[0083] in Features variance The correlation coefficient between the feature and the target variable. Weight coefficients are calculated based on the frequency of use of the features. Step 2032: Rank features based on importance scores, classifying features into three categories: high importance (top 30%), medium importance (middle 40%), and low importance (bottom 30%); Step 2033: Apply an exponential allocation function. Allocate privacy budget (of which From 1 to (representing the index of all features), where Represented by natural constant as the base It is an exponential function of the exponent. To adjust parameters to ensure that important features receive more privacy budget while maintaining overall budget constraints. (in From 1 to (Index representing all features).
[0084] Furthermore, the complete definition of each parameter in the importance scoring formula is: Target variable The labels indicating the success / failure of historical patch deployments are coded as follows: (0 indicates failure, 1 indicates success); Correlation coefficient Calculated using Pearson correlation coefficient
[0085]
[0086] Value constraints are Frequency of use:
[0087]
[0088] in Features The activation threshold (set as the feature mean) ), This represents the number of samples whose feature values exceed a threshold. For the total number of samples, ensure frequency It reflects the activity level of features in the dataset.
[0089] Step 300: Homomorphically encrypt the feature data to generate an encrypted dependency graph that can be computed in the ciphertext domain.
[0090] Step 301: Select a fully homomorphic encryption scheme that supports addition and multiplication operations, and generate a public-private key pair;
[0091] The input to the aforementioned fully homomorphic encryption scheme is plaintext data. and public key The output is in ciphertext. It supports homomorphic operations on ciphertext fields:
[0092] ,
[0093] ;
[0094] Furthermore, the specific implementation steps of the fully homomorphic encryption scheme using the CKKS scheme include: Step 3011: Generating cyclic polynomials ,in For the ring dimension; Step 3012: Select the modular chain ,in For multiplication depth, each modulus is a 60-bit prime number; Step 3013: Generate key pair, private key For ring Small coefficient polynomial on, public key in , For the error polynomial; Step 3014: Encryption process ,in , , It is a random small polynomial. The scaling factor; Step 3015: Homomorphic operations are implemented through polynomial operations, including addition. Multiplication operation Then, relinearization is performed to reduce the ciphertext dimension.
[0095] Step 302: Convert the feature fingerprint vector Dependency Matrix Each element is homomorphically encrypted to obtain the encrypted feature vector. and cryptographic dependency matrix ;
[0096] Step 303: Organize the encrypted data into an encrypted dependency graph ,in It is an encrypted set of node features. It is an encrypted set of edge weights;
[0097] Step 400: Execute the graph propagation algorithm in the ciphertext domain to calculate the propagation probability distribution of the patch's impact.
[0098] Step 401: In the cryptographic dependency graph Initialization affects the propagation vector Set the nodes directly affected by the patch to 1, and other nodes to 0;
[0099] Step 402: Iteratively perform influence propagation calculations in the ciphertext domain:
[0100]
[0101] in, For the first The encryption effect propagates in the next iteration. For a normalized encrypted adjacency matrix, For the first The encryption effect propagates in the next iteration. The initial encryption affects the propagation vector. The number of iterations ( (integer).
[0102] Step 403: After iterative convergence, the probability distribution of the encryption's impact propagation is obtained. ;
[0103] The aforementioned ciphertext domain graph propagation algorithm includes the following sub-steps: Step 4001: Construct the encryption state transition matrix ,in ,in For the encrypted state transition matrix, the first Line 1 Column elements, For the encrypted adjacency matrix, the first Line 1 Column elements, For nodes To the node The edge weight encryption value, Index the nodes; Step 4002: Initialize the encryption influence vector For nodes directly affected by the patch ,set up Other node settings Step 4003: Perform matrix-vector multiplication in the ciphertext field. ,in For temporary encryption of the influence vector, For the encrypted state transition matrix, For the first The encryption impact vector of the next iteration. Represents homomorphic multiplication; Step 4004: Perform vector addition in the ciphertext field. ,in For the first The encryption impact vector of the next iteration. For temporary encryption of the influence vector, This is the initial encryption effect vector. Represents homomorphic addition operation; Step 4005: Calculate the convergence criterion for the ciphertext field. ,in For encryption, convergence criteria For the first Second and third The next iteration affects the L2 norm of the vector difference, when Stop iteration when This is the preset convergence threshold;
[0104] Furthermore, the convergence threshold The value constraints are as follows The specific value is determined based on the system size and accuracy requirements: for small-scale systems with fewer than 100 nodes, set... For medium-sized systems with 100-1000 nodes, set For large-scale systems with more than 1000 nodes, set This ensures that the algorithm converges while maintaining computational accuracy that meets the needs of practical applications.
[0105] The aforementioned calculation of the L2 norm of the ciphertext field An approximation method is used: first, the vector difference is calculated in the ciphertext domain. ,in For encrypted vector difference, For the first The encryption impact vector of the next iteration. For the first The encryption impact vector of the next iteration. Represent the homomorphic subtraction operation; then calculate the sum of squares of each component. ,in For encrypted sum of squares, The first vector difference The encrypted value of each component, For component index ( ), For vector dimensions, This represents homomorphic multiplication; finally, Newton's iteration method is used to approximate the square root in the encrypted domain. ,get ;
[0106] Furthermore, the specific implementation steps of the Newton-Raphson iteration method for calculating the square root in the encrypted field include: Step 40051: Initialization As the initial estimate of the square root; Step 40052: Execute Newton's iterative formula ,in For the first The encrypted estimate of the next iteration. For the first The encrypted estimate of the next iteration. For encrypted sum of squares, It is a constant. This represents homomorphic multiplication. This represents homomorphic addition. Representing the approximate division operation of the ciphertext field, through accomplish, Calculations are performed in a finite field using Fermat's Little Theorem; Step 40053: Calculate the iteration error. ,in For the iteration error of encryption, For the first The square of the estimate in the next iteration Represents homomorphic subtraction, when Stop iteration when the time is right; Step 40054: Output As an approximation of the square root of the ciphertext field, the number of iterations is limited to a maximum of 10 to control computational complexity. Step 4006: Output the final probability distribution of the encryption effect propagation. .
[0107] It should be noted that the normalized adjacency matrix The calculation method is as follows:
[0108]
[0109] in, For the normalized adjacency matrix, The degree matrix is the negative first power of 2. This is a dependency matrix. For degree matrix, This represents matrix multiplication.
[0110] Furthermore, the degree matrix The specific calculation steps include: Step 4071: Calculate the degree value of each node. ,in For nodes The degree value, Dependency matrix The Middle Line 1 Column elements; Step 4072: Construct the degree matrix ,in For degree matrix, This represents a diagonal matrix function, where diagonal elements are node degree values and off-diagonal elements are 0; Step 4073: Calculate the negative 1 / 2 power of the degree matrix. For diagonal elements when hour, when At that time, among them The degree matrix is the first power of the negative two. Line 1 Column elements, Represent the square root of the degree value to avoid division by zero errors; Step 4074: Perform matrix multiplication. This yields a symmetric normalized adjacency matrix that satisfies... ,in For the normalized adjacency matrix, the first... Line 1 Column elements, For the corresponding elements of the dependency matrix, and They are nodes and nodes The degree value is used to ensure the numerical stability of the graph propagation algorithm.
[0111] In this embodiment of the application, an attenuation factor is introduced to improve the accuracy of the propagation algorithm. To simulate the attenuation of influence with propagation distance:
[0112]
[0113] in, For the first The encryption effect propagates in the next iteration. Attenuation factor ( ,express (Values greater than 0 and less than 1) For a normalized encrypted adjacency matrix, For the first The encryption effect propagates in the next iteration. The initial encryption affects the propagation vector. This represents matrix multiplication.
[0114] Furthermore, the time dimension Specifically, it is defined as the number of iteration steps, and its correspondence with actual time is as follows: ,in The unit time step has the following value constraints:
[0115] ( Belongs to a closed interval (This indicates a time step between 1 minute and 1 hour), with the specific value determined based on the system's response time characteristics: for real-time systems, the setting... Minutes, for batch processing system settings Minutes, for offline analysis system settings Hours. The total time window constraint affecting propagation is... Hours, of which To maximize the number of iterations, ensure that the impact propagation analysis is completed within a reasonable timeframe, and meet the actual business requirements for the timeliness of patch risk assessment.
[0116] Furthermore, attenuation factor The value constraints are as follows The specific value is determined based on the degree of coupling in the system: for tightly coupled systems, set... ( Belongs to a closed interval ,express The value (between 0.7 and 0.9) reflects the persistence of influence propagation under strong dependencies; for loosely coupled systems, it is set to... ( Belongs to a closed interval ,express The value (between 0.1 and 0.3) reflects the rapid decay of the impact under weak dependencies; for moderately coupled systems, it is set to... ( Belongs to a closed interval ,express (The value is between 0.4 and 0.6) to balance the range and intensity of the influence propagation and ensure that the attenuation model conforms to the dependency characteristics of the actual system.
[0117] Step 500: Perform secure multi-party aggregation and calculate the risk level of global cascading impact.
[0118] Step 501: Each organization calculates the propagation probability of the encrypted impact locally. Send to the aggregation server;
[0119] Step 502: The aggregation server calculates the global impact distribution in the ciphertext domain:
[0120]
[0121] in, To mitigate the impact of global encryption on distribution, For the first Normalized weighting coefficients for each organization For the first Local encryption by an organization affects the probability of propagation. For organizing indexes ( ), For the number of participating organizations, satisfy , This represents a scalar multiplication operation. The weighting coefficients are determined based on factors such as organizational size and service importance, and then normalized.
[0122] Furthermore, weighting coefficients The value constraints are as follows and This ensures that each organization has a minimum weight guarantee. The weight calculation formula is as follows: ,in For the first The weighting coefficients of each organization The weighting coefficient for the number of service nodes ( ), For the first Number of service nodes in an organization Weighting coefficients for the importance of services ( ), For the first Service importance score for each organization (range: ), For organizing indexes ( The denominator is the weighted sum of scores for all organizations, ensuring the fairness and rationality of weight allocation.
[0123] Step 503: Calculate the risk level score in the encrypted domain based on the preset risk threshold. ;
[0124] Furthermore, risk level scoring The objective function for the calculation, which includes the time dimension, is:
[0125]
[0126] in To assign a risk level score to encryption, The minimum value parameter operator is indicated. Risk level scoring variables ( ), For time index ( ), The length of the time window ( Hour), The time decay weighting function is... For a moment The global encryption impact distribution For a moment Target risk level For regularization parameters ( ), The baseline risk level is set at 0.5; the constraints are as follows: and This ensures the continuity and stability of risk scores over time, preventing drastic fluctuations in scores from affecting the reliability of deployment decisions.
[0127] In this embodiment of the application, in order to enhance the robustness of the aggregation results, a Bayesian network is used to analyze the conditional probability of patch changes and service performance indicators in the encrypted domain, generating a more accurate impact scoring matrix.
[0128] The aforementioned Bayesian network consists of a set of nodes. and the set of directed edges This forms a directed acyclic graph structure. The node set includes patch change nodes. (Indicating different types of code changes), intermediate affected nodes (Indicates the status of service components) and performance metric nodes (This represents a system performance metric). Directed edges between nodes represent conditional dependencies. Data is passed between nodes via a Conditional Probability Table (CPT). Each node... The conditional probability distribution is ,in For nodes Given a parent node Probability distribution under certain conditions For the first 1 node For nodes The set of parent nodes.
[0129] Furthermore, the specific implementation steps for constructing a Bayesian network include: Step 5031: Determine the network structure based on expert knowledge and historical data statistical analysis, and use the K2 algorithm to search for the optimal network topology. The scoring function is:
[0130]
[0131] in For network structure The rating, This is the chain multiplication operator. For gamma function, Combining values for the parent node Total frequency Combining values for the parent node Prior parameters, For nodes in the training data Value And the combination of parent node values frequency, For the corresponding prior parameters; Step 5032: Initialize the conditional probability table, using a uniform distribution for the root node. ,in root node Value The probability, The number of possible values for a node ( For non-root nodes, Laplace smoothing is used:
[0132]
[0133] in For nodes Value combinations in the parent node Values under certain conditions The probability, For Laplace smoothing parameters; Step 5033: Update CPT parameters using maximum likelihood estimation. ,in For parameters of the conditional probability table, Combining values for the parent node The total frequency; Step 5034: Use the Forward-Backward algorithm to perform inference, calculate the marginal probability and conditional probability of the node, and output the influence rating matrix.
[0134] Furthermore, the parameters in the K2 algorithm scoring function are defined as follows: Represents a node The number of possible combinations of values for the parent node is calculated using the following formula: ,in For nodes The set of parent nodes, parent node The size of the range of values; Represents a node The number of possible values, i.e. (Low, medium, and high states); prior parameters The hyperparameters of the Dirichlet distribution are constrained as follows: and (in From 1 to Represents a node (Index of all possible values), where Indicates uniform prior. Ensure that the prior weights of each state are equal; Gamma function The definition of For positive integers have The Stirling approximation is used in the calculation. Improve numerical stability.
[0135] The input to the aforementioned Bayesian network is an encrypted patch-modified feature vector. and historical performance data The output is an encrypted impact rating matrix. ,in Indicates the first The patch changes to the first... The impact score of each performance metric. After decrypting the impact score matrix, it is processed using the Sigmoid function. Map the score values to the interval [0,1] (where...) Represented by natural constant as the base (This is an exponential function of the index), representing the probability of influence, which facilitates subsequent risk level calculations.
[0136] The aforementioned Bayesian network employs the Expectation-Maximization (EM) algorithm for parameter learning, with incremental learning as the training mode, meaning the network parameters are continuously updated based on new monitoring data. The optimization strategy uses variational inference to approximate the posterior distribution, minimizing the KL divergence.
[0137]
[0138] in Let KL divergence function be used. For approximate posterior distribution, For the true posterior distribution, For the observation dataset, In distribution The expected operator under, This is the network parameter vector.
[0139] Furthermore, the complete constraint condition for the KL divergence optimization problem is defined as: the objective function ,in For constraint set, constraint set make sure For a valid probability distribution, For normalization constraints, Non-negativity constraint This indicates all parameters Valid; parameter space constraints ,in For parameter space, This represents the total number of parameters. The number of nodes in the Bayesian network; time dimension constraints:
[0140]
[0141] in For the optimal time step, For time step variable ( ), For time decay weight, Attenuation factor ( ), For a moment KL divergence, For a moment Observational data, For the maximum time step ( This ensures that the optimization process considers both the impact of historical data and the importance of the latest data, meeting the timeliness requirements of online learning.
[0142] Furthermore, the specific implementation steps of the EM algorithm include: Step 5041: Calculate the posterior probability of the latent variables. ,in Latent variables In observation data and current parameters Values under certain conditions The posterior probability, For the first One hidden variable, For the values of latent variables, For observation data, For the first The parameters for the next iteration are inferred precisely using the Junction Tree algorithm, and the message passing formula is as follows:
[0143]
[0144] in For the group To the group The message being delivered For the group The set of variables, For the group Remove the group Residual variables of common variables, Let be the cluster potential function. For nodes Neighbor set; M step 5042: Update network parameters:
[0145]
[0146] in For the first The parameters for the next iteration In order to provide the observation data and parameters condition for latent variables Expectations For the joint probability distribution, frequency statistics are used for discrete nodes:
[0147]
[0148] in These are the parameters for the updated conditional probability table. The total number of samples, For the first Nodes in each sample The value of , For the first Nodes in each sample The parent node value; convergence judgment step 5043: calculate the log-likelihood change. ,in This is the log-likelihood change. and The first Second and third The log-likelihood value of the nth iteration, when Stop iteration when the convergence parameters are reached, and output the convergence parameters. .
[0149] Furthermore, the complete definition of each parameter in the Junction Tree algorithm is: clique potential function. ,in For the group The set of factors in Factors in a conditional probability table; set of variables Indicates from the group Remove variables from the set that are related to the group Residual variables after common variables; messages The value constraints are as follows and This ensures that the message follows a valid probability distribution; neighbor set. ,in Let be the set of edges of the Junction Tree, and let the depth of the tree be constrained. This ensures that the time complexity of the inference algorithm is within an acceptable range.
[0150] Furthermore, the convergence threshold constraint for the KL divergence is: When the change in KL divergence over 10 consecutive iterations is less than At this point, convergence is considered possible. Network parameters. The constraints are ,in The number of nodes in the Bayesian network. The number of states for each node (K=3, corresponding to low, medium, and high states respectively) is determined to ensure the validity and numerical stability of the conditional probability table parameters.
[0151] The loss function of the aforementioned Bayesian network is the negative log-likelihood function:
[0152]
[0153] in For loss function, The number of training samples, For network parameter vectors, For the first Each sample in parameters The likelihood probability is as follows: For the first training samples, For the sample Middle node The observed values, For nodes The value of the parent node, For conditional probability, This represents the total number of nodes in the Bayesian network.
[0154] Furthermore, the complete definition of each parameter in the loss function is: training samples Indicates the first training samples, of which Indicates sample Middle node State values (0 represents a low state, 1 represents a medium state, and 2 represents a high state); conditional probability ,in For nodes The observed values, The index for the combination of values taken from the parent node; the time-weighted form of the loss function is:
[0155]
[0156] in The time decay weighting function is... The attenuation coefficient ( ), For the current time, For the sample The timestamp ensures that the loss function pays more attention to recent data, improving the model's adaptability to the latest system state.
[0157] Step 600: Based on the risk assessment results, generate patch deployment recommendations.
[0158] Step 601: Assess the risk level of encryption. Security decryption is performed to obtain a plaintext risk level score. ;
[0159] Step 602: Assign numerical risk level scores Converted into discrete risk levels. The risk level classification rule is: when The time is low risk. The risk level is currently medium. It is a high-risk time, among which Numerical risk level scoring ( ), and Thresholds for classifying risk levels, , , Numeric comparison operators;
[0160] Furthermore, risk level scoring The value constraints are as follows The thresholds of 0.3 and 0.7 are determined based on statistical analysis of historical patch deployment data: threshold 0.3 corresponds to 95% of historical successful deployment cases, and threshold 0.7 corresponds to 80% of historical successful deployment cases. When the system has a low risk tolerance, the thresholds can be adjusted to 0.2 and 0.5; when the system has a high risk tolerance, the thresholds can be adjusted to 0.4 and 0.8, ensuring that the risk level classification conforms to actual business needs and operational strategies.
[0161] Step 603: Generate a phased patch deployment sequence based on the risk level and preset deployment strategy rules. Low-risk patches can be deployed in parallel; medium-risk patches use rolling deployment; high-risk patches need to be deployed in batches with additional verification steps.
[0162] Step 604: Develop corresponding monitoring metrics and rollback trigger conditions for each deployment phase. Monitoring metrics include performance measures such as service response time, error rate, and resource utilization; rollback trigger conditions include abnormal situations such as response time increase exceeding 20%, error rate exceeding 1%, and unavailability of critical services, forming a complete deployment contingency plan.
[0163] Furthermore, the threshold constraints for rollback triggering conditions are specifically defined as follows: the response time increase threshold range is [10%, 50%], with a default of 20%; the error rate threshold range is [0.1%, 5%], with a default of 1%; and the resource utilization threshold range is [70%, 95%], with a default of 80%. The monitoring time window constraint is [1 minute, 30 minutes], with a continuous monitoring period of no less than 3 time windows. When any monitoring indicator exceeds the set threshold within 2 consecutive time windows, a rollback operation is automatically triggered to ensure system stability and service availability.
[0164] The following is a real-world application scenario of this invention: Risk assessment of security patch deployment on a large e-commerce platform. A large e-commerce platform needs to deploy a security patch involving an upgrade to the encryption algorithm of its payment module. This patch affects the core function of the payment service, PaymentEncrypt. The platform involves four independent organizations: PaymentCorp, OrderCorp, InventoryCorp, and RecommendCorp. Service call dependencies exist between these organizations, and it is necessary to assess the global cascading impact of the patch deployment while protecting the code privacy of each organization.
[0165] Step 100 Implementation Example:
[0166] PaymentCorp obtained patch change data and generated an initial dependency matrix. The patch involved changes to three core functions: PaymentEncrypt (payment encryption), TokenValidate (token verification), and LogAudit (audit log). See Table 1 for details.
[0167] Table 1: Initial Dependency Matrix (PaymentCorp local data)
[0168]
[0169] Among them, dependence strength Through formula The calculations show the following data regarding the number of calls:
[0170]
[0171] Data stream connection data:
[0172]
[0173] The calculation yielded:
[0174]
[0175] Step 200 Implementation Example:
[0176] Differential privacy processing is applied to code structure features, and the privacy budget is set to... As shown in Table 2:
[0177] Table 2: Feature Comparison Before and After Differential Privacy Processing
[0178]
[0179] Feature importance score calculation: For node degree distribution features:
[0180]
[0181] Allocate privacy budget:
[0182]
[0183] The final privacy-preserving feature fingerprint vector generated:
[0184] It includes three types of features: node degree distribution, clustering coefficient, and path length distribution, all processed with differential privacy.
[0185] Step 300 Implementation Example:
[0186] For feature fingerprint vector Dependency Matrix Homomorphic encryption is performed using the CKKS scheme, with a ring dimension. Multiplication depth As shown in Table 3:
[0187] Table 3: Results of Homomorphic Encryption Processing
[0188]
[0189] The generated cryptographic dependency graph ,
[0190] in:
[0191]
[0192] For encrypted node feature sets, This is the corresponding set of encrypted edge weights.
[0193] Step 400 Implementation Example:
[0194] Perform the graph propagation algorithm in the encrypted domain to calculate the propagation probability distribution of the patch's impact. Set the attenuation factor. Convergence threshold As shown in Table 4:
[0195] Table 4: Calculation Process of Ciphertext Domain Influence Propagation
[0196]
[0197] Convergence check of the ciphertext field during the 4th iteration The algorithm is valid, converges, and outputs the probability distribution of the propagation of the effects of encryption. The probability of the impact of the three functions, PaymentEncrypt, TokenValidate, and LogAudit, is calculated.
[0198] Step 500 Implementation Example:
[0199] The four organizations send their respective probabilities of cryptographic impact propagation to the aggregation server for secure multi-party aggregation. See Table 5:
[0200] Table 5: Probability and Weighting Coefficients of Encryption Impact of Various Organizations
[0201]
[0202] Calculate the global impact distribution in the ciphertext domain:
[0203]
[0204]
[0205] in This represents the homomorphic addition operation.
[0206] Calculating risk level scores in the ciphertext domain using Bayesian networks After decryption, we get It belongs to the medium risk level ( ).
[0207] Step 600 Implementation Example:
[0208] Risk level rating of encryption Security decryption is performed to obtain a plaintext risk level score. Based on this, phased patch deployment recommendations are generated, as shown in Table 6:
[0209] Table 6: Patch Deployment Sequence and Monitoring Configuration
[0210]
[0211] The monitoring time window is set to 5 minutes, with a continuous monitoring cycle of 4 windows. For PaymentCorp's high-risk deployments, a stricter monitoring strategy is adopted; any metric exceeding a threshold will immediately trigger an automatic rollback.
[0212] It is understood that data preprocessing methods known to those skilled in the art include data cleaning, data transformation, and data reduction. Data transformation includes type conversion and normalization and standardization. Although the dimensions and types of data were omitted in the description of the preceding embodiments, data preprocessing is a technical knowledge known to those skilled in the art and a prerequisite step in data processing. Therefore, the previously described well-known data preprocessing steps were not described independently.
[0213] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. A method for monitoring the operational status of a server cluster, characterized in that, Includes the following steps: Obtain patch change data from the local code repository, extract function call relationships and data flow dependency information through abstract syntax tree parsing, and generate an initial dependency matrix; Generating the initial dependency matrix includes: Retrieve patch change records from the local code repository, including a list of modified files, function signature changes, and line of code changes; perform abstract syntax tree parsing on the code files involved in the changes to extract function definition nodes, function call nodes, variable reference nodes, and control flow nodes; generate a dependency matrix based on the extracted dependency information, where the matrix elements represent the dependency strength between functions, and the dependency strength is calculated by weighting the number of function calls and the number of data flow connections; A differential privacy algorithm is used to add Laplacian noise to the code structure features extracted from the dependency matrix to generate a privacy-preserving feature fingerprint vector. Using differential privacy algorithms to process code structure features includes: The node degree distribution, clustering coefficient, and path length distribution are extracted from the dependency matrix as code structure features. A Laplacian mechanism is applied to each feature dimension to add calibration noise, with the noise scale parameter equal to the global sensitivity of the feature function divided by the privacy budget. An adaptive privacy budget allocation strategy is adopted, allocating a larger privacy budget to key features and a smaller privacy budget to non-key features. The noise-added features are combined into a privacy-preserving code feature fingerprint vector. Homomorphic encryption is performed on the feature fingerprint vector and dependency matrix to generate encrypted dependency graph data; The graph propagation algorithm is performed on the encryption dependency graph in the ciphertext domain. By iteratively calculating the propagation vector of the encryption influence, the probability distribution of the propagation of the encryption patch influence is obtained. Secure multi-party aggregation is performed to weight and sum the probabilities of the encrypted impact of each organization in the ciphertext domain to calculate the risk level of the global cascading impact; Generate patch deployment recommendations based on risk assessment results; The scaling parameter of the Laplace noise is determined based on the ratio of the global sensitivity of the feature function to the privacy budget.
2. The method for monitoring the operational status of a server cluster according to claim 1, characterized in that, Homomorphic encryption of feature data includes: Select a fully homomorphic encryption scheme that supports addition and multiplication operations, and generate a public-private key pair; perform homomorphic encryption on each element of the feature fingerprint vector and the dependency matrix to obtain the encrypted feature vector and the encrypted dependency matrix; organize the encrypted data into an encrypted dependency graph structure, including the encrypted node feature set and the encrypted edge weight set; The homomorphic encryption supports homomorphic operations on the ciphertext field, such that the result of homomorphic addition of two ciphertexts is equal to the encrypted result of adding the corresponding plaintexts, and the result of homomorphic multiplication of two ciphertexts is equal to the encrypted result of multiplying the corresponding plaintexts.
3. The method for monitoring the operational status of a server cluster according to claim 1, characterized in that, Graph propagation algorithms performed in the ciphertext domain include: Initialize the influence propagation vector on the encrypted dependency graph, setting the encrypted value of nodes directly affected by the patch to 1 and the encrypted value of other nodes to 0. Construct an encrypted state transition matrix, the elements of which are homomorphic products of the elements of the encrypted adjacency matrix and the encrypted values of the edge weights. Iteratively perform influence propagation calculations in the ciphertext domain. In each iteration, perform a homomorphic matrix multiplication operation between the normalized encrypted adjacency matrix and the current encrypted influence propagation vector, and then perform a homomorphic addition operation with the initial influence vector. Introduce an attenuation factor to simulate the attenuation of influence with propagation distance. The attenuation factor ranges from 0 to 1. Stop iterating when the convergence criterion of the ciphertext domain is less than the preset convergence threshold, and output the probability distribution of encrypted influence propagation.
4. The method for monitoring the operational status of a server cluster according to claim 1 or 3, characterized in that, The normalized adjacency matrix is obtained by multiplying the product of the degree matrix raised to the power of -2 and the dependency matrix, and then multiplying the product of the degree matrix raised to the power of -2.
5. The method for monitoring the operational status of a server cluster according to claim 1, characterized in that, Secure multi-party aggregation includes: Each organization sends its locally calculated probability of encrypted impact propagation to the aggregation server. The aggregation server calculates the global impact distribution in the encrypted domain by weighted summation of the probabilities of encrypted impact propagation for each organization, with the weight coefficients representing the relative importance of each organization. Based on a preset risk threshold, a risk level score is calculated in the encrypted domain. A Bayesian network is used to analyze the conditional probabilities of patch changes and service performance indicators in the encrypted domain, generating an impact score matrix. The Bayesian network includes patch change nodes, intermediate impact nodes, and performance indicator nodes, and data is transmitted between nodes through a conditional probability table.
6. The method for monitoring the operational status of a server cluster according to claim 5, characterized in that, Bayesian networks employ the expectation-maximization algorithm for parameter learning, optimize by minimizing the negative log-likelihood function as the loss function, use variational inference to approximate the posterior distribution, and continuously update network parameters based on new monitoring data.
7. The method for monitoring the operational status of a server cluster according to claim 1, characterized in that, Patch deployment recommendations generated based on risk assessment results include: The encrypted risk level score is securely decrypted to obtain the plaintext risk score. Based on the risk score and the preset deployment strategy rules, a phased patch deployment sequence is generated; Develop corresponding monitoring metrics and rollback trigger conditions for each deployment phase to form a complete deployment plan.
8. A system for monitoring the operational status of a server cluster, used to execute the method for monitoring the operational status of a server cluster as described in any one of claims 1-7, characterized in that, include: The code analysis module is used to obtain patch change data from the local code repository and generate an initial dependency matrix; The privacy protection module is used to process code structure features using differential privacy algorithms; The encryption module is used to perform homomorphic encryption on the feature data; The propagation computation module is used to execute graph propagation algorithms in the ciphertext domain; The aggregation module is used to perform secure multi-party aggregation calculations to assess global risks. The deployment recommendation module is used to generate patch deployment recommendations based on risk assessment results.