Causal structure discovery method and device based on expert knowledge correction

Through the causal structure discovery method based on expert knowledge correction, the autoencoder training and correction process is used to solve the accuracy problem of causal relationship discovery in QUIC protocol performance analysis, achieving higher causal graph accuracy and interpretability.

CN119808935AActive Publication Date: 2025-04-11TSINGHUA UNIVERSITY +1
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411713130.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-11
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The prior art lacks interpretability and accuracy in QUIC protocol performance analysis, and fails to effectively utilize expert knowledge, resulting in low accuracy of causal relationship discovery.

Method used

A causal structure discovery method based on expert knowledge correction is proposed. By obtaining the performance factor data set of the target protocol and the adjacency matrix obtained by expert knowledge, the preset autoencoder is trained to determine the target causal graph, and the expert knowledge is fully utilized to improve the accuracy of the causal graph.

Benefits of technology

By leveraging expert knowledge, the accuracy of causal structure discovery is significantly improved, the interpretability and accuracy of generating causal graphs are enhanced, and more effective theoretical guidance is provided to improve the performance of QUIC protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808935A_ABST
    Figure CN119808935A_ABST
Patent Text Reader

Abstract

The invention discloses a causal structure discovery method and device based on expert knowledge correction. The method comprises the following steps: determining a performance factor data set of a target protocol; obtaining an adjacent matrix of a target protocol obtained based on expert knowledge; and training a preset auto-encoder based on the performance factor data set and the adjacent matrix, and determining a target causal graph based on model parameters in the training process. The preset auto-encoder is trained based on the adjacency matrix and the performance factor data set of the target protocol obtained based on the expert knowledge, the target causal graph is determined based on the model parameters in the training process, the causal structure of the target protocol on the performance influence factors is obtained, the expert knowledge is fully utilized, and the accuracy of the performance influence factors is improved. And the causal graph generation accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of next generation Internet and artificial intelligence technology, and in particular to a causal structure discovery method and device based on expert knowledge correction. Background Art

[0002] The network protocol is the interactive language for data transmission on the Internet. Taking the QUIC protocol as an example, the QUIC protocol is a transport layer protocol based on the User Datagram Protocol implemented in user space, which aims to improve the speed and reliability of network connections. Among them, the performance of the QUIC protocol needs to be analyzed to ensure the speed and reliability of network connections. In addition, the performance of the QUIC protocol is affected by many independent factors such as network bandwidth, packet loss rate, and congestion window size.

[0003] At present, the performance analysis of the QUIC protocol mainly relies on experience-driven and manual analysis, or the use of traditional machine learning models. When relying on experience-driven and manual analysis, it may be necessary to rely entirely on expert knowledge, but the incompleteness of expert knowledge limits the depth and breadth of the analysis; when using traditional machine learning models for analysis, there is a lack of interpretability and limited accuracy. Therefore, the causal relationship between the performance influencing factors in the above QUIC protocol can be determined, thereby providing theoretical guidance for improving the performance of the QUIC protocol.

[0004] Among them, causal structure discovery refers to the establishment of a directed acyclic graph between observed variables to represent the causal relationship between variables through the analysis of observed data, so that causal reasoning can be performed based on causal structure discovery to improve the generalization and interpretability of intelligent algorithms. Specifically, a causal relationship is a relationship between variables. For two given variables, if changing one variable will change the other variable while keeping other mechanisms unchanged, the former is called the cause and the latter is called the effect. There may be complex causal relationships between multiple variables, forming a causal relationship network, which can be described by a directed acyclic graph, called a causal graph.

[0005] Furthermore, automatic causal structure discovery is an effective method for constructing causal graphs, which can automatically discover the causal relationship between variables based on the analysis of observed data when the causal relationship and correlation between variables are unclear. In the prior art, the causal structure discovery can be transformed into an optimization problem with the directed acyclicity of the generated graph as a constraint based on the gradient method, and the directed acyclicity constraint can be transformed into a continuous and differentiable constraint function, which can then be solved using the mainstream optimization solver. However, the above prior art does not take expert knowledge into account, resulting in low accuracy and possible reverse causality. Summary of the invention

[0006] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0007] To this end, an object of the present invention is to propose a causal structure discovery method based on expert knowledge correction, which can train a preset autoencoder based on the adjacency matrix and performance factor data set of the target protocol obtained based on expert knowledge, and determine the target causal graph based on the model parameters during the training process to obtain the causal structure of the target protocol in terms of performance influencing factors, thereby making full use of expert knowledge and improving the accuracy of generating causal graphs.

