Digital network switch caching method, device and equipment for scientific data center

By adopting cascaded cache structure topology network and multi-dimensional cache functions in digital networking, the response data is selectively cached, which solves the problems of switch resource overhead and low transmission efficiency, and realizes load balancing and efficient data transmission.

CN118488108BActive Publication Date: 2025-01-10PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410588192.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2025-01-10
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

In digital networking, when a switch processes request and response messages without cache, it leads to increased overhead of computing resources and network bandwidth, which may lead to network congestion and crash of the switch cache system, and inefficient data transmission.

Method used

The cascading cache structure topological network is adopted to calculate the cache priority of the response data through a multi-dimensional cache function, and selectively cache the response data according to the cache replacement algorithm to reduce switch resource overhead and achieve load balancing.

Benefits of technology

By selectively caching response data, the switch's resource overhead and network load are reduced, data transmission efficiency is improved, and switch caches are easier to hit the client's needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118488108B_ABST
    Figure CN118488108B_ABST
Patent Text Reader

Abstract

The present application provides a method, device and equipment for caching a digital networking switch for a scientific data center. The method is applied to at least one switch in a cascaded cache structure topology network, including: receiving multiple response data from a digital object warehouse; calculating the cache priority of multiple response data according to a multi-dimensional cache function to obtain the cache priority of each response data, and the multi-dimensional cache function is determined according to the cache scenario; determining the response data to be cached from the multiple response data according to the cache priority of each response data; according to the cache replacement algorithm, using the response data to be cached to replace the cache response data in the switch, so as to cache the response data to be cached to the switch, and the cache replacement algorithm is determined according to the hit rate of the lower-level device. In this way, the method reduces the resource overhead of the switch in the digital networking and realizes load balancing, thereby improving the data transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital networking technology, and in particular to a digital networking switch caching method, device and equipment for a scientific data center. Background Art

[0002] The data network is a network that combines and interacts with data from multiple fields. When transmitting data within and between domains, data needs to pass through a large number of switches. The performance of the switch greatly affects the overall transmission efficiency, so it is necessary to improve the performance of the switch. In the case of a data network without a cache on the switch, the request and response messages need to pass through the entire link completely each time. For the switch, unnecessary computing resources and network bandwidth overhead are added. For the entire network, it is also easy to cause network congestion, resulting in low overall transmission efficiency.

[0003] In the digital network, all kinds of data storage formats are fixed and stored in the warehouse in the form of digital objects. When transmitted over the network, they are transmitted in the form of digital object messages, which contain metadata and the data itself. For switches, they can easily obtain some metadata to make cache decisions. When digital object messages pass through switches, some of their built-in operations will consume the computing and storage resources of the switches. Unreasonable routing paths will increase the network load of local switches and may cause the internal cache system of some switches to crash.

[0004] Therefore, how to reduce the resource overhead of switches in digital networks, achieve load balancing, and improve data transmission efficiency is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of the above problems, the embodiments of the present application provide a method, apparatus and device for caching a digital network switch for a scientific data center, so as to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect of an embodiment of the present application, a data network switch caching method for a scientific data center is disclosed, which is applied to at least one switch in a cascaded cache structure topology network, and the method includes:

[0007] receiving a plurality of response data from a digital object repository;

[0008] Calculating the cache priorities of the plurality of response data according to a multi-dimensional cache function to obtain a cache priority of each response data, wherein the multi-dimensional cache function is determined according to a cache scenario;

[0009] Determining response data to be cached from the plurality of response data according to the cache priority of each of the response data;

[0010] According to a cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached, so as to cache the response data to be cached in the switch. The cache replacement algorithm is determined according to the hit rate of the lower-level device.

[0011] Optionally, the response data includes multi-dimensional indicator values, and the method further includes:

[0012] Detecting cache scenarios, including: indicator value priority constraints, non-indicator value priority constraints considering indicator consistency, and non-indicator value priority constraints considering the importance of indicator data;

[0013] When the cache scenario changes, switching the multi-dimensional cache function;

[0014] Calculating the cache priorities of the plurality of response data according to the multi-dimensional cache function to obtain the cache priority of each response data includes:

[0015] The cache priorities of the plurality of response data are calculated according to the switched multi-dimensional cache function to obtain the cache priority of each response data.

[0016] Optionally, the method further comprises:

[0017] Monitor the indicator values ​​of the response data;

[0018] When the change amount of the indicator value exceeds the threshold change amount, switching the cache replacement algorithm according to the association relationship between the indicator value and the cache replacement algorithm;

[0019] According to the cache replacement algorithm, the cache response data in the switch is replaced by the response data to be cached, including:

[0020] According to the switched cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached.

[0021] Optionally, the response data includes multi-dimensional indicator values. When the cache scenario is a non-indicator value priority constraint, the cache priorities of the multiple response data are calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including:

[0022] Normalizing each indicator value of the response data to obtain multiple normalized indicator values ​​corresponding to the response data;

[0023] According to the multi-dimensional cache function, the multiple normalized indicator values ​​are calculated to obtain the cache priority of each response data.

[0024] Optionally, normalizing each indicator value of the response data to obtain multiple normalized indicator values ​​corresponding to the response data includes:

[0025] According to the actual indicator values ​​collected within the preset time, the maximum boundary value and the minimum boundary value of each indicator value are determined;

[0026] According to the maximum boundary value and the minimum boundary value, each indicator value is normalized and calculated to obtain a plurality of normalized indicator values ​​corresponding to the response data.

[0027] Optionally, the multiple normalized indicator values ​​are calculated according to the multi-dimensional cache function to obtain a cache priority of each response data, including:

[0028] Under the condition of considering the non-index value priority constraint of the index consistency, the multiple normalized index values ​​are multiplied to obtain the cache priority of each response data;

[0029] Under the condition of considering the non-index value priority constraint of the importance of the index data, the multiple normalized index values ​​are weightedly summed to obtain the cache priority of each response data.

[0030] Optionally, the response data includes multi-dimensional indicator values. When the cache scenario is an indicator value priority constraint, the cache priority of the multiple response data is calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including:

[0031] Determine the constraint indicators according to the indicator value priority constraints;

[0032] Sorting the plurality of response data according to the constraint indicator value of each response data, and obtaining the cache priority of each response data according to the sorting result; or,

[0033] It is determined whether the constraint index value of each response data is greater than the constraint index threshold, and the cache priority of each response data is obtained according to the determination result.

[0034] Optionally, the cascade cache structure topology network is pre-configured, in which each digital object warehouse transmits response data through a directly connected switch, and each client obtains response data from the digital object warehouse through a directly connected switch and multiple intermediate layer switches.

[0035] In a second aspect of the embodiment of the present application, a data network switch cache device for a scientific data center is disclosed, which is applied to at least one switch in a cascade cache structure topology network, and the device includes:

[0036] A receiving module, used for receiving a plurality of response data from a digital object repository;

[0037] a calculation module, configured to calculate the cache priority of the plurality of response data according to a multi-dimensional cache function to obtain the cache priority of each response data, wherein the multi-dimensional cache function is determined according to a cache scenario;

[0038] A determination module, configured to determine the response data to be cached from the plurality of response data according to the cache priority of each of the response data;

[0039] The replacement module is used to replace the cache response data in the switch with the response data to be cached according to a cache replacement algorithm, so as to cache the response data to be cached in the switch. The cache replacement algorithm is determined according to the hit rate of the lower-level device.

[0040] According to a third aspect of an embodiment of the present application, an electronic device is disclosed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the digital network switch caching method for a scientific data center described in the first aspect of the embodiment of the present application are implemented.

[0041] The embodiments of the present application include the following advantages:

[0042] In an embodiment of the present application, a cascaded cache structure topology network is used for caching, and each switch receives multiple response data from a digital object warehouse; and the cache priority of the multiple response data is calculated according to a multi-dimensional cache function to obtain the cache priority of each response data, and the multi-dimensional cache function is determined according to a cache scenario; according to the cache priority of each of the response data, the response data to be cached is determined from the multiple response data; according to a cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached, so as to cache the response data to be cached to the switch, and the cache replacement algorithm is determined according to the hit rate of the lower-level device.

[0043] Since each switch in the cascade cache structure topology network does not cache all the response data received, but selects the data to be cached according to the multi-dimensional cache function, the cache of switches at different levels in the cascade cache structure topology network is more balanced, reducing the resource overhead in the switch. In addition, the cache priority of each response data is calculated according to the multi-dimensional cache function determined by the cache scenario, so that reasonable response data to be cached can be selected in different cache scenarios; the cache response data in the switch is replaced according to the cache replacement algorithm determined by the hit rate of the lower-level device, so that the cache of the switch is more likely to hit the client's needs. In this way, the resource overhead of the switch in the digital network is reduced and load balancing is achieved, thereby improving the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 It is a schematic diagram of a cascade cache structure topology network provided in an embodiment of the present application;

[0046] Figure 2 It is a flowchart of the steps of a data network switch caching method for a scientific data center provided by an embodiment of the present application;

[0047] Figure 3 It is a flowchart of another method for caching a data network switch for a scientific data center provided by an embodiment of the present application;

[0048] Figure 4 It is a structural schematic diagram of a data network switch cache device for a scientific data center provided by an embodiment of the present application;

[0049] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] The digital network switch caching method for scientific data centers provided in the embodiment of the present application is mainly used in switches of the digital network. The reason why it is not used in switches of the Internet is that the data formats of the Internet are diverse, and the role of the switch here is an intermediate site. It cannot process a variety of application layer data and can only process it in the form of byte streams or network packets; in the digital network, the data source itself may be more complex, and the format of the encapsulated digital objects is unified, and the metadata and data entities can be easily obtained, which is more convenient for the switch to process.

[0052] In the digital network, the message flow between the client and the digital object warehouse requires a certain number of switches. The number of switches depends on the size of the domain space. When the domain space is small, the number of switches required is small, the cache redundancy between the associated switches is not large, and even no special processing is performed. The performance of each switch backing up all caches originally and reducing redundant cache backups is almost the same. Once the domain space becomes larger, the number of switches increases, and the relationship between switches becomes complex, not only the data routing path must be considered, but also the cache backup degree between the associated switches; unreasonable routing paths will increase the network load of local switches and may cause the internal cache system of some switches to crash.

