General controllable service calling method and system based on public cloud, and medium
By decoupling public cloud resource descriptions from Kubernetes API calls and combining them with Django backend management technology, service instances can be dynamically created and managed. This solves the cross-platform adaptation challenge of public cloud service calls, enables flexible resource management and security control, and improves the versatility and reliability of the system.
Patent Information
- Application Number
- CN202510920927.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-03
AI Technical Summary
Existing public cloud service calling solutions have difficulties in cross-platform adaptation, inflexible resource management, poor security, serious resource waste, and lack of dynamic adaptability to different scenarios, resulting in high development costs, poor system versatility and portability, and difficulty in ensuring service reliability and stability.
By decoupling public cloud resource descriptions from Kubernetes API calls and combining them with Django backend management technology, it dynamically creates and manages service instances, detects resource usage status in real time, provides a resource recovery mechanism, and enables flexible control of resource demand, lifecycle, and security policies, making it compatible with a variety of public cloud platforms.
It improves the ability of a single system to adapt to multiple public cloud platforms, optimizes resource allocation, improves service reliability and stability, reduces development costs, and realizes dynamic management and security control of resources.
Smart Images

Figure CN120751014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software and cloud computing technology, and in particular to a method, system and medium for calling a universal controllable service based on a public cloud. Background Art
[0002] With the rapid development of cloud computing technology, public clouds have become a key choice for enterprises and developers to deploy services, thanks to their elastic scalability, low cost, and convenience. In public cloud environments, efficient service invocation is crucial to ensuring smooth business operations. However, existing solutions for invoking public cloud services present numerous challenges.
[0003] Currently, different public cloud platforms have significant differences in resource descriptions and service call interfaces, making it difficult for a single system to adapt to multiple public cloud platforms. Developers deploying services across multiple public cloud platforms require extensive customization tailored to the specific characteristics of each platform, which not only increases development costs and time but also reduces the system's versatility and portability.
[0004] When it comes to service creation and management, existing solutions lack effective control over resource requirements, lifecycles, and security policies. Developers struggle to dynamically create services that meet specific requirements based on actual needs, making it impossible to optimize resource allocation. Furthermore, existing solutions often employ fixed models for service lifecycle management and security protection, making it difficult to flexibly respond to changing needs in different scenarios. This presents security risks and wastes resources. Furthermore, existing solutions lack real-time monitoring of the public cloud resource pool's status during service creation, making it impossible to promptly identify and resolve issues like irrational resource allocation and service creation failures, making it difficult to guarantee service reliability and stability.
[0005] A search of patent documents revealed an invention patent with publication number CN116962547A, which discloses an MQ-based dynamic data gateway communication method. Combining the HTTP and MQ protocols, this method offers both speed and privacy during database communication. It also dynamically manages external interfaces, enabling functions such as interface forwarding, interception, and load balancing. This patent primarily focuses on MQ-based data gateway communication and does not cover API calls within public cloud platform operations or communication processes.
[0006] In summary, in response to the above-mentioned problems of the existing technology, researching a method, system and medium for calling a universal controllable service based on the public cloud has become a key task that needs to be solved urgently. Summary of the Invention
[0007] In view of the deficiencies in the prior art, the present invention aims to provide a method, system and medium for universal controllable service invocation based on a public cloud.
[0008] According to the present invention, a method for calling a universal controllable service based on a public cloud includes the following steps:
[0009] Step S1, receiving a request from a third-party program user, the request including resource requirements and lifecycle;
[0010] Step S2: Check whether the third-party program user has been assigned app_key and app_secret. If not, generate and assign app_key and app_secret.
[0011] Step S3, obtaining cluster resource description information from the selected public cloud platform;
[0012] Step S4: Based on the requested resource requirements, check whether the resources meet the requirements. If so, proceed to step S5; if not, return an error code and error description.
[0013] Step S5: Create a service instance through the Kubernetes API and check in real time during the creation process whether the service concurrency and resource usage have reached the warning limit;
[0014] Step S6: If the resource allocation is successful, the service access URL containing the token information is returned; if the resource allocation fails, the resource recovery mechanism is triggered.
[0015] Preferably, in step S3, a resource management database is established through the Django backend to record and maintain the real-time available resource list of the public cloud platform, detailed records of allocated resources and resource recovery logs in real time.
[0016] Preferably, in step S4, it is checked whether the available resources of the public cloud platform match the requested resource requirements.
[0017] Preferably, in step S5, deployment, service and ingress service instances are created to allocate hardware resources, select a deployment version and set the service time.
[0018] Preferably, step S5 includes the following sub-steps:
[0019] Step S5.1: Generate a deployment configuration based on the requested resource requirements and lifecycle and create the deployment through the Kubernetes API.
[0020] In step S5.2, based on the deployment, generate the service configuration and create the service through the Kubernetes API;
[0021] In step S5.3, based on the service, generate the ingress configuration and create the ingress through the Kubernetes API.
[0022] Preferably, step S5 detects in real time whether the public cloud resource pool status, service concurrency, and resource usage have reached the warning upper limit.
[0023] Preferably, in step S6, the resource recovery mechanism includes: deleting the created deployment, service and ingress service instances in sequence, releasing the occupied public cloud resources, and returning an error code and corresponding error description to the user.
[0024] Preferably, in step S6, when the service access URL is accessed by a third-party program user, the permission must be verified first. If the verification fails, an error code is returned. If the verification succeeds, access to the service is allowed.
[0025] The present invention also provides a system for calling universal controllable services based on a public cloud, comprising:
[0026] Module M1 receives requests from third-party program users, which include resource requirements and lifecycles.
[0027] Module M2 checks whether the third-party program user has been assigned app_key and app_secret. If not, it generates and assigns app_key and app_secret.
[0028] Module M3 obtains cluster resource description information from the selected public cloud platform;
[0029] Module M4 checks whether the resources meet the requirements based on the requested resource requirements. If so, module M5 is executed; if not, an error code and error description are returned.
[0030] Module M5 creates a service instance through the Kubernetes API and checks in real time during the creation process whether the service concurrency and resource usage have reached the warning limit;
[0031] Module M6, if the resource allocation is successful, returns the service access URL containing token information; if the resource allocation fails, triggers the resource recovery mechanism.
[0032] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for calling a universal controllable service based on a public cloud.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. This invention improves the ability of a single system to adapt to multiple public cloud platforms by decoupling public cloud resource descriptions from the Kubernetes API call structure. Since most public clouds on the market are based on the Kubernetes architecture engine, a single system can adapt to multiple cloud platforms with just one set of code that calls the Kubernetes API and combines it with the resource description files of each public cloud.
[0035] 2. The present invention is based on the cluster resource description information provided by the public cloud platform. When receiving a request from a third-party program user, step S1 is used to parse the service duration, CPU, memory hardware resources, service version and other parameters contained therein, and the Kubernetes API is called (step S5) to create service instances such as deployment, service and ingress on demand, allocate hardware resources, select the deployment version and set the service time. At the same time, the public cloud resource pool status and service concurrency, as well as whether resource usage reaches the warning upper limit are detected in real time. When the service life cycle ends, step S6 is used to automatically destroy the service and recycle resources. Finally, the service access URL containing token information is returned to the user for operation, thereby dynamically creating services that meet resource requirements, life cycle and security control. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0037] Figure 1 This is a flow chart of a method for calling a universal controllable service based on a public cloud in an embodiment of the present invention;
[0038] Figure 2 This is a schematic diagram of a service access URL being accessed by a third-party program user in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0040] Example 1:
[0041] Figure 1 This is a flow chart of a method for calling a universal controllable service based on a public cloud in an embodiment of the present invention.
[0042] like Figure 1As shown, this embodiment provides a method for calling a universal controllable service based on a public cloud, comprising the following steps:
[0043] Step S1: Receive a request from a third-party program user, where the request includes resource requirements and lifecycle.
[0044] Furthermore, the service duration, CPU, memory hardware resources, service version and other parameters contained in the request are parsed.
[0045] Step S2: Check whether the third-party program user has been assigned app_key and app_secret. If not, generate and assign app_key and app_secret.
[0046] Step S3: Obtain cluster resource description information from the selected public cloud platform.
[0047] Specifically, the cluster resource description information includes available resources.
[0048] In this embodiment, a resource management database is established through the Django backend to record and maintain the real-time available resource list of the public cloud platform, detailed records of allocated resources (including CPU / Memory quotas, allocation time, life cycle) and resource recovery logs.
[0049] By combining the Kubernetes API with Django backend management technology, not only can the dynamic allocation and restriction of CPU and Memory for requested resources be achieved, but the entire resource allocation and recycling process can also be recorded. The currently allocated resources and remaining available resources are dynamically calculated in real time, and the allocation strategy for the remaining resources is intelligently optimized based on the different resource request requirements of users. Compared with solutions that only implement the dynamic allocation of a single resource through the Kubernetes API, this invention has significant advantages in the comprehensiveness of resource management and allocation efficiency.
[0050] Step S4: Based on the requested resource requirements, check whether the resources meet the requirements. If so, execute step S5; if not, return an error code and error description.
[0051] Specifically, in step S4, it is checked whether the available resources of the public cloud platform match the requested resource requirements.
[0052] Step S5: Create a service instance through the Kubernetes API, and during the creation process, check in real time whether the service concurrency and resource usage have reached the warning limit.
[0053] Specifically, create deployment, service, and ingress service instances, allocate hardware resources, select a deployment version, and set service hours.
[0054] In this embodiment, step S5 creates a deployment, a service, and an ingress in sequence, and includes the following sub-steps:
[0055] In step S5.1, based on the requested resource requirements and lifecycle, a deployment configuration is generated and a deployment is created through the Kubernetes API.
[0056] In step S5.2, based on the deployment, generate the service configuration and create the service through the Kubernetes API.
[0057] In step S5.3, based on the service, generate the ingress configuration and create the ingress through the Kubernetes API.
[0058] Furthermore, step S5 detects in real time whether the public cloud resource pool status, service concurrency, and resource usage have reached the warning upper limit.
[0059] Step S6: If the resource allocation is successful, the service access URL containing the token information is returned for access by third-party program users; if the resource allocation fails, the resource recovery mechanism is triggered.
[0060] Specifically, the resource recovery mechanism includes: deleting the created deployment, service, and ingress service instances in sequence, releasing the occupied public cloud resources, and returning an error code and corresponding error description to the user to facilitate user location and resolution of the problem.
[0061] Figure 2 This is a schematic diagram of a service access URL being accessed by a third-party program user in an embodiment of the present invention.
[0062] like Figure 2 As shown, in step S6, when the service access URL is accessed by a third-party program user, the permission must be verified first. If the verification fails, an error code is returned. If the verification succeeds, access to the service is allowed.
[0063] Example 2:
[0064] The present invention also provides a system for calling a universal controllable service based on a public cloud. The system for calling a universal controllable service based on a public cloud can be implemented by executing the process steps of the method for calling a universal controllable service based on a public cloud. That is, those skilled in the art can understand the method for calling a universal controllable service based on a public cloud as a preferred implementation of the system for calling a universal controllable service based on a public cloud.
[0065] Specifically, the system for general controllable service calls based on the public cloud includes:
[0066] Module M1 receives requests from third-party program users, which include resource requirements and lifecycles.
[0067] Furthermore, the service duration, CPU, memory hardware resources, service version and other parameters contained in the request are parsed.
[0068] Module M2 checks whether the third-party program user has been assigned app_key and app_secret. If not, it generates and assigns app_key and app_secret.
[0069] Module M3 obtains cluster resource description information from the selected public cloud platform.
[0070] In this embodiment, a resource management database is established through the Django background to record and maintain in real time: the real-time available resource list of the public cloud platform, detailed records of allocated resources (including CPU / Memory quotas, allocation time, life cycle) and resource recovery logs.
[0071] Specifically, in module M3, the cluster resource description information includes available resources.
[0072] Module M4 checks whether the resources meet the requirements based on the requested resource requirements. If so, module M5 is executed; if not, an error code and error description are returned.
[0073] Specifically, in module M4, it is checked whether the available resources of the public cloud platform match the requested resource requirements.
[0074] Module M5 creates a service instance through the Kubernetes API and checks in real time during the creation process whether the service concurrency and resource usage have reached the warning limit.
[0075] Specifically, create deployment, service, and ingress service instances, allocate hardware resources, select a deployment version, and set service hours.
[0076] In this embodiment, module M5 creates deployment, service, and ingress in sequence, and includes the following submodules:
[0077] Module M5.1 generates deployment configuration based on the requested resource requirements and lifecycle and creates the deployment through the Kubernetes API.
[0078] Module M5.2, based on deployment, generates service configuration and creates services through the Kubernetes API.
[0079] Module M5.3 generates ingress configuration based on service and creates ingress through Kubernetes API.
[0080] Furthermore, module M5 detects in real time the status of the public cloud resource pool and the service concurrency and whether resource usage has reached the resource warning limit.
[0081] Module M6, if the resource allocation is successful, returns the service access URL containing token information for access by third-party program users; if the resource allocation fails, the resource recovery mechanism is triggered.
[0082] Specifically, the resource recovery mechanism includes: deleting the created deployment, service, and ingress service instances in sequence, releasing the occupied public cloud resources, and returning an error code and corresponding error description to the user to facilitate user location and resolution of the problem.
[0083] In module M6, when the service access URL is accessed by a third-party program user, the permission must be verified first. If the verification fails, an error code is returned. If the verification succeeds, access to the service is allowed.
[0084] Example 3:
[0085] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the computer program implements the steps of the above-mentioned method for calling a general controllable service based on a public cloud.
[0086] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.
[0087] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A method for calling a universal controllable service based on a public cloud, characterized in that: The steps include: Step S1, receiving a request from a third-party program user, wherein the request includes resource requirements and life cycle; Step S2, checking whether the third-party program user has been assigned app_key and app_secret, if not, generating and assigning app_key and app_secret; Step S3, obtaining cluster resource description information from the selected public cloud platform; Step S4: Based on the resource requirements of the request, check whether the resources meet the requirements. If so, execute step S5; if not, return an error code and error description; Step S5: Create a service instance through the Kubernetes API and check in real time during the creation process whether the service concurrency and resource usage have reached the warning limit; Step S6: If the resource allocation is successful, the service access URL containing the token information is returned for access by third-party program users; if the resource allocation fails, the resource recovery mechanism is triggered.
2. The method for calling a universal controllable service based on a public cloud according to claim 1, characterized in that: In step S3, a resource management database is established through the Django backend to record and maintain the real-time available resource list of the public cloud platform, detailed records of allocated resources and resource recovery logs.
3. The method for calling a universal controllable service based on a public cloud according to claim 2, characterized in that: In step S4, it is checked whether the available resources of the public cloud platform match the resource requirements of the request.
4. The method for calling a universal controllable service based on a public cloud according to claim 1, wherein: In step S5, deployment, service, and ingress service instances are created to allocate hardware resources, select a deployment version, and set service time.
5. The method for calling a universal controllable service based on a public cloud according to claim 4, characterized in that: The step S5 includes the following sub-steps: Step S5.1, generating a deployment configuration based on the resource requirements and lifecycle of the request and creating the deployment through the Kubernetes API; Step S5.2: Based on the deployment, generate a service configuration and create a service through the Kubernetes API; In step S5.3, based on the service, generate an ingress configuration and create an ingress through the Kubernetes API.
6. The method for calling a universal controllable service based on a public cloud according to claim 5, characterized in that: In step S5, the public cloud resource pool status, service concurrency, and resource usage are detected in real time to see whether they have reached the warning limit.
7. The method for calling a universal controllable service based on a public cloud according to claim 6, characterized in that: In step S6, the resource recovery mechanism includes: deleting the created deployment, service, and ingress service instances in sequence, releasing the occupied public cloud resources, and returning an error code and corresponding error description to the user.
8. The method for calling a universal controllable service based on a public cloud according to claim 1, wherein: In step S6, when the service access URL is accessed by a third-party program user, the permission must be verified first. If the verification fails, an error code is returned. If the verification succeeds, access to the service is allowed.
9. A system for general controllable service invocation based on public cloud, characterized in that: include: Module M1 receives a request from a third-party program user, wherein the request includes resource requirements and lifecycle; Module M2 checks whether the third-party program user has been assigned app_key and app_secret. If not, generates and assigns app_key and app_secret. Module M3 obtains cluster resource description information from the selected public cloud platform; Module M4 checks whether the resources meet the requirements based on the resource requirements of the request. If so, module M5 is executed; if not, an error code and error description are returned. Module M5 creates a service instance through the Kubernetes API and checks in real time during the creation process whether the service concurrency and resource usage have reached the warning limit; Module M6, if the resource allocation is successful, returns the service access URL containing token information for access by third-party program users; if the resource allocation fails, the resource recovery mechanism is triggered.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for calling a general controllable service based on a public cloud according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Dynamic data gateway communication method based on MQ
CN116962547A