[0008] Another object of the present invention is to propose a causal structure discovery device based on expert knowledge correction.

[0009] To achieve the above object, an embodiment of the present invention proposes a causal structure discovery method based on expert knowledge correction, comprising:

[0010] Determine the performance factor data set of the target protocol;

[0011] Acquire an adjacency matrix of the target protocol based on expert knowledge;

[0012] A preset autoencoder is trained based on the performance factor dataset and the adjacency matrix, and a target causal graph is determined based on model parameters during the training process.

[0013] The causal structure discovery method based on expert knowledge correction in the embodiment of the present invention may also have the following additional technical features:

[0014] Furthermore, a performance factor data set of the target protocol is determined, including:

[0015] Get the modified source code of the target protocol;

[0016] Based on the modified source code of the target protocol, running the application based on the target protocol to obtain the corresponding protocol log;

[0017] Based on the protocol log, a performance factor data set of a target protocol is determined.

[0018] Further, determining the performance factor data set of the target protocol based on the protocol log includes:

[0019] Determine an initial array, wherein each row in the initial array represents the values ​​of all performance-related variables at a corresponding moment, and each performance-related variable is set with a corresponding update time variable and an update value;

[0020] Read the target protocol log line by line, extract a target line starting with a preset character string, and extract a timestamp, a target variable, and a variable value from the target line;

[0021] If the timestamp is greater than the global variable, the global variable is updated, and a new row is added to the initial array to add the updated value corresponding to the target variable performance-related variable. The loop is executed until the timestamp is less than or equal to the global variable, and the update time variable and update value of the target variable are updated.

[0022] Furthermore, the step of training a preset autoencoder based on the performance factor dataset and the adjacency matrix, and determining a target causal graph based on model parameters during the training process, includes:

[0023] Determining an initial causal graph of the preset autoencoder;

[0024] Based on the initial causal graph, determining a loss function of the preset autoencoder;

[0025] Inputting the data in the performance factor dataset into a preset autoencoder in batches to obtain output results of each batch of data;

[0026] Based on the output result of each batch of data and the loss function, determine the loss function value corresponding to each batch of data;

[0027] Based on the loss function value and the adjacency matrix, the parameters and hyperparameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge, and the above training process is repeated until the number of iterations of the parameters reaches a preset number, and the causal graph corresponding to the hyperparameter that maximizes the loss function value is determined as the target causal graph.

[0028] Furthermore, determining the loss function of the preset autoencoder based on the initial causal graph includes:

[0029] Based on the initial causal graph, determining a first objective function;

[0030] The first objective function is converted into a second objective function, and the loss function of the preset autoencoder is determined based on the second objective function.

[0031] Furthermore, the preset autoencoder includes a fully connected layer; the optimization algorithm based on the loss function value and corrected by soft expert knowledge is used to update the parameters and hyperparameters in the preset autoencoder, including:

[0032] Determining parameter change values ​​and adjacency matrix values ​​of any two variables in the fully connected layer based on the loss function value and the adjacency matrix;

[0033] Based on the parameter change value and the adjacency matrix value, the parameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge.

[0034] Furthermore, the updating of the parameters and hyperparameters in the preset autoencoder using an optimization algorithm corrected by soft expert knowledge based on the parameter change value and the adjacency matrix value includes:

[0035] If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is less than or equal to the second threshold, updating the parameters in the fully connected layer according to the first rule;

[0036] If the parameter change value is greater than a first threshold value, and the adjacency matrix value is greater than a second threshold value, updating the parameters in the fully connected layer according to a second rule;

[0037] If the parameter change value is greater than a first threshold value, and the adjacency matrix value is less than or equal to a second threshold value, updating the parameters in the fully connected layer according to a third rule;

[0038] If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is greater than the second threshold, updating the parameters in the fully connected layer according to the fourth rule;

[0039] Update the parameters of the remaining network layers in the preset autoencoder according to the fifth rule;

[0040] Update the hyperparameters in the preset autoencoder according to the sixth rule.

[0041] To achieve the above object, another embodiment of the present invention provides a causal structure discovery device based on expert knowledge correction, the device comprising:

[0042] A determination module, for determining a performance factor data set of a target protocol;

