Mirror image caching method and device, electronic equipment and storage medium

By calculating value parameters such as timeliness, latency differences and redundancy factors of the mirror layer at edge nodes, and generating cache strategies, the problem of low cache hit rate in edge cloud environments is solved, achieving higher hit rate and lower network latency.

CN120475036APending Publication Date: 2025-08-12TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510556132.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In edge cloud environments, the prior art determines whether cache causes a low cache hit rate based on the popularity of the mirror layer only.

Method used

By obtaining value parameters such as timeliness, delay differences, popularity and redundancy factors of the mirror layer, the weight parameter adjustment model calculates the value of the mirror layer, and a cache strategy is generated to decide whether to cache the mirror layer.

Benefits of technology

Improve the hit rate of the cache policy, reduce the number of replacements of the mirror layer, and reduce network latency and bandwidth resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120475036A_ABST
    Figure CN120475036A_ABST
Patent Text Reader

Abstract

The invention provides a mirror image caching method and device, electronic equipment and a storage medium, and relates to the technical field of distributed caching. The method is applied to an edge node, the edge node belongs to a cache system, N mirror image layers are cached in the edge node, N is an integer larger than 1, the residual cache capacity of the edge node is smaller than the size of a to-be-cached mirror image layer, the method comprises the steps that value parameters of each mirror image layer in N + 1 mirror image layers are obtained, the N + 1 mirror image layers comprise the N mirror image layers and the to-be-cached mirror image layer, the value parameters comprise timeliness and delay difference of the mirror image layer, and popularity and redundancy factors of the mirror image layer in the cache system; determining the value of each mirror image layer according to the value parameter of each mirror image layer; generating a caching strategy according to the value of each mirror image layer; and performing mirror image caching according to the caching strategy. In this way, the hit rate of the mirror image layer cached by the edge node can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed caching technology, and in particular to a mirror caching method, device, electronic device, and storage medium. Background Art

[0002] With the rise of AIGC (Artificial Intelligence Generated Content) services, edge cloud computing, with its low latency and efficient data processing capabilities, has become an ideal platform for deploying AIGC services. Containerization technology, due to its resource isolation, lightweight nature, and high portability, has become the primary form of service deployment in edge cloud environments.

[0003] In related technologies, whether to cache an image layer is determined by the popularity of the image layer in an edge cloud environment.

[0004] However, simply determining whether to cache an image layer based on its popularity results in a low hit rate for cached images. Summary of the Invention

[0005] The present application provides an image caching method, device, electronic device, and storage medium, which at least to some extent overcome the problem of low hit rate of cached images in related technologies.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0007] According to one aspect of the present application, there is provided an image caching method, which is applied to an edge node, the edge node belonging to a cache system, wherein N image layers are cached in the edge node, where N is an integer greater than 1, and the remaining cache capacity of the edge node is less than the size of the image layer to be cached. The method includes: obtaining a value parameter of each of N+1 image layers, where the N+1 image layers include the N image layers and the image layer to be cached, the value parameters including the timeliness, delay difference, popularity, and redundancy factor of the image layer in the cache system; determining the value of each image layer according to the value parameter of each image layer; generating a cache strategy according to the value of each image layer; and performing image caching according to the cache strategy.

[0008] In some embodiments, determining the value of each image layer according to the value parameter of each image layer includes: obtaining a weight parameter adjustment model; obtaining the first state vector S of the N+1 image layers t , the S t Including the cache occupancy of the edge node O t , network delay L t, an access frequency vector including the access frequency of each of the N+1 image layers and the initial weight parameter θ t , the θ t Including the initial weights α of the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D t-1 , β t-1 , γ t-1 and μ t-1 ; Input the state vector into the weight parameter adjustment model, and generate the θ according to the weight parameter adjustment model t Adjustment strategy a t According to the a t , for the θ t Adjust to get θ t+1 , the θ t+1 ={α t ,β t ,γ t ,μ t}; According to the θ t+1 And the value parameters of each image layer, calculate the value of each image layer.

[0009] In some embodiments, the value of each image layer is calculated according to the following formula:

[0010] V i =α t T i +β t P i +γ t ΔL i -μ t D i

[0011] Among them, V i is the value of the i-th image layer in the N+1 image layers, T i 、P i , ΔL i and D i are respectively the timeliness, popularity, delay difference and redundancy factor of the i-th image layer.

