Node state combined local cache resource optimization method and system
By comprehensively considering the multi-dimensional state indicators of nodes, calculating the target cache value and generating local cache decision parameters, the problem of unreasonable resource allocation in the existing technology is solved, and the efficiency and security of the distributed network are improved.
Patent Information
- Application Number
- CN202510819917.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-19
AI Technical Summary
The existing local cache resource management method fails to fully consider the multi-dimensional state of the node, resulting in unreasonable resource allocation, affecting the node's operating efficiency and security, and failing to optimize network bandwidth and transmission costs.
By obtaining the node's resource usage status, security level, anti-destructive performance and transmission cost indicators, the target cache value is calculated, and the local cache decision parameters are generated based on dynamic adjustment factors, and the cache resource distribution is adjusted to achieve collaborative operation.
It improves node resource utilization and security, reduces network bandwidth waste and resource transmission delay, and enhances the overall performance and damage resistance of distributed networks.
Smart Images

Figure CN120343045A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud storage optimization, and more particularly, to a method and system for optimizing local cache resources in combination with node states. Background Art
[0002] In the existing distributed network environment, the management and optimization of local cache resources have always been a challenging issue. Traditional local cache resource management methods often only consider a single factor, such as the storage capacity of nodes or the access frequency of resources. These methods do not comprehensively consider the states of nodes in multiple dimensions, such as resource usage, security guarantee, anti-destruction performance, and resource transmission cost.
[0003] Due to the lack of consideration of the multi-dimensional states of nodes, there is irrationality in the allocation of cache resources. For example, resources may be cached to nodes where resource usage is already approaching saturation, which not only affects the normal operation of the nodes but also may lead to low resource access efficiency. At the same time, without considering the security level and anti-destruction performance of nodes, the cached resources face higher security risks and the possibility of being damaged. In addition, without considering the resource transmission cost, it will cause waste of network bandwidth and an increase in resource transmission delay. Therefore, there is an urgent need for a method to optimize local cache resources in combination with the multi-dimensional states of nodes. Summary of the Invention
[0004] In view of the above-mentioned problems, in combination with the first aspect of the present invention, embodiments of the present invention provide a method for optimizing local cache resources in combination with node states, the method comprising: Obtaining a set of state indicators of multiple nodes in a distributed network, the set of state indicators including node resource usage state indicators, node security level indicators, node anti-destruction performance indicators, and resource transmission cost indicators; Calculating the target cache value of the current node for the target information resource according to the set of state indicators, wherein the target cache value is positively correlated with the node resource usage state indicator and the node security level indicator, and negatively correlated with the resource transmission cost indicator; Performing real-time correction on the target cache value based on a preset dynamic adjustment factor to generate local cache decision parameters matching the current node; If the local cache decision parameter exceeds a preset node cache trigger threshold, storing the target information resource in the local cache space of the current node and generating a cache resource distribution update instruction; Adjusting the cache synchronization strategy of adjacent nodes in the distributed network according to the cache resource distribution update instruction, so that the adjacent nodes perform cache resource cooperation operations based on the adjusted cache synchronization strategy.
[0005] In another aspect, an embodiment of the present invention further provides a local cache resource optimization system combined with node states, including a processor and a machine-readable storage medium. The machine-readable storage medium is connected to the processor. The machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.
[0006] Based on the above aspects, by comprehensively considering multi-dimensional state indicators such as the resource usage status, security level, anti-destruction performance, and resource transmission cost of nodes in a distributed network, calculating the target cache value and making real-time corrections, the embodiment of the present invention can generate more reasonable local cache decision parameters, enabling a more comprehensive evaluation of the comprehensive state of nodes when making cache resource storage decisions, avoiding caching resources to unsuitable nodes, effectively improving the utilization rate and security of node resources. At the same time, based on the cache resource distribution update instruction, the cache synchronization strategy of adjacent nodes is adjusted to achieve collaborative operation of cache resources, reducing waste of network bandwidth and resource transmission delay, improving the resource access efficiency and stability of the entire distributed network, and enhancing the overall performance and anti-destruction ability of the distributed network. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 is a schematic flowchart of the execution process of the local cache resource optimization method combined with node states provided by an embodiment of the present invention.
[0008] Figure 2 is a schematic diagram of exemplary hardware and software components of the local cache resource optimization system combined with node states provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0009] The present invention will be specifically described below with reference to the accompanying drawings of the specification. Figure 1 is a schematic flowchart of the local cache resource optimization method combined with node states provided by an embodiment of the present invention. The local cache resource optimization method combined with node states will be introduced in detail below.
[0010] Step S110: Obtain a set of state indicators of multiple nodes in the distributed network. The set of state indicators includes node resource usage state indicators, node security level indicators, node anti-destruction performance indicators, and resource transmission cost indicators.
[0011] In a distributed network environment, to optimize local cache resources, the first step is to obtain a set of state indicators of multiple nodes because the state indicators of different nodes will affect the cache decision of target information resources. Obtaining these indicators comprehensively and accurately helps to achieve more efficient and reasonable cache resource allocation in the subsequent process. The specific process of obtaining each indicator will be elaborated in detail below.
[0012] Step S111: Traverse the real-time operation log data of all nodes in the distributed network, extract the resource access frequency and the proportion of resource storage capacity occupied by the node within a preset time window, and perform normalization processing on the resource access frequency and the proportion of resource storage capacity occupied to obtain the node resource usage status indicator.
[0013] First, it is necessary to traverse the real-time operation log data of each node in the distributed network. The real-time operation log records various operation and event information during the node's operation and is an important data source for obtaining the node's resource usage. The setting of the preset time window is a time period determined according to the operation characteristics of the network and the requirements of cache optimization. For example, for some networks with frequent updates and high requirements for data timeliness, the preset time window can be set shorter; while for relatively stable networks with slower data changes, the preset time window can be appropriately extended.
[0014] Within the preset time window, extract the resource access frequency and the proportion of resource storage capacity occupied. The resource access frequency refers to the number of times the node is accessed within this time window. This value can be obtained by counting the number of access requests recorded in the log. Assuming that within the preset time window T, the number of times the node is accessed is N, then the resource access frequency F = N / T. The proportion of resource storage capacity occupied refers to the proportion of the used storage capacity of the node to the total storage capacity. By obtaining the storage system information of the node, the used storage capacity U and the total storage capacity C can be obtained, so the proportion of resource storage capacity occupied R = U / C.
[0015] Since the dimensions and value ranges of the resource access frequency and the proportion of resource storage capacity occupied may be different, in order to facilitate subsequent calculations and comparisons, it is necessary to perform normalization processing on them. The purpose of normalization processing is to map different data to a unified interval, usually the [0, 1] interval. For the resource access frequency F, assuming its maximum value is F_max and its minimum value is F_min, then the normalized resource access frequency F_norm = (F - F_min) / (F_max - F_min). For the proportion of resource storage capacity occupied R, since its value range is already between [0, 1], additional normalization processing may not be required, but if it needs to be compared with other indicators under the same standard, a similar normalization method can also be used. Finally, combine the normalized resource access frequency F_norm and the proportion of resource storage capacity occupied R to form the node resource usage status indicator S_usage. For example, a weighted average method can be used, S_usage = α * F_norm + (1 - α) * R, where α is a weight coefficient and is adjusted according to the actual situation.
[0016] Step S112: Call the node security audit interface to obtain the historical security event record set of the node, perform feature encoding on the security threat type in the historical security event record set, generate a security threat encoding vector, input the security threat encoding vector into a pre-trained security scoring model, and output the node security level index.
[0017] In order to evaluate the security level of the node, the node's security audit interface is needed. The security audit interface is an interface in the node system specifically used to record and query security-related information. By calling this interface, you can obtain a collection of historical security event records of the node, which contains detailed information on various security threats encountered by the node in the past period of time, such as attack time, attack type, attack source, etc.
[0018] Characteristic encoding of security threat types in the historical security event record set is the process of converting different types of security threats into vector forms that can be processed by computers. There are many types of security threats, such as network attacks (including DDoS attacks, SQL injection attacks, etc.), data leaks, malware infections, etc. In order to encode these types, we must first establish a dictionary of security threat types and correspond each security threat type to a unique code. For example, DDoS attacks are coded as 001, SQL injection attacks are coded as 002, and so on. Then, the number of times each security threat type appears in the historical security event record set is counted, and these times are arranged in the order of coding to form a security threat coding vector V.
[0019] The generated security threat encoding vector V is input into the pre-trained security scoring model. The pre-trained security scoring model is trained based on a large amount of security data, and it can learn the mapping relationship between the security threat encoding vector and the node security level. The structure of the model can adopt a multi-layer perceptron (MLP), which includes an input layer, a hidden layer, and an output layer. The number of neurons in the input layer is the same as the dimension of the security threat encoding vector. There can be multiple hidden layers, each of which contains a certain number of neurons. The output layer has only one neuron, and the output value is the node security level indicator S_security. During the training process, a large number of security threat encoding vectors with security level labels are used as training data, and the parameters of the model are continuously adjusted through the back-propagation algorithm to make the output of the model as close to the real security level label as possible.
[0020] Step S113: monitor the hardware redundancy configuration data and network topology connection strength data of the node, calculate the node device replacement rate according to the hardware redundancy configuration data, construct an anti-destruction performance evaluation function in combination with the network topology connection strength data, and generate the node anti-destruction performance index through the anti-destruction performance evaluation function.
[0021] The anti-destruction performance of nodes is crucial for the stability of distributed networks, so it is necessary to accurately evaluate it. First, it is necessary to monitor the hardware redundancy configuration data and network topology connection strength data of nodes. The hardware redundancy configuration data includes information such as the quantity, type, and availability of spare hardware devices equipped by nodes. The network topology connection strength data reflects the connection tightness of nodes in the network topology structure, such as the number of connections with other nodes and the bandwidth of connections.
[0022] Calculate the node device replacement rate according to the hardware redundancy configuration data. The node device replacement rate refers to the probability of being able to replace a certain hardware device of a node in a timely manner when the hardware device fails. Assume that the node has n types of hardware devices, and the spare quantities of each type of hardware device are s_1, s_2, …, s_n respectively, and the failure rates of each type of hardware device are f_1, f_2, …, f_n respectively. Then for the i-th type of hardware device, its device replacement rate r_i can be calculated by the formula r_i = s_i / (s_i + f_i). Then, the device replacement rates of all hardware devices are weighted and averaged to obtain the node device replacement rate R_replace, and the weights can be determined according to the importance of hardware devices.
[0023] Construct an anti-destruction performance evaluation function in combination with the network topology connection strength data. The network topology connection strength can be represented by the connection weights between nodes and other nodes, and the connection weights can be determined according to factors such as the bandwidth and stability of the connections. Assume that the node is connected to m other nodes, and the connection weights are w_1, w_2, …, w_m respectively. A network topology connection strength index T = ∑(w_i) can be defined, where i ranges from 1 to m. Take the node device replacement rate R_replace and the network topology connection strength index T as the inputs of the anti-destruction performance evaluation function. The anti-destruction performance evaluation function can adopt the form of a linear combination. For example, A = β * R_replace + (1 - β) * T, where β is a weight coefficient and is adjusted according to the actual situation. The result calculated by this anti-destruction performance evaluation function is the node anti-destruction performance index S_resilience.
[0024] Step S114: Statistically analyze the network transmission path characteristics between the node and the source node to which the target information resource belongs, and calculate the resource transmission cost index according to the path hop count, link bandwidth, and transmission delay data in the network transmission path characteristics.
[0025] To calculate the resource transmission cost index, it is necessary to statistically analyze the network transmission path characteristics between the node and the source node to which the target information resource belongs. The network transmission path characteristics contain multiple important pieces of information, among which the path hop count, link bandwidth, and transmission delay data are key factors.
[0026] The path hop count refers to the number of intermediate nodes that need to be passed from the current node to the source node to which the target information resource belongs. The path hop count can be determined through the network topology structure and routing information. Assume the path hop count is H. The link bandwidth refers to the available bandwidth of each link in the network transmission path, usually expressed in bits per second (bps). The bandwidth information of each link can be obtained through network monitoring tools, and then the minimum value of all link bandwidths is taken as the effective link bandwidth B. The transmission delay refers to the time required for data to be transmitted from the current node to the source node to which the target information resource belongs, including propagation delay, queuing delay, etc. The transmission delay can be measured by sending test packets and recording the round-trip time. Assume the transmission delay is D.
[0027] Calculate the resource transmission cost metric based on this data. A comprehensive calculation formula can be adopted, such as C = γ_1 * H + γ_2 / B + γ_3 * D, where γ_1, γ_2, and γ_3 are weight coefficients, which are adjusted according to the influence degree of different factors on the transmission cost, and it takes into account the characteristics that the more the path hop count, the smaller the link bandwidth, and the greater the transmission delay, the higher the resource transmission cost.
[0028] Step S115: Perform standardization alignment processing on the node resource usage status metric, node security level metric, node anti-destruction performance metric, and resource transmission cost metric to generate the status metric set.
[0029] Since the dimensions and value ranges of the node resource usage status metric, node security level metric, node anti-destruction performance metric, and resource transmission cost metric may be different, in order to combine them into a unified status metric set, standardization alignment processing is required. The purpose of the standardization alignment processing is to convert these metrics to the same scale for subsequent calculation and comparison.
[0030] The Z-score standardization method can be adopted. For each metric, first calculate its mean μ and standard deviation σ. For the node resource usage status metric S_usage, the standardized metric S_usage_std = (S_usage - μ_usage) / σ_usage; for the node security level metric S_security, the standardized metric S_security_std = (S_security - μ_security) / σ_security; for the node resilience metric S_resilience, the standardized metric S_resilience_std = (S_resilience - μ_resilience) / σ_resilience; for the resource transmission cost metric C, the standardized metric C_std = (C - μ_C) / σ_C. Then, combine these four standardized metrics together to form the status metric set S = [S_usage_std, S_security_std, S_resilience_std, C_std].
[0031] Step S120: Calculate the target cache value of the current node for the target information resource according to the status metric set, where the target cache value is positively correlated with the node resource usage status metric and the node security level metric, and negatively correlated with the resource transmission cost metric.
[0032] After obtaining the status metric sets of multiple nodes in the distributed network, next, calculate the target cache value of the current node for the target information resource according to this status metric set. The target cache value reflects the comprehensive benefit of the current node caching the target information resource. It is positively correlated with the node resource usage status metric and the node security level metric, meaning that the better the node resource usage status and the higher the security level, the higher the target cache value; it is negatively correlated with the resource transmission cost metric, that is, the higher the resource transmission cost, the lower the target cache value. The calculation process is described in detail below.
[0033] Step S121: Extract the first value of the node resource usage status metric, the second value of the node security level metric, the third value of the resource transmission cost metric, and the fourth value of the node resilience metric from the status metric set.
[0034] From the set of status indicators S = [S_usage_std, S_security_std, S_resilience_std, C_std] generated previously, extract the values of each indicator respectively. Denote the value of the node resource usage status indicator S_usage_std as the first value a; denote the value of the node security level indicator S_security_std as the second value b; denote the value of the resource transmission cost indicator C_std as the third value c; denote the value of the node anti-destruction performance indicator S_resilience_std as the fourth value d.
[0035] Step S122: Perform weighted processing on the first value based on a preset cache value benchmark coefficient to generate a resource usage status contribution value.
[0036] The preset cache value benchmark coefficient is a coefficient determined according to the actual situation and experience, and is used to measure the contribution degree of the node resource usage status to the target cache value. Assume the preset cache value benchmark coefficient is k_1. Multiply the first value a by the cache value benchmark coefficient k_1 to obtain the resource usage status contribution value V_usage = k_1 * a. This status contribution value reflects the positive contribution of the node resource usage status to the target cache value.
[0037] Step S123: Determine a security level correction coefficient according to the second value and a preset security level mapping table, where the security level mapping table contains correction weight intervals corresponding to different security levels.
[0038] The preset security level mapping table is a predefined table that records the correction weight intervals corresponding to different security levels. According to the security level corresponding to the second value b, look up the corresponding correction weight interval in the security level mapping table, and then determine a specific security level correction coefficient k_2. For example, if the second value b is within a correction weight interval [w_min, w_max] corresponding to a certain security level, the security level correction coefficient k_2 can be determined according to a set rule, such as the method of linear interpolation. Assume linear interpolation is used, k_2 = w_min + (b - b_min) * (w_max - w_min) / (b_max - b_min), where b_min and b_max are the minimum and maximum values of the second value corresponding to this security level.
[0039] Step S124: Call a dynamic transmission cost function to perform inverse proportional transformation on the third value to generate a transmission cost suppression factor, where the output value of the dynamic transmission cost function decreases as the third value increases.
[0040] The function of the dynamic transmission cost function is to perform an inverse proportional transformation on the value of the resource transmission cost metric to reflect its inhibitory effect on the target cache value. Assume the dynamic transmission cost function is f(x), where x is the value of the input resource transmission cost metric (i.e., the third value c). The function f(x) is characterized by the fact that as x increases, the output value of the function decreases. For example, it can be in the form of f(x)=1 / (x+ε), where ε is a very small positive number used to avoid a zero denominator. Substitute the third value c into the dynamic transmission cost function f(x) to obtain the transmission cost inhibition factor k_3=f(c).
[0041] Step S125: Determine the dynamic redundancy compensation weight according to the fourth value and a preset redundancy enhancement coefficient table, where different compensation coefficients corresponding to different anti-destruction performance metric intervals are stored in the redundancy enhancement coefficient table.
[0042] The preset redundancy enhancement coefficient table is a table recording different compensation coefficients corresponding to different anti-destruction performance metric intervals. According to the anti-destruction performance metric interval where the fourth value d is located, look up the corresponding compensation coefficient in the redundancy enhancement coefficient table and use it as the dynamic redundancy compensation weight k_4. For example, if the fourth value d is within the anti-destruction performance metric interval [d_min, d_max], and the compensation coefficient corresponding to this anti-destruction performance metric interval is k, then the dynamic redundancy compensation weight k_4=k.
[0043] Step S126: Normalize the node resource usage status metric, the node security level metric, and the node anti-destruction performance metric respectively to convert them into positive gain coefficients within a unified proportional range.
[0044] To make the node resource usage status metric, the node security level metric, and the node anti-destruction performance metric comparable when calculating the target cache value, they need to be normalized respectively to convert them into positive gain coefficients within a unified proportional range. The normalization method mentioned above can be used, such as mapping the value of each metric to the interval [0, 1]. For the first value a of the node resource usage status metric, the normalized positive gain coefficient g_1=(a-a_min) / (a_max-a_min); for the second value b of the node security level metric, the normalized positive gain coefficient g_2=(b-b_min) / (b_max-b_min); for the fourth value d of the node anti-destruction performance metric, the normalized positive gain coefficient g_3=(d-d_min) / (d_max-d_min), where a_min, a_max, b_min, b_max, d_min, and d_max are the minimum and maximum values of the corresponding metrics respectively.
[0045] Step S127: Normalize the resource transmission cost metric and then convert it into a reverse inhibition coefficient.
[0046] Similarly, normalize the third value c of the resource transmission cost metric and convert it into a reverse inhibition coefficient. Use the normalization method to map the third value c to the interval [0, 1], and obtain the normalized value c_norm = (c - c_min) / (c_max - c_min). Then, to reflect its reverse inhibition effect, take the inverse of the normalized value to obtain the reverse inhibition coefficient g_4 = 1 - c_norm.
[0047] Step S128: Perform a weighted sum of the positive gain coefficients to generate a comprehensive gain factor, and then perform a weighted difference operation with the reverse inhibition coefficient to obtain the target cache value.
[0048] Perform a weighted sum of the previously obtained positive gain coefficients g_1, g_2, and g_3 to generate a comprehensive gain factor G. Assume the weighting coefficients are ω_1, ω_2, and ω_3 respectively, then the comprehensive gain factor G = ω_1 * g_1 + ω_2 * g_2 + ω_3 * g_3. Then, perform a weighted difference operation between the comprehensive gain factor G and the reverse inhibition coefficient g_4 to obtain the target cache value V. Assume the weighting coefficients are ω_G and ω_g4 respectively, then the target cache value V = ω_G * G - ω_g4 * g_4.
[0049] Step S130: Based on a preset dynamic adjustment factor, perform real-time correction on the target cache value to generate local cache decision parameters matching the current node.
[0050] After obtaining the target cache value, in order to make the cache decision more in line with the actual situation of the current node, it is necessary to perform real-time correction on the target cache value based on a preset dynamic adjustment factor, so as to generate local cache decision parameters matching the current node. The following details the specific correction process.
[0051] Step S131: Real-time monitor the remaining capacity of the local cache space of the current node and the storage space requirement of the target information resource.
[0052] Real-time monitoring of the remaining capacity of the local cache space of the current node and the storage space requirement of the target information resource is the basis for cache decision-making. The remaining capacity of the local cache space L_remain can be obtained by querying the storage system information of the node, and the storage space requirement L_need can be determined by analyzing the attributes of the target information resource.
[0053] Step S132: When the remaining capacity of the local cache space is less than the storage space requirement, generate a cache space shortage warning signal, and trigger a cache resource elimination strategy based on the cache space shortage warning signal.
[0054] If it is monitored that the remaining capacity L_remain of the local cache space is less than the storage space requirement L_need of the target information resource, that is, L_remain < L_need, it indicates that the local cache space of the current node is not sufficient to store the target information resource. At this time, a cache space shortage warning signal is generated. This cache space shortage warning signal will trigger a cache resource elimination strategy to release some cache space to store the target information resource.
[0055] Step S133: Calculate the priority score of the information resources already stored in the local cache space according to the cache resource elimination strategy, and mark the information resources already stored with a priority score lower than the preset elimination threshold as replaceable resources.
[0056] The cache resource elimination strategy needs to comprehensively consider multiple factors to calculate the priority score of the information resources already stored in the local cache space. These factors can include the access frequency of the information resource, the most recent access time, the timeliness of the data, and the importance to the business, etc.
[0057] For the access frequency of the information resource, it can be measured by counting the number of times the information resource is accessed within a set time window. Suppose within the time window T, the access times of the already stored information resource i is F_i. For the most recent access time, the time point when the information resource was last accessed can be recorded, and it is represented by a time difference. Let the most recent access time difference of the information resource i from the current time be D_i. In terms of the timeliness of the data, different types of information resources have different requirements for timeliness, and a timeliness weight W_ti can be assigned to it according to the type of the information resource. The importance to the business can assign an importance weight W_ii to each information resource according to business rules or the settings of the administrator.
[0058] In order to comprehensively calculate the priority score considering these factors, each factor can be normalized first to make it in the same dimension and range. For the access frequency F_i, it can be normalized by calculating its relative frequency among all the already stored information resources. Let the normalized access frequency be F_i_norm. For the most recent access time difference D_i, it can be converted into a relative value, and the larger it is, the less priority it indicates. After normalization, it is D_i_norm.
[0059] Then, corresponding weights are assigned to each factor according to its importance. Let the weight of the access frequency be ω_F, the weight of the most recent access time be ω_D, the timeliness weight be ω_t, and the business importance weight be ω_i. Then the priority score P_i of the information resource i can be calculated by weighted summation, that is, P_i = ω_F * F_i_norm + ω_D * D_i_norm + ω_t * W_ti + ω_i * W_ii.
[0060] The preset elimination threshold is a fixed value set according to the cache policy and actual requirements of the node, denoted as P_threshold. The priority score P_i of each stored information resource calculated is compared with the preset elimination threshold P_threshold. If P_i is less than P_threshold, then the information resource is marked as a replaceable resource.
[0061] Step S134: Compare the difference between the target cache value and the priority score of the replaceable resource. If the target cache value exceeds the maximum replaceable resource score, then generate a cache replacement execution instruction.
[0062] After marking the replaceable resources, obtain the maximum priority score among the replaceable resources, denoted as P_max_replace. Compare the previously calculated target cache value V with P_max_replace. The purpose of the comparison is to determine whether the target information resource is worth replacing the replaceable resource in the current cache. If the target cache value V exceeds the maximum replaceable resource score P_max_replace, that is, V > P_max_replace, it means that the target information resource has a higher value in the cache. At this time, generate a cache replacement execution instruction. This instruction is used to trigger subsequent cache replacement operations, store the target information resource in the local cache, and remove the corresponding replaceable resource.
[0063] Step S135: Release the storage space corresponding to the replaceable resource based on the cache replacement execution instruction, and calculate the remaining capacity of the local cache space after the release.
[0064] After generating the cache replacement execution instruction, process the replaceable resources according to this instruction. First, the storage locations of the information resources marked as replaceable resources in the local cache space can be located, and then these information resources are deleted from the cache to release the storage space they occupy. Let the total storage space occupied by the replaceable resources be L_replace. After releasing this storage space, recalculate the remaining capacity of the local cache space. The previous remaining capacity of the local cache space is L_remain, and the remaining capacity of the local cache space after release L_remain_new can be calculated by L_remain + L_replace.
[0065] Step S136: If the remaining capacity of the local cache space after release still cannot meet the storage space requirement, recursively execute the cache resource elimination strategy until the released space meets the requirement or there are no replaceable resources.
[0066] After calculating the remaining capacity L_remain_new of the local cache space after release, compare it with the storage space requirement L_need of the target information resource. If L_remain_new is still less than L_need, that is, L_remain_new < L_need, it means that the released storage space is not enough to store the target information resource. At this time, it is necessary to recursively execute the cache resource elimination strategy. When recursively executing, the priority scores of the remaining stored information resources in the local cache space will be recalculated, the replaceable resources will be marked again, and then the storage space of these replaceable resources will be released, and the remaining capacity of the local cache space after release will be calculated again. This process will be repeated continuously until the released space meets the storage space requirement of the target information resource, that is, L_remain_new >= L_need, or there are no replaceable resources in the local cache space.
[0067] Step S137: Dynamically adjust the weight allocation rule of the dynamic adjustment factor according to the proportional relationship between the final available capacity and the storage requirement, where the lower the available capacity ratio, the greater the correction amplitude of the dynamic adjustment factor to the target cache value.
[0068] After the previous steps, the final available capacity L_available of the local cache space is obtained. Calculate the ratio of the final available capacity to the storage space requirement of the target information resource, denoted as R = L_available / L_need. The dynamic adjustment factor is an important parameter used to correct the target cache value, and its weight allocation rule will be dynamically adjusted according to the size of the ratio R. When the ratio R is low, it means that the local cache space is relatively tight. At this time, a larger correction of the target cache value is required to ensure more cautious cache decisions. Different weight allocation rules can be set according to different intervals of the ratio R. For example, when R is in the interval [0, R_1), the weight of the dynamic adjustment factor is ω_1; when R is in the interval [R_1, R_2), the weight of the dynamic adjustment factor is ω_2, and ω_1 > ω_2. As R increases, the weight of the dynamic adjustment factor gradually decreases, and the correction amplitude of the target cache value also gradually decreases.
[0069] Step S138: Generate the local cache decision parameter based on the corrected target cache value.
[0070] According to the weight allocation rule of the dynamically adjusted dynamic adjustment factor, the target cache value V is corrected. Let the dynamic adjustment factor be A, and the corrected target cache value V' can be calculated by V and A according to the adjusted weight allocation rule. For example, if the weighted multiplication method is adopted, V' = V * A * ω, where ω is the weight corresponding to the dynamic adjustment factor at the current ratio R. The corrected target cache value V' is the final local cache decision parameter, which will be used to determine whether to store the target information resource in the local cache space subsequently.
[0071] Step S140: If the local cache decision parameter exceeds the preset node cache trigger threshold, store the target information resource in the local cache space of the current node, and generate a cache resource distribution update instruction.
[0072] Compare the generated local cache decision parameter V' with the preset node cache trigger threshold P_trigger. The preset node cache trigger threshold is a fixed value preset according to factors such as the cache policy and performance of the node. If the local cache decision parameter V' exceeds the preset node cache trigger threshold P_trigger, that is, V' > P_trigger, it indicates that caching the target information resource at the current node has high value and necessity. At this time, the target information resource can be stored in the local cache space of the current node. During the storage process, the corresponding storage space can be allocated for the target information resource to ensure its normal storage and access. At the same time, in order to ensure the consistency and coordination of the cache resources of each node in the distributed network, a cache resource distribution update instruction can be generated. This instruction contains relevant information about the target information resource, such as the resource identifier, storage location, etc., and is used to notify other nodes to update the cache resource distribution information.
[0073] Step S150: Adjust the cache synchronization policy of adjacent nodes in the distributed network according to the cache resource distribution update instruction, so that the adjacent nodes perform cache resource cooperation operations based on the adjusted cache synchronization policy.
[0074] After generating the cache resource distribution update instruction, it is necessary to adjust the cache synchronization policy of adjacent nodes in the distributed network according to this instruction to achieve cache resource cooperation operations. The following are the specific operation steps: Step S151: Parse the target information resource identifier and source node location information in the cache resource distribution update instruction.
[0075] After receiving the cache resource distribution update instruction, it is first parsed. The cache resource distribution update instruction contains the identifier of the target information resource and the location information of the source node. The target information resource identifier is a code used to uniquely identify the target information resource, and through this identifier, the target information resource can be accurately located and identified. The source node location information indicates the node location where the target information resource was originally located. Parsing this information is the basis for subsequent operations. By accurately obtaining this information, it can provide a basis for determining the transmission path and performing cache synchronization in the subsequent process.
[0076] Step S152: Query the topology structure data of the distributed network according to the source node location information, and determine the optimal transmission path between the current node and the source node and the set of path-covered nodes.
[0077] According to the parsed source node location information, the topology structure data of the distributed network can be queried. The topology structure data of the distributed network records information such as the connection relationships and communication paths between each node in the network. By analyzing and calculating the topology structure data, the optimal transmission path between the current node and the source node can be determined. The determination of the optimal transmission path can consider multiple factors, such as the length, bandwidth, and latency of the path. Methods such as the shortest path algorithm and the bandwidth-first algorithm can be used to calculate the optimal transmission path. During the process of determining the optimal transmission path, the set of path-covered nodes will be obtained simultaneously, that is, the set of all intermediate nodes passed by this transmission path.
[0078] Step S153: Send a cache synchronization detection request to each intermediate node in the set of path-covered nodes, and the cache synchronization detection request contains the target information resource identifier and the local cache decision parameter.
[0079] After determining the set of path-covered nodes, a cache synchronization detection request can be sent to each intermediate node in the set of path-covered nodes. The cache synchronization detection request contains the target information resource identifier and the local cache decision parameter. The target information resource identifier is used by the intermediate node to identify the target information resource that needs to be synchronized, and the local cache decision parameter is used by the intermediate node to understand the cache decision situation of the current node for the target information resource. After receiving the cache synchronization detection request, the intermediate node will perform corresponding processing and feedback based on this information.
[0080] Step S154: Receive the cache status response data returned by the intermediate node, and the cache status response data contains the current cache load rate and available storage capacity of the intermediate node.
[0081] After receiving a cache synchronization detection request, the intermediate node checks its own cache status and returns the check result in the form of cache status response data. The cache status response data includes the current cache load rate and available storage capacity of the intermediate node. The current cache load rate refers to the proportion of the cache space used by the intermediate node in the total cache space, and the available storage capacity refers to the size of the remaining space available for storing data by the intermediate node. Further analysis and processing can be performed after receiving this cache status response data.
[0082] Step S155: Calculate the cache synchronization priority of the intermediate node according to the current cache load rate and available storage capacity, and sort the intermediate nodes according to the cache synchronization priority.
[0083] Based on the current cache load rate and available storage capacity of the received intermediate node, the cache synchronization priority of the intermediate node can be calculated. The calculation of the cache synchronization priority needs to comprehensively consider multiple factors. In addition to the current cache load rate and available storage capacity, the historical cache access record, network bandwidth utilization rate, processor load status, etc. of the intermediate node can also be considered.
[0084] First, obtain the historical cache access record of the intermediate node, and extract the resource request frequency and resource type distribution characteristics from it. The resource request frequency reflects the demand degree of the intermediate node for cache resources, and the resource type distribution characteristics reflect the preference of the intermediate node for different types of resources. Determine the preference coefficient of the intermediate node for the resource type to which the target information resource belongs according to the resource type distribution characteristics. For example, if the intermediate node has a high request frequency for a certain type of resource historically, then its preference coefficient for this type of resource is relatively large.
[0085] Calculate the expected cache utility value of the intermediate node based on the resource request frequency and preference coefficient. The expected cache utility value represents the possible benefit brought by the intermediate node caching the target information resource. At the same time, monitor the real-time network bandwidth utilization rate and processor load status of the intermediate node, and calculate the node performance attenuation factor according to the real-time network bandwidth utilization rate and processor load status. The node performance attenuation factor reflects the performance status of the intermediate node under the current network and processing capabilities.
[0086] Perform a weighted sum of the expected cache utility value and the node performance attenuation factor to obtain the initial synchronization priority score of the intermediate node. Then, perform a negative correction on the initial synchronization priority score according to the current cache load rate to obtain the corrected synchronization priority score. Finally, compare the corrected synchronization priority score with a preset priority threshold to determine the cache synchronization priority level of the intermediate node.
[0087] Sort the intermediate nodes according to the cache synchronization priority level, with the nodes having a higher priority ranked in the front, so as to allocate cache synchronization tasks according to the sorting result subsequently.
[0088] Step S156: Perform correlation analysis on the sorted intermediate node queue and the local cache decision parameters to generate a cache synchronization task allocation list.
[0089] Perform correlation analysis on the sorted intermediate node queue and the local cache decision parameters. The local cache decision parameters include the cache decision situation of the current node for the target information resource, such as the necessity of caching and the value of caching. Through correlation analysis, the role and task volume of each intermediate node in the cache synchronization task can be determined. For example, if an intermediate node has a higher cache synchronization priority and the local cache decision parameters show that the cache value of the target information resource is relatively large, then this intermediate node may undertake more cache synchronization tasks. Generate a cache synchronization task allocation list according to the result of the correlation analysis. The list records the specific content and requirements of the cache synchronization tasks that each intermediate node needs to execute.
[0090] Step S157: Before sending the cache synchronization policy instruction, check whether the available storage capacity of the intermediate node is greater than the data volume of the target information resource. If so, preferentially select the full - volume cache replication instruction; if not, select the incremental cache update instruction according to the version difference data volume of the target information resource, or only send the cache metadata backup instruction; and when the available storage capacity of the intermediate node is lower than the preset security threshold, suspend allocating cache synchronization tasks to it and mark it as a restricted node.
[0091] Before sending the cache synchronization policy instruction, it is necessary to check the available storage capacity of the intermediate node. Compare the available storage capacity of the intermediate node with the data volume of the target information resource. If the available storage capacity of the intermediate node is greater than the data volume of the target information resource, it means that the intermediate node has enough space to store the full - volume data of the target information resource. At this time, preferentially select the full - volume cache replication instruction to copy the complete data of the target information resource into the cache of the intermediate node.
[0092] If the available storage capacity of the intermediate node is less than the data volume of the target information resource, further judgment needs to be made according to the version difference data volume of the target information resource. If the version difference data volume is small, the incremental cache update instruction can be selected to only synchronize the version difference data of the target information resource into the cache of the intermediate node to reduce the data transmission volume and storage requirements. If the version difference data volume is large, or the storage capacity of the intermediate node is limited, only the cache metadata backup instruction can be sent to only back up the metadata of the target information resource, such as the name, type, update time, etc. of the resource.
[0093] Meanwhile, to ensure the cache security and stability of intermediate nodes, a preset security threshold is set. When the available storage capacity of an intermediate node is lower than the preset security threshold, it indicates that the storage resources of this intermediate node are already very tight. At this time, the allocation of cache synchronization tasks to it is suspended, and it is marked as a restricted node. Restricted nodes will no longer participate in subsequent cache synchronization operations until their available storage capacity returns to the safe range.
[0094] Step S210: Create a cache metadata index for the target information resource in the current node. The cache metadata index includes a resource version identifier, a cache validity period, and source node verification information.
[0095] After storing the target information resource in the local cache space of the current node, it is necessary to create a cache metadata index for the target information resource in the current node. The cache metadata index is an important set of information for managing and maintaining cache data, which includes a resource version identifier, a cache validity period, and source node verification information. The resource version identifier is used to uniquely identify different versions of the target information resource. Through this identifier, different versions of the resource can be accurately identified and distinguished. The cache validity period specifies the effective time range during which the target information resource can be used in the local cache. Beyond this time range, the cache data may need to be updated or verified. The source node verification information is used to communicate and verify with the source node to ensure the accuracy and consistency of the cache data. During the process of creating the cache metadata index, this information can be sorted and stored for subsequent cache health checks and data update operations.
[0096] Step S220: Start a periodic cache health check task. The cache health check task performs the following operations based on the cache metadata index: establish a communication connection with the source node through the source node verification information, verify the consistency between the resource version identifier and the current resource version of the source node, and verify the remaining duration of the cache validity period.
[0097] After creating the cache metadata index, start a periodic cache health check task. The main purpose of this task is to ensure the accuracy and effectiveness of the target information resource in the local cache. The cache health check task operates based on the cache metadata index. First, establish a communication connection with the source node through the source node verification information in the cache metadata index. After establishing the communication connection, the version identifier of the current resource of the source node can be obtained and compared with the resource version identifier of the target information resource in the local cache to verify the consistency between the two. If it is found that the versions are inconsistent, it indicates that the data in the local cache may be outdated and needs to be updated.
[0098] Meanwhile, the remaining duration of the cache validity period can be verified. Based on the cache validity period recorded in the cache metadata index, calculate the remaining duration from the current time to the end of the cache validity period. If the remaining duration is lower than the set threshold, it indicates that the cached data is about to expire and corresponding processing is required, such as renewal or update.
[0099] Step S221: Configure the basic execution interval time and the maximum allowable delay time of the cache health check task.
[0100] To reasonably arrange the execution of the cache health check task, it is necessary to configure the basic execution interval time and the maximum allowable delay time. The basic execution interval time refers to the execution cycle of the cache health check task under normal circumstances, for example, performing a check task at regular intervals. The maximum allowable delay time refers to the maximum time length that the cache health check task can be delayed in some special cases, such as when the system load is too high or the network is congested. By configuring these two time parameters, while ensuring the accuracy of the cached data, the impact on system performance can be avoided.
[0101] Step S222: Monitor the system load status and network congestion degree of the current node, and dynamically extend the basic execution interval time according to the system load status.
[0102] During the execution of the cache health check task, it is necessary to monitor the system load status and network congestion degree of the current node in real time. The system load status reflects the usage of resources such as the processor and memory of the current node, and the network congestion degree reflects the communication status of the network. When the system load status is high, it indicates that the resources of the node are already relatively tense. At this time, in order to avoid the cache health check task having too much impact on system performance, the basic execution interval time can be dynamically extended according to the system load status. For example, when the system load reaches the set threshold, the basic execution interval time is extended to twice the original.
[0103] Step S223: When it is detected that the network congestion degree exceeds the preset congestion threshold, enable the delayed execution queue to temporarily store the cache health check task, and execute the tasks in the queue in the order of priority after the network congestion degree decreases.
[0104] When the network congestion degree exceeds the preset congestion threshold, to ensure the smooth execution of the cache health check task and avoid causing greater pressure on the network, a delayed execution queue can be enabled. The role of this delayed execution queue is to temporarily store the cache health check tasks that were originally to be executed. When storing tasks in the delayed execution queue, a priority can be assigned to each task. The determination of the priority can be based on multiple factors, such as the importance of the target information resource and the remaining duration of the cache validity period. For tasks with high importance and a short remaining duration of the cache validity period, a higher priority will be assigned.
[0105] In this embodiment, the network congestion degree is continuously monitored. When the network congestion degree drops to a set level, that is, below the preset executable threshold, the tasks in the delayed execution queue are started to be executed in the order of task priorities. Before executing a task, the validity of the task can be checked again. For example, it can be checked whether the target information resource still exists in the cache and whether the cache metadata index is still valid, etc. If the task is invalid, it can be removed from the delayed execution queue. For valid tasks, they can be executed in order from high to low priority to ensure that important and urgent tasks can be processed first.
[0106] Step S224: Record the execution time consumption and resource consumption data of each cache health check task, and train a task scheduling optimization model based on the historical execution data.
[0107] When each cache health check task is executed, the execution time consumption of the task and the resource consumption data can be recorded in detail. The execution time consumption can reflect the efficiency of task execution, and the resource consumption data includes the usage of resources such as the processor, memory, and network bandwidth during the task execution process. These data will be stored in the system log file to form historical execution data.
[0108] Use these historical execution data to train a task scheduling optimization model. The task scheduling optimization model can adopt machine learning algorithms, such as neural network algorithms. During the training process, the historical execution data is used as input, and the goal of the model is to learn the relationship between the task execution time consumption, resource consumption, and task-related features (such as the size and type of the target information resource, cache validity period, etc.). By continuously adjusting the parameters of the model, the model can accurately predict the execution time consumption and resource consumption of different tasks under different system states. In this way, in subsequent task scheduling, the model can reasonably arrange the execution order and time of tasks according to the task features and the current system state to improve the efficiency of task scheduling.
[0109] Step S225: Call the task scheduling optimization model to predict the change trend of node load in the future time period, and dynamically adjust the trigger time point of the cache health check task based on the prediction result.
[0110] After training the task scheduling optimization model, the task scheduling optimization model can be called to predict the change trend of node load in the future time period. The task scheduling optimization model will predict the usage of resources such as the processor load, memory usage, and network bandwidth of the node in a future period according to the current system state, historical execution data, and other relevant information.
[0111] Based on the predicted node load change trend, the trigger time point of the cache health check task can be dynamically adjusted. If it is predicted that the node load will be high in a certain future time period, to avoid causing too much impact on the system performance, the trigger time point of the cache health check task can be postponed to a time period when the node load is low. On the contrary, if it is predicted that the future node load is low, the cache health check task can be triggered in advance to improve the accuracy and timeliness of the cache data.
[0112] Step S226: When it is detected that the target information resource is marked as a priority resource, generate a forced check instruction to override the dynamically adjusted trigger time point.
[0113] During the operation of the system, the status of the target information resource is monitored in real time. If it is detected that the target information resource is marked as a priority resource, it means that this resource is of great significance for the normal operation of the system or the development of the business, and cache health check needs to be performed in a timely manner. At this time, a forced check instruction can be generated, and this instruction will override the trigger time point dynamically adjusted according to the node load change trend before. Regardless of the current load situation of the node, the cache health check task for this priority resource can be immediately executed to ensure that the cached data of this resource always remains accurate and effective.
[0114] Step S230: When it is detected that the resource version identifier of the target information resource is inconsistent with the current resource version of the source node, trigger an incremental data synchronization request, and obtain the version difference data from the source node based on the source node verification information and update the local cache content.
[0115] During the execution of the cache health check task, when it is detected that the resource version identifier of the target information resource is inconsistent with the current resource version of the source node, it indicates that the data in the local cache is outdated and needs to be updated. At this time, an incremental data synchronization request can be triggered. The incremental data synchronization request only requests to obtain the version difference data of the target information resource, rather than the entire resource data.
[0116] Then, establish a communication connection with the source node based on the source node verification information in the cache metadata index, and send an incremental data synchronization request to the source node. After receiving the request, the source node will calculate the version difference data based on the latest resource data stored locally and the local cache resource version information carried in the request. Then, the source node sends the version difference data to the current node. After receiving the version difference data, the current node will apply it to the target information resource in the local cache to update the local cache content to make it consistent with the latest resource version of the source node.
[0117] Step S240: When it is detected that the remaining duration of the cache validity period is lower than a preset expiration threshold, generate a cache renewal request including the resource version identifier and the source node verification information, and send it to the source node. After receiving the renewal authorization response returned by the source node, extend the cache validity period.
[0118] In the cache health check task, if it is detected that the remaining duration of the cache validity period of the target information resource is lower than the preset expiration threshold, it indicates that the cached data is about to expire and a renewal operation is required. A cache renewal request can be generated, which includes the resource version identifier of the target information resource and the source node verification information.
[0119] The cache renewal request can be sent to the source node. After receiving the request, the source node will review the request according to its own policies and rules. The review content may include the usage of the resource, the security of the data, etc. If the review passes, the source node will return a renewal authorization response, which includes the new cache validity period information. After receiving the renewal authorization response, the current node will extend the cache validity period of the target information resource according to the information in the response to ensure that the resource can continue to be used in the local cache.
[0120] Step S250: Real-time statistics of the access frequency of the target information resource in the local cache space and the data transmission volume based on the cache metadata index record, establish a periodic adjustment function including the access frequency factor, the data transmission volume factor, and the cache validity period factor, and dynamically adjust the execution period of the cache health check task according to the periodic adjustment function, where the execution period is negatively correlated with the access frequency factor and positively correlated with the data transmission volume factor.
[0121] The access frequency of the target information resource in the local cache space and the data transmission volume based on the cache metadata index record can be statistically analyzed in real time. The access frequency reflects the degree of user demand for the resource, and the data transmission volume reflects the usage of the resource in the network.
[0122] Based on these statistical data, a periodic adjustment function is established. The periodic adjustment function includes the access frequency factor, the data transmission volume factor, and the cache validity period factor. The access frequency factor is related to the access frequency of the target information resource, the data transmission volume factor is related to the data transmission volume, and the cache validity period factor is related to the remaining duration of the cache validity period.
[0123] According to the period adjustment function, the execution period of the cache health check task can be dynamically adjusted. Since the execution period is negatively correlated with the access frequency factor, when the access frequency of the target information resource is high, it indicates that the resource is relatively important and frequently used, and cache health checks need to be performed more frequently. Therefore, the execution period will be shortened. And the execution period is positively correlated with the data transfer volume factor. When the data transfer volume is large, it means that the network is relatively busy. To avoid excessive pressure on the network, the execution period will be appropriately extended. At the same time, the cache validity period factor will also affect the execution period. If the remaining duration of the cache validity period is short, the execution period can be appropriately shortened to ensure inspection and update before the cache expires.
[0124] Step S310: Register the cache location change event of the target information resource in the control plane of the distributed network to generate a resource location metadata update request.
[0125] After storing the target information resource in the local cache space of the current node and generating a cache resource distribution update instruction, it is necessary to register the cache location change event of the target information resource in the control plane of the distributed network. The control plane of the distributed network is responsible for managing and coordinating various resources and events in the network. Registering the cache location change event allows the control plane to timely understand that the cache location of the target information resource has changed.
[0126] After registration is completed, a resource location metadata update request can be generated. The resource location metadata update request contains the latest cache location information of the target information resource, which is used to notify other nodes in the network to update the location information of the resource. The generation of this request is to ensure the accuracy of the location and access of the target information resource by each node in the distributed network.
[0127] Step S320: Broadcast the resource location metadata update request to all routing nodes in the distributed network to trigger the update operation of the routing node's forwarding rules.
[0128] After generating the resource location metadata update request, the request can be broadcast to all routing nodes in the distributed network. Routing nodes are the nodes in the distributed network responsible for data forwarding and routing selection. The purpose of broadcasting the resource location metadata update request is to enable all routing nodes to receive the latest cache location information of the target information resource.
[0129] When a routing node receives the resource location metadata update request, it will trigger the update operation of its forwarding rules. The routing node will update its forwarding rules according to the latest cache location information contained in the request to ensure that in subsequent data transmission processes, access requests for the target information resource can be accurately routed to the latest cache location, improving the efficiency and accuracy of data transmission.
[0130] Step S330: Receive the rule update confirmation signal returned by the routing node, and count the number of routing nodes for which the update has been confirmed and the list of unconfirmed nodes.
[0131] After the routing node completes the forwarding rule update operation, it returns a rule update confirmation signal. After receiving these rule update confirmation signals, the number of routing nodes for which the update has been confirmed is counted. At the same time, the routing nodes that have not returned the confirmation signal can be recorded to form a list of unconfirmed nodes. Counting the number of routing nodes for which the update has been confirmed allows the system to understand the execution status of the forwarding rule update operation, and the list of unconfirmed nodes is used for subsequent follow-up and processing.
[0132] Step S340: Resend the metadata update request to the routing nodes in the list of unconfirmed nodes, and start a retry counter to limit the number of transmissions.
[0133] For the routing nodes in the list of unconfirmed nodes, the metadata update request can be resent. This is to ensure that these nodes can also update the forwarding rules in a timely manner, avoiding problems with data transmission due to some nodes not updating the rules.
[0134] During the process of resending the request, a retry counter can be started. The retry counter is used to record the number of times the request is resent. Setting a limit on the number of transmissions is to avoid sending requests infinitely and wasting network resources. For example, when the retry counter reaches the preset maximum number of retries, the request to that node will stop being sent.
[0135] Step S350: When the retry counter reaches the preset maximum retry threshold and no confirmation signal is received, mark the routing nodes in the list of unconfirmed nodes as abnormal nodes and trigger the network topology reconstruction process.
[0136] If the retry counter reaches the preset maximum retry threshold and at this time no confirmation signal is still received from the routing nodes in the list of unconfirmed nodes, it indicates that the routing node may have an abnormal situation, such as a network failure or a node failure. At this time, the routing node can be marked as an abnormal node.
[0137] After marking the abnormal nodes, the network topology reconstruction process can be triggered. The purpose of the network topology reconstruction process is to re-plan the network topology structure, bypass the abnormal nodes, and ensure the normal operation of the network and the effective transmission of data.
[0138] For example, Step S351: Obtain the global topology structure diagram of the distributed network and the node - to - node connection status data.
[0139] When triggering the network topology reconstruction process, it is first necessary to obtain the global topology structure diagram of the distributed network and the connection status data between nodes. The global topology structure diagram shows the positions of all nodes in the network and the connection relationships between them, while the connection status data between nodes records the status of each connection, such as whether it is available, the bandwidth size, etc. Obtaining this data can be achieved through the network management system or information interaction between nodes, which can collect information from each node and integrate it to form the global topology structure diagram and the connection status data between nodes, providing basic information for subsequent topology reconstruction.
[0140] Step S352: Remove the abnormal node and all its associated connection edges from the global topology structure diagram to generate an initial reconstructed topology diagram.
[0141] After obtaining the global topology structure diagram and the connection status data between nodes, the abnormal node and all its associated connection edges can be removed from the global topology structure diagram. The abnormal node is the node that previously marked as not responding to the metadata update request and reached the maximum retry count. After removing the abnormal node and its associated connection edges, an initial reconstructed topology diagram is obtained. This initial reconstructed topology diagram reflects the network topology structure after excluding the abnormal node, providing a basis for further topology optimization.
[0142] Step S353: Calculate the scale sizes of each connected subgraph in the initial reconstructed topology diagram, and mark the connected subgraphs with a scale smaller than the preset threshold as invalid partitions.
[0143] After obtaining the initial reconstructed topology diagram, the scale sizes of each connected subgraph in it can be calculated. A connected subgraph refers to a set of nodes that are connected to each other in the graph. The scale size can be measured by the number of nodes or the number of connection edges, and the connected subgraphs with a scale smaller than the preset threshold can be marked as invalid partitions. The preset threshold is a standard set according to the actual situation and performance requirements of the network, used to determine whether a connected subgraph has sufficient scale to maintain effective network communication. Marking the invalid partitions is for subsequent processing of these partitions to restore the connectivity and performance of the network.
[0144] Step S354: Identify candidate nodes with cross-partition connection capabilities in the invalid partitions, and add virtual connection channels to the candidate nodes to restore inter-partition communication.
[0145] For the connected subgraphs marked as invalid partitions, candidate nodes with cross-partition connection capabilities can be identified in them. Candidate nodes refer to those nodes that have the conditions and capabilities to connect to other partitions, such as having redundant network interfaces or strong communication capabilities.
[0146] After identifying the candidate nodes, virtual connection channels can be added to these candidate nodes. The virtual connection channels can be implemented through software-defined network (SDN) technology or virtual private network (VPN) technology. The purpose of adding virtual connection channels is to restore the communication between the invalid partition and other partitions, enabling the network to reform into a connected whole again.
[0147] Step S355: Recalculate the average path length and network diameter metrics of the global topology graph to evaluate the network transmission efficiency after topology reconstruction.
[0148] After adding virtual connection channels to restore communication between partitions, the average path length and network diameter metrics of the global topology graph can be recalculated. The average path length refers to the average length of the shortest paths between any two nodes in the network, and the network diameter refers to the length of the longest shortest path between any two nodes in the network.
[0149] By recalculating these metrics, the network transmission efficiency after topology reconstruction can be evaluated. The shorter the average path length and the smaller the network diameter, the higher the network transmission efficiency. If these metrics are improved, it indicates that the topology reconstruction has achieved good results; if the metrics are not significantly improved or deteriorate, further adjustment of the topology structure may be required.
[0150] Step S356: When the network transmission efficiency is lower than the preset efficiency threshold, enable the standby relay node set to establish additional data transmission paths.
[0151] If it is evaluated that the network transmission efficiency after topology reconstruction is lower than the preset efficiency threshold, it indicates that the current network topology structure still cannot meet the performance requirements of the network. At this time, the standby relay node set can be enabled. The standby relay node set is a pre-set group of nodes used to play a role when the network has problems or additional transmission paths are needed.
[0152] This embodiment can use the standby relay node set to establish additional data transmission paths. These additional data transmission paths can bypass areas with poor performance and improve the network transmission efficiency. When establishing additional data transmission paths, factors such as the load situation of nodes and connection bandwidth can be considered to ensure that the new paths can effectively share network traffic.
[0153] Step S357: Update the routing table information of all nodes according to the reconstructed global topology graph and synchronize it to the control plane database of the distributed network.
[0154] After completing the topology reconstruction and establishing additional data transmission paths, the routing table information of all nodes can be updated according to the reconstructed global topology structure diagram. The routing table is important information for nodes to determine data transmission paths. Updating the routing table information can ensure that nodes can accurately route data to the target nodes.
[0155] The updated routing table information will be synchronized to the control plane database of the distributed network. The control plane database is the core database in the distributed network for storing and managing network configuration information. Synchronizing the updated routing table information to this database can ensure that all nodes in the network can obtain the latest routing information, thus achieving the stable and efficient operation of the network.
[0156] Step S360: Update the node connection relationships of the distributed network according to the network topology reconstruction process, and generate a new optimal transmission path to bypass the abnormal node.
[0157] After triggering the network topology reconstruction process, the node connection relationships of the distributed network can be updated according to this process. This includes removing the abnormal node and its related connection edges, and recalculating the connection relationships and paths between nodes.
[0158] Based on the updated node connection relationships, a new optimal transmission path can be generated to bypass the abnormal node. Methods such as the shortest path algorithm and the bandwidth-first algorithm can be used to generate the optimal transmission path, comprehensively considering factors such as the length, bandwidth, and delay of the path to ensure that the new transmission path can efficiently transmit data. The updated network topology structure and the new optimal transmission path will be applied to the distributed network, enabling the network to still maintain stable and efficient operation in the presence of abnormal nodes.
[0159] In the above embodiment, during the data collection phase, for the acquisition of the state index sets of multiple nodes in the distributed network, the collected data all comes from legal and compliant channels. The collection of real-time operation log data, historical security event record sets, hardware redundancy configuration data, network topology connection strength data, and network transmission path characteristics and other data are all carried out under the authorization of the node owner or manager. For privacy-sensitive data, a series of strict privacy protection and anti-disclosure technical measures are taken. For example, during data transmission, encryption algorithms are used to encrypt the data to prevent the data from being stolen or tampered with during transmission. In terms of data storage, the data is classified and stored, and different access permissions are set, and only authorized personnel can access the corresponding data. At the same time, the data is regularly backed up to prevent data loss or damage.
[0160] In the label management process, whether it is encoding the characteristics of security threat types or standardizing and aligning various status indicators of nodes, it is based on the principles of objectivity and fairness. The encoding of security threat types is carried out according to their actual characteristics and natures, without any subjective bias. During the process of standardization and alignment, the indicators of all nodes are processed according to unified standards and methods, ensuring that each node can be treated fairly and will not be discriminated against due to factors such as the identity and status of the node.
[0161] Regarding rule settings, various preset thresholds, coefficients, weights, etc. are determined through scientific analysis and evaluation. For example, node cache trigger thresholds, preset elimination thresholds, priority thresholds, congestion thresholds, expiration thresholds, maximum retry thresholds, etc. These threshold settings are based on the actual operating conditions and performance requirements of the network to ensure the stable and efficient operation of the network, rather than based on any unfair or discriminatory factors. The determination of cache value benchmark coefficients, security level correction coefficients, dynamic transmission cost functions, redundancy reinforcement coefficient tables, weighted coefficients, etc. is also achieved through the analysis and experiment of a large amount of data to achieve the optimal cache decision effect, without any partiality or discrimination towards certain nodes or resources.
[0162] In the recommendation decision-making process, whether it is determining the target cache value, local cache decision parameters, or performing cache synchronization task allocation, it is based on objective indicators and data. The calculation of the target cache value comprehensively considers multiple factors such as node resource usage status indicators, node security level indicators, node anti-destruction performance indicators, and resource transmission cost indicators. Each factor has its reasonable weight and calculation method to ensure the fairness and rationality of the decision. When allocating cache synchronization tasks, they are sorted and allocated according to the cache synchronization priorities of intermediate nodes. The calculation of cache synchronization priorities considers multiple aspects such as the current cache load rate, available storage capacity, historical cache access records, network bandwidth utilization rate, and processor load status of intermediate nodes, avoiding human intervention and unfair allocation.
[0163] During the construction and training process of artificial intelligence models, the principles of fairness and justice are also followed. The training data of the pre-trained security scoring model and task scheduling optimization model are strictly screened and processed to ensure the diversity and representativeness of the data, avoiding discriminatory results of the model caused by data biases. During the training process of the model, fairness evaluation indicators and methods are adopted to monitor and adjust the output of the model to ensure that the model can maintain fairness and justice when processing different nodes and resources.
[0164] Throughout the implementation of the entire method, the goal has always been to ensure the normal operation of the network, improve resource utilization efficiency, and maintain fairness and justice. Through strict institutional and technical means, it is ensured that each link complies with the requirements of laws and social morality, and there are no situations of violating laws, going against fairness and justice, or having discrimination and prejudice, providing a strong guarantee for the stable and sustainable development of the distributed network.
[0165] In operations such as cache resource distribution update and network topology reconstruction, relevant principles are also strictly adhered to. When broadcasting resource location metadata update requests, triggering routing node forwarding rule update operations, and performing network topology reconstruction, all nodes are treated equally. For the handling of abnormal nodes, it is also based on objective judgment criteria, that is, whether to respond to metadata update requests in a timely manner, rather than based on other attributes of the nodes. During the network topology reconstruction process, operations such as adding virtual connection channels to invalid partitions and enabling standby relay node sets are all aimed at restoring network connectivity and improving transmission efficiency, rather than favoring certain nodes or regions.
[0166] During the execution of the cache health check task, whether it is dynamically adjusting the execution cycle or forcibly checking priority resources, it is based on the actual situation of the resources and the operating state of the network, rather than based on any discriminatory factors. Real-time statistics of the access frequency and data transmission volume of target information resources, and dynamically adjusting the check cycle based on these data, are to ensure the accuracy and timeliness of cached data, while avoiding excessive pressure on the network and ensuring that all resources can be reasonably managed and maintained.
[0167] During the operation of the entire system, a supervision and auditing mechanism is also established. Regularly review links such as data collection, label management, rule setting, and recommendation decision-making to ensure that each link meets the requirements of laws and fairness and justice. If any violations are found, they will be corrected and processed in a timely manner to maintain the normal operation and fairness of the system. In addition, user feedback channels are set up to allow users to put forward opinions and suggestions on the operation and decision-making of the system, so as to timely discover and solve possible problems and continuously optimize the performance and fairness of the system.
[0168] Regarding the use and sharing of data, relevant laws and regulations are strictly complied with. For the collected node status indicator data and other relevant information, it is only used for the purpose of local cache resource optimization and will not be leaked to third parties or used for other illegal purposes. When sharing data with other systems or institutions, strict confidentiality agreements and data use agreements will be signed to ensure the safe and legal use of data.
[0169] Figure 2FIG. 0 shows a schematic diagram of exemplary hardware and software components of a local cache resource optimization system 100 for combining node states provided by some embodiments of the present application, which can implement the idea of the present application. For example, the processor 120 can be used on the local cache resource optimization system 100 for combining node states and for performing the functions in the present application.
[0170] The local cache resource optimization system 100 for combining node states can be a general-purpose server or a special-purpose server, both of which can be used to implement the local cache resource optimization method for combining node states of the present application. Although only one server is shown in the present application, for convenience, the functions described in the present application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0171] For example, the local cache resource optimization system 100 for combining node states can include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as disks, ROM, or RAM, or any combination thereof. Exemplarily, the local cache resource optimization system 100 for combining node states can also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The local cache resource optimization system 100 for combining node states also includes an I / O interface 150 between the computer and other input / output devices.
[0172] For ease of illustration, only one processor is described in the local cache resource optimization system 100 for combining node states. However, it should be noted that the local cache resource optimization system 100 in the present application can also include multiple processors. Therefore, the steps performed by one processor described in the present application can also be jointly performed or separately performed by multiple processors. For example, if the processor of the local cache resource optimization system 100 for combining node states performs steps A and B, it should be understood that steps A and B can also be jointly performed by two different processors or separately performed in one processor. For example, the first processor performs step A, the second processor performs step B, or the first processor and the second processor jointly perform steps A and B.
[0173] In addition, an embodiment of the present invention also provides a readable storage medium, in which computer-executable instructions are preset. When the processor executes the computer-executable instructions, the local cache resource optimization method for combining node states as described above is implemented.
[0174] It should be noted that, in order to simplify the description of the present invention disclosure and thus assist in understanding one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, sometimes multiple features are merged into one embodiment, drawing, or description thereof.
Claims
1. A local cache resource optimization method combined with node status, characterized in that The method includes: Obtaining a set of status indicators of multiple nodes in a distributed network, where the set of status indicators includes node resource usage status indicators, node security level indicators, node anti-destruction performance indicators, and resource transmission cost indicators; Calculating the target cache value of the current node for the target information resource according to the set of status indicators, where the target cache value is positively correlated with the node resource usage status indicator and the node security level indicator, and negatively correlated with the resource transmission cost indicator; Performing real-time correction on the target cache value based on a preset dynamic adjustment factor to generate local cache decision parameters matching the current node; If the local cache decision parameter exceeds a preset node cache trigger threshold, storing the target information resource in the local cache space of the current node and generating a cache resource distribution update instruction; Adjusting the cache synchronization strategy of adjacent nodes in the distributed network according to the cache resource distribution update instruction, so that the adjacent nodes perform cache resource cooperation operations based on the adjusted cache synchronization strategy.
2. The local cache resource optimization method combining node states according to claim 1, wherein, The obtaining a set of status indicators of multiple nodes in a distributed network includes: Traversing the real-time operation log data of all nodes in the distributed network, extracting the resource access frequency and the resource storage capacity occupancy ratio of the nodes within a preset time window, and normalizing the resource access frequency and the resource storage capacity occupancy ratio to obtain the node resource usage status indicator; Invoking the node security audit interface to obtain the set of historical security event records of the node, performing feature encoding on the security threat types in the set of historical security event records to generate a security threat encoding vector, and inputting the security threat encoding vector into a pre-trained security scoring model to output the node security level indicator; Monitoring the hardware redundancy configuration data and the network topology connection strength data of the node, calculating the node device replacement rate according to the hardware redundancy configuration data, constructing an anti-destruction performance evaluation function in combination with the network topology connection strength data, and generating the node anti-destruction performance indicator through the anti-destruction performance evaluation function; Statistically analyzing the network transmission path characteristics between the node and the source node to which the target information resource belongs, and calculating the resource transmission cost indicator according to the path hop count, link bandwidth, and transmission delay data in the network transmission path characteristics; Performing standardized alignment processing on the node resource usage status indicator, the node security level indicator, the node anti-destruction performance indicator, and the resource transmission cost indicator to generate the set of status indicators.
3. The local cache resource optimization method combined with node status according to claim 1, characterized in that The calculating the target cache value of the current node for the target information resource according to the set of status indicators includes: Extracting a first value of the node resource usage status indicator, a second value of the node security level indicator, a third value of the resource transmission cost indicator, and a fourth value of the node anti-destruction performance indicator from the set of status indicators; Performing weighted processing on the first value based on a preset cache value benchmark coefficient to generate a resource usage status contribution value; Determine a security level correction factor according to the second value and a preset security level mapping table, where the security level mapping table includes correction weight intervals corresponding to different security levels; Call a dynamic transmission cost function to perform an inverse proportional transformation on the third value to generate a transmission cost suppression factor, where the output value of the dynamic transmission cost function decreases as the third value increases; Determine a dynamic redundancy compensation weight according to the fourth value and a preset redundancy enhancement coefficient table, where compensation coefficients corresponding to different anti-destruction performance index intervals are stored in the redundancy enhancement coefficient table; Normalize the node resource usage status index, node security level index, and node anti-destruction performance index respectively to convert them into positive gain coefficients within a unified ratio range; Normalize the resource transmission cost index and then convert it into an inverse suppression coefficient; Perform a weighted sum of the positive gain coefficients to generate a comprehensive gain factor, and then perform a weighted difference operation with the inverse suppression coefficient to obtain the target cache value.
4. The local cache resource optimization method combined with node status according to claim 1, characterized in that Perform real-time correction on the target cache value based on a preset dynamic adjustment factor to generate local cache decision parameters matching the current node, including: Real-time monitor the remaining capacity of the local cache space of the current node and the storage space requirement of the target information resource; When the remaining capacity of the local cache space is less than the storage space requirement, generate a cache space shortage warning signal, and trigger a cache resource elimination strategy based on the cache space shortage warning signal; Calculate the priority score of the information resources already stored in the local cache space according to the cache resource elimination strategy, and mark the information resources already stored with a priority score lower than a preset elimination threshold as replaceable resources; Compare the difference between the target cache value and the priority score of the replaceable resources. If the target cache value exceeds the maximum replaceable resource score, generate a cache replacement execution instruction; Release the storage space corresponding to the replaceable resources based on the cache replacement execution instruction, and calculate the remaining capacity of the local cache space after release; If the remaining capacity of the local cache space after release still cannot meet the storage space requirement, recursively execute the cache resource elimination strategy until the released space meets the requirement or there are no replaceable resources; Dynamically adjust the weight allocation rule of the dynamic adjustment factor according to the proportional relationship between the final available capacity and the storage requirement, where the lower the available capacity ratio, the greater the correction amplitude of the dynamic adjustment factor to the target cache value; Generate the local cache decision parameters based on the corrected target cache value.
5. The local cache resource optimization method combined with node states according to claim 1, wherein Adjust the cache synchronization strategy of adjacent nodes in the distributed network according to the cache resource distribution update instruction, including: Parse the target information resource identifier and source node location information in the cache resource distribution update instruction; Query the topology structure data of the distributed network according to the source node location information to determine the optimal transmission path between the current node and the source node and the set of path coverage nodes; Send a cache synchronization detection request to each intermediate node in the path coverage node set, where the cache synchronization detection request includes the target information resource identifier and the local cache decision parameter; Receive the cache status response data returned by the intermediate node, where the cache status response data includes the current cache load rate and available storage capacity of the intermediate node; Calculate the cache synchronization priority of the intermediate node according to the current cache load rate and available storage capacity, and sort the intermediate nodes according to the cache synchronization priority; Perform correlation analysis on the sorted intermediate node queue and the local cache decision parameter to generate a cache synchronization task allocation list; Before sending a cache synchronization policy instruction, verify whether the available storage capacity of the intermediate node is greater than the data volume of the target information resource. If so, preferentially select a full - volume cache replication instruction. Otherwise, select an incremental cache update instruction according to the version difference data volume of the target information resource, or only send a cache metadata backup instruction; And when the available storage capacity of the intermediate node is lower than a preset security threshold, suspend allocating cache synchronization tasks to it and mark it as a restricted node.
6. The local cache resource optimization method in combination with node status according to claim 5, wherein The calculating the cache synchronization priority of the intermediate node according to the current cache load rate and available storage capacity includes: Obtain the historical cache access record of the intermediate node, and extract the resource request frequency and resource type distribution characteristics in the historical cache access record; Determine the preference coefficient of the intermediate node for the resource type to which the target information resource belongs according to the resource type distribution characteristics; Calculate the expected cache utility value of the intermediate node based on the resource request frequency and preference coefficient; Monitor the real - time network bandwidth utilization rate and processor load status of the intermediate node, and calculate the node performance decay factor according to the real - time network bandwidth utilization rate and processor load status; Perform weighted summation on the expected cache utility value and the node performance decay factor to obtain the initial synchronization priority score of the intermediate node; Perform negative correction on the initial synchronization priority score according to the current cache load rate to obtain the corrected synchronization priority score; Based on the comparison between the corrected synchronization priority score and a preset priority threshold, determine the cache synchronization priority level of the intermediate node.
7. The local cache resource optimization method combined with node status according to claim 1, characterized in that After storing the target information resource in the local cache space of the current node, the method further includes: Create a cache metadata index for the target information resource in the current node, where the cache metadata index includes a resource version identifier, a cache validity period, and source node verification information; Start a periodic cache health check task, and the cache health check task performs the following operations based on the cache metadata index: establish a communication connection with the source node through the source node verification information, verify the consistency between the resource version identifier and the current resource version of the source node, and verify the remaining duration of the cache validity period; When it is detected that the resource version identifier of the target information resource is inconsistent with the current resource version of the source node, an incremental data synchronization request is triggered, and the version difference data is obtained from the source node based on the source node verification information and the local cache content is updated; When it is detected that the remaining duration of the cache validity period is lower than the preset expiration threshold, a cache renewal request including the resource version identifier and the source node verification information is generated and sent to the source node, and the cache validity period is extended after receiving the renewal authorization response returned by the source node; The access frequency of the target information resource in the local cache space is statistically counted in real time, and the data transmission volume based on the cache metadata index record is established. A periodic adjustment function including an access frequency factor, a data transmission volume factor, and a cache validity period factor is established, and the execution period of the cache health check task is dynamically adjusted according to the periodic adjustment function. Among them, the execution period is negatively correlated with the access frequency factor and positively correlated with the data transmission volume factor.
8. The method for optimizing local cache resources in combination with node states according to claim 7, wherein The starting of the periodic cache health check task includes: Configuring the basic execution interval time and the maximum allowable delay time of the cache health check task; Monitoring the system load status and network congestion degree of the current node, and dynamically extending the basic execution interval time according to the system load status; When it is detected that the network congestion degree exceeds the preset congestion threshold, a delayed execution queue is enabled to temporarily store the cache health check task, and the tasks in the queue are executed in the order of priority after the network congestion degree decreases; Recording the execution time consumption and resource consumption data of each cache health check task, and training a task scheduling optimization model according to the historical execution data; Calling the task scheduling optimization model to predict the node load change trend in the future time period, and dynamically adjusting the trigger time point of the cache health check task based on the prediction result; When it is detected that the target information resource is marked as a priority resource, a forced check instruction is generated to overwrite the dynamically adjusted trigger time point.
9. The local cache resource optimization method in combination with node states according to claim 1, characterized in that After the cache resource distribution update instruction is generated, the method further includes: Registering the cache location change event of the target information resource in the control plane of the distributed network, and generating a resource location metadata update request; Broadcasting the resource location metadata update request to all routing nodes in the distributed network, and triggering the forwarding rule update operation of the routing nodes; Receiving the rule update confirmation signal returned by the routing node, and counting the number of routing nodes that have confirmed the update and the list of unconfirmed nodes; Resending the metadata update request to the routing nodes in the unconfirmed node list, and starting a retry counter to limit the number of sending times; When the retry counter reaches the preset maximum retry threshold and no confirmation signal is received, the routing nodes in the unconfirmed node list are marked as abnormal nodes and the network topology reconstruction process is triggered; Updating the node connection relationship of the distributed network according to the network topology reconstruction process, and generating a new optimal transmission path to bypass the abnormal nodes.
10. A local cache resource optimization system combined with node status, characterized in that It includes a processor and a memory. The memory is connected to the processor. The memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the local cache resource optimization method for combining node states described in any one of claims 1-9 above.
Citation Information
Patent Citations
Destroy-resistant wireless sensor network node under field survival conditions
CN105611652A
Method for allocating millimeter wave phased-array antenna communication resources as required
CN110891317A
Fog computing network content cache replacement method based on value function
CN111124298A
Internet of Things edge gateway adaptive data caching and synchronizing method, system and device and storage medium
CN119652904A
Intelligent caching method and device for loading front-end resources as required, equipment and medium
CN119691305A
Cited By
Elastic load balancing ten-million-level concurrent access processing method and system
CN120711010A
Cross-data-space data circulation method
CN120825433A
A data flow method across data spaces
CN120825433B
Cloud-edge collaborative intelligent control edge computing terminal
CN121486425A
Dynamic cache management method and device of Internet of Vehicles and computer equipment
CN122340178A