Resource recycling method, system, device and storage medium

CN116225608BActive Publication Date: 2026-10-27SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211497075.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-25
Publication Date
2026-10-27
Estimated Expiration
2042-11-25

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于解决当前K8S部署的项目回收资源的效率较低维护成本过大的技术问题

Benefits of technology

[0045]在本发明实施例中,本发明适用于长期规划使用kubernetes作为项目迭代上线部署的平台,在不需要变更较多代码的情况下,减少了后期维护,并削减了管理上需要花费大量的时间成本,根据应用的业务判断项目是否仍在使用从而达到资源回收的目的,解决了当前K8S部署的项目回收资源的效率较低维护成本过大的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225608B_ABST
    Figure CN116225608B_ABST
Patent Text Reader

Abstract

The application relates to the field and discloses a resource recycling method, a system, a device and a storage medium. The method comprises the following steps: a business service system sends a business registration request to a K8S service system; the K8S service system injects registration data corresponding to the business registration request into a K8S image container, generates a storage key value, and sends the storage key value to the business service system based on a Sidecar mode; the business service system receives the storage key value, stores the storage key value, receives a business calling instruction, analyzes the storage key value corresponding to the calling of the business calling instruction, judges whether the called storage key value exists in the business service system, if the called storage key value exists in the business service system, the K8S service system receives an update request, and updates the storage key value corresponding to the update request, if the called storage key value does not exist in the business service system, the business service system sends a resource recycling request corresponding to the business calling instruction to the K8S service system, and the K8S service system performs resource recycling processing on the K8S image container according to the resource recycling request, so that resource recycling is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource recycling, and more particularly to a resource recycling method, system, device, and storage medium. Background Technology

[0002] Currently, there are two main aspects to Kubernetes resource reclamation on the market. The first part is Kubernetes' native built-in feature, which mainly uses the Garbage Collector component and ownerReference to implement the "garbage collection (GC)" function. The second part is that some enterprises reclaim and clean up Kubernetes PV / pod resources by monitoring their own disk and CPU performance indicators. These resource reclamation mechanisms are more at the physical level.

[0003] More and more enterprises are using Kubernetes for testing, development, and production environments, resulting in an increasing number of resources such as Pods and Page Views (PVs). These resources consume physical machine resources, and Kubernetes has a maximum limit of 110 Pods per Node. As projects iterate and older projects are deprecated, these resources remain unused, occupying both physical resources and the Pod limit, requiring significant time for maintenance and management. Therefore, a new technology is needed to address the current technical problems of low resource reclamation efficiency and high maintenance costs in Kubernetes deployments. Summary of the Invention

[0004] The main objective of this invention is to solve the technical problems of low efficiency in resource recovery and high maintenance costs in current Kubernetes deployments.

[0005] The first aspect of this invention provides a resource recycling method, which is applied to a resource recycling system, the resource recycling system comprising: a business service system and a Kubernetes service system, the resource recycling method comprising:

[0006] The business service system sends a business registration request to the K8S service system based on the Sidecar pattern.

[0007] The K8S service system receives the business registration request, injects the registration data corresponding to the business registration request into the K8S image container, generates a storage key value, performs storage processing on the storage key value, and sends the storage key value to the business service system based on the Sidecar mode.

[0008] The business service system receives the storage key value and stores the storage key value;

[0009] Receive a service call instruction and analyze the storage key value corresponding to the service call instruction;

[0010] Determine whether the storage key value being called exists in the business service system;

[0011] If it exists, then send the storage key-value update request corresponding to the call to the K8S service system;

[0012] The K8S service system receives the update request and updates the storage key-value corresponding to the update request;

[0013] If it does not exist, a resource reclamation request corresponding to the business call instruction is sent to the K8S service system;

[0014] The K8S service system receives the resource reclamation request and performs resource reclamation processing on the K8S image container according to the resource reclamation request, thereby realizing resource reclamation.

