Request processing method, server, readable storage medium and program product
By introducing a consistent Raft server cluster between cloud pipe and cloud dock server, the problem of poor data consistency between cloud pipe and cloud dock server is solved, efficient information synchronization and system decoupling is achieved, and the efficiency of cloud computing resource management is improved.
Patent Information
- Application Number
- CN202411785123.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
AI Technical Summary
The data consistency between cloud pipes and cloud docks is poor, resulting in inefficient cloud computing resource management.
By introducing a consistent Raft server cluster between the cloud management server and the cloud dock server, database query statements are generated and data processing and synchronization is performed through the Raft server cluster, data consistency is ensured.
It improves the information synchronization capability between cloud pipes and cloud docks, reduces network congestion and data loss, decouples cloud pipes and cloud docks servers, and improves the reliability and efficiency of the system.
Smart Images

Figure CN119646042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cloud computing, and in particular to a request processing method, a server, a readable storage medium, and a program product. Background Art
[0002] With the development of cloud computing technology, cloud management and cloud base together constitute a cloud scheduling system, which enables users to manage cloud computing resources, including monitoring and changing cloud hosts, cloud hard disks, gateways, etc. Usually, cloud management and cloud base are deployed as two independent services in different hosts or containers, and the two services use two independent database systems.
[0003] In traditional technologies, cloud management can access cloud base services, query and change cloud base resource status by using HTTP requests, message queues, etc. However, traditional technologies may cause poor data consistency between cloud management and cloud base. Summary of the invention
[0004] Based on this, it is necessary to provide a request processing method, server, readable storage medium and program product that can improve data consistency between cloud management and cloud base in response to the above technical problems.
[0005] In a first aspect, the present application provides a request processing method, which is applied to a cloud management server, and the method includes:
[0006] Receive resource management requests sent by the client;
[0007] Generate a database query statement based on the request content of the resource management request;
[0008] The resource management request is processed according to the database query statement and the consistent Raft server cluster.
[0009] In one embodiment, the processing of the resource management request according to the database query statement and the consistent Raft server cluster includes:
[0010] Sending the database query statement to a database server cluster through the Raft server cluster;
[0011] Obtaining the query result returned by the database server cluster through the Raft server cluster;
[0012] The resource management request is processed according to the query result.
[0013] In one embodiment, if the resource management request is a resource change request, processing the resource management request according to the query result includes:
[0014] Performing a business check on the resource change request according to the query result;
[0015] If the resource change request service verification passes, sending the resource change request to the Raft server cluster;
[0016] The resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform an atomic change operation on the cloud computing resources, and send a resource persistence request of the resource change result to the Raft server cluster, and the database server cluster is controlled by the Raft server cluster to change or create resource entries.
[0017] In one embodiment, if the resource management request is a resource query request, processing the resource management request according to the query result includes:
[0018] Processing the data format of the query result according to the data format corresponding to the client to obtain a processed query result;
[0019] The processed query result is sent to the client.
[0020] In one embodiment, generating a database query statement based on the request content of the resource management request includes:
[0021] According to the request content, obtaining the information of the client;
[0022] When the information of the client is verified, the database query statement is generated according to the request content.
[0023] In a second aspect, the present application provides a request processing method, which is applied to a cloud base server, and the method includes:
[0024] Receive resource change requests sent by the cloud management server through the consistent Raft server cluster;
[0025] Acquire the business module information to be changed from the request header of the resource change request;
[0026] According to the information of the business module to be changed, an atomic change operation is performed on the business module to be changed.
[0027] In one embodiment, the method further comprises:
[0028] When the atomic change operation is completed on the business module to be changed, a resource persistence request for the resource change result is generated;
[0029] The resource change result and the resource persistence request are sent to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0030] In a third aspect, the present application further provides a request processing device, which is applied to a cloud management server, and includes:
[0031] A receiving module, used for receiving a resource management request sent by a client;
[0032] A generating module, used for generating a database query statement based on the request content of the resource management request;
[0033] The processing module is used to process the resource management request according to the database query statement and the consistent Raft server cluster.
[0034] In a fourth aspect, the present application further provides a request processing device, which is applied to a cloud base server, and includes:
[0035] The receiving module is used to receive resource change requests sent by the cloud management server through the consistent Raft server cluster;
[0036] An acquisition module, used for acquiring the business module information to be changed from the request header of the resource change request;
[0037] The processing module is used to perform an atomic change operation on the business module to be changed according to the information of the business module to be changed.
[0038] In a fifth aspect, the present application further provides a server, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the request processing method as described in the first aspect or the request processing method as described in the second aspect is implemented.
[0039] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the request processing method as described in the first aspect or the request processing method as described in the second aspect is implemented.
[0040] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the request processing method as described in the first aspect or the request processing method as described in the second aspect.
[0041] The above-mentioned request processing method, server, readable storage medium and program product, the cloud management server receives the resource management request sent by the client, and can generate a database query statement based on the request content of the resource management request, so that the resource management request can be processed according to the database query statement and the consistency server cluster, and the interconnection and intercommunication between the cloud management server and the cloud base server are realized through the consistency server cluster, and the cloud management server and the cloud base server are decoupled. Furthermore, the cloud management server and the cloud base server communicate through the consistency server cluster, reducing the network congestion caused by direct communication and polling, avoiding data loss, and thus improving the information synchronization capability between the cloud management server and the cloud base server. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 An application environment diagram of a request processing method in an embodiment;
[0044] Figure 2 A schematic diagram of a request processing method in one embodiment;
[0045] Figure 3 A flowchart of a request processing method in another embodiment;
[0046] Figure 4 A flowchart of a request processing method in another embodiment;
[0047] Figure 5 A schematic diagram of a request processing method in one embodiment;
[0048] Figure 6 A flowchart of a request processing method in another embodiment;
[0049] Figure 7 A flowchart of a request processing method in another embodiment;
[0050] Figure 8 A flowchart of a request processing method in another embodiment;
[0051] Fig. 9 is a structural block diagram of a request processing device in one embodiment;
[0052] Fig.10is a structural block diagram of a request processing device in another embodiment;
[0053] Fig.11 is a structural block diagram of a request processing device in another embodiment;
[0054] Fig.12 is a structural block diagram of a request processing device in one embodiment;
[0055] Fig.13 is a structural block diagram of a request processing device in another embodiment;
[0056] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The request processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the cloud management server is composed of modules such as network, compute, storage, image, gateway, and talk order. Except for the gateway and talk order modules, each of the other modules corresponds to a type of resource in cloud computing. For example, the network module can be responsible for the management and maintenance of resources such as gateway, load balancing, and elastic IP, and the storage can be responsible for the management of resources such as cloud hard disk and object storage. The same applies to the computing and image modules. Gateway and talk order are public modules responsible for the pre-request verification, authentication, diversion, and resource billing of the cloud management system. Each module can be deployed as a separate microservice in different hosts, virtual machines, or containers to reduce the coupling between modules and improve system availability and reliability. After the various requests sent by the front-end page are verified by the unified gateway module, they are received and business operations are performed by the modules they are responsible for. If it involves access to the database, the http request is called to the consistent Raft server cluster, and the Raft server cluster accesses the database and returns the result to the cloud management server. The cloud management server only communicates with the Raft server cluster and the front end of the cloud scheduling system.
[0059] The cloud base server is a control and scheduling platform for atomic operations on cloud computing resources. You can choose to expand the open source OpenStack framework for development and be responsible for the management and maintenance of the underlying resources of cloud computing. It can be mainly divided into Nova, Neutron, Cinder, Swift, Keystone and other modules, which are responsible for computing, networking, block storage, object storage, and identity authentication services respectively. Each module can be deployed as a microservice. After completing the change of cloud computing resources, it sends a callback message to the Raft server cluster for data synchronization and resource information persistence. The cloud base server only communicates with the Raft server cluster.
[0060] The database server cluster is used to persist various types of resource information, including business fields such as name, id, type, specification, and creation time. The cloud management server and the cloud base server share the data of the database server cluster to ensure the consistency of data in each service. The database server cluster can perform persistence operations through various types of databases. Different databases, such as MySQL and MongoDB, can be selected according to whether the resource information is structured. Different cluster deployment methods can be selected according to the amount of data to ensure high data availability. The database server cluster only communicates with the Raft server cluster.
[0061] The Raft server cluster is responsible for coordinating the service processes and data in the distributed system, ensuring the consistency of message transmission and data between the cloud management server and the cloud base server, decoupling the cloud management server and the cloud base server, and avoiding business pollution caused by mutual calls between services. The Raft algorithm ensures the accuracy and consistency of message transmission and data persistence between components.
[0062] In this application environment, the Raft server cluster serves as the interaction hub for various components and can interact with the cloud management server, cloud base server, and database server cluster. The cloud management server only interacts with the front-end and Raft server cluster, and the cloud base server and database server cluster only interact with the Raft server cluster.
[0063] In an exemplary embodiment, Figure 2 As shown, a request processing method is provided, which is applied to Figure 1 The following is an example of the cloud management server in the example, including:
[0064] S201, receiving a resource management request sent by a client.
[0065] Among them, the resource management request can be sent by the client to the cloud management server, and the request format of the resource management request can be a common http request body. The first to receive the resource management request is the gateway module of the cloud management server, which extracts the request body information to perform client authority verification, resource pool verification, and request legitimacy verification. After the verification is successful, the request is forwarded to the business module corresponding to the Infrastructure as a Service IAAS resource. For example, if the IAAS resource is a cloud host, the request is forwarded to the computing business module.
[0066] Optionally, the resource management request in this embodiment may be a resource change request, or may be a resource query request, wherein the resource change request may include resource creation, deletion, update, unbinding, rebinding, etc.
[0067] S202: Generate a database query statement based on the request content of the resource management request.
[0068] In this embodiment, as described in the above embodiment, the gateway module will forward the resource management request to the business module. Optionally, after receiving the resource management request, the business module will perform different verification processes according to different businesses. For example, if the resource management request is to create a cloud host, the business module can verify whether there is a cloud host with the same name, a cloud host supporting network, and whether the storage resources already exist based on the transmitted parameters. Usually, when performing business verification, it generally involves querying the database. At this time, the business module of the cloud management server can generate a database query statement based on the request content of the above resource management request, and obtain the data required for business verification through the database query statement. Alternatively, after the business module receives the resource management request, it is necessary to query the database. For example, when the resource management request is a resource query request, the business module receives the resource query request and needs to query the database according to the information required by the business requirements. At this time, the cloud management server can generate a database query statement based on the request content of the resource management request to query the database. Further, if the resource management request involves the query of multiple databases, query statements for different databases can be generated based on the request content of the resource management request.
[0069] S203, processing the resource management request according to the database query statement and the consistent Raft server cluster.
[0070] Optionally, in this embodiment, the cloud management server can send the database query statement to the database server cluster through the consistency Raft server cluster to process the resource management request. For example, if the resource management request is a resource query request, the database query statement can be sent to the database server cluster through the Raft server cluster to query the data corresponding to the resource query request; if the resource management request is a resource change request, the database query statement can be sent to the database server cluster through the Raft server cluster to obtain verification data for the resource change request.
[0071] In addition, it should be noted that the interaction between the client and the cloud management server selects the commonly used Web request based on the Http protocol encapsulation, including the request header and the request body. Different business modules can be distinguished by different request URLs. For example, the requested page belongs to the cloud host, and the cloud host belongs to the computing module, then the URL can be added with an infix such as "compute". Exemplarily, in this embodiment, the message body of the interaction between the cloud management server, the Raft server cluster, and the cloud base server can be the message body shown in Table 1, wherein the term field represents the internal node term identifier of the Raft server cluster, the seq field represents the request sequence number within the Raft server cluster, and the module represents the business module to which it belongs, which is used for the Raft server cluster to call back the cloud management server or cloud base server interface.
[0072] Table 1
[0073]
[0074] In the above request processing method, the cloud management server receives the resource management request sent by the client, and can generate a database query statement based on the request content of the resource management request, so that the resource management request can be processed according to the database query statement and the consistency server cluster. The interconnection and intercommunication between the cloud management server and the cloud base server are achieved through the consistency server cluster, and the cloud management server and the cloud base server are decoupled. Furthermore, the cloud management server and the cloud base server communicate through the consistency server cluster, which reduces the network congestion caused by direct communication and polling, avoids data loss, and thus improves the information synchronization capability between the cloud management server and the cloud base server.
[0075] This embodiment will explain the detailed process of the cloud management server processing the resource management request according to the database query statement and the Raft server cluster. Figure 3 As shown, the above S203 includes:
[0076] S301, sending a database query statement to a database server cluster through a Raft server cluster.
[0077] In this embodiment, the Raft server cluster acts as an interactive hub, and the database query statement can be sent to the database server cluster through the Raft server cluster. That is to say, in this embodiment, the Raft server cluster plays the role of data forwarding. Optionally, in this embodiment, after receiving the database query statement, the Raft server cluster can mark the request sequence and business module, synchronize messages within the cluster, and record and persist the operation log. After the synchronization is completed, the database query statement is read and forwarded to the database server cluster.
[0078] S302, obtaining the query result returned by the database server cluster through the Raft server cluster.
[0079] Optionally, in this embodiment, after receiving the database query statement, the database server cluster can query the corresponding entry in the database server cluster and send the query result to the Raft server cluster. The Raft server cluster receives the result returned by the database server cluster, synchronizes messages within the cluster, records and persists the operation log, matches the request sequence and business module corresponding to the return, and forwards it to the corresponding business module of the cloud management server.
[0080] In addition, it is understandable that the use of Raft server clusters to uniformly set up log records for various cloud computing resources and business operations makes the log structure, recording information, and persistence methods more reasonable, reducing the time and manpower loss caused by multiple components jointly troubleshooting the same problem.
[0081] S303: Process the resource management request according to the query result.
[0082] Optionally, in this embodiment, if the resource management request is a resource change request, the resource change request can be service-verified according to the query results above. If the service verification of the resource change request is passed, the resource change request is sent to the Raft server cluster. At the same time, an indication can be returned to the client, instructing the client to display the words "resource creation" and the like. Further, after receiving the resource change request, the Raft server cluster can mark the request sequence and service module, encapsulate the request, and after the message synchronization in the Raft server cluster is completed and the log is persisted, the resource change request is sent to the cloud base server. After receiving the resource change request, the cloud base server extracts the service module information from the request header of the resource change request, selects different modules (Nova, Neutron, Cinder, Swift) for processing, performs atomic change operations on the resources, and returns the result to the Raft server cluster after success, and synchronously packages the persistent request for the completion of the resource information change to the Raft server cluster. The Raft server cluster receives the resource change results and resource persistence requests sent by the cloud base server, performs message synchronization within the cluster, outputs logs and persists them after synchronization is completed, extracts database operation statements in the resource persistence request, and sends them to the database server cluster. The database server cluster receives the database operation statements, changes or creates resource entries, and performs atomic change operations on the business modules to be changed. After the change operation is completed, the results are returned to the Raft server cluster. The Raft server cluster receives the database change results, performs message synchronization within the cluster, and persists logs after synchronization is completed, completing the response to the resource change request.
[0083] Optionally, in this embodiment, if the resource management request is a resource query request, the data format of the above query result can be processed according to the data format corresponding to the client, the data format of the query result can be converted into the data format corresponding to the client, the processed query result can be obtained, and the processed query result can be sent to the client.
[0084] In this embodiment, the generated database query statement can be sent to the database server cluster through the Raft server cluster, and the query result returned by the database server cluster can be obtained through the Raft server cluster, so that the resource management request can be processed according to the query result. The cloud management server and the cloud base server are decoupled through the Raft server cluster, and data is forwarded through the Raft server cluster, which ensures the accuracy and consistency of data persistence, thereby ensuring the consistency of message transmission and data between the cloud management and cloud base, and improving the information synchronization capability between the cloud management server and the cloud base server.
[0085] In this embodiment, the specific process of generating a database query statement based on the request content of the received resource management request by the cloud management server is explained. Figure 4 As shown, the above S202 includes:
[0086] S401, obtaining client information according to the request content.
[0087] Optionally, in this embodiment, the cloud management server may extract the request content of the resource management request, and then determine the request body information in the request content as the client information.
[0088] S402: When the information verification of the client passes, a database query statement is generated according to the request content.
[0089] Optionally, in this embodiment, the cloud management server can perform permission verification, resource pool verification, and request legitimacy verification on the client information, and then determine the different services included in the received resource management request based on the request content when the client information verification passes. The process of performing different service verifications on different services involves querying relevant information in the database server cluster. In this scenario, the cloud management server can generate corresponding database query statements based on the service type in the request content. As an optional implementation method, the generated database query statement can also be encapsulated and the encapsulated database query statement can be sent to the Raft server cluster.
[0090] In this embodiment, the client information can be obtained according to the request content of the received resource management request, and the client information can be verified. When the client information verification is passed, a database query statement is generated according to the request content of the received resource management request. This avoids the processing of illegal resource management requests and ensures that the database query statement sent by the cloud management server to the Raft server cluster is a query statement corresponding to a legal resource management request, thereby avoiding the processing of illegal resource management requests.
[0091] In the scenario where the resource management request sent by the client is a resource change request, the cloud base server is required to perform an atomic change operation on the cloud computing resources to complete the resource change request. Figure 5 As shown, a request processing method is provided, which is applied to Figure 1 The cloud base server in the example is used to illustrate, including:
[0092] S501, receiving a resource change request sent by a cloud management server through a consistent Raft server cluster.
[0093] Optionally, in this embodiment, if the resource management request sent by the client is a resource change request, the cloud management server performs a business verification on the resource change request when receiving the resource change request. If the business verification of the resource change request passes, the resource change request is sent to the Raft server cluster. After receiving the resource change request, the Raft server cluster marks the request sequence and business module and encapsulates the request. After the message synchronization in the cluster is completed and the log is persisted, the resource change request is sent to the cloud base server.
[0094] S502: Acquire information of the business module to be changed from the request header of the resource change request.
[0095] In this embodiment, after receiving the resource change request, the cloud base server obtains the business module information to be changed from the request header of the resource change request. For example, the business module to be changed may be Nova, Neutron, Cinder, Swift and other modules in the cloud base server.
[0096] S503: Perform an atomic change operation on the business module to be changed according to the information of the business module to be changed.
[0097] Optionally, in this embodiment, the cloud base server may perform an atomic change operation on the business module to be changed according to the acquired information of the business module to be changed, and return the result to the Raft server cluster upon success.
[0098] In the above request processing method, after the cloud base server receives the resource change request sent by the cloud management server through the consistency server cluster, it can obtain the business module information to be changed from the request header of the resource change request, so that it can perform atomic change operations on the business module to be changed based on the business module information to be changed. In this process, the cloud management server and the cloud base server are interconnected and interoperable through the consistency server cluster, and the cloud management server and the cloud base server are decoupled, so that the cloud base server can receive the resource change request through the consistency server cluster, and perform atomic change operations on the business module to be changed corresponding to the resource change request. Furthermore, the cloud management server and the cloud base server communicate through the consistency server cluster, which reduces the network congestion caused by direct communication and polling, avoids data loss, and thus improves the information synchronization capability between the cloud management server and the cloud base server.
[0099] In some scenarios, after the cloud base service performs an atomic change operation on the business module to be changed, it can also request that the resource change result be persisted in the consistency server. Figure 6 As shown, the above method also includes:
[0100] S601, when the atomic change operation is completed on the business module to be changed, a resource persistence request for the resource change result is generated.
[0101] Optionally, in this embodiment, when the cloud base server completes the atomic change operation on the business module to be changed, it can generate a resource persistence request for the resource change result based on the resource change result, and request to change or create a resource entry of the resource change result.
[0102] S602, sending the resource change result and the resource persistence request to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0103] In this embodiment, the cloud base server can send the resource change result and the resource persistence request of the resource change result to the Raft server cluster. After receiving the resource change result and the resource persistence request sent by the cloud base server, the Raft server cluster synchronizes the messages within the cluster. After the synchronization is completed, the log is output and persisted, and the database operation statement in the resource persistence request is extracted, and the database operation statement is sent to the database server cluster. After receiving the database operation statement, the database server cluster changes or creates the resource entry and returns the result to the Raft server cluster. The Raft server cluster receives the database change result, synchronizes the messages within the cluster, and persists the log after the synchronization is completed to complete the resource change process.
[0104] In this embodiment, when the cloud base server completes the atomic change operation on the business module to be changed, it generates a resource persistence request for the resource change result, and sends the resource change result and the resource persistence request to the Raft server cluster, so that the Raft server cluster can control the database server cluster to change or create resource entries based on the resource persistence request, ensuring the consistency of data in the database server cluster and the cloud base server when the cloud base server performs the atomic change operation on the business module to be changed.
[0105] To facilitate understanding by those skilled in the art, the request processing method provided by the present disclosure is described in detail below. Figure 7 As shown, when the resource management request sent by the client is a resource change request, the method may include:
[0106] S1, the gateway module of the cloud management server receives the resource change request sent by the client, and extracts the request body information to perform client permission verification, resource pool verification and request legitimacy verification. After successful verification, the resource change request is forwarded to the corresponding business module.
[0107] S2: The business module of the cloud management server receives the resource change request, generates a database query statement based on the request content, and sends the database query statement to the Raft server cluster.
[0108] S3, the Raft server cluster receives the database query statement sent by the business module, marks the request sequence and business module, synchronizes messages within the cluster, records and persists the operation log, and forwards the database query statement to the database server cluster after synchronization is completed.
[0109] S4: The database server cluster receives the database query statement, obtains the query result, and returns the query result to the Raft server cluster.
[0110] S5, the Raft server cluster receives the query result returned by the database server cluster, performs message synchronization within the cluster, matches the request sequence and business module corresponding to the return, and forwards it to the corresponding business module of the cloud management server.
[0111] S6, after receiving the query structure, the business module of the cloud management server performs business verification of the resource change request. After the verification passes, the resource change request is encapsulated and sent to the Raft server cluster. At the same time, a display request is returned to the client, and the client displays words such as "resources are being created".
[0112] S7, the Raft server cluster receives the resource change request, marks the request sequence and business module, encapsulates the request, and after the message synchronization within the cluster is completed and the log is persisted, the resource change request is sent to the cloud base server.
[0113] S8, the cloud base server receives the resource change request sent by the Raft server cluster, extracts the business module information from the request header, selects different business modules for processing, performs atomic change operations on the resources, returns the result to the Raft server cluster after the change is completed, and sends a persistence request for the completion of the resource information change to the Raft server cluster.
[0114] S9, the Raft server cluster receives the resource change results and resource persistence requests sent by the cloud base server, synchronizes messages within the cluster, outputs logs and persists them after synchronization is completed, extracts database operation statements in the resource persistence request, and sends them to the database server cluster.
[0115] S10, after receiving the resource persistence request, the database server cluster changes or creates a resource entry and returns the result to the Raft server cluster.
[0116] S11, after receiving the change result from the database server cluster, the Raft server cluster synchronizes the messages within the cluster, and after the synchronization is completed, the log is persisted to complete the resource change operation.
[0117] It should be noted that for the description of the above steps, reference may be made to the relevant description in the above embodiment, and the effects are similar, so this embodiment will not be repeated here.
[0118] To facilitate understanding by those skilled in the art, the request processing method provided by the present disclosure is described in detail below. Figure 8 As shown, when the resource management request sent by the client is a resource query request, the method may include:
[0119] T1, the gateway module of the cloud management server receives the resource query request sent by the client, and extracts the request body information to perform client permission verification, resource pool verification and request legitimacy verification. After successful verification, the resource change request is forwarded to the corresponding business module.
[0120] T2: The business module of the cloud management server receives the resource query request, generates a database query statement based on the request content, and sends the database query statement to the Raft server cluster.
[0121] T3, the Raft server cluster receives the database query statement sent by the business module, marks the request sequence and business module, synchronizes messages within the cluster, records and persists the operation log, and forwards the database query statement to the database server cluster after synchronization is completed.
[0122] T4: The database server cluster receives the database query statement, obtains the query result, and returns the query result to the Raft server cluster.
[0123] T5, the Raft server cluster receives the query results returned by the database server cluster, synchronizes messages within the cluster, matches the request sequence and business module corresponding to the return, and forwards it to the corresponding business module of the cloud management server.
[0124] T6, after receiving the database query results sent by the Raft server cluster, the corresponding business module of the cloud management server converts the query results into the data format type required by the client and sends it to the client.
[0125] T7: The client receives and displays the resource query results, completing the resource query.
[0126] It should be noted that for the description of the above steps, reference may be made to the relevant description in the above embodiment, and the effects are similar, so this embodiment will not be repeated here.
[0127] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0128] Based on the same inventive concept, the embodiment of the present application also provides a request processing device for implementing the request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more request processing device embodiments provided below can refer to the limitations on the request processing method above, and will not be repeated here.
[0129] In an exemplary embodiment, Fig. 9 As shown, a request processing device is provided, comprising: a receiving module 10, a generating module 11 and a processing module 12, wherein:
[0130] The receiving module 10 is used to receive a resource management request sent by a client.
[0131] The generating module 11 is used to generate a database query statement based on the request content of the resource management request.
[0132] The processing module 12 is used to process the resource management request according to the database query statement and the consistent Raft server cluster.
[0133] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0134] Based on the above embodiments, Fig.10 As shown, optionally, the processing module 12 includes: a sending unit 121, a first acquiring unit 122 and a processing unit 123, wherein:
[0135] The sending unit 121 is used to send the database query statement to the database server cluster through the Raft server cluster.
[0136] The first acquisition unit 122 is used to acquire the query result returned by the database server cluster through the Raft server cluster.
[0137] The processing unit 123 is used to process the resource management request according to the query result.
[0138] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0139] Based on the above examples, please continue to refer to Fig. 9 Optionally, if the resource management request is a resource change request, the processing unit 123 is specifically used to perform business verification on the resource change request according to the query result; if the business verification of the resource change request passes, the resource change request is sent to the Raft server cluster; the resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform atomic change operations on cloud computing resources, and send a resource persistence request of the resource change result to the Raft server cluster, and control the database server cluster to change or create resource entries through the Raft server cluster.
[0140] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0141] Based on the above examples, please continue to refer to Fig. 9 Optionally, if the resource management request is a resource query request, the processing unit 123 is specifically used to process the data format of the query result according to the data format corresponding to the client to obtain the processed query result; and send the processed query result to the client.
[0142] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0143] Based on the above embodiments, Fig.11 As shown, optionally, the above-mentioned generating module 11 includes: a second acquiring unit 111 and a generating unit 112, wherein:
[0144] The second obtaining unit 111 is used to obtain the client information according to the request content.
[0145] The generating unit 112 is used to generate a database query statement according to the request content when the information verification of the client passes.
[0146] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0147] In an exemplary embodiment, Fig.12 As shown, a request processing device is provided, including: a receiving module 20, an acquisition module 21 and a processing module 22, wherein:
[0148] The receiving module 20 is used to receive a resource change request sent by the cloud management server through the consistent Raft server cluster.
[0149] The acquisition module 21 is used to acquire the service module information to be changed from the request header of the resource change request.
[0150] The processing module 22 is used to perform an atomic change operation on the business module to be changed according to the information of the business module to be changed.
[0151] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0152] Based on the above embodiments, Fig.13 As shown, optionally, the above device further includes: a generating module 23 and a sending module 24, wherein:
[0153] The generating module 23 is used to generate a resource persistence request of the resource change result when the atomic change operation is completed on the business module to be changed.
[0154] The sending module 24 is used to send the resource change result and the resource persistence request to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0155] The request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0156] Each module in the above request processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0157] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.14As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store resource entries. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a request processing method is implemented.
[0158] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] In an exemplary embodiment, a server is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0160] Receive resource management requests sent by the client;
[0161] Generate a database query statement based on the request content of the resource management request;
[0162] Process resource management requests based on database query statements and consistent Raft server clusters.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] Send database query statements to the database server cluster through the Raft server cluster;
[0165] Get the query results returned by the database server cluster through the Raft server cluster;
[0166] Process the resource management request based on the query results.
[0167] In one embodiment, if the resource management request is a resource change request, the processor further implements the following steps when executing the computer program:
[0168] Based on the query results, perform business verification on the resource change request;
[0169] If the resource change request passes the business verification, the resource change request is sent to the Raft server cluster;
[0170] The resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform atomic change operations on cloud computing resources, and send the resource persistence request of the resource change result to the Raft server cluster, and the database server cluster is controlled by the Raft server cluster to change or create resource entries.
[0171] In one embodiment, if the resource management request is a resource query request, the processor further implements the following steps when executing the computer program:
[0172] According to the data format corresponding to the client, the data format of the query result is processed to obtain the processed query result;
[0173] Send the processed query results to the client.
[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0175] Get the client information according to the request content;
[0176] When the client information is verified, a database query statement is generated according to the request content.
[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0178] Receive resource change requests sent by the cloud management server through the consistent Raft server cluster;
[0179] Obtain the business module information to be changed from the request header of the resource change request;
[0180] According to the information of the business module to be changed, perform atomic change operations on the business module to be changed.
[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0182] When the atomic change operation is completed for the business module to be changed, a resource persistence request for the resource change result is generated;
[0183] The resource change result and resource persistence request are sent to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0184] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0185] Receive resource management requests sent by the client;
[0186] Generate a database query statement based on the request content of the resource management request;
[0187] Process resource management requests based on database query statements and consistent Raft server clusters.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] Send database query statements to the database server cluster through the Raft server cluster;
[0190] Get the query results returned by the database server cluster through the Raft server cluster;
[0191] Process the resource management request based on the query results.
[0192] In one embodiment, if the resource management request is a resource change request, the computer program further implements the following steps when executed by the processor:
[0193] Based on the query results, perform business verification on the resource change request;
[0194] If the resource change request passes the business verification, the resource change request is sent to the Raft server cluster;
[0195] The resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform atomic change operations on cloud computing resources, and send the resource persistence request of the resource change result to the Raft server cluster, and the database server cluster is controlled by the Raft server cluster to change or create resource entries.
[0196] In one embodiment, if the resource management request is a resource query request, the computer program further implements the following steps when executed by the processor:
[0197] According to the data format corresponding to the client, the data format of the query result is processed to obtain the processed query result;
[0198] Send the processed query results to the client.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0200] Get the client information according to the request content;
[0201] When the client information is verified, a database query statement is generated according to the request content.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0203] Receive resource change requests sent by the cloud management server through the consistent Raft server cluster;
[0204] Obtain the business module information to be changed from the request header of the resource change request;
[0205] According to the information of the business module to be changed, perform atomic change operations on the business module to be changed.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0207] When the atomic change operation is completed for the business module to be changed, a resource persistence request for the resource change result is generated;
[0208] The resource change result and resource persistence request are sent to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0209] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0210] Receive resource management requests sent by the client;
[0211] Generate a database query statement based on the request content of the resource management request;
[0212] Process resource management requests based on database query statements and consistent Raft server clusters.
[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0214] Send database query statements to the database server cluster through the Raft server cluster;
[0215] Get the query results returned by the database server cluster through the Raft server cluster;
[0216] Process the resource management request based on the query results.
[0217] In one embodiment, if the resource management request is a resource change request, the computer program further implements the following steps when executed by the processor:
[0218] Based on the query results, perform business verification on the resource change request;
[0219] If the resource change request passes the business verification, the resource change request is sent to the Raft server cluster;
[0220] The resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform atomic change operations on cloud computing resources, and send the resource persistence request of the resource change result to the Raft server cluster, and the database server cluster is controlled by the Raft server cluster to change or create resource entries.
[0221] In one embodiment, if the resource management request is a resource query request, the computer program further implements the following steps when executed by the processor:
[0222] According to the data format corresponding to the client, the data format of the query result is processed to obtain the processed query result;
[0223] Send the processed query results to the client.
[0224] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0225] Get the client information according to the request content;
[0226] When the client information is verified, a database query statement is generated according to the request content.
[0227] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0228] Receive resource change requests sent by the cloud management server through the consistent Raft server cluster;
[0229] Obtain the business module information to be changed from the request header of the resource change request;
[0230] According to the information of the business module to be changed, perform atomic change operations on the business module to be changed.
[0231] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0232] When the atomic change operation is completed for the business module to be changed, a resource persistence request for the resource change result is generated;
[0233] The resource change result and resource persistence request are sent to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
[0234] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0235] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0236] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A request processing method, characterized in that: The method is applied to a cloud management server, and the method includes: Receive resource management requests sent by the client; Generate a database query statement based on the request content of the resource management request; The resource management request is processed according to the database query statement and the consistent Raft server cluster.
2. The method according to claim 1, characterized in that The processing of the resource management request according to the database query statement and the consistent Raft server cluster includes: Sending the database query statement to a database server cluster through the Raft server cluster; Obtaining the query result returned by the database server cluster through the Raft server cluster; The resource management request is processed according to the query result.
3. The method according to claim 2, characterized in that If the resource management request is a resource change request, processing the resource management request according to the query result includes: Performing a business check on the resource change request according to the query result; If the resource change request service verification passes, sending the resource change request to the Raft server cluster; The resource change request is sent to the cloud base server through the Raft server cluster; the resource change request is used to instruct the cloud base server to perform an atomic change operation on the cloud computing resources, and send a resource persistence request of the resource change result to the Raft server cluster, and the database server cluster is controlled by the Raft server cluster to change or create resource entries.
4. The method according to claim 2, characterized in that: If the resource management request is a resource query request, processing the resource management request according to the query result includes: Processing the data format of the query result according to the data format corresponding to the client to obtain a processed query result; The processed query result is sent to the client.
5. The method according to any one of claims 1 to 4, characterized in that: The step of generating a database query statement based on the request content of the resource management request includes: According to the request content, obtaining the information of the client; When the information of the client is verified, the database query statement is generated according to the request content.
6. A request processing method, characterized in that: The method is applied to a cloud base server, and the method comprises: Receive resource change requests sent by the cloud management server through the consistent Raft server cluster; Acquire the business module information to be changed from the request header of the resource change request; According to the information of the business module to be changed, an atomic change operation is performed on the business module to be changed.
7. The method according to claim 6, characterized in that The method further comprises: When the atomic change operation is completed on the business module to be changed, a resource persistence request for the resource change result is generated; The resource change result and the resource persistence request are sent to the Raft server cluster; the resource persistence request is used to instruct the Raft server cluster to control the database server cluster to change or create resource entries.
8. A server, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 or claims 6 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method of any one of claims 1 to 5 or claims 6 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method of any one of claims 1 to 5 or claims 6 to 7 are implemented.