[0043] An acquisition module, used for acquiring an adjacency matrix of the target protocol based on expert knowledge;

[0044] A training module is used to train a preset autoencoder based on the performance factor data set and the adjacency matrix, and determine a target causal graph based on model parameters during the training process.

[0045] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0047] Figure 1 A flowchart of a causal structure discovery method based on expert knowledge correction according to an embodiment of the present invention;

[0048] Figure 2 Schematic diagram of the structure of a causal structure discovery device based on expert knowledge correction according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0050] The following describes a causal structure discovery method and device based on expert knowledge correction according to an embodiment of the present invention with reference to the accompanying drawings.

[0051] First, a causal structure discovery method based on expert knowledge correction proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0052] Figure 1 The flowchart of the causal structure discovery method based on expert knowledge correction according to one embodiment of the present invention.

[0053] like Figure 1 As shown, the causal structure discovery method based on expert knowledge correction includes the following steps:

[0054] Step S1, determining a performance factor data set of a target protocol;

[0055] It should be noted that, in an embodiment of the present invention, the target protocol may be any network protocol, which is not limited in the embodiment of the present invention. For example, the target protocol may be the QUIC protocol.

[0056] In one embodiment of the present invention, the source code of the target protocol may be modified, and then the performance factor data set of the target protocol may be determined based on the modified source code.

[0057] Specifically, in one embodiment of the present invention, the method for determining the performance factor data set of the target protocol may include the following steps:

[0058] Step S11, obtaining the modified source code of the target protocol;

[0059] Step S12, based on the source code modified by the target protocol, running the application based on the QUIC protocol to obtain the corresponding protocol log;

[0060] Step S13: determining a performance factor data set of the target protocol based on the protocol log.

[0061] In one embodiment of the present invention, in the source code of the target protocol, a print log code is added after the code line that changes the value of the performance-related variable. Record performance-related variables in the log in the format of i At time t, the value is Each record occupies one line.

[0062] In one embodiment of the present invention, a method for determining a performance factor data set of a target protocol based on a protocol log may include the following steps:

[0063] Step S131, determining an initial array, wherein each row in the initial array represents the values ​​of all performance-related variables at a corresponding moment, and each performance-related variable is set with a corresponding update time variable and an update value;

[0064] Step S132, reading the target protocol log line by line, extracting the target line starting with a preset character string, and extracting the timestamp, target variable and variable value from the target line;

[0065] Step S133, if the timestamp is greater than the global variable, update the global variable, and add a new row in the initial array to add the update value corresponding to the target variable performance-related variable, and execute the loop until the timestamp is less than or equal to the global variable, and update the update time variable and update value of the target variable.

[0066] Among them, in one embodiment of the present invention, a variable length initial array can be used The performance influencing factor data is recorded at a specified time granularity g. Each row in the initial array represents the value of all performance-related variables at the corresponding moment, for example The sth row of records the values ​​of all performance variables at time s·g.

[0067] And, in one embodiment of the present invention, the target protocol log is read line by line, the target line starting with a preset string is extracted, and the timestamp t and the target variable x are extracted. i and variable values Among them, the preset string can be "CHANGE" in the above-mentioned modified source code, and a global variable record_time is set, initialized to 0, and the update time variable last_update_time and update value last_value of the temporary variable are set for each performance-related variable. Last_update_time is initialized to 0, and last_value is initialized to the default value of each variable in the initial state, which can be determined by checking the protocol source code and configuration file.

[0068] Further, in one embodiment of the present invention, if the timestamp t>record_time, then update the global variable record_time←record_time+g, and in the initial array Add a new line to add the updated values ​​of the performance-related variables corresponding to the target variable, where the value of the jth item is the variable x j The last_value value of the loop is executed until the timestamp t≤record_time, and the target variable x is updated i The update time variable last_update_time is t, and the update value last_value is

[0069] Step S2, obtaining an adjacency matrix of the target protocol based on expert knowledge;