[0015] Optionally, in a first implementation of the first aspect of the present invention, injecting the registration data corresponding to the business registration request into a K8S image container, generating a storage key-value pair, and performing storage processing on the storage key-value pair includes:

[0016] The Container that injects the registration data into the K8S image container is identified as a Dapr object, the cleanup period of the Dapr object is set, and the storage key value is stored in the Dapr object.

[0017] Optionally, in a second implementation of the first aspect of the present invention, the K8S service system receiving the update request and updating the storage key-value corresponding to the update request includes:

[0018] The K8S service system receives the update request;

[0019] Based on the update request, the Dapr object corresponding to the storage key value of the update request is retrieved, and the clearing cycle of the Dapr object is updated.

[0020] Optionally, in a third implementation of the first aspect of the present invention, the step of performing resource reclamation processing on the K8S image container according to the resource reclamation request, thereby realizing resource reclamation, includes:

[0021] Parse the storage key-value pair corresponding to the resource reclamation request;

[0022] The Dapr object corresponding to the storage key-value pair is deleted from the K8S image container to reclaim resources.

[0023] Optionally, in a fourth implementation of the first aspect of the present invention, the step of performing resource reclamation processing on the K8S image container according to the resource reclamation request, to realize resource reclamation, includes:

[0024] Parse the storage key-value pair corresponding to the resource reclamation request;

[0025] The storage key-value pair in the K8S image container is deleted to reclaim resources.

[0026] Optionally, in a fifth implementation of the first aspect of the present invention, deleting the storage key-value pair in the K8S image container to reclaim resources includes:

[0027] Determine whether the storage key value exists in the K8S image container;

[0028] If it exists, delete the registration data bound to the storage key value in the K8S image container, and delete the storage key value in the K8S image container;

[0029] If it does not exist, it is determined to be a state where resource recycling has been achieved.

[0030] Optionally, in a sixth implementation of the first aspect of the present invention, the business service system receiving the storage key value and storing the storage key value includes:

[0031] The business service system receives the storage key value and stores it in a pre-configured Redis database.

[0032] A second aspect of the present invention provides a resource recycling system, the resource recycling system comprising:

[0033] Business service system, Kubernetes service system;

[0034] The business service system is used to send business registration requests to the K8S service system based on the Sidecar pattern;

[0035] The K8S service system is used to receive the business registration request, inject the registration data corresponding to the business registration request into the K8S image container, generate a storage key value, perform storage processing on the storage key value, and send the storage key value to the business service system based on the Sidecar mode.

[0036] The business service system is used to receive the storage key value and store the storage key value.

[0037] Receive a service call instruction and analyze the storage key value corresponding to the service call instruction;

[0038] Determine whether the storage key value being called exists in the business service system;

[0039] If it exists, then send the storage key-value update request corresponding to the call to the K8S service system;

[0040] The K8S service system is used to receive the update request and update the storage key value corresponding to the update request;

[0041] If it does not exist, a resource reclamation request corresponding to the business call instruction is sent to the K8S service system;

[0042] The K8S service system is used to receive the resource reclamation request, and perform resource reclamation processing on the K8S image container according to the resource reclamation request to realize resource reclamation.

[0043] A third aspect of the present invention provides a resource recycling device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the resource recycling device to perform the resource recycling method described above.

[0044] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the resource reclamation method described above.

[0045] In this embodiment of the invention, the invention is applicable to long-term planning using Kubernetes as the platform for iterative deployment of projects. It reduces later maintenance and cuts down on the time and cost of management without requiring many code changes. It determines whether the project is still in use based on the application's business needs, thereby achieving the purpose of resource recycling. This solves the technical problems of low efficiency and high maintenance costs in the current Kubernetes deployment of projects. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of one embodiment of the resource recycling method in this invention;

[0047] Figure 2 This is a schematic diagram of one embodiment of the resource recycling system in this invention;