[0012] In some embodiments, the method further includes: determining a feedback reward for the cache strategy according to the following formula:

[0013] R t =η*H t+1 -ζ*L t+1 +ζ*O t+1 -λ*B t

[0014] Among them, H t+1 、Lt+1 and O t+1 are respectively the cache hit rate, network delay and cache occupancy of the edge node after caching according to the cache strategy; B t The number of replacement image layers is proportional to the number of replacement image layers, where the replacement image layer is the image layer replaced in the N image layers to cache the image layer to be cached; η, ξ, ζ and λ are preset parameters; the second state vector S of the N+1 image layer after image caching is obtained. t+1 ;Build historical samples{S t ,a t ,R t ,S t+1} and stored in the experience pool, and the historical samples in the experience pool are used to train the weight parameter adjustment model.

[0015] In some embodiments, generating a cache strategy based on the value of each image layer includes: planning a cache strategy according to the following formula X={X i ∈{0,1},i=1,2,…,N+1}:

[0016]

[0017] Among them, X i =1 indicates that the i-th image layer among the N+1 image layers is cached, X i =0 indicates that the i-th image layer is not cached, V i is the value of the i-th image layer, c i is the size of the i-th image layer, and C is the cache capacity of the edge node.

[0018] According to another aspect of the present application, there is also provided an image caching device, which is applied to an edge node, the edge node belonging to a cache system, N image layers cached in the edge node, N is an integer greater than 1, and the remaining cache capacity of the edge node is less than the size of the image layer to be cached, including: an acquisition module, used to obtain value parameters of each image layer in N+1 image layers, the N+1 image layers including the N image layers and the image layer to be cached, the value parameters including the timeliness of the image layer, the delay difference, the popularity of the image layer in the cache system, and the redundancy factor; a determination module, used to determine the value of each image layer based on the value parameter of each image layer; a generation module, used to generate a cache strategy based on the value of each image layer; and a cache module, used to perform image caching according to the cache strategy.

[0019] In some embodiments, the determination module is used to obtain a weight parameter adjustment model; obtain the first state vector S of the N+1 image layer t , the S tIncluding the cache occupancy of the edge node O t , network delay L t , an access frequency vector including the access frequency of each of the N+1 image layers and the initial weight parameter θ t , the θ t Including the initial weights α of the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D t-1 , β t-1 , γ t-1 and μ t-1 ; Input the state vector into the weight parameter adjustment model, and generate the θ according to the weight parameter adjustment model t Adjustment strategy a t According to the a t , for the θ t Adjust to get θ t+1 , the θ t+1 ={α t ,β t ,γ t ,μ t}; According to the θ t+1 And the value parameters of each image layer, calculate the value of each image layer.

[0020] In some embodiments, the method further includes: a sample construction module configured to determine the feedback reward of the cache strategy according to the following formula:

[0021] R t =η*H t+1 -ξ*L t+1 +ζ*O t+1 -λ*B t

[0022] Among them, H t+1 、L t+1 and O t+1 are respectively the cache hit rate, network delay and cache occupancy of the edge node after caching according to the cache strategy; B t The number of replacement image layers is proportional to the number of replacement image layers, where the replacement image layer is the image layer replaced in the N image layers to cache the image layer to be cached; η, ξ, ζ and λ are preset parameters; the second state vector S of the N+1 image layer after image caching is obtained. t+1 ;Build historical samples{S t ,a t ,R t ,S t+1} and stored in the experience pool, and the historical samples in the experience pool are used to train the weight parameter adjustment model.

[0023] In some embodiments, the generating module is used to plan the cache strategy according to the following formula X={X i ∈{0,1},i=1,2,…,N+1}:

[0024]

[0025]

[0026] Among them, X i =1 indicates that the i-th image layer among the N+1 image layers is cached, X i =0 indicates that the i-th image layer is not cached, V i is the value of the i-th image layer, c i is the size of the i-th image layer, and C is the cache capacity of the edge node.

[0027] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-described image caching methods by executing the executable instructions.

[0028] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image caching method described above is implemented.

[0029] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-mentioned mirror caching methods.

[0030] The technical solutions provided in the embodiments of the present application include at least the following beneficial effects:

[0031] The technical solution provided in the embodiments of the present application calculates the value of the N+1 image layers based on the cached N image layers and the value parameters of the image layers to be cached when the remaining cache space of the edge node is insufficient to cache the image layers to be cached, and generates a cache strategy based on the value of the image layers to determine whether to cache the image layers to be cached. This can improve the hit rate of the image layers cached in the edge node after the execution of the cache strategy.

[0032] Furthermore, the value parameters include the timeliness, delay difference, and redundancy factor of the image layer, which can also reduce the number of replacements of the image layer cached in the edge node, reduce the use of bandwidth resources, and reduce the delay when the image layer is used. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart of a mirror caching method according to an embodiment of the present application is shown;

[0034] Figure 2 A schematic diagram of a mirror cache device in one embodiment of the present application is shown;

[0035] Figure 3 A structural block diagram of an electronic device in one embodiment of the present application is shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0037] In addition, the accompanying drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0038] For ease of understanding, before introducing the embodiments of the present application, several terms involved in the embodiments of the present application are first explained as follows:

[0039] Image layer timeliness: The time difference since the image layer was last accessed in the edge node can be calculated as: the time difference between the time when the image layer timeliness is obtained and the time when the image layer was last accessed;

[0040] Image layer popularity: reflects the number of times an image layer is accessed or requested within a period of time. The more times it is accessed, the higher its popularity.

[0041] Image layer latency difference: The difference between the latency of obtaining the image layer from other edge nodes in the cache system or devices outside the cache system and the latency of obtaining the image layer directly from the local cache can be calculated as: the latency of obtaining the image layer from other edge nodes in the cache system or devices outside the cache system;

[0042] Image layer redundancy factor: This reflects the number of image layers cached in the cache system. The more image layers in the cache system, the greater the redundancy factor.

[0043] Image layer access frequency: The number of times the edge node receives accesses to the image layer within a specific time window. For example, the number of times the edge node receives accesses to the image layer from the current time to one hour ago.

[0044] Edge node cache occupancy: This value indicates the cache space occupied by the edge node, and can be expressed as the ratio of occupied cache space to the total cache space.

[0045] Network latency of edge nodes: This indicates the communication latency between edge nodes and other edge nodes in the cache system. It can be expressed as the average value of the communication latency between edge nodes and other edge nodes in the cache system.

[0046] The specific implementation of the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0047] Figure 1 A flow chart of a mirror caching method according to an embodiment of the present application is shown as follows: Figure 1 As shown, the image caching method provided in the embodiment of the present application includes the following S101 to S104. The method is applied to an edge node, which belongs to a cache system. The edge node caches N image layers, where N is an integer greater than 1, and the remaining cache capacity of the edge node is less than the size of the image layer to be cached.

[0048] S101, obtaining value parameters of each of N+1 image layers, where the N+1 image layers include N image layers and image layers to be cached. The value parameters include timeliness, delay difference, popularity of the image layer in the cache system, and redundancy factor.

[0049] The edge node records the time each time the image layer is accessed. When the timeliness of the image layer needs to be obtained, the edge node can calculate the timeliness of the image layer based on the time difference between the last time the image layer was accessed and the current time.

[0050] For each cached or to-be-cached image layer, the edge node has stored or can directly obtain the size of the image layer and can calculate the delay required to obtain the image layer based on the size of the image layer and the transmission rate. The transmission rate can be obtained through signaling testing or other methods, which is not limited by this application.

[0051] Different edge nodes in the cache system can communicate with each other, and the communication content can include the access status of the image layer. For any edge node in the cache system, the popularity of the image layer in the cache system can be determined based on the access status of the image layer sent by other edge nodes within a preset time length, as well as the access status of the image layer received by itself. The more access times, the higher the popularity. For example, the popularity can directly use the total number of times the image layer is accessed in the cache system within a preset time length. The preset time length can be any time window, for example, the preset time length can be a time window of the last hour.

[0052] In a cache system, communications between different edge nodes can also include information about which image layers the edge node currently caches. Therefore, for any edge node in the cache system, the redundancy factor of an image layer can be determined based on the number of image layers present in other edge nodes and itself. The greater the number of image layers in the cache system, the greater the redundancy factor. For example, the number of image layers in the cache system can be used directly as the redundancy factor for that image layer.

[0053] S102: Determine the value of each image layer according to the value parameter of each image layer.