[0053] The embodiment of the present application takes into account the overall topology of the switch. In order to balance the overall cache load, a cascaded cache structure topology network is used for caching, so that the caches of switches at different levels are more balanced. Figure 1 This is a schematic diagram of a cascade cache structure topology network provided in an embodiment of the present application. The cascade cache structure topology network is pre-configured. In the cascade cache structure topology network, each digital object warehouse transmits response data through a directly connected switch, and each client obtains response data from the digital object warehouse through a directly connected switch and multiple intermediate layer switches.

[0054] Since the switch caches the response data (i.e., response message) from the digital object warehouse, the switch closer to the digital object warehouse is called the upper-layer switch, and the switch directly connected to the digital object warehouse is the top-layer switch. Each digital object warehouse transmits the response data through a directly connected switch (i.e., the top-layer switch); the switch closer to the client is called the bottom-layer switch, and the switch directly connected to the client is the bottom-layer switch. Each client can obtain the response data from the digital object warehouse through a directly connected switch (i.e., the bottom-layer switch) and multiple middle-layer switches.

[0055] In the specific implementation, if the switches at different levels are backed up indiscriminately, then the bottom switch will back up the same cache as the top switch, which is a heavy burden for the bottom switch. The bottom switch may establish a connection with the top switch through multiple routing paths. Once the cache data of multiple top switches are all backed up to the bottom switch, the storage, calculation and network bandwidth overhead of the bottom switch will be greater than that of the top switch. Therefore, when the cache of the upper switch is transferred to the lower switch, partial backup should be selected. A single lower switch will cache the cache data from multiple upper switches, so that the total cache amount may be the same in the end, but for the lower switch, its cache data will be richer. Since a single client may need to use data from multiple digital object warehouses, and usually, a single client is connected to other switches through a single lower switch, the data used by the client is likely to come from multiple digital object warehouses. At this time, the response data from each digital object warehouse is selectively cached in the lower switch in a certain way (i.e., the digital network switch caching method for scientific data centers provided in the embodiment of the present application), and its hit rate and resource overhead will be smaller, which will be more suitable for the client. Moreover, the main function of the upper-layer switch cache is to cache the response messages of a single digital object warehouse that is more closely related to it. Such a switch has stronger directionality, and its cached data is more closely related to the data of a single warehouse.

[0056] Based on this cascaded cache structure topology network, the switch selectively caches the received response data, making the caches of switches at different levels more balanced, thereby improving the data transmission efficiency. The following is a detailed description of the data network switch cache method for scientific data centers provided in the embodiment of the present application.

[0057] Reference Figure 2 As shown, Figure 2 The embodiment of the present application provides a flow chart of the steps of a data network switch caching method for a scientific data center, which is applied to at least one switch in a cascade cache structure topology network. The switch can be as follows: Figure 1 For any switch shown, each switch in the cascade cache topology network is based on Figure 2 The schematic diagram shows a method for caching data in a network switch for scientific data centers to cache response data. Figure 2 As shown, the method may include steps S210 to S240:

[0058] Step S210: receiving a plurality of response data from the digital object repository.

[0059] In the embodiment of the present application, in a cascade cache structure topology network, the client obtains multiple response data from the digital object warehouse through a corresponding routing path, and the routing path includes multiple switches. Each switch can obtain multiple response data from the digital object warehouse through an upper-level switch, or directly receive multiple response data from the digital object warehouse. The multiple response data can come from the same digital object warehouse or from multiple digital object warehouses.

[0060] For example, Figure 1 The client 1 in the example can obtain multiple response data from the digital object warehouse 1 through the routing path composed of switch 1, switch 3 and switch 6. Among them, switch 1 directly receives multiple response data fed back from the digital object warehouse 1, switch 3 receives multiple response data fed back from the digital object warehouse 1 through switch 1, and switch 6 receives multiple response data fed back from the digital object warehouse 1 through switch 3, and finally transmits the response data to the client 1.

[0061] Step S220: Calculate the cache priority of the multiple response data according to the multi-dimensional cache function to obtain the cache priority of each response data, wherein the multi-dimensional cache function is determined according to the cache scenario.

[0062] In an embodiment of the present application, in order to reduce the cache resource consumption of the switch, each switch selectively caches multiple received response data. In order to make the selected cache response data (i.e., the data to be cached) better meet the hit rate of the lower-level device (such as the lower-level switch, the client), the cache priority of each response data is calculated through a multi-dimensional cache function to measure whether the response data needs to be cached based on the cache priority.

[0063] The response data includes multi-dimensional indicator values, including: storage time of response message, frequency of client access to the digital object, time delay of response message, maximum storage time of response message, computing cost of operation executed by response message on switch, storage cost of response message on switch, network bandwidth of switch. The above indicator values ​​are quantified by multi-dimensional cache function to obtain a common dimension value, and the cache priority of response data is determined by the common dimension value.

[0064] In some optional implementations of the embodiments of the present application, the cache priority can be represented by a numerical value. For example, the cache priority of response data A is 2, and the cache priority of response data B is 1. In this case, the cache priority of response data A is greater than that of response data B. In some other optional implementations of the embodiments of the present application, the cache priority can also be represented by a priority category. For example, the cache priority of response data A is represented as a high priority, and the cache priority of response data B is represented as a low priority.