[0048] Figure 3 This is a schematic diagram of one embodiment of the resource recycling device in this invention. Detailed Implementation

[0049] This invention provides a resource recycling method, system, device, and storage medium.

[0050] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0051] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 This invention provides an embodiment of a resource recycling method, wherein the resource recycling method is applied to a resource recycling system, the resource recycling system comprising: a business service system and a Kubernetes service system, and the resource recycling method comprising:

[0052] 101. The business service system sends a business registration request to the K8S service system based on the Sidecar pattern;

[0053] In this embodiment, each service launched in the business service system sends a registration request to the Kubernetes service system in the form of a sidecar. The business service system is a front-end server.

[0054] 102. The K8S service system receives the business registration request, injects the registration data corresponding to the business registration request into the K8S image container, generates storage key-value pairs, performs storage processing on the storage key-value pairs, and sends the storage key-value pairs to the business service system based on the Sidecar pattern.

[0055] In this embodiment, the Kubernetes service system receives a business registration request and injects an additional Container (image package) into a Pod (Kubernetes image container) based on the request. This Container is a Dapr object. Furthermore, based on the injected registration data, it generates service information key-value pairs, for example: service-namespace: service-name. After storing the key-value pairs, it feeds them back to the business service system based on the same Sidecar pattern.

[0056] Furthermore, the following steps can be performed in step 102:

[0057] 1021. Identify the Container that injects registration data into the K8S image container as a Dapr object, set the cleanup period of the Dapr object, and store the storage key-value pair in the Dapr object.

[0058] In step 1021, based on the business registration request, an additional Container (a Dapr object) is injected into a Pod (a Kubernetes image container). The Dapr object used in the service call employs a standard transport encryption method, utilizing a capability of the Dapr object. This capability can also be implemented in your own program, as it's an open-source feature of the Dapr object and will not be elaborated upon here. When generating the Dapr object, a cleanup period is set. This cleanup period is the waiting time for the business scenario to release the resource. In one embodiment, the Dapr object can point to a Redis database deployed in the Kubernetes image container.

[0059] 103. The business service system receives the storage key-value pair and performs storage processing on it;

[0060] 104. Receive the business call instruction and analyze the storage key value corresponding to the business call instruction;

[0061] 105. Determine if the requested storage key-value pair exists in the business service system;

[0062] 106. If it exists, send the update request corresponding to the stored key-value pair to the K8S service system;

[0063] In step 103, after receiving the storage key-value through the business service system, the storage key-value is stored. In order to call the registered service information later, the storage key-value is used as the index data for retrieving the registration data of the K8S service system.

[0064] Furthermore, the following steps can be performed at 103:

[0065] 1031. The business service system receives the storage key-value pair and stores it in a pre-configured Redis database.

[0066] In step 1031, the business service system receives and stores the key-value pairs in the Redis database attached to the business service system.

[0067] In steps 104-106, the business service system receives the business call instruction, first analyzes the storage key-value pair corresponding to the call instruction, then uses the Dapr object injected by the Sidecar to find the Dapr object in the Kubernetes service system and completes message delivery. Before accessing the data, it checks whether the storage key-value pair exists in the business service system as needed. If it does, the Kubernetes service system retrieves the corresponding service information based on the message and then updates the expiration time of the key-value pair in Redis at the hourly interval set daily (which can be understood as a scheduled task).

[0068] 107. The K8S service system receives an update request and updates the storage key-value pair corresponding to the update request.

[0069] In this embodiment, after receiving an update request, the Kubernetes service system modifies the storage key-value pair of the update request. This modification can be either pointing to the injected information after the business modification or changing the key-value pair's clearing cycle time. During the modification process, the DAPr object's own properties can be used to directly index the DAPr object stored in the image container within the Kubernetes service system, and the data within the DAPr object can be modified to update the storage key-value pair.

[0070] Furthermore, the following steps can be performed in step 107:

[0071] 1071. The Kubernetes service system receives an update request;

[0072] 1072. Based on the update request, query the Dapr object corresponding to the storage key-value pair of the update request, and update the clearing cycle of the Dapr object.

[0073] In steps 1071-1072, the K8S service system receives the update request, retrieves the Dapr object based on the storage key-value pair (without using the Dapr object's attributes), and then performs an update process based on the Dapr object's cleanup cycle.

[0074] 108. If it does not exist, send the resource reclamation request corresponding to the business call instruction to the K8S service system;

[0075] 109. The K8S service system receives resource reclamation requests and performs resource reclamation processing on K8S image containers according to the resource reclamation requests to achieve resource reclamation.

[0076] In steps 108-109, if the key-value pair does not exist in the business service system, a resource reclamation request is directly sent to the Kubernetes service system. Upon receiving the request, the Kubernetes service system calls the Kubernetes interface to delete and reclaim the resource specified in the request. Simultaneously, it checks if any other business resources are sharing the service, ingress, or PV resources bound to the Pod (Kubernetes image container). If not, it calls the Kubernetes interface to delete and reclaim these resources as well. If none of these resources are found, it is assumed that they have been manually modified or deleted. In one embodiment, the resource reclamation request is obtained based on the Sidecar pattern. The Kubernetes service system directly accesses the DAPr object in the Kubernetes image container and deletes it.

[0077] Furthermore, the following steps can be performed in step 109:

[0078] 1091. Parse the storage key-value pair corresponding to the resource reclamation request;

[0079] 1092. Delete the Dapr object corresponding to the storage key-value pair in the K8S image container to reclaim resources.

[0080] In steps 1091-1092, the storage key value corresponding to the resource reclamation request is parsed, and the Dapr object in the K8S image container is retrieved and deleted using the storage key value as an index.

[0081] Furthermore, the following steps can be performed in step 109:

[0082] 1093. Parse the storage key-value pair corresponding to the resource reclamation request;

[0083] 1094. Delete the storage key-value pairs in the K8S image container to reclaim resources.

[0084] In steps 1093-1094, after deleting the key-value pairs stored in the Kubernetes image container, the container (image package) storing the key-value pairs is cleaned up. However, this has little impact on the entire Pod (Kubernetes image container), as there are still multiple containers (image packages) in the Pod (Kubernetes image container).

[0085] Furthermore, the following steps can be performed in step 1094:

[0086] 10941. Determine if the stored key-value pair exists in the K8S image container;

[0087] 10942. If it exists, delete the registration data of the key-value binding stored in the K8S image container, and delete the key-value stored in the K8S image container.

[0088] 10943. If it does not exist, then it is determined to be a state of resource recycling.

[0089] In steps 10941-10943, after obtaining the key-value pair, first determine if the key-value pair exists in the Kubernetes image container. If it exists, find the service / ingress / pv resources bound to the corresponding Pod (Kubernetes image container) resource and check if other business resources share the same resource. If not, call the Kubernetes API to delete and reclaim these resources. If the key-value pair is not found, it is assumed that the resource corresponding to the key-value pair has been manually modified or deleted.

[0090] In this embodiment of the invention, the invention is applicable to long-term planning using Kubernetes as the platform for iterative deployment of projects. It reduces later maintenance and cuts down on the time and cost of management without requiring many code changes. It determines whether the project is still in use based on the application's business needs, thereby achieving the purpose of resource recycling. This solves the technical problems of low efficiency and high maintenance costs in the current Kubernetes deployment of projects.

[0091] The resource recycling method in the embodiments of the present invention has been described above. The resource recycling system in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 2 One embodiment of the resource recycling system in this invention includes:

[0092] Business Service System 201, K8S Service System 202;

[0093] The business service system 201 is used to send a business registration request to the K8S service system based on the Sidecar mode.

[0094] The K8S service system 202 is used to receive the business registration request, inject the registration data corresponding to the business registration request into the K8S image container, generate a storage key value, perform storage processing on the storage key value, and send the storage key value to the business service system based on the Sidecar mode.

[0095] The business service system 201 is used to receive the storage key value and store the storage key value;

[0096] Receive a service call instruction and analyze the storage key value corresponding to the service call instruction;

[0097] Determine whether the storage key value being called exists in the business service system;

[0098] If it exists, then send the storage key-value update request corresponding to the call to the K8S service system;

[0099] The K8S service system 202 is used to receive the update request and update the storage key value corresponding to the update request;

[0100] If it does not exist, a resource reclamation request corresponding to the business call instruction is sent to the K8S service system;

[0101] The K8S service system 202 is used to receive the resource reclamation request and perform resource reclamation processing on the K8S image container according to the resource reclamation request, thereby realizing resource reclamation.

[0102] Specifically, the K8S service system 202 is used for:

[0103] The Container that injects the registration data into the K8S image container is identified as a Dapr object, the cleanup period of the Dapr object is set, and the storage key value is stored in the Dapr object.

[0104] Specifically, the K8S service system 202 is also used for:

[0105] The K8S service system receives the update request;

[0106] Based on the update request, the Dapr object corresponding to the storage key value of the update request is retrieved, and the clearing cycle of the Dapr object is updated.

[0107] Specifically, the K8S service system 202 is also used for:

[0108] Parse the storage key-value pair corresponding to the resource reclamation request;

[0109] The Dapr object corresponding to the storage key-value pair is deleted from the K8S image container to reclaim resources.

[0110] Specifically, the K8S service system 202 is also used for:

[0111] Parse the storage key-value pair corresponding to the resource reclamation request;

[0112] The storage key-value pair in the K8S image container is deleted to reclaim resources.

[0113] Specifically, the K8S service system 202 is also used for:

[0114] Determine whether the storage key value exists in the K8S image container;

[0115] If it exists, delete the registration data bound to the storage key value in the K8S image container, and delete the storage key value in the K8S image container;

[0116] If it does not exist, it is determined to be a state where resource recycling has been achieved.

[0117] Specifically, the business service system 201 is used for:

[0118] The business service system receives the storage key value and stores it in a pre-configured Redis database.

[0119] In this embodiment of the invention, the invention is applicable to long-term planning using Kubernetes as the platform for iterative deployment of projects. It reduces later maintenance and cuts down on the time and cost of management without requiring many code changes. It determines whether the project is still in use based on the application's business needs, thereby achieving the purpose of resource recycling. This solves the technical problems of low efficiency and high maintenance costs in the current Kubernetes deployment of projects.

[0120] above Figure 2 The resource recycling system in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The resource recycling equipment in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0121] Figure 3 This is a schematic diagram of a resource recycling device 300 provided in an embodiment of the present invention. The resource recycling device 300 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 310 (e.g., one or more processors) and a memory 320, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 333 or data 332. The memory 320 and storage media 330 can be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the resource recycling device 300. Furthermore, the processor 310 may be configured to communicate with the storage media 330 and execute the series of instruction operations in the storage media 330 on the resource recycling device 300.