[0054] In one embodiment, determining the value of each image layer according to the value parameter of each image layer may include: obtaining a weight parameter adjustment model; obtaining the first state vector S of the N+1 image layers; t , the S t Including the cache occupancy of the edge node O t , network delay L t , an access frequency vector containing the access frequency of each of the N+1 image layers and the initial weight parameter θ t , the θ t Including the initial weights α of the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D t-1 , β t-1 , γ t-1 and μ t-1 ; Input the state vector into the weight parameter adjustment model, and generate the θ according to the weight parameter adjustment model t Adjustment strategy a t According to the a t , for this θ t Adjust to get θ t+1 , the θ t+1 ={α t ,β t ,γ t ,μ t}; According to the θ t+1And the value parameters of each image layer, calculate the value of each image layer.

[0055] In one embodiment, the value of each image layer can be calculated according to the following formula 1:

[0056] V i =α t T i +β t P i +γ t ΔL i -μ t D i (1)

[0057] Among them, V i is the value of the i-th image layer in the N+1 image layers, T i 、P i , ΔL i and D i are the timeliness, popularity, delay difference and redundancy factor of the i-th image layer respectively.

[0058] The weight parameter adjustment model may be any reinforcement learning model, which is not limited in the embodiments of the present application. For example, the weight parameter adjustment model may be a Deep Q-Network (DQN).

[0059] The edge node can test the communication delay between it and other edge nodes in the cache system through signaling, and then calculate the network delay L based on the communication delay. t .

[0060] When there is no previous time step t-1, that is, when time step t is the starting time step, θ t The initial weights α of the image layer’s timeliness T, popularity P, delay difference ΔL, and redundancy factor D are included in t-1 , β t-1 , γ t-1 and μ t-1 These are the corresponding initial preset values.

[0061] Using a reinforcement learning model to generate weight values for each value parameter can better balance which value parameter has a greater impact on the value of the image layer in the current state, so as to better adapt to the current state of the edge node. As a result, the value of the image layer calculated based on the weight value generated by the reinforcement learning model can be more adapted to the current state of the edge node, and the cache plan generated based on the value can also be more adapted to the current state of the edge node, which is conducive to improving the hit rate of the cached image layer, reducing the replacement operation of the cached image layer, thereby reducing the use of bandwidth resources, and reducing the delay caused by replacing the cached image layer.

[0062] In another embodiment, a greater timeliness T of an image layer indicates that the image layer is likely to be accessed sooner, meaning that the image layer is likely to be accessed sooner. Therefore, the timeliness T of the image layer should be positively correlated with the value of the image layer. A higher popularity P of an image layer also indicates that the image layer is more likely to be accessed sooner. Therefore, the popularity P of the image layer should be positively correlated with the value of the image layer. A greater latency difference ΔL of an image layer indicates that the latency cost required to obtain the image layer from other edge nodes or network devices is greater. To reduce latency, the image layer should be cached locally. A smaller latency difference ΔL indicates that the latency cost required to obtain the image layer from other edge nodes or network devices is lower. Even if the image layer is not cached, it can still be obtained with lower latency. Therefore, the latency difference ΔL should also be positively correlated with the value of the image layer. The larger the redundancy factor D of the image layer in the cache system, the more of the image layer is cached in the cache system, making it easier for edge nodes to obtain the image layer from other edge nodes. Therefore, the redundancy factor D should be smaller, and the redundancy factor D should be negatively correlated with the value of the image layer.

[0063] Based on the correlation between the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D and the image layer's value, various calculation methods can be used to process timeliness T, popularity P, delay difference ΔL, and redundancy factor D to obtain the image layer's value. This application does not limit the specific calculation method. For example, the image layer's value can be obtained by directly adding timeliness T, popularity P, and delay difference ΔL and subtracting redundancy factor D.

[0064] S103: Generate a cache strategy based on the value of each image layer.

[0065] In one embodiment, a cache strategy is generated based on the value of each image layer. The image layers are sorted directly by value, starting with the space occupied by the more valuable image layers, and continuing until the edge node's cache space can no longer accommodate the next image layer. This determines the image layers that need to be cached among the N+1 image layers. For example, if N=10, then N+1=11. After sorting the 11 image layers by value, if the total size of the first 9 image layers is less than the edge node's cache space, and the total size of the first 10 image layers is greater than the edge node's cache space, then the first 9 image layers are the image layers that need to be cached, while the 10th and 11th image layers are not cached. If the not-cached image layers are currently cached by the edge node, then the 10th and 11th image layers need to be deleted and the image layers to be cached are cached.