[0070] In one embodiment of the present invention, the adjacency matrix can quantify the confidence of expert knowledge in the existence of causal relationships. Specifically, in one embodiment of the present invention, for an object with d observed variables, the expert knowledge can be represented as a d×d adjacency matrix K, where K ij (i,j≤d) represents the confidence of expert knowledge that there is a direct causal relationship between the i-th variable and the j-th variable, K ij =1 means that the expert believes that there must be a direct causal relationship between the i-th variable and the j-th variable; K ij =0 means that the expert believes that there is no causal relationship between the i-th variable and the j-th variable. The above two categories are "hard expert knowledge", that is, the expert knowledge definitely believes that there is or is not a causal relationship between the two variables; K ij ∈(0,1) indicates that the degree of certainty of the expert knowledge that there is a causal relationship between the i-th variable and the j-th variable is K ij , such cases are “soft expert knowledge”. And, if K ij =0.5 means that expert knowledge cannot determine whether there is a causal relationship between the i-th variable and the j-th variable. It should be noted that in one embodiment of the present invention, the statement "there is a causal relationship between the i-th variable and the j-th variable" is directional, the i-th variable is the "cause" and the j-th variable is the "effect".

[0071] Step S3, training the preset autoencoder based on the performance factor data set and the adjacency matrix, and determining the target causal graph based on the model parameters during the training process.

[0072] In one embodiment of the present invention, after obtaining the performance factor dataset and the adjacency matrix through the above steps, the preset autoencoder can be trained based on the performance factor dataset and the adjacency matrix, and the target causal graph can be determined based on the model parameters during the training process.

[0073] Specifically, in one embodiment of the present invention, the method for training a preset autoencoder based on a performance factor dataset and an adjacency matrix, and determining a target causal graph based on model parameters during the training process may include the following steps:

[0074] Step S31, determining an initial causal graph of a preset autoencoder;

[0075] Step S32, determining a loss function of a preset autoencoder based on the initial causal graph;

[0076] Step S33, inputting the data in the performance factor data set into a preset autoencoder in batches to obtain an output result of each batch of data;

[0077] Step S34, determining the loss function value corresponding to each batch of data based on the output result of each batch of data and the loss function;

[0078] Step S35, based on the loss function value and the adjacency matrix, use the optimization algorithm corrected by soft expert knowledge to update the parameters and hyperparameters in the preset autoencoder, repeat the above training process until the number of iterations of the parameters reaches the preset number, and then determine the causal graph corresponding to the hyperparameter that maximizes the loss function value as the target causal graph.

[0079] Among them, in one embodiment of the present invention, the input of the above-mentioned preset autoencoder can be multi-dimensional data in the performance factor data set, and the output data has the same dimension as the input data. For example, assuming that the input dimension of the preset autoencoder is d, the output dimension is d, and the first layer of the preset autoencoder can be a fully connected layer. Other layers can use any type of neural network. Activation functions can be used between layers to increase the degree of nonlinearity of the model. The specific network and activation function type depends on the specific application scenario and data type. Among them, the input dimension and output dimension of the fully connected layer can be the same or different. For example, assuming that the input dimension of the fully connected layer is d, and the output dimension is d×m, where m is a positive integer, the parameters of the preset autoencoder can be expressed as a matrix A of (d·m)×d. (1) .

[0080] And, in one embodiment of the present invention, a random initialization method can be used in the preset autoencoder to initialize parameters: for the parameter matrix A of the first layer (l) (l>1), its elements have a mean of 0 and a variance of Gaussian distribution, where n l-1 is the number of parameters in the l-1th layer; the parameters in the first layer are initialized to a random real number matrix that obeys the standard normal distribution.

[0081] Further, in one embodiment of the present invention, the initial causal graph of the preset autoencoder may be determined by artificial experience, wherein the initial causal graph contained in the preset autoencoder may be W, and the element of the i-th row and j-th column thereof is defined as:

[0082]

[0083] Where σ is the edge activation threshold, W ij ′ It is expressed as:

[0084]

[0085] Among them, A (1) (d·j+t)i Represents the matrix A (1) The element in the d·j+tth row and the i-th column.

[0086] Further, in one embodiment of the present invention, the method for determining the loss function of the preset autoencoder based on the initial causal graph may include the following steps:

[0087] Step S321, determining a first objective function based on the initial causal graph;

[0088] Step S322: convert the first objective function into a second objective function, and determine the second objective function as the loss function of the preset autoencoder.

[0089] In one embodiment of the present invention, based on the initial causal graph, a first objective function with a nonlinear equality constraint may be determined:

[0090]

[0091] subject to h(W)=0

[0092] Among them, h(W) is the constraint function that characterizes directed acyclicity:

[0093]

[0094] Here, operator ° is the Hadamard multiplication of the matrix and tr(·) is the rank of the matrix.