[0065] The multi-dimensional cache function is determined according to the cache scenario. Different cache scenarios have different corresponding types of multi-dimensional cache functions. In addition, the multi-dimensional cache function can be predetermined according to the cache scenario, or it can be flexibly adjusted according to the cache scenario. Specifically, the cache scenario includes indicator value priority constraints and non-indicator value priority constraints, wherein the indicator value priority constraints refer to considering the priority restriction relationship between different indicator values. When calculating the cache priority of the response data, the multi-dimensional cache function only calculates according to the indicator value with the high priority; the non-indicator value priority constraints refer to not considering the priority restriction relationship between different indicator values. When calculating the cache priority of the response data, all indicator values ​​of the multi-dimensional cache function are calculated.

[0066] The following describes the cache priority calculation methods in different cache scenarios.

[0067] (1) The response data includes multi-dimensional indicator values. When the cache scenario is non-indicator value priority constraint, the cache priorities of the multiple response data are calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including steps A1 to A2:

[0068] Step A1: normalize each indicator value of the response data to obtain a plurality of normalized indicator values ​​corresponding to the response data.

[0069] In the embodiment of the present application, the response data is evaluated for cache priority from multiple dimensions. The response data contains multi-dimensional index values, which are not uniformly measured and are therefore difficult to compare. Therefore, multiple index values ​​in the response data are normalized and converted to the same dimension for comparison.

[0070] Specifically, each indicator value of the response data is normalized to obtain multiple normalized indicator values ​​corresponding to the response data, including: determining the maximum boundary value and the minimum boundary value of each indicator value based on the actual indicator values ​​collected within a preset time; and performing normalization calculation on each indicator value based on the maximum boundary value and the minimum boundary value to obtain multiple normalized indicator values ​​corresponding to the response data.

[0071] The preset time is a time period flexibly set according to actual usage, for example, the preset time can be one hour. In an optional implementation of the embodiment of the present application, according to the actual indicator value collected within the preset time, the maximum boundary value and the minimum boundary value of each indicator value are determined, including: for each indicator data, multiple actual indicator values ​​within the preset time are collected, the endpoint values ​​of the multiple actual indicator values ​​collected are removed, and the maximum value remaining after removing the endpoints is enlarged by 1 times to obtain the maximum boundary value x max , reduce the remaining minimum value after removing the endpoint by half to get the minimum boundary value x min . This solves the problem that the actual index values ​​collected cannot completely cover the entire range of reasonable values. This method follows the idea of ​​normal distribution and prevents the collected boundary values ​​from shrinking, making them closer to the boundary values.

[0072] For the indicator value x, according to the maximum boundary value x max and the minimum boundary value x min The normalized calculation of the indicator value is expressed as:

[0073]

[0074] Among them, y represents the normalized indicator value corresponding to the indicator value x.

[0075] Step A2: According to the multi-dimensional cache function, the multiple normalized indicator values ​​are calculated to obtain the cache priority of each response data.

[0076] In the embodiment of the present application, since the monitored indicators are multi-dimensional, it is necessary to calculate a value that comprehensively considers the numerical values ​​of each indicator as the cache priority of the response data. In order to make the cache priority of the response data more in line with actual use, the non-indicator numerical priority constraints are divided into two cache scenarios: non-indicator numerical priority constraints considering indicator consistency and non-indicator numerical priority constraints considering the importance of indicator data. Among them, the non-indicator numerical priority constraint considering indicator consistency means: the response data does not distinguish the importance of the indicator values, all indicator values ​​are equally important, that is, the weights of each indicator value are the same; the non-indicator numerical priority constraint considering the importance of indicator data means: distinguishing the importance of each indicator value in the response data, and giving a larger weight value to important indicator values.

[0077] Specifically, according to the multi-dimensional cache function, the multiple normalized indicator values ​​are calculated to obtain the cache priority of each response data, including step A21 and step A22:

[0078] Step A21: Under the non-index value priority constraint of index consistency, the multiple normalized index values ​​are multiplied to obtain the cache priority of each response data.

[0079] For example, the cache priority z of the response data can be expressed as:

[0080] z=\prod\limits_{i=1}^n y_{i},

[0081] Among them, the \prod function is used to find the product of array elements, the \limits function is used to represent data within a certain range, y_{i} represents the i-th normalized indicator value, and n represents the number of indicator values. Therefore, \prod\limits_{i=1}^ny_{i} means multiplying the 1st normalized indicator value to the nth normalized indicator value.

[0082] At this time, the weights of the various indicator values ​​in the response data are the same, and the calculation method of the cache priority of the response data is suitable for cache priority calculation in general scenarios.

[0083] Step A22: taking into account the non-index value priority constraint of the importance of the index data, weighted summing the multiple normalized index values ​​is performed to obtain the cache priority of each response data.

[0084] For example, the cache priority z of the response data can be expressed as:

[0085]

[0086] Among them, α iis the weight corresponding to the value of the ith indicator, y i Indicates the i-th normalized indicator value, and n indicates the number of indicator values. At this time, the cache priority is obtained based on the importance of each indicator value. In some extreme cases, some indicator values ​​are particularly important. This uses a weighted summation method and assigns a higher weight to the indicator value, so that the calculated cache priority of the response data is more reasonable.