[0066] In another embodiment, generating a cache strategy based on the value of each image layer may include: planning a cache strategy X={X i ∈{0,1},i=1,2,…,N+1}:

[0067]

[0068] Among them, X i =1 means that the i-th image layer among N+1 image layers is cached, X i =0 means that the i-th image layer is not cached, V i is the value of the i-th image layer, c i is the size of the i-th image layer, and C is the cache capacity of the edge node.

[0069] Formulas 2 and 3 above can maximize the value of the image layer cached in the edge node. By adopting this planning method to generate a caching strategy, the image layer cached in the edge node can have a higher hit rate.

[0070] S104: Cache the image according to the cache strategy.

[0071] In one embodiment, the feedback reward of the cache strategy is determined according to the following formula 4:

[0072] R t =η*H t+1 -ξ*L t+1 +ζ*O t+1 -λ*B t (4)

[0073] Among them, H t+1 、L t+1 and O t+1 are the cache hit rate, network delay and cache occupancy of the edge node after caching according to the cache strategy; B t It is proportional to the number of replacement image layers, where the replacement image layer is the image layer replaced in the N image layers to cache the image layer to be cached; η, ξ, ζ and λ are preset parameters.

[0074] After that, the second state vector S of the N+1 image layer after the image cache is obtained t+1 ;Build historical samples{S t ,a t ,R t ,S t+1} and stored in the experience pool, and the historical samples in the experience pool are used to train the weight parameter adjustment model.

[0075] The embodiments of the present application do not limit the values of η, ξ, ζ and λ, which can be set based on experience.

[0076] The technical solution provided in the embodiments of the present application calculates the value of the N+1 image layers based on the cached N image layers and the value parameters of the image layers to be cached when the remaining cache space of the edge node is insufficient to cache the image layers to be cached, and generates a cache strategy based on the value of the image layers to determine whether to cache the image layers to be cached. This can improve the hit rate of the image layers cached in the edge node after the execution of the cache strategy.

[0077] Furthermore, the value parameters include the timeliness, delay difference, and redundancy factor of the image layer, which can also reduce the number of replacements of the image layer cached in the edge node, reduce the use of bandwidth resources, and reduce the delay when the image layer is used.

[0078] By combining a dynamic adjustment mechanism with a deep reinforcement learning model, we can quickly adjust caching strategies when edge node status changes, preventing performance degradation caused by network changes or load fluctuations. This flexible adjustment mechanism enhances the robustness of the caching system, enabling it to maintain a high cache hit rate and good performance in complex and changing environments.

[0079] By dynamically calculating the value of image layers and optimizing them with a deep reinforcement learning model, this application can adjust caching strategies in real time and accurately select the image layers that need to be cached. This mechanism can effectively improve cache hit rates and reduce the frequency of requesting image layers from remote nodes (other edge nodes or network nodes outside the cache system), thereby significantly reducing network latency and transmission bandwidth consumption. This is crucial for improving the responsiveness and user experience of AIGC service workloads, especially in edge computing scenarios with unstable network environments or limited bandwidth resources.

[0080] By dynamically adjusting the storage and replacement strategies for cache image layers, this application can flexibly adjust the selection and replacement of cache images based on the actual cache space, avoiding unnecessary resource waste. Furthermore, continuous optimization of cache strategies using deep reinforcement learning ensures optimal utilization of cache resources, reduces the overall system load, alleviates communication pressure between edge nodes and remote nodes, and improves the overall stability and performance of the system.

[0081] This application introduces a comprehensive value calculation model that takes into account multi-dimensional factors (timeliness, popularity, latency differences, etc. of the image layer) and dynamically adjusts the impact of each factor through weighted coefficients. This model breaks through the limitations of traditional caching algorithms that overly focus on cache size and access frequency, incorporating network latency and image timeliness into the decision-making process, making caching decisions more in line with actual needs. This comprehensive optimization strategy can maintain a high cache hit rate under various conditions.