[0095] And, in one embodiment of the present invention, the first objective function F(W) may be expanded as follows:

[0096] F(W)=SSE+λ‖W‖1+p(θ)

[0097] Among them, SS is the sum of squares of the error between the decoding result and the original data:

[0098]

[0099] Among them, ‖W‖1 is the l1 norm of W, θ represents the autoencoder model parameters, λ is the regularization coefficient, and f refers to the mapping represented by the autoencoder model. p(θ) is the penalty term for violating the hard expert knowledge constraint:

[0100]

[0101] Among them, γ is a sufficiently large penalty coefficient.

[0102] And, in one embodiment of the present invention, it is impossible to use a neural network to solve the constrained optimization problem. Based on this, the augmented Lagrangian method can be used to convert the above first objective function into solving the following second objective function:

[0103]

[0104] After the second objective function is obtained through the above steps, the loss function of the neural network can be set based on the second objective function. for:

[0105]

[0106] Among them, ρ is the penalty coefficient of the constraint function, and α is the hyperparameter of the loss function.

[0107] Furthermore, in one embodiment of the present invention, after the loss function is obtained through the above steps, the data in the performance factor data set can be input into the preset autoencoder in batches to obtain the output results of each batch of data. Specifically, assuming that the training round is n_epoch, the data in the performance factor data set is input into the preset autoencoder in multiple batches in each round of training, and the size of each batch of data is batch_size. And, for each batch of data, the autoencoder output of the batch of data is obtained through the preset autoencoder, and the loss function value corresponding to the batch of data is calculated using the above loss function.

[0108] Furthermore, in one embodiment of the present invention, after obtaining the loss function value corresponding to each batch of data through the above steps, the parameters and hyperparameters in the preset autoencoder can be updated based on the loss function value and the adjacency matrix using an optimization algorithm corrected by soft expert knowledge, and the above training process is repeated until the number of iterations of the parameters reaches a preset number, and the causal graph corresponding to the hyperparameter that maximizes the loss function value is determined as the target causal graph.

[0109] Among them, in one embodiment of the present invention, the optimization algorithm for soft expert knowledge correction can be that if the current gradient descent direction makes the changing trend of the causal relationship between variables in the causal graph contained in the neural network opposite to the causal relationship that the expert knowledge tends to believe, the step size of this update should be reduced, otherwise the step size of this update should be increased; and the more confident the expert knowledge is in the causal relationship it tends to believe, the larger the update step size in that direction should be, and the smaller the update step size away from that direction should be; and the farther the causal relationship between variables in the current causal graph deviates from the causal relationship that the expert knowledge tends to believe, the larger the step size should be when updating in the direction suggested by the expert knowledge, and the smaller the step size should be when updating away from that direction.

[0110] Specifically, in one embodiment of the present invention, the method for updating the parameters and hyperparameters in the preset autoencoder based on the loss function value and the optimization algorithm corrected by soft expert knowledge may include the following steps:

[0111] Step 1: Based on the loss function value and the adjacency matrix, determine the parameter change value and adjacency matrix value of any two variables in the fully connected layer;

[0112] Step 2: Based on the parameter change value and the adjacency matrix value, the parameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge.

[0113] In one embodiment of the present invention, the parameters of the first fully connected layer in the autoencoder are preset to be A (1) (m·j+t)i , then the parameter change values ​​of variables i and j in any two variables are

[0114] And, in one embodiment of the present invention, based on the parameter change value and the adjacency matrix value, the method of updating the parameters in the preset autoencoder using the optimization algorithm corrected by soft expert knowledge may include the following steps:

[0115] Step a: If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is less than or equal to the second threshold, update the parameters in the fully connected layer according to the first rule;

[0116] Step b: if the parameter change value is greater than the first threshold value, and the adjacency matrix value is greater than the second threshold value, updating the parameters in the fully connected layer according to the second rule;

[0117] Step c: if the parameter change value is greater than the first threshold and the adjacency matrix value is less than or equal to the second threshold, update the parameters in the fully connected layer according to the third rule;

[0118] Step d: If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is greater than the second threshold, then update the parameters in the fully connected layer according to the fourth rule;

[0119] Step e: updating the parameters of the remaining network layers in the preset autoencoder according to the fifth rule;

[0120] Step f: Update the hyperparameters in the preset autoencoder according to the sixth rule.

