Data processing methods, devices, equipment, and media based on cloud computing platforms
By introducing Tengine's VTS module into the cloud computing platform and utilizing shared memory and the Prometheus database, the problems of latency and complexity in Nginx access log collection response code monitoring data were solved, achieving timeliness and convenience in monitoring the response codes of load balancing network elements.
Patent Information
- Application Number
- CN202411770673.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In existing technologies, collecting response code monitoring data through Nginx access logs suffers from high latency, unfriendly data formats, and slow reading speeds, making it difficult to meet the needs for real-time and efficient response code monitoring.
By introducing the VTS module of Tengine, response code data is accumulated in shared memory, and monitoring data is divided at the level of load balancer instances and listeners. Combined with the Prometheus database for real-time reporting, the response code rate can be calculated and displayed.
It improves the real-time performance and convenience of response code monitoring, provides a more detailed understanding of server performance, and supports in-depth analysis and optimization.
Smart Images

Figure CN119814625B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to data processing methods, apparatus, equipment and media based on cloud computing platforms. Background Technology
[0002] When tenants use load balancing products from cloud computing vendors, the load balancer returns different HTTP response codes based on request processing. Response codes can be obtained by utilizing the access logs of Nginx (a high-performance open-source web server and reverse proxy server). By adding the `$status` field to the `log_format` property of the `access_log` property in the Nginx configuration file, the access log records the response code returned by the load balancer to the front-end device whenever a request accesses the load balancer, thus obtaining the rate of each response code. However, collecting response code monitoring data through Nginx access logs has many limitations and is difficult to meet the requirements. Summary of the Invention
[0003] In view of the above problems, a data processing method, apparatus, device, and medium based on a cloud computing platform are proposed to overcome or at least partially solve the above problems, including:
[0004] A data processing method based on a cloud computing platform, wherein the cloud computing platform deploys a server cluster and a load balancing cluster, the cloud computing platform provides virtual hosts to tenants through the server cluster and provides load balancing network elements through the load balancing cluster, comprising:
[0005] Receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform;
[0006] Obtain the current response code of the load balancing network element in response to the access request, and update the cumulative response code value corresponding to the current response code in the shared memory based on the current response code;
[0007] The cumulative response code value is collected from the shared memory at intervals, and the response code rate is determined based on the cumulative response code value collected from the shared memory in two consecutive intervals and the interval.
[0008] The response code rate is reported to the database for display on the tenant monitoring platform.
[0009] Optionally, before receiving the access request for a tenant's virtual host in the cloud computing platform, the method further includes:
[0010] Add a response code accumulation value field for the target response code to the pre-defined structure;
[0011] The step of updating the cumulative response code value corresponding to the current response code in shared memory based on the current response code includes:
[0012] When the current response code is detected to be the target response code, the cumulative response code value recorded in the cumulative response code field for the target response code is incremented.
[0013] Optionally, the step of collecting the accumulated response code value from the shared memory at intervals includes:
[0014] Obtain the target listener identifier and / or target load balancing network element identifier to be collected; where each load balancing network element corresponds to multiple listeners, and different listeners listen to different types of access requests;
[0015] Based on the target listener identifier and / or the target load balancing network element identifier, the cumulative response code value is collected from the shared memory at intervals; wherein, the shared memory records the cumulative response code value according to the dimension of the listener in the load balancing network element.
[0016] Optionally, determining the response code rate based on the cumulative value of two consecutive response codes retrieved from the shared memory and the interval duration includes:
[0017] The difference is determined based on the cumulative value of the response codes obtained from the shared memory in two consecutive transactions.
[0018] The response code rate is determined based on the difference and the interval duration.
[0019] Optionally, determining the response code rate based on the difference and the interval duration includes:
[0020] In the presence of multiple load balancing network elements, the differences between the multiple load balancing network elements are summed to obtain the sum of differences, and the response code rate is determined using the sum of differences and the interval duration.
[0021] Optionally, obtaining the current response code of the load balancing network element for the access request includes:
[0022] Obtain monitoring data from the load balancing network element in response to the access request;
[0023] The monitoring data is parsed into a specified format, and the current response code of the load balancing network element to the access request is obtained through the monitoring data in the specified format.
[0024] Optionally, the load balancing network element is a Layer 7 load balancing network element.
[0025] A data processing device based on a cloud computing platform, wherein the cloud computing platform deploys a server cluster and a load balancing cluster, the cloud computing platform provides virtual hosts to tenants through the server cluster and provides load balancing network elements through the load balancing cluster, comprising:
[0026] The access request processing module is used to receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform.
[0027] The response code accumulation value update module is used to obtain the current response code of the load balancing network element in response to the access request, and update the response code accumulation value corresponding to the current response code in the shared memory according to the current response code.
[0028] The response code rate determination module is used to collect the cumulative response code value from the shared memory at intervals, and determine the response code rate based on the cumulative response code value obtained from the shared memory in two consecutive intervals and the interval.
[0029] The response code rate display module is used to report the response code rate to the database for display on the tenant monitoring platform.
[0030] An electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.
[0031] A computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the method described above.
[0032] The embodiments of the present invention have the following advantages:
[0033] In this embodiment of the invention, by receiving access requests for virtual hosts of tenants in a cloud computing platform and processing the access requests through load balancing network elements in the cloud computing platform; obtaining the current response code of the load balancing network element in response to the access request, and updating the cumulative response code value corresponding to the current response code in shared memory according to the current response code; collecting the cumulative response code value from shared memory at intervals, and determining the response code rate based on the cumulative response code value obtained from shared memory twice consecutively and the interval; and reporting the response code rate to the database for display on the tenant monitoring platform, the invention achieves optimized processing of response code monitoring data of load balancing network elements in the cloud computing platform, improving the timeliness and convenience of response code monitoring data processing of load balancing network elements. Attached Figure Description
[0034] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of a monitoring indicator collection process provided in some embodiments of the present invention;
[0036] Figure 2 This is an architecture diagram of a seven-layer load balancing network provided in some embodiments of the present invention;
[0037] Figure 3 This is a flowchart of another data processing method based on a cloud computing platform provided in some embodiments of the present invention;
[0038] Figure 4 This is a structural block diagram of a data processing device based on a cloud computing platform provided in some embodiments of the present invention. Detailed Implementation
[0039] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0040] With the rapid development of cloud computing technology, load balancing, as a core component of cloud architecture, plays a crucial role in ensuring the stability, reliability, and performance of cloud services. Located at the front end of the cloud architecture, it is responsible for intelligently distributing traffic, requests, and workloads to multiple backend servers to maintain server load balance and prevent any single server from failing due to overload. This mechanism is essential for ensuring the efficient operation of cloud services.
[0041] Meanwhile, with the widespread adoption of cloud computing services, tenant monitoring has become an indispensable service provided by cloud computing vendors. Through tenant monitoring, vendors can monitor the real-time operational status of tenant cloud services, ensuring service availability, optimizing resource utilization, reducing costs, and promptly identifying and addressing faults that may affect tenant applications, thereby improving troubleshooting efficiency. This is crucial for enhancing tenant satisfaction and strengthening the competitiveness of cloud computing vendors.
[0042] When tenants use layer 7 load balancing products from cloud computing vendors, the load balancer returns different HTTP response codes based on request processing. These response codes not only reflect the request processing result but also contain fault information. For example, a 404 Not Found response code indicates that the resource requested by the client does not exist on the server, which may mean that there are some problems with the tenant's service; a 429 Too Many Requests response code indicates that the client sent too many requests, which may be due to a malicious attack; a 499 Client Closed Request response code indicates that the client interrupted the connection before the server returned a response, which may be due to client-side timeout caused by network fluctuations; and a 502 Bad Gateway response code indicates that the load balancer could not obtain a valid response from the backend server, which may be due to backend server failure or incorrect configuration of the load balancer instance.
[0043] In related technologies, Nginx's access logs are used to obtain response code monitoring data. Nginx, as the main carrier of the Layer 7 load balancing service, customizes the `log_format` property of `access_log` in its configuration file, adding a `$status` field to record the response codes returned by the load balancer to the front-end devices. However, this method has the following problems:
[0044] 1. Data latency: Nginx access logs are written to disk asynchronously. Therefore, under high traffic conditions, the monitoring data obtained may have a large latency and cannot reflect the real-time operation status of cloud services.
[0045] 2. The data format is not user-friendly. Access logs are stored in plain text format. Parsing specific response codes requires complex parsing strategies such as regular expressions, which not only consumes a lot of CPU resources, but also increases the complexity and cost of data processing.
[0046] 3. Slow read speed: Since access logs are stored on disk, they need to be read by calling the file system API. As the log file grows (typically one access log is about 1GB), frequent disk file reads not only increase the memory burden but also reduce the data read speed, affecting the real-time performance and accuracy of monitoring.
[0047] To address the aforementioned issues, Tengine (a high-performance HTTP and reverse proxy server based on Nginx), as a high-performance enhancement of Nginx, proposes, in this embodiment of the invention, to introduce the ngx_http_vhost_traffic_status (Vhost Traffic Status / VTS) module from Tengine. This module is specifically designed to collect and statistically analyze real-time traffic data of virtual hosts. The VTS module can accumulate and update virtual host traffic statistics in real time, including but not limited to key indicators such as request count, processing time, and bandwidth consumption. This provides administrators with a comprehensive view of server load, facilitating targeted resource optimization and performance tuning.
[0048] However, the original VTS module has relatively limited support for response code statistics, primarily focusing on common success and error response codes such as 200 (success) and 500 (internal server error). It doesn't provide direct statistical support for response codes specific to certain scenarios, such as 404 (not found), 429 (too many requests), 499 (client closed connection), and 502 (bad gateway). These response codes often reflect specific situations such as problems with client requests, server overload, or upstream service failures, and are crucial for in-depth analysis of service performance and user experience.
[0049] Therefore, this invention innovatively extends the Tengine VTS module by adding response code fields such as 404, 429, 499, and 502 for each virtual traffic node. By modifying the statistical process, it ensures that these newly added fields can accurately and in real-time capture the corresponding response code data. This improvement not only enriches the dimensions of the monitoring data but also allows administrators to gain a more detailed understanding of the server's performance under different conditions, providing data support for further optimization.
[0050] Furthermore, compared to access log monitoring methods in related technologies, the VTS module in this embodiment of the invention employs a shared memory storage mechanism, which significantly improves data reading speed. In the Nginx Master (MasterProcess) process, an independent memory area is allocated to the listener of each load balancing instance for accumulating monitoring data. When a Worker process handles an HTTP request, it directly updates the corresponding shared memory area based on the response code and other information, avoiding the overhead of log writing. Simultaneously, the VTS module supports parsing monitoring data into multiple formats such as JSON and Prometheus, which not only facilitates subsequent data processing and analysis but also reduces resource consumption during data conversion, making the entire monitoring and data collection process more efficient and flexible.
[0051] In specific implementations, embodiments of the present invention may include the following:
[0052] 1. Combined with Tengine's VTS module, which is developed based on Nginx, relevant configuration items have been added, and it has intervened in the log processing stage of Nginx's request handling module (using Nginx as the load balancer, configuring load balancing service on this type of server, and introducing Tengine's VTS module into Nginx for use).
[0053] 2. Add the fields stat_404_counter, stat_429_counter, stat_499_counter, and stat_502_counter to the ngx_http_vhost_traffic_status_node_t structure in the VTS module. These fields are used to record the cumulative number of response codes obtained by the current listener (i.e., the number of times the response code appears within a preset time period). This structure stores traffic statistics information for virtual hosts and upstream servers.
[0054] 3. Whenever Nginx processes an HTTP request, it updates the statistics in this structure during the log module processing phase. This is done by checking the load balancer's response code in the `ngx_http_vhost_traffic_status_node_update` function. If the response code matches the above criteria, the accumulated value in the corresponding shared memory of the listener is updated. Specifically, the cloud computing platform establishes virtual hosts (backend servers) for tenants through a server cluster; the client sends an HTTP request to access the tenant's virtual host; the HTTP request is first sent to Nginx for load balancing processing, and then the target virtual host is determined; after the request is processed, the listener monitors the response code corresponding to the request and updates the accumulated response code value recorded in VTS based on the response code.
[0055] 4. To differentiate between monitoring data at the load balancer instance level and the listener level, this embodiment of the invention adds a configuration item to filter statistical information by service ID. This service ID contains the load balancer instance ID and the listener ID (wherein, a load balancer instance can include multiple listeners, and different listeners are used to listen for different types of requests). After configuring the VTS module, each call to the interface provided by this module can obtain the cumulative response code value of the listener where each load balancer instance resides in real time.
[0056] 5. The Agent is responsible for filtering and assembling the statistical information to obtain the necessary monitoring information. Then, the Monitor process calls the data at minute intervals to collect the response code rate of the Layer 7 load balancing network elements. The overall process is as follows: Figure 1 As shown, the data is ultimately reported to the Prometheus database. Here, "Agent" refers to the application responsible for managing and querying load balancers, such as distributing nginx configuration information and calling nginx-related interfaces to query information. Prometheus is an open-source system monitoring and alerting toolkit that employs a flexible data model, enabling data to be labeled and queried across multiple dimensions. It can store monitoring data as time-series data and offers flexible query languages.
[0057] 6. The overall architecture and traffic path of the Layer 7 load balancing service are as follows: Figure 2 As shown, to ensure high availability of the load balancing service, multiple load balancing network elements can be deployed in a cluster to handle request processing and distribution simultaneously. Collecting tenant monitoring data from only a single load balancer would be inaccurate; therefore, it is necessary to collect monitoring data from each Layer 7 load balancing network element, calculate the rate, and then display it to the tenant monitoring platform. The calculation formula is shown below:
[0058]
[0059] Here, 'n' represents the number of Layer 7 load balancing network elements in the cluster; 't' represents the interval for collecting monitoring data, such as 60 seconds; 'rc' represents the cumulative value of monitoring response codes collected in real time; and 'rcl' represents the cumulative value of response codes collected last time through shared memory. Finally, the rate of a certain load balancing response code within one minute can be calculated. Specifically, the Agent can obtain recorded data from the VTS; the Monitor calls the data obtained by the Agent at minute intervals, calculates the response code rate of the Layer 7 load balancing network elements, and transmits the calculated response code rate to the Prometheus database; when users need monitoring data, they can retrieve data from the Prometheus database and display it on the tenant monitoring platform.
[0060] The embodiments of the present invention have the following advantages:
[0061] 1. In view of the shortcomings of log collection methods in related technologies, such as high latency, complex data processing and slow reading speed, in this embodiment of the invention, the VTS module is further developed to make full use of the flexibility of the nginx module and store the load balancing response code related data in shared memory, thereby solving the shortcomings of the log collection method.
[0062] 2. In this embodiment of the invention, a scheme for reporting response code data in shared memory is proposed. The Agent and Monitor are modified so that the monitoring data can be divided at the dimensions of load balancing instance and listener instance, and the final response code rate to be counted is generated.
[0063] The present invention will be further described below with reference to the accompanying drawings:
[0064] Reference Figure 3 The diagram illustrates a flowchart of a data processing method based on a cloud computing platform according to some embodiments of the present invention. The cloud computing platform deploys a server cluster and a load balancing cluster. The cloud computing platform provides virtual hosts to tenants through the server cluster and load balancing network elements through the load balancing cluster.
[0065] Among them, a cloud computing platform can provide an environment that allows computing power, storage space, and information services to be provided to users (tenants) on demand.
[0066] A server cluster refers to a system composed of multiple servers connected via a network, working together to provide higher computing power and reliability. In cloud computing platforms, server clusters can be used to provide virtual hosting for tenants. A virtual host is a logical server created on a physical server using virtualization technology; each virtual host can independently run its own operating system and applications.
[0067] A load balancing cluster is a technology that improves system throughput and reliability by distributing network or application service access requests across multiple servers or network nodes. In cloud computing platforms, load balancing clusters can provide load balancing network elements.
[0068] A load balancing network element can be a load balancer, which is a key component in a load balancing cluster. It is responsible for receiving requests from clients and distributing these requests to different servers in the cluster according to certain strategies (such as round-robin, least connections, etc.) to avoid overloading a single server and improve the overall performance and stability of the system.
[0069] In practical applications, cloud computing platforms can provide virtual hosting to tenants through server clusters, enabling tenants to obtain one or more virtual servers to run their applications or websites. Through load balancing network elements provided by load balancing clusters, cloud computing platforms distribute tenant requests to different servers in the server cluster according to certain strategies, so as to avoid overloading of individual servers and improve the overall performance and stability of the system.
[0070] Specifically, it may include the following steps:
[0071] Step 301: Receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform.
[0072] As examples, a tenant in a cloud computing platform refers to an organization or individual that uses cloud services and can choose different cloud services based on their needs, such as computing resources, storage space, network bandwidth, etc.
[0073] In some examples, the cloud computing platform receives the access request when a tenant's client (such as a browser, application, etc.) attempts to access its own virtual host deployed on the cloud computing platform.
[0074] When a cloud computing platform receives an access request, it can pass the request to a load balancing element for processing. The load balancing element is responsible for allocating and managing access requests to virtual hosts, determining which server or virtual machine to send the request to.
[0075] In some embodiments of the present invention, before receiving the access request for a virtual host of a tenant in the cloud computing platform, the method further includes: adding a response code accumulation value field for the target response code to a preset structure.
[0076] As examples, a new field can be added to an already defined structure (data structure). This new field records the number of occurrences of a specific target response code, i.e., the cumulative response code value. The target response code can be predetermined and represents a specific state or result, such as success, error, or timeout.
[0077] For example, you can add the fields stat_404_counter, stat_429_counter, stat_499_counter, and stat_502_counter to the ngx_http_vhost_traffic_status_node_t structure in the VTS module. These fields are used to record the cumulative number of response codes that the listener has obtained (i.e., the number of times the response code appears within a preset time period). This structure stores traffic statistics information for virtual hosts and upstream servers.
[0078] In some embodiments of the present invention, the load balancing network element is a Layer 7 load balancing network element.
[0079] Among them, the load balancing network element is a Layer 7 load balancing network element, which refers to the load balancing device or component that works at the application layer (layer 7) of the OSI (Open Systems Interconnection) network model in load balancing technology.
[0080] Layer 7 load balancing elements reside at the highest layer of the OSI model, the application layer. They analyze and process network traffic, distributing requests to different servers to achieve load balancing. For example, a Layer 7 load balancing element can determine how to distribute requests based on the request content (such as URL path, request parameters, etc.), ensuring that requests are distributed to the most suitable server, thus improving system performance and reliability. This load balancing method can intelligently distribute traffic based on application layer protocols (such as HTTP, HTTPS, SMTP, etc.), thereby improving server performance and reliability.
[0081] Step 302: Obtain the current response code of the load balancing network element in response to the access request, and update the cumulative response code value corresponding to the current response code in the shared memory according to the current response code.
[0082] In some examples, the current response code refers to the response code returned by the server for the current access request. Specifically, after the load balancing element distributes the access request to the backend servers in the server cluster, the server returns a response code to the load balancing element to indicate the processing result of the access request. This response code can be an HTTP status code, such as 200, 404, or 500.
[0083] Shared memory refers to a shared storage area that allows multiple processes or threads to access it. Through shared memory, different processes or threads can share data, thereby achieving fast data transfer and synchronization.
[0084] As examples, listeners can be pre-configured. A load balancer instance can include multiple listeners, with different listeners used to listen for different types of requests. Whenever a load balancer element receives a response code, it can increment the corresponding listener by 1 to record the number of times the response code has appeared.
[0085] As an example, updating the cumulative response code value corresponding to the current response code in shared memory means that when the load balancing element receives the current response code returned by the backend server, it can look up the listener corresponding to that response code. Then, it increments the listener's value by 1 to indicate that the response code has appeared again, thereby updating the cumulative response code value corresponding to the current response code.
[0086] In some embodiments of the present invention, obtaining the current response code of the load balancing network element in response to the access request includes: obtaining monitoring data of the load balancing network element in response to the access request; parsing the monitoring data into a specified format, and obtaining the current response code of the load balancing network element in response to the access request through the monitoring data in the specified format.
[0087] Monitoring data refers to data collected in real-time or periodically by the load balancing network element regarding the processing of access requests. For example, monitoring data of the load balancing network element regarding the access requests can be obtained through the log module.
[0088] As examples, a specified format refers to a monitoring data format defined to meet specific needs or standards. A specified format can include the name, type, and order of data fields.
[0089] After acquiring monitoring data, the monitoring data can be parsed into a specified format, and the current response code of the load balancing network element for the access request can be obtained based on the monitoring data in the specified format; for example, a specific data field can be found in the monitoring data in the specified format and returned as the current response code.
[0090] In some embodiments of the present invention, updating the response code accumulation value corresponding to the current response code in shared memory according to the current response code includes: when the current response code is detected to be the target response code, increasing the response code accumulation value recorded in the response code accumulation value field for the target response code.
[0091] In some examples, after obtaining the current response code, the field of the current response code can be matched with the field of the target response code added in the pre-defined structure. If the current response code matches the target response code, the cumulative response code value recorded in the cumulative response code value field for the target response code is increased (that is, the cumulative count of the current response code is increased by 1).
[0092] Step 303: Collect the cumulative response code value from the shared memory according to the interval, and determine the response code rate based on the cumulative response code value obtained from the shared memory in two consecutive steps and the interval.
[0093] The phrase "collecting accumulated response codes from shared memory at intervals" refers to collecting accumulated response codes at certain time intervals. These intervals can be fixed (e.g., per second, per minute) or variable (dynamically adjusted based on system load, user needs, etc.).
[0094] "Two consecutive times" refers to the process of collecting the cumulative response code value from shared memory twice consecutively at the aforementioned interval. Based on the cumulative response code values collected in two consecutive times and the interval between them, the average rate of occurrence of a specific response code per unit time is calculated.
[0095] For example, the formula for calculating the response code rate is as follows:
[0096]
[0097] Here, 'n' represents the number of Layer 7 load balancing network elements in the cluster; 't' represents the interval for collecting monitoring data, such as 60 seconds; 'rc' represents the cumulative value of monitoring response codes collected in real time; and 'rcl' represents the cumulative value of response codes collected last time through shared memory. Finally, the rate of a certain load balancing response code within one minute can be calculated. Specifically, the Agent can obtain recorded data from the VTS; the Monitor calls the data obtained by the Agent at minute intervals, calculates the response code rate of the Layer 7 load balancing network elements, and transmits the calculated response code rate to the Prometheus database; when users need monitoring data, they can retrieve data from the Prometheus database and display it on the tenant monitoring platform.
[0098] In some embodiments of the present invention, determining the response code rate based on the cumulative value of response codes obtained from the shared memory in two consecutive steps and the interval duration includes: determining a difference based on the cumulative value of response codes obtained from the shared memory in two consecutive steps; and determining the response code rate based on the difference and the interval duration.
[0099] The cumulative response code value acquired in two consecutive acquisitions represents the cumulative response codes read from the shared memory by the same listener (or load balancing element) at two consecutive time points (or acquisition cycles). By calculating the difference between the cumulative response code values at these two time points, the change in the number of response codes processed by the listener (or load balancing element) between two consecutive acquisitions can be obtained. This difference reflects the increase or decrease in the number of response codes within a given time interval.
[0100] As in the formula above (rc) i -rcl i ), rc represents the cumulative value of the monitoring response codes collected in real time, rcl represents the cumulative value of the response codes collected last time through shared memory, and t represents the interval between collection of monitoring data.
[0101] In some embodiments of the present invention, determining the response code rate based on the difference and the interval duration includes: when there are multiple load balancing network elements, summing the differences between the multiple load balancing network elements to obtain a sum of differences, and using the sum of differences and the interval duration to determine the response code rate.
[0102] As examples, a cloud computing platform may have one or more load balancing elements running, each responsible for handling a portion of network traffic and distributing requests to backend servers. The difference between the cumulative values of two consecutive response codes retrieved from shared memory can be calculated for each load balancing element.
[0103] Then, the differences of all load balancing elements are summed to obtain a total difference, i.e., the sum of differences. This sum of differences represents the total change in the number of response codes jointly processed by all load balancing elements within a given time interval.
[0104] In some examples, the overall response code rate is obtained by dividing the calculated difference by the interval duration. This rate represents the number of response codes processed by all load balancing network elements per unit time.
[0105] In some embodiments of the present invention, the step of collecting accumulated response code values from the shared memory at intervals includes: obtaining the target listener identifier and / or the target load balancing network element identifier to be collected; wherein, each load balancing network element corresponds to multiple listeners, and different listeners listen to different types of access requests; collecting accumulated response code values from the shared memory at intervals based on the target listener identifier and / or the target load balancing network element identifier; wherein, the shared memory records the accumulated response code values according to the dimension of the listeners in the load balancing network element.
[0106] The target listener identifier refers to the unique identifier of a specific listener that collects the accumulated response code value. The target load balancing element identifier refers to the unique identifier of a load balancing device that contains multiple listeners.
[0107] Recording the cumulative response code value by the listener dimension in the load balancing element means that, in shared memory, the cumulative response code value is recorded according to the dimension of each listener in the load balancing element. That is, for each listener, there is a corresponding cumulative response code value record.
[0108] In practical applications, the accumulated response codes of the corresponding listeners can be read from shared memory based on the obtained target listener identifier and / or target load balancing network element identifier, as well as the set interval.
[0109] As examples, you can add configuration items to the VTS module to filter statistics by service ID, which can include the load balancer instance ID and the listener ID. After configuring the VTS module, you can obtain the cumulative response code value of the listener where each load balancer instance is located in real time every time you call the interface provided by the module.
[0110] The Agent is responsible for filtering and assembling the statistical information to obtain the monitoring information needed. Then, the Monitor process calls the data at minute intervals to collect the response code rate of the Layer 7 load balancing network element.
[0111] Step 304: The response code rate is reported to the database for display on the tenant monitoring platform.
[0112] In practical applications, the calculated response code rate data can be sent to a database for storage. A database is a centralized data storage system capable of efficiently storing, retrieving, and managing large amounts of data.
[0113] The tenant monitoring platform refers to a monitoring and visualization platform for tenants (i.e., customers or users of the load balancing service). It provides a graphical interface that allows tenants to intuitively understand the performance and status of the load balancing service they are using.
[0114] As examples, once response code rate data is stored in a database, the tenant monitoring platform can retrieve this data and display it through charts, dashboards, and other formats. This allows tenants to understand the response code rate of their load balancing service in real time, as well as potential performance bottlenecks or issues.
[0115] In this embodiment of the invention, by receiving access requests for virtual hosts of tenants in a cloud computing platform and processing the access requests through load balancing network elements in the cloud computing platform; obtaining the current response code of the load balancing network element in response to the access request, and updating the cumulative response code value corresponding to the current response code in shared memory according to the current response code; collecting the cumulative response code value from shared memory at intervals, and determining the response code rate based on the cumulative response code value obtained from shared memory twice consecutively and the interval; and reporting the response code rate to the database for display on the tenant monitoring platform, the invention achieves optimized processing of response code monitoring data of load balancing network elements in the cloud computing platform, improving the timeliness and convenience of response code monitoring data processing of load balancing network elements.
[0116] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0117] Reference Figure 4 The diagram illustrates a data processing device based on a cloud computing platform according to some embodiments of the present invention. The cloud computing platform deploys a server cluster and a load balancing cluster. The cloud computing platform provides virtual hosts to tenants through the server cluster and provides load balancing network elements through the load balancing cluster.
[0118] Specifically, it can include the following modules:
[0119] The access request processing module 401 is used to receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform.
[0120] The response code accumulation value update module 402 is used to obtain the current response code of the load balancing network element in response to the access request, and update the response code accumulation value corresponding to the current response code in the shared memory according to the current response code.
[0121] The response code rate determination module 403 is used to collect the cumulative response code value from the shared memory at intervals, and determine the response code rate based on the cumulative response code value obtained from the shared memory in two consecutive intervals and the interval.
[0122] The response code rate display module 404 is used to report the response code rate to the database for display on the tenant monitoring platform.
[0123] In some embodiments of the present invention, the apparatus further includes:
[0124] The field addition module is used to add a response code accumulation value field for the target response code to a pre-defined structure;
[0125] The response code cumulative value update module 402 includes:
[0126] The response code accumulation value increment submodule is used to increment the response code accumulation value recorded in the response code accumulation value field for the target response code when the current response code is detected to be the target response code.
[0127] In some embodiments of the present invention, the response code rate determination module 403 includes:
[0128] The identifier acquisition submodule is used to acquire the identifier of the target listener and / or the identifier of the target load balancing network element to be collected; wherein, each load balancing network element corresponds to multiple listeners, and different listeners listen to different types of access requests;
[0129] The response code accumulation value acquisition submodule is used to acquire the response code accumulation value from the shared memory according to the target listener identifier and / or the target load balancing network element identifier at intervals; wherein, the shared memory records the response code accumulation value according to the dimension of the listener in the load balancing network element.
[0130] In some embodiments of the present invention, the response code rate determination module 403 includes:
[0131] The difference determination submodule is used to determine the difference based on the cumulative value of the response codes obtained from the shared memory in two consecutive transactions.
[0132] The response code rate determination submodule is used to determine the response code rate based on the difference and the interval duration.
[0133] In some embodiments of the present invention, the response code rate determination submodule includes:
[0134] The summation unit is used to sum the differences between multiple load balancing network elements when multiple load balancing network elements exist, obtain the sum of differences, and use the sum of differences and the interval duration to determine the response code rate.
[0135] In some embodiments of the present invention, the response code cumulative value update module 402 includes:
[0136] The monitoring data acquisition submodule is used to acquire the monitoring data of the load balancing network element in response to the access request;
[0137] The monitoring data parsing submodule is used to parse the monitoring data into a specified format and obtain the current response code of the load balancing network element in response to the access request through the monitoring data in the specified format.
[0138] In some embodiments of the present invention, the load balancing network element is a Layer 7 load balancing network element.
[0139] In this embodiment of the invention, by receiving access requests for virtual hosts of tenants in a cloud computing platform and processing the access requests through load balancing network elements in the cloud computing platform; obtaining the current response code of the load balancing network element in response to the access request, and updating the cumulative response code value corresponding to the current response code in shared memory according to the current response code; collecting the cumulative response code value from shared memory at intervals, and determining the response code rate based on the cumulative response code value obtained from shared memory twice consecutively and the interval; and reporting the response code rate to the database for display on the tenant monitoring platform, the invention achieves optimized processing of response code monitoring data of load balancing network elements in the cloud computing platform, improving the timeliness and convenience of response code monitoring data processing of load balancing network elements.
[0140] Some embodiments of the present invention also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.
[0141] Some embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, and which, when executed by a processor, implements the method described above.
[0142] Some embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0143] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0145] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0146] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0148] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0150] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0151] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the aforementioned element.
[0152] The above provides a detailed description of the data processing method, apparatus, equipment, and medium based on the cloud computing platform. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data processing method based on a cloud computing platform, characterized in that, The cloud computing platform deploys server clusters and load balancing clusters. The cloud computing platform provides virtual hosts to tenants through the server clusters and load balancing network elements through the load balancing clusters, including: Receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform; Obtain the current response code of the load balancing network element in response to the access request, and update the cumulative response code value corresponding to the current response code in the shared memory based on the current response code; The cumulative response code value is collected from the shared memory at intervals, and the response code rate is determined based on the cumulative response code value collected from the shared memory in two consecutive intervals and the interval. The response code rate is reported to the database for display on the tenant monitoring platform; The method further includes, before receiving the access request for a tenant's virtual host in the cloud computing platform: Add a response code accumulation value field for the target response code to the pre-defined structure; The step of updating the cumulative response code value corresponding to the current response code in shared memory based on the current response code includes: When the current response code is detected to be the target response code, the cumulative response code value recorded in the cumulative response code value field for the target response code is incremented.
2. The method according to claim 1, characterized in that, The step of collecting accumulated response code values from the shared memory at intervals includes: Obtain the target listener identifier and / or target load balancing network element identifier to be collected; where each load balancing network element corresponds to multiple listeners, and different listeners listen to different types of access requests; Based on the target listener identifier and / or the target load balancing network element identifier, the cumulative response code value is collected from the shared memory at intervals; wherein, the shared memory records the cumulative response code value according to the dimension of the listener in the load balancing network element.
3. The method according to any one of claims 1 to 2, characterized in that, The step of determining the response code rate based on the cumulative value of two consecutive response codes retrieved from the shared memory and the interval duration includes: The difference is determined based on the cumulative value of the response codes obtained from the shared memory in two consecutive transactions. The response code rate is determined based on the difference and the interval duration.
4. The method according to claim 3, characterized in that, The step of determining the response code rate based on the difference and the interval duration includes: In the presence of multiple load balancing network elements, the differences between the multiple load balancing network elements are summed to obtain the sum of differences, and the response code rate is determined using the sum of differences and the interval duration.
5. The method according to any one of claims 1 to 2, characterized in that, Obtaining the current response code of the load balancing network element for the access request includes: Obtain monitoring data from the load balancing network element in response to the access request; The monitoring data is parsed into a specified format, and the current response code of the load balancing network element to the access request is obtained through the monitoring data in the specified format.
6. The method according to claim 1, characterized in that, The load balancing network element is a Layer 7 load balancing network element.
7. A data processing device based on a cloud computing platform, characterized in that, The cloud computing platform deploys server clusters and load balancing clusters. The cloud computing platform provides virtual hosts to tenants through the server clusters and load balancing network elements through the load balancing clusters, including: The access request processing module is used to receive access requests for virtual hosts of tenants in the cloud computing platform, and process the access requests through the load balancing network element in the cloud computing platform. The response code accumulation value update module is used to obtain the current response code of the load balancing network element in response to the access request, and update the response code accumulation value corresponding to the current response code in the shared memory according to the current response code. The response code rate determination module is used to collect the cumulative response code value from the shared memory at intervals, and determine the response code rate based on the cumulative response code value obtained from the shared memory in two consecutive intervals and the interval. The response code rate display module is used to report the response code rate to the database for display on the tenant monitoring platform; The field addition module is used to add a response code accumulation value field for the target response code to a pre-defined structure; The response code cumulative value update module includes: The response code accumulation value increment submodule is used to increment the response code accumulation value recorded in the response code accumulation value field for the target response code when the current response code is detected to be the target response code.
8. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Cloud big data acquisition crawler system
CN118349719A
System for Communicating Between Two Electrical Devices and Method Therefore
US20120054400A1