[0082] Based on the same inventive concept, the present application also provides a mirror cache device, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0083] Figure 2 A schematic diagram of a mirror cache device in an embodiment of the present application is shown as follows: Figure 2 As shown, the device is applied to an edge node, which belongs to a cache system. N image layers are cached in the edge node, where N is an integer greater than 1. The remaining cache capacity of the edge node is less than the size of the image layer to be cached. The device includes: an acquisition module 21, which is used to obtain value parameters of each image layer in N+1 image layers, where the N+1 image layers include the N image layers and the image layer to be cached, and the value parameters include the timeliness, delay difference, popularity and redundancy factor of the image layer in the cache system; a determination module 22, which is used to determine the value of each image layer according to the value parameter of each image layer; a generation module 23, which is used to generate a cache strategy according to the value of each image layer; and a cache module 24, which is used to cache the image according to the cache strategy.

[0084] In some embodiments, the determination module 22 is used to obtain a weight parameter adjustment model; obtain the first state vector S of the N+1 image layer t , the S t Including the cache occupancy of the edge node O t , network delay L t , an access frequency vector containing the access frequency of each of the N+1 image layers and the initial weight parameter θ t , the θ t Including the initial weights α of the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D t-1 , β t-1 , γ t-1 and μ t-1 ; Input the state vector into the weight parameter adjustment model, and generate the θ according to the weight parameter adjustment model t Adjustment strategy a t According to the a t , for this θ t Adjust to get θ t+1 , the θ t+1 ={α t ,β t ,γ t ,μ t}; According to the θ t+1 And the value parameters of each image layer, calculate the value of each image layer.

[0085] In some embodiments, the present invention further includes: a sample construction module 25 for determining the feedback reward of the cache strategy according to the following formula 4; obtaining the second state vector S of the N+1 image layer after the image is cached t+1 ;Build historical samples{S t ,a t ,R t ,S t +1} and stored in the experience pool, and the historical samples in the experience pool are used to train the weight parameter adjustment model.

[0086] In some embodiments, the generating module 23 is used to plan the cache strategy X={X i ∈{0,1},i=1,2,…,N+1}.

[0087] The technical solution provided in the embodiments of the present application calculates the value of the N+1 image layers based on the cached N image layers and the value parameters of the image layers to be cached when the remaining cache space of the edge node is insufficient to cache the image layers to be cached, and generates a cache strategy based on the value of the image layers to determine whether to cache the image layers to be cached. This can improve the hit rate of the image layers cached in the edge node after the execution of the cache strategy.

[0088] Furthermore, the value parameters include the timeliness, delay difference, and redundancy factor of the image layer, which can also reduce the number of replacements of the image layer cached in the edge node, reduce the use of bandwidth resources, and reduce the delay when the image layer is used.

[0089] Those skilled in the art will appreciate that various aspects of the present application can be implemented as systems, methods, or program products. Therefore, various aspects of the present application can be specifically implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."

[0090] Refer to the following Figure 3 hereinafter, an electronic device 300 according to this embodiment of the present application is described. Figure 3 The electronic device 300 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0091] like Figure 3 As shown, electronic device 300 is implemented as a general-purpose computing device. Components of electronic device 300 may include, but are not limited to, the aforementioned at least one processing unit 310, the aforementioned at least one storage unit 320, and a bus 330 connecting various system components (including storage unit 320 and processing unit 310).

[0092] The storage unit stores program code, which can be executed by the processing unit 310, so that the processing unit 310 performs the steps of various exemplary embodiments of the present application described in the "Exemplary Method" section above. For example, the processing unit 310 can perform the following steps of the above method embodiment: S101-S104.

[0093] The storage unit 320 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit 3202 , and may further include a read-only memory unit (ROM) 3203 .

[0094] The storage unit 320 may also include a program / utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0095] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0096] The electronic device 300 can also communicate with one or more external devices 340 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 300, and / or any device that enables the electronic device 300 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 350. Furthermore, the electronic device 300 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 360. As shown, the network adapter 360 communicates with other modules of the electronic device 300 via a bus 330. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 300, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0097] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0098] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned mirror caching method when executed by a processor.

[0099] In an exemplary embodiment of the present application, a computer-readable storage medium is further provided, which may be a readable signal medium or a readable storage medium. The computer-readable storage medium stores a program product capable of implementing the above-mentioned method of the present application.