[0121] In one embodiment of the present invention, the first threshold and the second threshold can be set as needed. For example, the first threshold is 0 and the second threshold is 0.5.

[0122] And, in one embodiment of the present invention, if the parameter change value Δ ij ≤0, and the adjacency matrix value and K ij ≤0.5, indicating that expert knowledge tends to believe that there is no causal relationship between variable i and variable j, and the update direction is consistent with the direction recommended by expert knowledge. ij K reflects the degree of deviation between the current causal diagram and the causal relationship that expert knowledge tends to believe. ij Reflecting the support degree of expert knowledge for updating in the direction of reducing the causal relationship between variable i and variable j, the parameters in the fully connected layer are updated according to the first rule, where the first rule is:

[0123]

[0124] Among them, lr is the set learning rate, express A (1) (m·j+t)i Find the partial derivative.

[0125] In one embodiment of the present invention, if the parameter change value Δ ij >0, and the adjacency matrix value K ij >0.5, indicating that expert knowledge tends to believe that there is a causal relationship between variable i and variable j, and the update direction is opposite to the direction recommended by expert knowledge, 1-W ij Reflects the degree of deviation between the current causal graph and the causal relationship that expert knowledge tends to believe, 1-K ij Reflecting the support degree of expert knowledge for updating in the direction of reducing the causal relationship between variable i and variable j, the parameters in the fully connected layer are updated according to the second rule, where the second rule is:

[0126]

[0127] In one embodiment of the present invention, if the parameter change value Δ ij >0, and the adjacency matrix value K ij≤0.5, then update the parameters in the fully connected layer according to the third rule, where the third rule is:

[0128]

[0129] In one embodiment of the present invention, if the parameter change value Δ ij ≤0, and the adjacency matrix value K ij >0.5, then update the parameters in the fully connected layer according to the fourth rule, where the fourth rule is:

[0130]

[0131] In one embodiment of the present invention, the parameters in the remaining network layers in the preset autoencoder are updated according to the fifth rule, wherein the fifth rule is:

[0132]

[0133] In one embodiment of the present invention, the hyperparameters in the preset autoencoder are updated according to the sixth rule, wherein the sixth rule is:

[0134]

[0135] Furthermore, in one embodiment of the present invention, the above optimization algorithm uses soft expert knowledge to adjust the iterative step size, which can guide the optimization process to proceed in the direction suggested by the soft expert knowledge as much as possible, thereby improving the rate of discovering the causal graph. Moreover, in the case where there are multiple local optimal solutions to the objective function, the above process can also guide the optimization process to find the optimal solution that conforms to the laws of the real world, thereby improving the accuracy of discovering the causal graph.

[0136] Furthermore, in one embodiment of the present invention, the above training steps S33 to S35 may be repeated until the number of iterations of the parameters reaches a preset number, and the causal graph corresponding to the hyperparameter that maximizes the loss function value is determined as the target causal graph.

[0137] In one embodiment of the present invention, the above-mentioned causal structure discovery method based on expert knowledge correction records the runtime data of performance-related factors with less overhead and constructs a causal reasoning data set that retains data distribution information, and cleverly introduces hard expert knowledge and soft expert knowledge into the loss function and optimization algorithm respectively, thereby improving the accuracy and execution speed of automatic causal structure discovery, and efficiently realizing the causal structure discovery of factors affecting the performance of the target protocol, providing theoretical guidance for further improving the performance of the target protocol. Among them, by recording data only when the variable value changes, it is possible to minimize the data recording overhead while retaining the data distribution information with high precision; by introducing hard expert knowledge into the loss function, the generated causal graph is effectively constrained not to violate the existing knowledge, and the information contained in the expert knowledge is learned during the training process of the autoencoder; by introducing soft expert knowledge into the optimization algorithm, the loss function is effectively guided to decrease in the direction suggested by the expert knowledge, increasing the possibility of obtaining the optimal solution in the area recognized by the expert knowledge, thereby improving the accuracy of the generated causal graph, and accelerating the speed at which the algorithm converges to the optimal solution in the area.

[0138] According to the causal structure discovery method based on expert knowledge correction proposed in an embodiment of the present invention, the preset autoencoder can be trained based on the adjacency matrix and performance factor data set of the target protocol obtained based on expert knowledge, and the target causal graph is determined based on the model parameters during the training process to obtain the causal structure of the target protocol in terms of performance influencing factors, thereby making full use of expert knowledge and improving the accuracy of generating causal graphs.