[0087] (2) The response data includes multi-dimensional indicator values. When the cache scenario is an indicator value priority constraint, the cache priorities of the multiple response data are calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including steps B1 to B3:

[0088] Step B1: Determine the constraint indicator according to the indicator value priority constraint.

[0089] Step B2: sorting the plurality of response data according to the constraint indicator value of each response data, and obtaining the cache priority of each response data according to the sorting result.

[0090] Step B3: Determine whether the constraint index value of each response data is greater than the constraint index threshold, and obtain the cache priority of each response data according to the determination result.

[0091] In the embodiment of the present application, the priority restriction relationship between different indicator values ​​is taken into account. When calculating the cache priority of the response data, the multi-dimensional cache function is calculated only according to the indicator value with high priority. Specifically, step B1 is executed first to determine the constraint indicator; for example, considering the constraint of indicator value 1 in the response data, that is, indicator value 1 is the constraint indicator, and the cache priority calculation is performed only based on indicator value 1.

[0092] Then, step B2 or step B3 is performed. For step B2, the constraint index values ​​of the plurality of response data are sorted, and the cache priority of the top N response data is determined as a high priority (i.e., the top N response data are selected for caching), and the cache priority of the remaining response data is determined as a low priority (i.e., the response data after the top N response data are not cached). For step B3, a constraint index threshold is determined according to actual usage, and the cache priority of the response data whose constraint index value is greater than the constraint index threshold is determined as a high priority (i.e., the response data is selected for caching), and the cache priority of the response data whose constraint index value is not greater than the constraint index threshold is determined as a low priority (i.e., the response data is not selected for caching).

[0093] Step S230: Determine the response data to be cached from the multiple response data according to the cache priority of each response data.

[0094] In an embodiment of the present application, the cache priority of the response data is the basis for determining whether the response data is cached. According to the cache priority of each response data, the response data to be cached is determined from multiple response data. The response data to be cached refers to the data that is about to be cached in the switch.

[0095] In some optional implementations of the embodiments of the present application, the cache priority can be represented by a numerical value, and the response data to be cached is determined from the multiple response data according to the cache priority of each response data, including: sorting the multiple response data according to the cache priority of each response data, and determining the first M response data in the sorting result as the response data to be cached. In some other optional implementations of the embodiments of the present application, the cache priority can also be represented by a priority category (such as high priority and low priority), and the response data to be cached is determined from the multiple response data according to the cache priority of each response data, including: determining the response data with a high cache priority as the response data to be cached.

[0096] Step S240: according to a cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached, so as to cache the response data to be cached in the switch, wherein the cache replacement algorithm is determined according to the hit rate of the lower-level device.

[0097] In the embodiment of the present application, the cache replacement algorithm includes: first-in-first-out algorithm, least recently used algorithm, least frequently used algorithm, random replacement algorithm and adaptive replacement algorithm. Different cache replacement algorithms are adaptive to different scenarios (i.e., different cache replacement algorithms correspond to different indicator value ranges). A suitable cache replacement algorithm can improve the cache hit rate without causing excessive overhead.

[0098] The cache replacement algorithm is the default cache replacement algorithm inside the switch, and can also be flexibly set according to the hit rate of the lower-level device. When the switch determines the response data to be cached, the cache replacement algorithm will use the response data to be cached to replace the previously cached response data, so that the response data to be cached is cached in the switch.

[0099] The method provided by the above-mentioned embodiment of the present application is that each switch in the cascaded cache structure topology network does not cache all the received response data, but selects the data to be cached for caching according to the multi-dimensional cache function, thereby making the cache of switches at different levels in the cascaded cache structure topology network more balanced and reducing the resource overhead in the switch. In addition, according to the multi-dimensional cache function determined by the cache scenario, the cache priority of each response data is calculated, and more reasonable response data to be cached can be selected in different cache scenarios; according to the cache replacement algorithm determined by the hit rate of the lower-level device, the cache response data in the switch is replaced, so that the cache of the switch is more likely to hit the client's needs. In this way, the resource overhead of the switch in the digital network is reduced and load balancing is achieved through this method, thereby improving the data transmission efficiency.

[0100] Further references Figure 3 , Figure 3 1 is a flowchart of another method for caching a data network switch for a scientific data center provided by an embodiment of the present application. The method is applied to at least one switch in a cascade cache structure topology network, such as Figure 3 As shown, the method includes the following steps 310 to S380:

[0101] Step S310: receiving a plurality of response data from the digital object repository.

[0102] In the embodiment of the present application, step 310 can be referred to Figure 2 The step 210 of the corresponding embodiment will not be described in detail here.

[0103] Step S320: Detect cache scenarios, including: indicator value priority constraints, non-indicator value priority constraints considering indicator consistency, and non-indicator value priority constraints considering the importance of indicator data.

[0104] In the embodiment of the present application, different caching scenarios correspond to different multi-dimensional cache functions. For example, if some indicator values ​​need special consideration (i.e., non-indicator value priority constraints of indicator consistency are considered), the cache priority of the response data should be calculated by weighted summation; if the importance of the indicator value is not considered (i.e., non-indicator value priority constraints of indicator data importance are considered), the cache priority of the response data should be calculated by accumulation, which will reduce the amount of calculation and save more computing resources.