[0122] The resource recycling device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 3 The illustrated resource recycling equipment structure does not constitute a limitation on resource recycling equipment and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0123] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the resource reclamation method.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system or system / unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0125] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0126] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A resource recycling method, characterized in that, The resource recycling method is applied to a resource recycling system, which includes a business service system and a K8S service system. The resource recycling method includes: The business service system sends a business registration request to the K8S service system based on the Sidecar pattern. The K8S service system receives the business registration request, injects the registration data corresponding to the business registration request into the K8S image container, generates a storage key value, performs storage processing on the storage key value, and sends the storage key value to the business service system based on the same Sidecar pattern. The business service system receives the storage key value and stores the storage key value; Receive a service call instruction and analyze the storage key value corresponding to the service call instruction; Determine whether the storage key value being called exists in the business service system; If it exists, then send the storage key-value update request corresponding to the call to the K8S service system; The K8S service system receives the update request and updates the storage key-value corresponding to the update request; If it does not exist, a resource reclamation request corresponding to the business call instruction is sent to the K8S service system; The K8S service system receives the resource reclamation request and performs resource reclamation processing on the K8S image container according to the resource reclamation request to realize resource reclamation; The step of injecting the registration data corresponding to the business registration request into the K8S image container, generating a storage key-value pair, and performing storage processing on the storage key-value pair includes: The Container in the K8S image container into which the registration data is injected is identified as a Dapr object, the cleanup period of the Dapr object is set, and the storage key value is stored in the Dapr object.