[0139] Next, a causal structure discovery device based on expert knowledge correction proposed in accordance with an embodiment of the present invention will be described with reference to the accompanying drawings.

[0140] Figure 2 Schematic diagram of the structure of a causal structure discovery device based on expert knowledge correction according to an embodiment of the present invention.

[0141] like Figure 2 As shown, the causal structure discovery device 10 based on expert knowledge correction includes: a determination module 201, an acquisition module 202 and a training module 203, wherein

[0142] A determination module 201, used to determine a performance factor data set of a target protocol;

[0143] An acquisition module 202, used to acquire an adjacency matrix of a target protocol based on expert knowledge;

[0144] The training module 203 is used to train the preset autoencoder based on the performance factor data set and the adjacency matrix, and determine the target causal graph based on the model parameters during the training process.

[0145] Furthermore, the determination module 201 is specifically configured to:

[0146] Get the modified source code of the target protocol;

[0147] Based on the modified source code of the target protocol, run the application based on the target protocol and obtain the corresponding protocol log;

[0148] Based on the protocol log, determine the performance factor dataset of the target protocol.

[0149] Furthermore, the determination module 201 is further configured to:

[0150] Determine an initial array, wherein each row in the initial array represents the values ​​of all performance-related variables at a corresponding moment, and each performance-related variable is set with a corresponding update time variable and an update value;

[0151] Read the target protocol log line by line, extract the target line starting with a preset string, and extract the timestamp, target variable, and variable value from the target line;

[0152] If the timestamp is greater than the global variable, the global variable is updated, and a new row is added to the initial array to add the updated value corresponding to the performance-related variable of the target variable. The loop is executed until the timestamp is less than or equal to the global variable, and the update time variable and update value of the target variable are updated.

[0153] Furthermore, the training module 203 is specifically used for:

[0154] Determine an initial causal graph of a preset autoencoder;

[0155] Based on the initial causal graph, determine the loss function of the preset autoencoder;

[0156] Input the data in the performance factor dataset into the preset autoencoder in batches to obtain the output result of each batch of data;

[0157] Based on the output results and loss function of each batch of data, determine the loss function value corresponding to each batch of data;

[0158] Based on the loss function value and the adjacency matrix, the optimization algorithm corrected by soft expert knowledge is used to update the parameters and hyperparameters in the preset autoencoder. The above training process is repeated until the number of iterations of the parameters reaches the preset number. The causal graph corresponding to the hyperparameter that maximizes the loss function value is determined as the target causal graph.

[0159] Furthermore, the training module 203 is specifically used for:

[0160] Based on the initial causal graph, determining a first objective function;

[0161] The first objective function is converted into a second objective function, and a loss function of the preset autoencoder is determined based on the second objective function.

[0162] Furthermore, the training module 203 is also used for:

[0163] Based on the loss function value and the adjacency matrix, determine the parameter change value and adjacency matrix value of any two variables in the fully connected layer;

[0164] Based on the parameter change values ​​and the adjacency matrix values, the parameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge.

[0165] Furthermore, the training module 203 is also used for:

[0166] If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is less than or equal to the second threshold, then update the parameters in the fully connected layer according to the first rule;

[0167] If the parameter change value is greater than the first threshold and the adjacency matrix value is greater than the second threshold, the parameters in the fully connected layer are updated according to the second rule;

[0168] If the parameter change value is greater than the first threshold and the adjacency matrix value is less than or equal to the second threshold, the parameters in the fully connected layer are updated according to the third rule;

[0169] If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is greater than the second threshold, then update the parameters in the fully connected layer according to the fourth rule;

[0170] Update the parameters of the remaining network layers in the preset autoencoder according to the fifth rule;

[0171] Update the hyperparameters in the preset autoencoder according to the sixth rule.

[0172] According to the causal structure discovery device based on expert knowledge correction proposed in an embodiment of the present invention, the preset autoencoder can be trained based on the adjacency matrix and performance factor data set of the target protocol obtained based on expert knowledge, and the target causal graph can be determined based on the model parameters in the training process to obtain the causal structure of the target protocol in terms of performance influencing factors, thereby making full use of expert knowledge and improving the accuracy of generating causal graphs.