[0105] A default multi-dimensional cache function is pre-configured in the interactive machine. In actual use, the multi-dimensional cache function in the interactive machine can be adjusted according to the cache scenario to match the multi-dimensional cache function with the actual cache scenario.

[0106] Step S330: When the cache scenario changes, the multi-dimensional cache function is switched.

[0107] In the embodiment of the present application, due to the change of the cache scenario, the previous multi-dimensional cache function is not applicable to the current cache scenario. When the cache scenario is detected to have changed, the multi-dimensional cache function in the switch needs to be switched to a multi-dimensional cache function that matches the changed cache scenario.

[0108] For example, when it is detected that the cache scenario changes from "non-indicator numerical priority constraints considering indicator consistency" to "non-indicator numerical priority constraints considering indicator data importance", the multi-dimensional cache function is switched to a weighted sum calculation method.

[0109] Step S340: Calculate the cache priorities of the plurality of response data according to the switched multi-dimensional cache function to obtain the cache priority of each response data.

[0110] In the embodiment of the present application, the switched multi-dimensional cache function matches the current cache scenario, and the switched multi-dimensional cache function is used to perform cache priority calculation. Specifically, the response data includes multi-dimensional index values, and the multi-dimensional cache function after switching is used to quantify multiple index values ​​to obtain a common dimension value, and the cache priority of the response data is determined by the common dimension value.

[0111] Step S350: Determine the response data to be cached from the multiple response data according to the cache priority of each response data.

[0112] In the embodiment of the present application, step 350 can be referred to Figure 2 The step 230 of the corresponding embodiment will not be described in detail here.

[0113] Step S360: monitor the indicator values ​​of the response data.

[0114] In the embodiment of the present application, the data usage in the data network (for example, the frequency of data usage, the usage cycle of the same data, etc.) may change, that is, the index value of the response data may change. After the index value changes, if the previous cache replacement algorithm is used for a long time, it may cause the hit rate of the lower-level device to decrease. Therefore, by monitoring the index value of the response data, the cache replacement algorithm can be dynamically adjusted according to the change of the index value.

[0115] In some optional implementations of the embodiments of the present application, the indicator values ​​of the response data are monitored, including: periodic indicator value monitoring and average calculation to obtain more stable indicator values.

[0116] Step S370: When the change in the indicator value exceeds the threshold change, the cache replacement algorithm is switched according to the association between the indicator value and the cache replacement algorithm.

[0117] In an embodiment of the present application, the threshold change is determined based on the resource overhead and data transmission efficiency of the switch. When the change in the indicator value exceeds the threshold change, it means that the cache replacement algorithm at this time is not suitable for the current indicator value. At this time, the cache replacement algorithm needs to be switched in the hope of obtaining a better hit rate of the lower-level device and reducing various resource overheads.

[0118] The relationship between the indicator value and the cache replacement algorithm is predefined in the switch, that is, the reasonable range of the relationship between various indicator values ​​is predefined for each cache replacement algorithm. For example, the cache replacement function corresponding to indicators such as data usage frequency, computing overhead and storage overhead that the switch needs to bear in different value ranges is defined. When the change in the indicator value exceeds the threshold change, the switch automatically switches the cache replacement algorithm according to the current indicator value and the relationship between the indicator value and the cache replacement algorithm.

[0119] It should be noted that step S360 and step S370 may be performed before step S350 or after step S350, which is not limited here.

[0120] Step S380: according to the switched cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached.

[0121] In the embodiment of the present application, according to the cache replacement algorithm after switching, the response data to be cached determined in step S350 is used to replace the previously cached response data, so that the response data to be cached is cached in the switch.

[0122] In an optional implementation method, in order to further improve the hit rate of the lower-level device and reduce various resource overheads, after the cached response data in the switch is replaced with the response data to be cached, the hit rate of the lower-level device is calculated based on the replaced response data in the switch; when the hit rate of the lower-level device does not meet the hit rate threshold, the cache replacement algorithm in the switch continues to be adjusted until the hit rate of the lower-level device meets the hit rate threshold.

[0123] It can be understood that after the multi-dimensional cache function and cache replacement algorithm in the switch are switched, the original cache response data in the switch remains unchanged, and the newly received response data is cached according to the switched multi-dimensional cache function and the switched cache replacement algorithm.

[0124] Furthermore, when the switch stops running, the cached response data in the switch is cleared. The reason is that it is difficult to ensure that the cached response data is fully backed up when the switch is turned on. If it is not fully backed up, once a disorder occurs, it may cause the response data to expire or be wrong. Based on the data network switch cache method for scientific data centers provided by the embodiment of the present application, even if it is cleared, when the switch is restarted, it is only time-consuming for a period of time at the beginning of the startup, which will not affect the subsequent operation efficiency, and the cost is relatively low.

[0125] from Figure 3 It can be seen that Figure 2 Compared with the corresponding embodiments, the data network switch caching method for scientific data centers in the embodiments of the present application involves the step of switching the multi-dimensional cache function and cache replacement algorithm in the switch. Therefore, the scheme described in the embodiments of the present application can be flexibly and adaptively adjusted according to the changes in the cache scenarios and actual usage of data in the data network, and can always select more reasonable cache data for caching, further improving the hit rate of the lower-level devices and reducing various resource overheads.

