A SERVICE CACHING METHOD FOR A CROSS-BORDER SERVICE NETWORK
20220407940 · 2022-12-22
Inventors
- JIANWEI YIN (HANGZHOU, ZHEJIANG PROVINCE, CN)
- BANGPENG ZHENG (HANGZHOU, ZHEJIANG PROVINCE, CN)
- SHUIGUANG DENG (HANGZHOU, ZHEJIANG PROVINCE, CN)
- HUAN ZHANG (HANGZHOU, ZHEJIANG PROVINCE, CN)
- SHENGYE PANG (HANGZHOU, ZHEJIANG PROVINCE, CN)
- YUCHENG GUO (HANGZHOU, ZHEJIANG PROVINCE, CN)
- MAOLIN ZHANG (HANGZHOU, ZHEJIANG PROVINCE, CN)
Cpc classification
International classification
Abstract
The present invention discloses a service caching method for a cross-border service network, wherein the method includes: a cache space of a service switch node is divided into a resident area, a change area, a pre-reclaimed area and a maintenance index area; among them, a cache hit frequency is: a resident area>a change area>a pre-reclaimed area, and the maintenance index area is used for separate storage services call path. when a service call is generated, a cache content in the cache space is replaced according to a cache value of a missed cache or a hit cache; a service router and service switch nodes in the corresponding area jointly form a hierarchical cache mode. When the cache space of any node in the service switch node is insufficient, the service switch nodes in the same area perform collaborative cache and store them in other cache space of the service switch node through indexing. The method provided by the present invention can improve the cache utilization efficiency in the cross-border service network, thereby accelerating service invocation.
Claims
1. A service caching method for a cross-border service network, wherein the method comprises: dividing a cache space of a service switch node into a resident area, a change area, a pre-reclaimed area and a maintenance index area, wherein, a cache hit frequency is: a resident area>a change area>a pre-reclaimed area, and the maintenance index area is used for separate storage services call path' when a service call is generated, replacing a cache content in the cache space according to a cache value of a missed cache or a hit cache; a service router and service switch nodes in the corresponding area jointly forming a hierarchical cache mode, wherein when the cache space of any node in the service switch node is insufficient, the service switch nodes in the same area perform collaborative cache and store them in other cache space of the service switch node through indexing.
2. The service caching method for a cross-border service network according to claim 1, wherein, a pace allocation of the cache space is: the change area>the resident area=the pre-reclaimd area>the maintenance index area; a cache tolerance and cache survival time are: resident area>change area>pre-reclaimd area.
3. The service caching method for a cross-border service network according to claim 2, wherein, according to the cache hit frequency, the cache content in the resident area and the change area are replaced with each other. The cache content in the change area is replaced with the pre-reclaimd area. The cache content in the pre-reclaimd area is removed from the cache space after losing the cache tolerance and the cache survival space.
4. The service caching method for a cross-border service network according to claim 1, wherein, a method of the cache content in the cache space is replaced according to the cache value of the missed cache or the hit cache is: (1) when a service call is generated, if it hits the cache, executing step (2), if it misses the cache, executing step (3). (2) updating the cache value of the hit cache, and judging the hit cache as a complete hit cache or a partial hit cache according to the cache value; if it is a complete hit cache, the service call returns, if the cache is a partial hit cache, the cache is partially replaced; checking the area where the cache is located, if necessary for partition adjustment, the cache space area is replaced. (3) checking whether there is a corresponding cached call path information in the index area, if there is, then performing the corresponding service call, if not, re-initiating a service call process; replacing the cache with the lowest cache value in the pre-reclaimed area according to a result of the service call, and replacing the required cache into the change area. If the storage space in the change area is full, replacing the cache with the lowest cache value to the pre-reclaimed area according to the cache value of the cache in the change area.
5. The service caching method for a cross-border service network according to claim 4, wherein, in step (2), a calculation formula for the cache value is:
6. The service caching method for a cross-border service network according to claim 4, wherein, in step (2), when the cache is completely hit, checking the location mark of the cache. If the cache is in the change area, checking whether the current cache value reaches a threshold of the change area; if the threshold is reached, adjusting the cache from the change area to the resident area; if the cache is in the pre-reclaimed area, checking whether the current cache reaches a threshold of the pre-reclaimed area; if it exceeds the threshold of the pre-reclaimed area, adjusting the cache from the pre-reclaimed area to the change area.
7. The service caching method for a cross-border service network according to claim 4, wherein, in step (2), when the cache is partially hit, updating the cache content and partially replace the information that needs to be stored into the cache space; checking a location mark of the cache, checking whether the cache reaches the corresponding area threshold, if it does, changing the area mark where the cache is located.
8. The service caching method for a cross-border service network according to claim 7, wherein, when the cache is replaced out of the cache space, the content in the storage space is replaced, and at the same time, a service call path corresponding to the cache is reserved to the index area, the index area is managed by the LRU (least frequently used) strategy to improve the efficiency of the index area.
9. The service caching method for a cross-border service network according to claim 1, wherein, a method of when the cache space of any node in the service switch node is insufficient, the service switch nodes in the same area perform collaborative cache and store them in other cache space of the service switch node through indexing is: (1) when the cache space in the service switch node i is insufficient, initiating a collaborative cache process in the area; (2) the service router maintains the node value of the service switch node in the area; (3) selecting a node j with the lowest node value in the area, the node i will forward the content that needs to be cached to the node j, and it will be saved by the node j, and the node j will return the specific storage location of the cache to the node I; the node i will save the index in a form of <IP.sub.j, index>; (4) after the node i is hit and cached, it will initiate a cache hit request to the node j through the index, along with the address of the service call initiator, after the node j learns the address, it returns the cache of the service call result to the service call initiator; (5) when a service hotspot phenomenon occurs at the node j, and the cache value of the remaining caches is greater than the value of the collaborative cache initiated by the node i, the node j will replace the collaborative cache at this time, and at the same time send the cache invalidation information to the node i, after receiving the cache invalidation message, the node i will re-initiate a collaborative cache request in the area; (6) after the service hot spot phenomenon in node i disappears, node i will initiate a request to all cooperative cache nodes, and other nodes will invalidate the cooperative cache in this node after receiving the message.
10. The service caching method for a cross-border service network according to claim 9, wherein, in step (2), a calculation formula of the node value is:
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0040]
[0041]
[0042]
[0043]
DESCRIPTION OF THE EMBODIMENTS
[0044] In order to make the objects, technical solutions, and advantages of the present invention clearer, the following further describes the present invention in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and do not limit the protection scope of the present invention.
[0045] A service caching method for a cross-border service network provided by the present invention includes:
[0046] a cache space of a service switch node is divided into a resident area, a change area, a pre-reclaimed area and a maintenance index area; among them, a cache hit frequency is: a resident area>a change area>a pre-reclaimed area, and the maintenance index area is used for separate storage services call path.
[0047] when a service call is generated, a cache content in the cache space is replaced according to a cache value of a missed cache or a hit cache;
[0048] a service router and service switch nodes in the corresponding area jointly form a hierarchical cache mode. When the cache space of any node in the service switch node is insufficient, the service switch nodes in the same area perform collaborative cache and store them in other cache space of the service switch node through indexing.
[0049] Wherein, a pace allocation of the cache space is: the change area>the resident area=the pre-reclaimd area>the maintenance index area; a cache tolerance and cache survival time are: resident area>change area>pre-reclaimd area. The resident area stores the hot information in the cache service call, that is, it has been frequently called in the recent period of time. For this category of service call information, the node will allocate greater cache tolerance and cache lifetime. The service call information stored in the change area is often replaced in the cache, for this category of service call information, nodes will allocate relatively less cache tolerance and cache lifetime. The pre-reclaimed area stores cached content with a low cache hit rate, which is a cache that is not frequently used, for this type of information node, the least cache tolerance and cache lifetime will be allocated. Wherein,
[0050] According to the cache hit frequency, the cache content in the resident area and the change area are replaced with each other. The cache content in the change area is replaced with the pre-reclaimd area. The cache content in the pre-reclaimd area is removed from the cache space after losing the cache tolerance and the cache survival space. For example, after the service invocation information in the change area is used relatively frequently, after exceeding the upper threshold of the cache hit frequency in the change area, it will be transformed from the change area to the resident area. After the use frequency of the cache in the change area decreases, after it is lower than the lower threshold of the cache hit frequency in the change area, it will be converted from the change area to the pre-reclaimed area. The service information of the resident area will be transferred from the resident area to the change area after the hit frequency drops to the lower threshold of the cache hit frequency of the resident area. The service information in the pre-reclaimed area is removed from the cache space after the cache tolerance and cache survival space are lost. The service information is in the change area when it is replaced into the cache for the first time.
[0051]
[0052] As shown in
[0053] (1) when a service call is generated, if it hits the cache, executing step (2), if it misses the cache, executing step (6).
[0054] (2) updating the cache value of the hit cache, a calculation formula for the cache value is:
[0055] Wherein, V represents a cache value, Size(i) represents a size of the i-th parameter in the service call information that needs to be cached, Fr is a function related to an access frequency, T.sub.now represents a current time, T score represents a time recorded when the cache enters;
[0056] that is, when the cache hits, the function value increases by one, and when the cache misses, the function value does not change.
[0057] (3) In the case of a cache hit, check whether the cache is completely hit, if the cache is completely hit, go to step (4), if the cache hits partially, go to step (5).
[0058] (4) when the cache is completely hit, checking the location mark of the cache. If the cache is in the change area, checking whether the current cache value reaches a threshold of the change area. If the threshold is reached, adjusting the cache from the change area to the resident area; if the cache is in the pre-reclaimed area, checking whether the current cache reaches a threshold of the pre-reclaimed area; if it exceeds the threshold of the pre-reclaimed area, adjusting the cache from the pre-reclaimed area to the change area.
[0059] (5) updating the cache content and partially replace the information that needs to be stored into the cache space; checking a location mark of the cache, checking whether the cache reaches the corresponding area threshold, if it does, changing the area mark where the cache is located.
[0060] When the cache is replaced out of the cache space, the content in the storage space is replaced, and at the same time, a service call path corresponding to the cache is reserved to the index area, the index area is managed by the LRU strategy to improve the efficiency of the index area.
[0061] (6) checking whether there is a corresponding cached call path information in the index area, if there is, then performing the corresponding service call, if not, re-initiating a service call process;
[0062] replacing the cache with the lowest cache value in the pre-reclaimed area, and replacing the required cache into the change area. If the storage space in the change area is full, replacing the cache with the lowest cache value to the pre-reclaimed area according to the cache value of the cache in the change area.
[0063] As shown in
[0064] (1) when the cache space in the service switch node i is insufficient, initiating a collaborative cache process in the area; [0065] (2) the service router maintains the node value of the service switch node in the area; [0066] a calculation formula of the node value is:
[0067] wherein, Load.sub.i is the current load of the node I, n is the number of nodes in the area, and Value(i).sub.static is the static node value calculated according to the network topology:
[0068] wherein, R.sub.jk s the number of shortest paths between any two nodes j and k in the area, R.sub.jk(i) is the number of shortest paths passing through the node i, and n is the number of nodes in the area;
[0069] wherein, V(i) is the node cache value, and pis the remaining rate of cache space in the area.
[0070] (3) selecting a node j with the lowest node value in the area, the node i will forward the content that needs to be cached to the node j, and it will be saved by the node j, and the node j will return the specific storage location of the cache to the node I; the node i will aave the index in a form of <IP.sub.j, index>;
[0071] (4) after the node i is hit and cached, it will initiate a cache hit request to the node j through the index, along with the address of the service call initiator, after the node j learns the address, it returns the cache of the service call result to the service call initiator;
[0072] (5) when a service hotspot phenomenon occurs at the node j, and the cache value of the remaining caches is greater than the value of the collaborative cache initiated by the node i, the node j will replace the collaborative cache at this time, and at the same time send the cache invalidation information to the node i, after receiving the cache invalidation message, the node i will re-initiate a collaborative cache request in the area;
[0073] (6) after the service hot spot phenomenon in node i disappears, node i will initiate a request to all cooperative cache nodes, and other nodes will invalidate the cooperative cache in this node after receiving the message.
[0074] The specific implementations described above describe the technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only the most preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, additions and equivalent replacements made within the scope shall be included in the protection scope of the present invention.