[0173] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0174] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0175] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A causal structure discovery method based on expert knowledge correction, characterized in that: The method comprises: Determine the performance factor data set of the target protocol; Acquire an adjacency matrix of the target protocol based on expert knowledge; A preset autoencoder is trained based on the performance factor dataset and the adjacency matrix, and a target causal graph is determined based on model parameters during the training process.

2. The method according to claim 1, characterized in that The performance factor data set for determining the target protocol includes: Get the modified source code of the target protocol; Based on the modified source code of the target protocol, running the application based on the target protocol to obtain the corresponding protocol log; Based on the protocol log, a performance factor data set of a target protocol is determined.

3. The method according to claim 2, characterized in that The step of determining a performance factor data set of a target protocol based on the protocol log includes: Determine an initial array, wherein each row in the initial array represents the values ​​of all performance-related variables at a corresponding moment, and each performance-related variable is set with a corresponding update time variable and an update value; Read the target protocol log line by line, extract a target line starting with a preset character string, and extract a timestamp, a target variable, and a variable value from the target line; If the timestamp is greater than the global variable, the global variable is updated, and a new row is added to the initial array to add the updated value corresponding to the performance-related variable of the target variable. The loop is executed until the timestamp is less than or equal to the global variable, and the update time variable and update value of the target variable are updated.

4. The method according to claim 1, characterized in that: The step of training a preset autoencoder based on the performance factor dataset and the adjacency matrix, and determining a target causal graph based on model parameters, includes: Determining an initial causal graph of the preset autoencoder; Based on the initial causal graph, determining a loss function of the preset autoencoder; Inputting the data in the performance factor dataset into a preset autoencoder in batches to obtain output results of each batch of data; Based on the output result of each batch of data and the loss function, determine the loss function value corresponding to each batch of data; Based on the loss function value and the adjacency matrix, the parameters and hyperparameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge, and the above training process is repeated until the number of iterations of the parameters reaches a preset number, and the causal graph corresponding to the hyperparameter that maximizes the loss function value is determined as the target causal graph.

5. The method according to claim 4, characterized in that The step of determining the loss function of the preset autoencoder based on the initial causal graph includes: Based on the initial causal graph, determining a first objective function; The first objective function is converted into a second objective function, and the loss function of the preset autoencoder is determined based on the second objective function.

6. The method according to claim 4, characterized in that The preset autoencoder includes a fully connected layer; the optimization algorithm based on the loss function value and the adjacency matrix and corrected by soft expert knowledge is used to update the parameters and hyperparameters in the preset autoencoder, including: Determining parameter change values ​​and adjacency matrix values ​​of any two variables in the fully connected layer based on the loss function value and the adjacency matrix; Based on the parameter change value and the adjacency matrix value, the parameters in the preset autoencoder are updated using an optimization algorithm corrected by soft expert knowledge.

7. The method according to claim 5, characterized in that The method of updating the parameters and hyperparameters in the preset autoencoder based on the parameter change value and the adjacency matrix value by using the optimization algorithm corrected by soft expert knowledge includes: If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is less than or equal to the second threshold, updating the parameters in the fully connected layer according to the first rule; If the parameter change value is greater than a first threshold value, and the adjacency matrix value is greater than a second threshold value, updating the parameters in the fully connected layer according to a second rule; If the parameter change value is greater than a first threshold value, and the adjacency matrix value is less than or equal to a second threshold value, updating the parameters in the fully connected layer according to a third rule; If the parameter change value is less than or equal to the first threshold, and the adjacency matrix value is greater than the second threshold, updating the parameters in the fully connected layer according to the fourth rule; Update the parameters of the remaining network layers in the preset autoencoder according to the fifth rule; Update the hyperparameters in the preset autoencoder according to the sixth rule.

8. A causal structure discovery device based on expert knowledge correction, characterized in that: The device comprises: A determination module, for determining a performance factor data set of a target protocol; An acquisition module, used for acquiring an adjacency matrix of the target protocol based on expert knowledge; A training module is used to train a preset autoencoder based on the performance factor data set and the adjacency matrix, and determine a target causal graph based on model parameters during the training process.

9. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Unknown network protocol classification method based on small sample learning

    CN116405419A

  • Wireless communication network optimization method based on knowledge graph causal effect estimation

    CN116896754A

  • Root cause positioning model training method and root cause positioning method and device

    CN117061330A

  • Root cause alarm positioning method and system for communication network alarm data

    CN118158071A

  • Knowledge element learning-based multi-language event causal relationship identification method and system

    CN118333057A