[0126] The embodiment of the present application also provides a data network switch cache device for a scientific data center, which is applied to at least one switch in a cascade cache structure topology network, referring to Figure 4 As shown, Figure 4 1 is a schematic diagram of a structure of a data network switch cache device for a scientific data center provided in an embodiment of the present application, the device comprising:

[0127] The receiving module 410 is used to receive a plurality of response data from the digital object repository;

[0128] A calculation module 420, configured to calculate the cache priority of the plurality of response data according to a multi-dimensional cache function to obtain a cache priority of each response data, wherein the multi-dimensional cache function is determined according to a cache scenario;

[0129] A determination module 430 is configured to determine the response data to be cached from the plurality of response data according to the cache priority of each of the response data;

[0130] The replacement module 440 is used to replace the cached response data in the switch with the response data to be cached according to a cache replacement algorithm, so as to cache the response data to be cached in the switch. The cache replacement algorithm is determined according to the hit rate of the lower-level device.

[0131] In an optional embodiment, the device further includes:

[0132] A detection module is used to detect cache scenarios, wherein the cache scenarios include: indicator value priority constraints, non-indicator value priority constraints considering indicator consistency, and non-indicator value priority constraints considering the importance of indicator data;

[0133] A first switching module, configured to switch the multi-dimensional cache function when the cache scenario changes;

[0134] The switching module comprises:

[0135] The first replacement submodule is used to calculate the cache priority of the multiple response data according to the switched multi-dimensional cache function to obtain the cache priority of each response data.

[0136] In an optional embodiment, the device further includes:

[0137] A detection module is used to monitor the indicator values ​​of the response data;

[0138] A second switching module is used to switch the cache replacement algorithm according to the association relationship between the indicator value and the cache replacement algorithm when the change amount of the indicator value exceeds the threshold change amount;

[0139] The switching module comprises:

[0140] The second replacement submodule is used to replace the cache response data in the switch with the response data to be cached according to the switched cache replacement algorithm.

[0141] In an optional embodiment, the response data includes multi-dimensional indicator values. When the cache scenario is a non-indicator value priority constraint, the calculation module includes:

[0142] A normalization processing module, used for performing normalization processing on each indicator value of the response data to obtain a plurality of normalized indicator values ​​corresponding to the response data;

[0143] The cache priority calculation module is used to calculate the multiple normalized indicator values ​​according to the multi-dimensional cache function to obtain the cache priority of each response data.

[0144] In an optional embodiment, the normalization processing module includes:

[0145] A boundary determination module, used to determine the maximum boundary value and the minimum boundary value of each indicator value according to the actual indicator values ​​collected within a preset time;

[0146] The normalization calculation module is used to perform normalization calculation on each indicator value according to the maximum boundary value and the minimum boundary value to obtain multiple normalized indicator values ​​corresponding to the response data.

[0147] In an optional embodiment, the cache priority calculation module includes:

[0148] A multiplication module, used for multiplying the plurality of normalized indicator values ​​to obtain a cache priority of each response data while taking into account a non-indicator numerical priority constraint of indicator consistency;

[0149] The weighted summation module is used to perform weighted summation on the multiple normalized indicator values ​​under the condition of considering the non-indicator value priority constraint of the indicator data importance, so as to obtain the cache priority of each response data.

[0150] In an optional embodiment, the response data includes multi-dimensional indicator values. When the cache scenario is an indicator value priority constraint, the calculation module includes:

[0151] A constraint indicator module is used to determine the constraint indicator according to the indicator value priority constraint;

[0152] A sorting module, used to sort the plurality of response data according to the constraint indicator value of each response data, and obtain the cache priority of each response data according to the sorting result;

[0153] The judgment module is used to judge whether the constraint index value of each response data is greater than the constraint index threshold, and obtain the cache priority of each response data according to the judgment result.

[0154] In an optional embodiment, the cascade cache structure topology network is preconfigured, in which each digital object warehouse transmits response data through a directly connected switch, and each client obtains response data from the digital object warehouse through a directly connected switch and multiple intermediate layer switches.

[0155] The present application also provides an electronic device, referring to Figure 5 , Figure 5 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 500 includes: a memory 510 and a processor 520, the memory 510 and the processor 520 are connected via a bus communication, the memory 510 stores a computer program, and the computer program can be run on the processor 520, thereby implementing the steps of the digital network switch caching method for a scientific data center described in the embodiment of the present application.

