Cloud platform maintenance management method and device, equipment and medium
By intercepting interface requests in the cloud platform's API gateway, matching maintenance levels and conducting access detection, the problem of unsustainable and inefficient maintenance management of cloud platform is solved, and more efficient maintenance management is achieved.
Patent Information
- Application Number
- CN202411718803.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-25
AI Technical Summary
The existing cloud platforms have problems such as unsustainable maintenance management and low maintenance efficiency.
When the API gateway receives the interface request, the intercept read process obtains the sending user and the request source, and the maintenance level matches the sending user according to the preset maintenance rules. Admission detection is performed based on the maintenance level and the request source, and response data is obtained and the request result is sent to the user.
Improve the scalability and sustainability of maintenance management methods and improve maintenance efficiency.
Smart Images

Figure CN119520618A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud technology, and in particular to a cloud platform maintenance management method, device, equipment and medium. Background Art
[0002] With the maturity of the cloud-native concept and the open source technology ecosystem developed around cloud-native construction, current IT services (ISSA) are being built based on the cloud-native concept and ecosystem. However, the current cloud-native infrastructure and its ecosystem only provide a cloud-native core construction platform, and do not provide users with out-of-the-box, continuously maintained solutions. At the same time, the cloud platform requires users to integrate and build tools and capabilities that meet the actual production requirements in order to provide production-level cloud-native service capabilities.
[0003] Therefore, the current cloud platform has problems with unsustainable maintenance management and low maintenance efficiency. Summary of the invention
[0004] The embodiments of the present invention provide a cloud platform maintenance management method, device, equipment and medium, aiming to solve the problems of unsustainable maintenance management and low maintenance efficiency of existing cloud platforms.
[0005] In a first aspect, an embodiment of the present invention provides a cloud platform maintenance management method, the method comprising:
[0006] When the API gateway receives an interface request, it intercepts and reads the interface request to obtain the sending user and the request source;
[0007] Matching the sending user with the preset maintenance rules to obtain a maintenance level;
[0008] Performing an access detection on the interface request based on the maintenance level and the request source to obtain an access detection result;
[0009] When the admission detection result is the interface request admission, obtaining response data of the cloud platform based on the interface request as the request result;
[0010] The request result is sent to the sending user.
[0011] In a second aspect, an embodiment of the present invention further provides a cloud platform maintenance management device, the device comprising:
[0012] A reading unit is used to intercept and read the interface request when the API gateway receives the interface request to obtain the sending user and the request source;
[0013] A matching unit, used for matching the sending user with the sending user according to a preset maintenance rule to obtain a maintenance level;
[0014] An admission detection unit, configured to perform an admission detection on the interface request based on the maintenance level and the request source, and obtain an admission detection result;
[0015] An acquisition unit, configured to acquire, when the admission detection result is the admission of the interface request, response data of the cloud platform based on the interface request as a request result;
[0016] A sending unit is used to send the request result to the sending user.
[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions, when executed by a processor, can implement the method described in the first aspect above.
[0019] The present invention provides a cloud platform maintenance management method, device, equipment and medium, the method comprising: when an API gateway receives an interface request, intercepting and reading the interface request to obtain a sending user and a request source; matching the sending user according to a preset maintenance rule to obtain a maintenance level; performing access detection on the interface request based on the maintenance level and the request source to obtain an access detection result; when the access detection result is that the interface request is allowed, obtaining the response data of the cloud platform based on the interface request as a request result; and sending the request result to the sending user. The embodiment of the present invention can match the sending user according to a preset maintenance rule to obtain a maintenance level, thereby improving the scalability of the maintenance management method; the embodiment of the present invention can also perform access detection on the interface request based on the maintenance level and the request source to obtain an access detection result, thereby achieving standardized processing of the access of the interface request and improving the sustainability and efficiency of maintenance management. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of a process flow of a cloud platform maintenance management method provided by an embodiment of the present invention;
[0022] Figure 2 A schematic block diagram of a cloud platform maintenance and management device provided in an embodiment of the present invention;
[0023] Figure 3 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0026] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0027] It should be further understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. The embodiments of the present invention provide a cloud platform maintenance management method, apparatus, equipment and medium. Under the premise of large-scale application of cloud native infrastructure, the current cloud service mode is still mainly divided into three modes of providing cloud services: private cloud, public cloud and hybrid cloud. On the other hand, because business intelligence has become more and more commercially valuable, business data can bring huge value to enterprises, and some businesses themselves are sensitive, the construction of private clouds is inevitable. The specific application scenario of the cloud platform maintenance management method is to perform maintenance management on the cloud platform, such as introducing maintenance management capabilities for a cloud platform with private cloud management functions.
[0028] Figure 1 The following is a flow chart of a cloud platform maintenance management method provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S150.
[0029] S110. When the API gateway receives an interface request, it intercepts and reads the interface request to obtain a sending user and a request source.
[0030] In this embodiment, the API gateway is used to receive the interface request, and the interface request is intercepted and read to obtain the sending user and the request source. The interface request is a request from a user to access data resources in the cloud platform. For example, the object of the interface request can be a data resource object stored in ETCD (a highly available distributed key-value pair storage system, the core data storage component of the cloud platform); the sending user refers to the user who initiates the interface request, which may include information such as the user's unique identifier; the request source refers to the source of the interface request, which may include internal requests and external requests. Internal requests are initiated from within the cluster of the cloud platform, and external requests are initiated by external applications of the cloud platform through calling interfaces.
[0031] In one embodiment, the method further comprises:
[0032] Before the API gateway receives the interface request, building an admission controller;
[0033] The controller plug-in mechanism is used to embed the admission controller into the cloud platform maintenance management control process in a plug-in manner.
[0034] In this embodiment, this step is performed before step S110, that is, before the API gateway receives the interface request; the admission controller can be self-developed according to functional requirements; the controller plug-in mechanism is a mechanism of a cloud platform with private cloud management functions; at the same time, the custom admission controller does not need to recompile the entire cloud platform, and can be deployed as a dynamic plug-in configuration to a specific directory of the cloud platform to provide cloud platform maintenance and management services, avoiding recompiling the entire cloud platform. Among them, the cloud platform with private cloud management functions can be the de facto standard Kubernetes of the current cloud native infrastructure, that is, the basic environment of the cloud platform maintenance and management method is a cloud native environment built based on Kubernetes, and the Kubernetes version is 1.19+ and above; in this way, after the enterprise system builds a private cloud service, it will generally be based on Kubernetes as the core framework of the private cloud, and the self-built admission controller will be used to improve the functions so that the cloud platform can be actually applied to production. The present invention aims to utilize the cloud-native platform construction capabilities provided by Kubernetes itself to make maintenance capabilities cloud-native, while providing an access method that complies with Kubernetes standards. That is to say, by internalizing the maintenance function into Kubernetes, on the one hand, it complies with cloud-native semantics, and on the other hand, it can make use of the resource management Restful API architecture provided by Kubernetes to interface the maintenance management functions, making it convenient for subsequent expansion through programs.
[0035] Therefore, the embodiment of the present invention can utilize the controller plug-in mechanism to embed the access controller into the cloud platform maintenance management control process in a plug-in manner, so that the subsequent maintenance management method can be controlled by the access controller, thereby improving the scalability of the maintenance management method, and thereby improving the sustainability and efficiency of maintenance management.
[0036] In one embodiment, before step S110, that is, before the API gateway receives the interface request, and after the step of embedding the admission controller into the cloud platform maintenance management control process in a plug-in manner using the controller plug-in mechanism, the method further includes:
[0037] Before the API gateway receives the interface request, obtain the role type and all users;
[0038] Binding processing is performed on all the users according to the role type to obtain a role management table.
[0039] In this embodiment, this step is performed before step S110, that is, before the API gateway receives the interface request, and after the step of embedding the access controller into the cloud platform maintenance management control process in a plug-in manner using the controller plug-in mechanism; the role types may include cluster administrators, namespace administrators, namespace ordinary users, or private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users, etc.; all users are users who are registered and can log in to the cloud platform, and may include user unique identifiers and user names, etc. When each user registers, the user can be bound to the default role type, and the cluster administrator can also modify the role type binding. Specifically, the role management table is obtained by binding each user among all the users according to the role type, and each user can correspond to multiple role types, and one role type can correspond to multiple users. Among them, the role management table includes data such as user unique identifiers and role types.
[0040] Therefore, the embodiment of the present invention can use the role type to bind all the users to obtain a role management table. The establishment of the role management table improves the scalability of the maintenance management method, thereby improving the sustainability and efficiency of maintenance management.
[0041] S120: Matching the sending user with the preset maintenance rule to obtain a maintenance level.
[0042] In this embodiment, a matching process is performed with the sending user according to a preset maintenance rule to obtain a maintenance level; wherein the maintenance rule is a preset rule determined based on the role type and the maintenance level.
[0043] In one embodiment, step S120, i.e., the step of matching the sending user with the preset maintenance rule to obtain the maintenance level, includes:
[0044] Obtaining the sending role type of the sending user;
[0045] If the sending role type is a first-class role, the maintenance level is frozen maintenance or controlled maintenance;
[0046] If the sending role type is a second-type role, the maintenance level is regular maintenance;
[0047] If the sending role type is a third-type role, the maintenance level is default maintenance.
[0048] In this embodiment, the sending role type of the sending user is obtained from the user management table, wherein all users include multiple sending users, and the sending role type may include a first type of role, a second type of role, and a third type of role; the first type of role may include cluster administrators, namespace administrators, namespace ordinary users, private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users and the like; the second type of role may include cluster administrators, namespace administrators, namespace ordinary users, private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users and the like; the third type of role may include cluster administrators, namespace administrators, namespace ordinary users, private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users and the like; the maintenance level may include frozen maintenance, controlled maintenance, regular maintenance and default maintenance.
[0049] Specifically, the first category of roles may also be other role types in addition to specific role types such as cluster administrators and namespace administrators, that is, the first category of roles may be namespace ordinary users, private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users, and the like; wherein, the specific role types may include cluster administrators, namespace administrators, namespace ordinary users, private cloud maintenance personnel, private cloud tenant administrators, tenant ordinary users, and the like; the second category of roles and the composition rules of the second category of roles are the same as the composition rules of the first category of roles.
[0050] Therefore, the embodiment of the present invention can use the maintenance rules and the sending role type of the sending user to match and obtain the corresponding maintenance level. The design of the maintenance rules and maintenance levels improves the scalability of the maintenance management method, thereby improving the sustainability and efficiency of maintenance management.
[0051] S130: Perform an access check on the interface request based on the maintenance level and the request source to obtain an access check result.
[0052] In this embodiment, the maintenance levels include frozen maintenance, controlled maintenance, regular maintenance and default maintenance; the request sources include internal requests and external requests.
[0053] In one embodiment, step S130, i.e., performing an admission detection on the interface request based on the maintenance level and the request source to obtain an admission detection result, includes:
[0054] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-category source, the admission detection result is that the interface request is not admitted;
[0055] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-category source, the admission detection result is the interface request admission;
[0056] If the maintenance level is regular maintenance and the request source is a first-category source or a second-category source, the admission detection result is the interface request admission;
[0057] If the maintenance level is default maintenance and the request source is a first-category source or a second-category source, the admission detection result is that the interface request is not admitted.
[0058] In this embodiment, when it is detected that the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-class source, the access detection result is the interface request access; when it is detected that the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-class source, the access detection result is the interface request access; when it is detected that the maintenance level is regular maintenance and the request source is a first-class source or a second-class source, the access detection result is the interface request access; when it is detected that the maintenance level is default maintenance and the request source is a first-class source or a second-class source, the access detection result is the interface request denial of access. Among them, the first-class source may refer to requests other than internal requests, that is, external requests; the first-class source may also refer to requests other than external requests, that is, internal requests; the second-class source may refer to sources of specific role types, internal requests or external requests.
[0059] Therefore, the embodiment of the present invention can utilize the maintenance level and the request source to obtain the access detection result of whether the interface request is allowed. The design of the maintenance level and the access detection result improves the scalability of the maintenance management method, thereby improving the sustainability and maintenance efficiency of maintenance management.
[0060] S140. When the admission detection result is the interface request admission, obtain response data of the cloud platform based on the interface request as the request result.
[0061] In this embodiment, if the admission detection result is the interface request admission, the interface request is used to perform data operations on the cloud platform to obtain response data as the request result.
[0062] S150: Send the request result to the sending user.
[0063] In this embodiment, the admission detection result includes two situations: the interface request is not allowed to enter and the interface request is allowed to enter.
[0064] In one embodiment, after step S130, that is, after performing an admission detection on the interface request based on the maintenance level and the request source and obtaining the admission detection result, the method further:
[0065] If the admission detection result is that the interface request is not admitted, a request result indicating that the request failed is sent to the sending user, and the interface request is terminated.
[0066] In this embodiment, the access detection result includes two situations: the interface request is not allowed and the interface request is allowed; specifically, in the first situation, if the access detection result is that the interface request is not allowed, then the request result of the failed request is sent to the sending user, and the process of the interface request is terminated; in the second situation, if the access detection result is that the interface request is allowed, the interface request is used to perform data operations on the cloud platform to obtain response data as the request result, specifically through the maintenance management configuration resource acquisition in the form of ConfigMap (an API object for storing non-encrypted configuration data, commonly used for environment variables, command line parameters and storage volumes) maintained in the cloud platform cluster, or through the CRD (Custom Resource Definition) mechanism to abstract the maintenance management itself into Kubernetes resources for integrated processing. Therefore, according to different access detection results, the interface request is processed accordingly, which improves the scalability of the maintenance management method, thereby improving the sustainability and efficiency of maintenance management.
[0067] In one embodiment, after step S150, that is, after the step of sending the request result to the sending user, the method includes:
[0068] The interface request and the request result are recorded through the admission callback function to realize the audit function.
[0069] In this embodiment, after the step of sending the request result to the sending user according to the admission detection result, the interface request and the request result are saved and recorded in a local file or remote storage through the admission callback function in the admission controller, which can realize the subsequent audit function for subsequent playback or audit by the maintainer. At the same time, the playback function can also be integrated into the Kubernetes cloud platform itself in the form of CRD (Custom Resource Definition). Therefore, the audit function is realized by recording the interface request and the request result through the admission callback function, which improves the scalability of the maintenance management method, thereby improving the sustainability and efficiency of maintenance management.
[0070] To sum up, the embodiment of the present invention can match the sending user according to the preset maintenance rules to obtain the maintenance level, thereby improving the scalability of the maintenance management method; the embodiment of the present invention can also perform access detection on the interface request based on the maintenance level and the request source to obtain the access detection result, thereby realizing standardized processing of the access of the interface request, and improving the sustainability and efficiency of maintenance management.
[0071] Figure 2 A schematic block diagram of a cloud platform maintenance management device provided by an embodiment of the present invention. Figure 2 As shown, corresponding to the above cloud platform maintenance and management method, the present invention also provides a cloud platform maintenance and management device.
[0072] Specifically, see Figure 2 , the cloud platform maintenance management device 700 includes:
[0073] The reading unit 701 is used to intercept and read the interface request when the API gateway receives the interface request to obtain the sending user and the request source;
[0074] A matching unit 702, configured to perform matching processing with the sending user according to a preset maintenance rule to obtain a maintenance level;
[0075] An admission detection unit 703, configured to perform an admission detection on the interface request based on the maintenance level and the request source, and obtain an admission detection result;
[0076] The acquisition unit 704 is used to acquire the response data of the cloud platform based on the interface request as the request result when the admission detection result is the interface request admission;
[0077] The sending unit 705 is used to send the request result to the sending user.
[0078] In some embodiments, when the matching unit 702 performs matching processing with the sending user according to a preset maintenance rule to obtain a maintenance level, it is specifically used to:
[0079] Obtain the sending role type of the sending user; if the sending role type is a first-class role, the maintenance level is frozen maintenance or controlled maintenance; if the sending role type is a second-class role, the maintenance level is regular maintenance; if the sending role type is a third-class role, the maintenance level is default maintenance.
[0080] In some embodiments, when the admission detection unit 703 performs the admission detection on the interface request based on the maintenance level and the request source to obtain the admission detection result, it is specifically used to:
[0081] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-class source, the access detection result is that the interface request is not allowed to access; if the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-class source, the access detection result is that the interface request is allowed to access; if the maintenance level is regular maintenance and the request source is a first-class source or a second-class source, the access detection result is that the interface request is allowed to access; if the maintenance level is default maintenance and the request source is a first-class source or a second-class source, the access detection result is that the interface request is not allowed to access.
[0082] In some embodiments, after performing the step of performing admission detection on the interface request based on the maintenance level and the request source to obtain the admission detection result, the sending unit 705 is specifically used to:
[0083] If the admission detection result is that the interface request is not admitted, a request result indicating that the request failed is sent to the sending user, and the interface request is terminated.
[0084] In some embodiments, it is also used to:
[0085] Before the API gateway receives the interface request, an admission controller is constructed; and the admission controller is embedded in the cloud platform maintenance management control process in a plug-in manner using a controller plug-in mechanism.
[0086] In some embodiments, it is also used to:
[0087] Before the API gateway receives the interface request, the role type and all users are obtained; and binding processing is performed on all users according to the role type to obtain a role management table.
[0088] In some embodiments, after executing the step of sending the request result to the sending user, the sending unit 705 is further used to:
[0089] The request result is recorded through the admission callback function to implement the audit function.
[0090] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned cloud platform maintenance management device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0091] The cloud platform maintenance and management device can be implemented in the form of a computer program. Figure 3 Runs on the computer device shown.
[0092] See also Figure 3 , Figure 3800 is a schematic block diagram of an electronic device provided by an embodiment of the present invention. The computer device 800 may be a terminal or a server, wherein the terminal may be an electronic device with a communication function. The server may be an independent server or a server cluster composed of multiple servers.
[0093] See also Figure 3 The electronic device 800 includes a processor 802 , a memory and a network interface 805 connected via a system bus 801 , wherein the memory may include a non-volatile storage medium 803 and an internal memory 804 .
[0094] The non-volatile storage medium 803 can store an operating system 8031 and a computer program 8032. The computer program 8032 includes program instructions, and when the program instructions are executed, the processor 802 can execute a cloud platform maintenance management method.
[0095] The processor 802 is used to provide computing and control capabilities to support the operation of the entire electronic device 800 .
[0096] The internal memory 804 provides an environment for the operation of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can execute a cloud platform maintenance management method.
[0097] The network interface 805 is used to communicate with other devices over the network. Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the electronic device 800 to which the solution of the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0098] The processor 802 is used to run the computer program 8032 stored in the memory to implement the following steps:
[0099] When the API gateway receives an interface request, it intercepts and reads the interface request to obtain the sending user and the request source;
[0100] Matching the sending user with the preset maintenance rules to obtain a maintenance level;
[0101] Performing an access detection on the interface request based on the maintenance level and the request source to obtain an access detection result;
[0102] When the admission detection result is the interface request admission, obtaining response data of the cloud platform based on the interface request as the request result;
[0103] The request result is sent to the sending user.
[0104] In some embodiments, when the processor 802 performs matching processing with the sending user according to a preset maintenance rule to obtain a maintenance level, the processor 802 specifically implements the following steps:
[0105] Obtain the sending role type of the sending user; if the sending role type is a first-class role, the maintenance level is frozen maintenance or controlled maintenance; if the sending role type is a second-class role, the maintenance level is regular maintenance; if the sending role type is a third-class role, the maintenance level is default maintenance.
[0106] In some embodiments, when the processor 802 performs an admission detection on the interface request based on the maintenance level and the request source to obtain an admission detection result, the processor 802 specifically implements the following steps:
[0107] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-class source, the access detection result is that the interface request is not allowed to access; if the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-class source, the access detection result is that the interface request is allowed to access; if the maintenance level is regular maintenance and the request source is a first-class source or a second-class source, the access detection result is that the interface request is allowed to access; if the maintenance level is default maintenance and the request source is a first-class source or a second-class source, the access detection result is that the interface request is not allowed to access.
[0108] In some embodiments, after the processor 802 performs an admission detection on the interface request based on the maintenance level and the request source to obtain an admission detection result, the processor 802 further performs the following steps:
[0109] If the admission detection result is that the interface request is not admitted, a request result indicating that the request failed is sent to the sending user, and the interface request is terminated.
[0110] In some embodiments, the processor 802 further implements the following steps:
[0111] Before the API gateway receives the interface request, an admission controller is constructed; and the admission controller is embedded in the cloud platform maintenance management control process in a plug-in manner using a controller plug-in mechanism.
[0112] In some embodiments, the processor 802 further implements the following steps:
[0113] Before the API gateway receives the interface request, the role type and all users are obtained; and binding processing is performed on all users according to the role type to obtain a role management table.
[0114] In some embodiments, after implementing the step of sending the request result to the sending user, the processor 802 further implements the following steps:
[0115] The request result is recorded through the admission callback function to implement the audit function.
[0116] It should be understood that in the embodiment of the present invention, the processor 802 may be a central processing unit (CPU), and the processor 802 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0117] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0118] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:
[0119] When the API gateway receives an interface request, it intercepts and reads the interface request to obtain the sending user and the request source;
[0120] Matching the sending user with the preset maintenance rules to obtain a maintenance level;
[0121] Performing an access detection on the interface request based on the maintenance level and the request source to obtain an access detection result;
[0122] When the admission detection result is the interface request admission, obtaining response data of the cloud platform based on the interface request as the request result;
[0123] The request result is sent to the sending user.
[0124] In one embodiment, when the processor executes the step of matching the sending user according to the preset maintenance rule to obtain the maintenance level, the processor specifically implements the following steps:
[0125] Obtaining the sending role type of the sending user;
[0126] If the sending role type is a first-class role, the maintenance level is frozen maintenance or controlled maintenance;
[0127] If the sending role type is a second-type role, the maintenance level is regular maintenance;
[0128] If the sending role type is a third-type role, the maintenance level is default maintenance.
[0129] In one embodiment, when the processor performs the step of performing an admission detection on the interface request based on the maintenance level and the request source to obtain an admission detection result, the processor specifically implements the following steps:
[0130] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-category source, the admission detection result is that the interface request is not admitted;
[0131] If the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-category source, the admission detection result is the interface request admission;
[0132] If the maintenance level is regular maintenance and the request source is a first-category source or a second-category source, the admission detection result is the interface request admission;
[0133] If the maintenance level is default maintenance and the request source is a first-category source or a second-category source, the admission detection result is that the interface request is not admitted.
[0134] In one embodiment, after executing the step of performing admission detection on the interface request based on the maintenance level and the request source to obtain the admission detection result, the processor further implements the following steps:
[0135] If the admission detection result is that the interface request is not admitted, a request result indicating that the request failed is sent to the sending user, and the interface request is terminated.
[0136] In one embodiment, the processor further implements the following steps:
[0137] Before the API gateway receives the interface request, building an admission controller;
[0138] The controller plug-in mechanism is used to embed the admission controller into the cloud platform maintenance management control process in a plug-in manner.
[0139] In one embodiment, the processor further implements the following steps:
[0140] Before the API gateway receives the interface request, obtain the role type and all users;
[0141] Binding processing is performed on all the users according to the role type to obtain a role management table.
[0142] In one embodiment, after executing the step of sending the request result to the sending user, the processor further implements the following steps:
[0143] The request result is recorded through the admission callback function to implement the audit function.
[0144] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0145] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0146] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0147] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0149] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims. At the same time, the non-company software tools or components that appear in the embodiments of the present invention are only examples and do not represent actual use.
Claims
1. A cloud platform maintenance and management method, characterized in that: The method comprises: When the API gateway receives an interface request, it intercepts and reads the interface request to obtain the sending user and the request source; Matching the sending user with the preset maintenance rules to obtain a maintenance level; Performing an access detection on the interface request based on the maintenance level and the request source to obtain an access detection result; When the admission detection result is the interface request admission, obtaining response data of the cloud platform based on the interface request as the request result; The request result is sent to the sending user.
2. The cloud platform maintenance and management method according to claim 1, characterized in that: The matching process with the sending user according to the preset maintenance rule to obtain the maintenance level includes: Obtaining the sending role type of the sending user; If the sending role type is a first-class role, the maintenance level is frozen maintenance or controlled maintenance; If the sending role type is a second-type role, the maintenance level is regular maintenance; If the sending role type is a third-type role, the maintenance level is default maintenance.
3. The cloud platform maintenance and management method according to claim 2, characterized in that: The performing admission detection on the interface request based on the maintenance level and the request source to obtain an admission detection result includes: If the maintenance level is frozen maintenance or controlled maintenance and the request source is a first-category source, the admission detection result is that the interface request is not admitted; If the maintenance level is frozen maintenance or controlled maintenance and the request source is a second-category source, the admission detection result is the interface request admission; If the maintenance level is regular maintenance and the request source is a first-category source or a second-category source, the admission detection result is the interface request admission; If the maintenance level is default maintenance and the request source is a first-category source or a second-category source, the admission detection result is that the interface request is not admitted.
4. The cloud platform maintenance and management method according to claim 3, characterized in that: After performing admission detection on the interface request based on the maintenance level and the request source and obtaining the admission detection result, the method further includes: If the admission detection result is that the interface request is not admitted, a request result indicating that the request failed is sent to the sending user, and the interface request is terminated.
5. The cloud platform maintenance and management method according to claim 1, characterized in that: The method further comprises: Before the API gateway receives the interface request, building an admission controller; The controller plug-in mechanism is used to embed the admission controller into the cloud platform maintenance management control process in a plug-in manner.
6. The cloud platform maintenance and management method according to claim 1, characterized in that: The method further comprises: Before the API gateway receives the interface request, obtain the role type and all users; Binding processing is performed on all the users according to the role type to obtain a role management table.
7. The cloud platform maintenance and management method according to claim 1, characterized in that: After sending the request result to the sending user, the method further includes: The request result is recorded through the admission callback function to implement the audit function.
8. A cloud platform maintenance and management device, characterized in that: The device comprises: A reading unit is used to intercept and read the interface request when the API gateway receives the interface request to obtain the sending user and the request source; A matching unit, used for matching the sending user with the sending user according to a preset maintenance rule to obtain a maintenance level; An admission detection unit, configured to perform an admission detection on the interface request based on the maintenance level and the request source, and obtain an admission detection result; An acquisition unit, configured to acquire, when the admission detection result is the admission of the interface request, response data of the cloud platform based on the interface request as a request result; A sending unit is used to send the request result to the sending user.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the cloud platform maintenance and management method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the cloud platform maintenance and management method according to any one of claims 1 to 7.