2. The resource recycling method according to claim 1, characterized in that, The K8S service system receives the update request and performs update processing on the storage key-value corresponding to the update request, including: The K8S service system receives the update request; Based on the update request, the Dapr object corresponding to the storage key value of the update request is retrieved, and the clearing cycle of the Dapr object is updated.

3. The resource recycling method according to claim 2, characterized in that, The step of performing resource reclamation processing on the K8S image container according to the resource reclamation request, and realizing resource reclamation, includes: Parse the storage key-value pair corresponding to the resource reclamation request; The Dapr object corresponding to the storage key-value pair is deleted from the K8S image container to reclaim resources.

4. The resource recycling method according to claim 1, characterized in that, The step of performing resource reclamation processing on the K8S image container according to the resource reclamation request, and realizing resource reclamation, includes: Parse the storage key-value pair corresponding to the resource reclamation request; The storage key-value pair in the K8S image container is deleted to reclaim resources.

5. The resource recycling method according to claim 4, characterized in that, The step of deleting the storage key-value pair in the K8S image container to reclaim resources includes: Determine whether the storage key value exists in the K8S image container; If it exists, delete the registration data bound to the storage key value in the K8S image container, and delete the storage key value in the K8S image container; If it does not exist, it is determined to be a state where resource recycling has been achieved.

6. The resource recycling method according to claim 1, characterized in that, The business service system receives the storage key value and performs storage processing on the storage key value, including: The business service system receives the storage key value and stores it in a pre-configured Redis database.

7. A resource recycling system, characterized in that, The resource recycling system includes: Business service system, Kubernetes service system; The business service system sends a business registration request to the K8S service system based on the Sidecar pattern. The K8S service system is used to receive the business registration request, inject the registration data corresponding to the business registration request into the K8S image container, generate a storage key value, perform storage processing on the storage key value, and send the storage key value to the business service system based on the same Sidecar pattern. The business service system is used to receive the storage key value and store the storage key value. Receive a service call instruction and analyze the storage key value corresponding to the service call instruction; Determine whether the storage key value being called exists in the business service system; If it exists, then send the storage key-value update request corresponding to the call to the K8S service system; The K8S service system is used to receive the update request and update the storage key value corresponding to the update request; If it does not exist, a resource reclamation request corresponding to the business call instruction is sent to the K8S service system; The K8S service system is used to receive the resource reclamation request, and perform resource reclamation processing on the K8S image container according to the resource reclamation request to realize resource reclamation; The step of injecting the registration data corresponding to the business registration request into the K8S image container, generating a storage key-value pair, and performing storage processing on the storage key-value pair includes: The Container in the K8S image container into which the registration data is injected is identified as a Dapr object, the cleanup period of the Dapr object is set, and the storage key value is stored in the Dapr object.

8. A resource recycling device, characterized in that, The resource recycling device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the resource recycling device to perform the resource recycling method as described in any one of claims 1-6.

9. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the resource recovery method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Cache processing method, device and equipment based on Kubernetes cluster and storage medium

    CN113031874A

  • Data processing method and device

    CN114661468A