[0156] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0157] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods and devices according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0158] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0160] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0161] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0162] The above is a detailed introduction to a data network switch caching method, device and equipment for a scientific data center provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data network switch caching method for a scientific data center, characterized in that: Applied to at least one switch in a cascaded cache structure topology network, the method comprises: receiving a plurality of response data from a digital object repository; Calculating the cache priorities of the plurality of response data according to a multi-dimensional cache function to obtain a cache priority of each response data, wherein the multi-dimensional cache function is determined according to a cache scenario; Determining response data to be cached from the plurality of response data according to the cache priority of each of the response data; According to a cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached, so as to cache the response data to be cached in the switch, wherein the cache replacement algorithm is determined according to a hit rate of a lower-level device; The cache scenario includes: indicator value priority constraints, non-indicator value priority constraints considering indicator consistency, and non-indicator value priority constraints considering the importance of indicator data. The indicator value priority constraints refer to the priority restriction relationship between different indicator values. The response data contains multi-dimensional indicator values, which include: response message storage time, client access frequency of the digital object, response message time delay, response message maximum storage time, response message operation calculation overhead consumed on the switch, response message storage overhead on the switch, and switch network bandwidth. In the case where the cache scenario is a non-indicator numerical priority constraint, the cache priorities of the multiple response data are calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including: normalizing each indicator value of the response data to obtain multiple normalized indicator values ​​corresponding to the response data; in the case of a non-indicator numerical priority constraint considering indicator consistency, multiplying the multiple normalized indicator values ​​to obtain the cache priority of each response data; in the case of a non-indicator numerical priority constraint considering the importance of the indicator data, weighted summing the multiple normalized indicator values ​​to obtain the cache priority of each response data; In the case where the cache scenario is an indicator value priority constraint, the cache priority of the multiple response data is calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including: determining the constraint indicator according to the indicator value priority constraint; sorting the multiple response data according to the constraint indicator value of each response data, and obtaining the cache priority of each response data according to the sorting result; or, judging whether the constraint indicator value of each response data is greater than the constraint indicator threshold, and obtaining the cache priority of each response data according to the judgment result.

2. The method according to claim 1, characterized in that The response data includes multi-dimensional indicator values, and the method further includes: Detect cache scenarios; When the cache scenario changes, switching the multi-dimensional cache function; Calculating the cache priorities of the plurality of response data according to the multi-dimensional cache function to obtain the cache priority of each response data includes: The cache priorities of the plurality of response data are calculated according to the switched multi-dimensional cache function to obtain the cache priority of each response data.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Monitor the indicator values ​​of the response data; When the change amount of the indicator value exceeds the threshold change amount, switching the cache replacement algorithm according to the association relationship between the indicator value and the cache replacement algorithm; According to the cache replacement algorithm, the cache response data in the switch is replaced by the response data to be cached, including: According to the switched cache replacement algorithm, the cache response data in the switch is replaced with the response data to be cached.

4. The method according to claim 1, characterized in that Normalizing each indicator value of the response data to obtain multiple normalized indicator values ​​corresponding to the response data, including: According to the actual indicator values ​​collected within the preset time, the maximum boundary value and the minimum boundary value of each indicator value are determined; According to the maximum boundary value and the minimum boundary value, each indicator value is normalized and calculated to obtain a plurality of normalized indicator values ​​corresponding to the response data.

5. The method according to claim 1, characterized in that The cascade cache structure topology network is preconfigured. In the cascade cache structure topology network, each digital object warehouse transmits response data through a directly connected switch, and each client obtains response data from the digital object warehouse through a directly connected switch and multiple intermediate layer switches.

6. A data network switch cache device for a scientific data center, characterized in that: Applied to at least one switch in a cascade cache structure topology network, the device comprises: A receiving module, used for receiving a plurality of response data from a digital object repository; a calculation module, configured to calculate the cache priority of the plurality of response data according to a multi-dimensional cache function to obtain the cache priority of each response data, wherein the multi-dimensional cache function is determined according to a cache scenario; A determination module, configured to determine the response data to be cached from the plurality of response data according to the cache priority of each of the response data; a replacement module, configured to replace cached response data in the switch with the response data to be cached according to a cache replacement algorithm, so as to cache the response data to be cached in the switch, wherein the cache replacement algorithm is determined according to a hit rate of a lower-level device; The cache scenario includes: indicator value priority constraints, non-indicator value priority constraints considering indicator consistency, and non-indicator value priority constraints considering the importance of indicator data. The indicator value priority constraints refer to the priority restriction relationship between different indicator values. The response data contains multi-dimensional indicator values, which include: response message storage time, client access frequency of the digital object, response message time delay, response message maximum storage time, response message operation calculation overhead consumed on the switch, response message storage overhead on the switch, and switch network bandwidth. In the case where the cache scenario is a non-indicator numerical priority constraint, the cache priorities of the multiple response data are calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including: normalizing each indicator value of the response data to obtain multiple normalized indicator values ​​corresponding to the response data; in the case of a non-indicator numerical priority constraint considering indicator consistency, multiplying the multiple normalized indicator values ​​to obtain the cache priority of each response data; in the case of a non-indicator numerical priority constraint considering the importance of the indicator data, weighted summing the multiple normalized indicator values ​​to obtain the cache priority of each response data; In the case where the cache scenario is an indicator value priority constraint, the cache priority of the multiple response data is calculated according to the multi-dimensional cache function to obtain the cache priority of each response data, including: determining the constraint indicator according to the indicator value priority constraint; sorting the multiple response data according to the constraint indicator value of each response data, and obtaining the cache priority of each response data according to the sorting result; or, judging whether the constraint indicator value of each response data is greater than the constraint indicator threshold, and obtaining the cache priority of each response data according to the judgment result.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data network switch caching method for a scientific data center described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Cache replacement method and device thereof, and heterogeneous multi-core system

    CN109032964A

  • Remote cache replacement method and device for big data platform

    CN115718767A