[0100] In some possible implementations, various aspects of the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present application described in the above "Exemplary Method" section of this specification.

[0101] More specific examples of computer-readable storage media in the present application may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] In this application, a computer-readable storage medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries readable program code. Such a transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0103] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0104] In a specific implementation, the program code for performing the operations of the present application can be written in any combination of one or more programming languages, including Python and Go. The program code can be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0105] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0106] Furthermore, although the steps of the method of the present application are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0107] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0108] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the appended claims.

Claims

1. A mirror caching method, characterized in that: Applied to an edge node, the edge node belongs to a cache system, the edge node caches N image layers, N is an integer greater than 1, and the remaining cache capacity of the edge node is less than the size of the image layer to be cached, including: Obtaining value parameters for each of the N+1 image layers, where the N+1 image layers include the N image layers and the image layer to be cached, and the value parameters include timeliness, latency variance, popularity, and redundancy factor of the image layer in the cache system; Determine the value of each image layer based on the value parameters of each image layer; Generate a caching strategy based on the value of each image layer; Mirror caching is performed according to the caching strategy.

2. The image caching method according to claim 1, wherein: Determining the value of each image layer according to the value parameter of each image layer includes: Get weight parameters to adjust the model; Get the first state vector S of the N+1 image layers t , the S t Including the cache occupancy of the edge node O t , network delay L t , an access frequency vector including the access frequency of each of the N+1 image layers and the initial weight parameter θ t , the θ t Including the initial weights α of the image layer's timeliness T, popularity P, delay difference ΔL, and redundancy factor D t-1 , β t-1 , γ t-1 and μ t-1 ; The state vector is input into the weight parameter adjustment model, and the θ is generated according to the weight parameter adjustment model. t Adjustment strategy a t ; According to the a t , for the θ t Adjust to get θ t+1 , the θ t+1 ={α t ,β t ,γ t ,μ t }; According to the t+1 And the value parameters of each image layer, calculate the value of each image layer.

3. The image caching method according to claim 2, wherein: The value of each image layer is calculated according to the following formula: V i =a t T i +b t P i +g t ΔL i -m t D i Among them, V i is the value of the i-th image layer in the N+1 image layers, T i 、P i , ΔL i and D i are respectively the timeliness, popularity, delay difference and redundancy factor of the i-th image layer.

4. The image caching method according to claim 2, wherein: Also includes: The feedback reward of the cache strategy is determined according to the following formula: R t =η*H t+1 -ξ*L t+1 +ζ*O t+1 -λ*B t Among them, H t+1 、L t+1 and O t+1 are respectively the cache hit rate, network delay and cache occupancy of the edge node after caching according to the cache strategy; B t is proportional to the number of replacement image layers, where the replacement image layer is the image layer replaced in the N image layers to cache the image layer to be cached; η, ξ, ζ and λ are preset parameters; The second state vector st of the N+1 image layers after obtaining the image cache +1 ; Constructing historical samples t ,a t ,R t ,S t+1 } and stored in the experience pool, and the historical samples in the experience pool are used to train the weight parameter adjustment model.

5. The image caching method according to claim 1, wherein: The cache strategy is generated based on the value of each image layer, including: Plan the cache strategy according to the following formula X={X i ∈{0,1},i=1,2,…,N+1}: Among them, X i =1 indicates that the i-th image layer among the N+1 image layers is cached, X i =0 indicates that the i-th image layer is not cached, V i is the value of the i-th image layer, c i is the size of the i-th image layer, and C is the cache capacity of the edge node.

6. A mirror cache device, characterized in that: Applied to an edge node, the edge node belongs to a cache system, the edge node caches N image layers, N is an integer greater than 1, and the remaining cache capacity of the edge node is less than the size of the image layer to be cached, including: an acquisition module, configured to acquire value parameters of each of the N+1 image layers, where the N+1 image layers include the N image layers and the image layer to be cached, and the value parameters include timeliness, latency difference, popularity of the image layer in the cache system, and redundancy factor of the image layer; A determination module, configured to determine the value of each image layer based on the value parameters of each image layer; The generation module is used to generate a cache strategy based on the value of each image layer; The cache module is used to perform image caching according to the cache strategy.

7. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the mirror caching method according to any one of claims 1 to 5 by executing the executable instructions.

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

9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the image caching method according to any one of claims 1 to 5 is implemented.