Service dynamic capacity expansion method and device, equipment and storage medium

By obtaining access and call data in the server, combining conversion rate and historical data analysis, dynamically expanding back-end service resources is solved, and the problems of low resource utilization and high operating costs are achieved, and higher resource utilization and better cost-effectiveness are achieved.

CN120499009AActive Publication Date: 2025-08-15SHENZHEN YLINK COMPUTING SYST

Patent Information

Application Number
CN202510955824.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-08-15
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

The prior art has problems of low resource utilization and high operating costs in server deployment, especially during peak traffic periods, which makes it difficult to dynamically adapt to traffic fluctuations, resulting in slow service response or crash.

Method used

By obtaining the access data and call data within the preset time period, calculating the average access volume and current conversion rate, judging the service load value, combining historical data analysis to meet the expansion conditions, dynamically expand the back-end service resources.

Benefits of technology

It achieves the goal of ensuring smooth business operation while avoiding idle and waste of hardware resources, improving resource utilization and reducing operating costs, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499009A_ABST
    Figure CN120499009A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of server deployment and capacity expansion, in particular to a service dynamic capacity expansion method and device, equipment and a storage medium. Comprising the following steps: acquiring page view data of a plurality of target pages and call volume data of services in a preset time period, and calculating an average page view of each back-end service in the preset time period based on the call volume data; according to the page view data and the call volume data, calculating a current conversion rate from each target page to the corresponding back-end service, and calculating a current service load value of the corresponding back-end service after routing conversion; judging whether the current service load value is greater than a preset threshold, and if so, calling a historical data set corresponding to a preset time period in a historical database; and based on the historical data set, the comprehensive average access amount and the current conversion rate, judging whether a capacity expansion triggering condition is met, and if yes, triggering dynamic capacity expansion of the corresponding back-end service. The resource utilization rate and the better cost effectiveness can be improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of server deployment and expansion, and in particular to a method, apparatus, device, and storage medium for dynamic service expansion. Background Art

[0002] Under current traditional server deployment architectures, enterprises operating websites or applications often face the dual challenges of low resource utilization and high operating costs. To cope with sudden traffic spikes, enterprises often over-provision hardware resources in advance. This not only results in a large amount of hardware equipment being idle during off-peak hours, resulting in wasted resources and unnecessary capital investment, but also increases the company's operational costs. This over-provisioning strategy can provide necessary support during peak traffic periods, but it can easily cause resources to idle during normal times, failing to effectively improve resource utilization.

[0003] Currently, traffic monitoring technology primarily relies on simple network statistics tools, which can lead to significant delays in predicting large traffic influxes in complex business scenarios. Furthermore, load balancing mechanisms often rely on manual experience or static threshold triggers, making it difficult to dynamically adapt to traffic fluctuations. This is especially true during peak periods like promotional events, where delayed adjustments can lead to slow service responses or even system crashes.

[0004] It can be seen that the coarse granularity and lag in traffic monitoring in existing technologies lead to the inability to accurately identify business conversion activity, making it difficult for servers in existing technologies to improve resource utilization through refined scheduling when facing traffic shocks, ultimately leading to high operating costs and damaged user experience. Summary of the Invention

[0005] In order to overcome the shortcomings of the existing technology, the present application provides a method, device, equipment and storage medium for dynamic capacity expansion of services, which can avoid idle waste caused by over-configuration of hardware resources while ensuring smooth operation of the business, ultimately achieving higher resource utilization and better cost-effectiveness, and improving user experience.

[0006] The technical solution adopted by this application to solve its technical problems is: In a first aspect, the present application provides a method for dynamic capacity expansion of a service, the method comprising: Obtaining visit volume data of multiple target pages and call volume data of corresponding backend services within a preset time period, and calculating the average visit volume of each backend service within the preset time period based on the call volume data; Calculate the current conversion rate of each target page to the corresponding backend service based on the pageview data and the call volume data, and calculate the current service load value of the corresponding backend service after routing conversion by combining the current conversion rate and the average pageview volume; Determining whether the current service load value is greater than a preset threshold, and if the current service load value is greater than the preset threshold, retrieving a historical data set corresponding to the preset time period in a historical database; Based on the historical data set, the average page views and the current conversion rate are comprehensively considered to determine whether the expansion trigger condition is met. If so, dynamic expansion of the corresponding backend service is triggered.

[0007] Optionally, before the step of obtaining pageview data of a plurality of target pages and corresponding backend service call data within a preset time period, the method includes: In response to a user accessing the target page, a network request including page routing information is sent to a tracking service interface through a tracking code pre-deployed on the target page; In response to the network request, the tracking service updates the access data and the call data of the corresponding backend service through the current access record.

[0008] Optionally, if the current service load value is greater than a preset threshold, the step of retrieving a historical data set corresponding to the preset time period from a historical database includes: Obtaining historical average page views and historical call volume data for all identical time periods within a historical period corresponding to the preset time period in the historical database, and calculating an average historical conversion rate of the target page to the corresponding backend service based on the historical average page views and the historical call volume data; Analyze the visit volume change trend of the target page based on the visit volume data of the same time window in multiple historical periods; The historical average visits, the historical conversion rate average and the visit change trend are integrated into the historical data set output.

[0009] Optionally, the step of determining whether the expansion trigger condition is met based on the historical data set and comprehensively considering the average page views and the current conversion rate includes: After calculating the difference between the average visits per minute and the historical average visits per minute, the ratio of the difference to the historical average visits per minute is used as the visit change rate; If the visit volume change rate exceeds the first threshold, the current conversion rate is higher than the second threshold of the historical conversion rate average, and the visit volume trend data shows an upward trend, it is determined that the expansion trigger condition of the corresponding back-end service is met, and the second threshold is a positive gain value.

[0010] Optionally, after the step of determining whether the expansion trigger condition is met based on the historical data set and comprehensively considering the average page views per point and the current conversion rate, the method further includes: If the visit volume change rate exceeds the first threshold, and the current conversion rate is less than a third threshold of the historical conversion rate average, the corresponding backend service is determined to be an abnormal service, and the third threshold is a negative gain value; The abnormal service is monitored in real time, and the access data and call data of the abnormal service are continuously collected to form an integrated output.

[0011] Optionally, the step of triggering dynamic capacity expansion of the corresponding backend service includes: Obtaining the current number of load balancing nodes, and determining the capacity expansion quantity based on the number of load balancing nodes, the average number of visits, and the preset threshold; Scan the performance parameters of all idle resources, sort all the idle resources in descending order according to the performance parameters, and select the top N idle resources as candidate servers, where N is the expansion number; Each of the candidate servers is configured, and after all the candidate servers are configured, a reload configuration instruction is output, and in response to the reload configuration instruction, the dynamic expansion of the corresponding backend service is achieved.

[0012] Optionally, in the step of determining the capacity expansion amount based on the number of load balancing nodes, the average number of visits, and the preset threshold, the formula used is: .

[0013] In a second aspect, the present application provides a device for dynamically expanding service capacity, comprising: The tracking data acquisition module is used to obtain the visit volume data of multiple target pages and the call volume data of the corresponding backend services within a preset time period, and calculate the average visit volume of each backend service within the preset time period based on the call volume data; A service status acquisition module is used to calculate the current conversion rate of each target page to the corresponding backend service based on the pageview data and the call volume data, and to calculate the current service load value of the corresponding backend service after routing conversion by combining the current conversion rate and the average pageview volume; a service adjustment determination module, configured to determine whether the current service load value is greater than a preset threshold, and if so, retrieve a historical data set corresponding to the preset time period from a historical database; The dynamic expansion trigger module is used to determine whether the expansion trigger condition is met based on the historical data set, the average visits per point and the current conversion rate. If so, it triggers the dynamic expansion of the corresponding backend service.

[0014] In a third aspect, the present application provides an electronic device, comprising: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the above method.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium, in which a program or instruction is stored. When the program or instruction is executed, the above method is implemented.

[0016] The beneficial effects of the present application are: first, by collecting the visit data of multiple target pages and the call data of the corresponding back-end services within a preset time period, the real-time situation of business operations can be accurately grasped. Secondly, on this basis, the average visit volume of each back-end service and the conversion rate of the target page to the corresponding back-end service are calculated, and then the current service load value is evaluated. If it is identified that the current service load value exceeds the preset threshold, the system will retrieve the historical data set corresponding to the current time period from the historical database for comparison and analysis. Finally, considering factors such as historical data, current conversion rate and average visit volume, the system can determine whether it is necessary to dynamically expand the back-end service, so as to ensure that it can flexibly respond to changes in sudden traffic. Through such a process, the system can avoid idle waste caused by over-configuration of hardware resources while ensuring the smooth operation of the business, and ultimately achieve higher resource utilization and better cost-effectiveness, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a method for dynamically expanding service capacity provided by an embodiment of the present application; Figure 2 This is a schematic diagram of a specific process of the dynamic service expansion method provided in an embodiment of the present application; Figure 3 It is a virtual structural diagram of the service dynamic expansion device provided by this application; Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The present application is further described below with reference to the accompanying drawings and examples.

[0019] The following will clearly and completely describe the concept, specific structure and technical effects of this application in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features created in this application can be combined interactively without conflicting with each other.

[0020] Reference Figure 1 , Figure 1 This is a flow chart of the method for dynamic capacity expansion of services provided by an embodiment of the present application, which specifically shows the main implementation steps of the method for dynamic capacity expansion based on page embedding and service conversion rate judgment of traffic provided by the present application. The following are detailed descriptions of each of them: In step S1, the pageview data of multiple target pages and the call volume data of corresponding backend services within a preset time period are obtained, and the average pageview volume of each backend service within the preset time period is calculated based on the call volume data.

[0021] Among them, the preset time period refers to a pre-set traffic data collection cycle, such as 15 minutes, which is used to count the access and call data within this period; the target page is a specific front-end page that needs to be monitored, such as an order page or a payment page, whose access behavior may trigger a back-end service call; the access data is the page views (PV), which indicates the number of times users visit the target page within the preset time period; the call data refers to the number of calls to the corresponding back-end service interface triggered by the target page, such as the number of times the order service is called; the average visit volume is the total number of calls to the back-end service within the preset time period divided by the number of minutes included in the time period, to obtain the average call volume per minute.

[0022] Specifically, the system first collects data on the number of visits to multiple target pages and the number of calls to their corresponding backend services within a preset time period. For example, if a page is visited 300 times within 15 minutes and triggers 150 calls to the order service, this raw data needs to be recorded. The average number of visits to each backend service is then calculated based on the call volume data. This is done by dividing the total number of calls by the total number of minutes in the preset time period (e.g., 150 calls / 15 minutes = 10 calls / minute), thereby obtaining the average number of service visits per minute. This metric is used to measure the actual load pressure of the service and provides a basis for subsequent traffic trend analysis and capacity expansion decisions.

[0023] More specifically, in order to promptly record and collect the relevant data involved in step S1, in an embodiment of the present application, before the step of obtaining the visit data of multiple target pages and the call data of the corresponding backend services within a preset time period, the method includes: In response to the user's access to the target page, a network request containing page routing information is sent to the embedding service interface through the embedding code pre-deployed on the target page.

[0024] Among them, the tracking code refers to the JavaScript code embedded in the target page, which is used to monitor user behavior and send data to the background service; the tracking service interface is the API interface provided by the backend, which is used to receive page access data sent by the tracking code; the page routing information is used to identify the specific page path visited by the user (such as order.html). The page routing information can be used to distinguish the access behavior of different pages.

[0025] In response to the network request, the tracking service updates the access data and the call data of the corresponding backend service through the current access record.

[0026] Specifically, when a user visits a target page, the pre-deployed tracking code on that page immediately responds, automatically sending a network request to the tracking service interface. This request carries the routing information for the current page (e.g., order.html), identifying the specific page the user visited. After receiving the request, the tracking service locates the corresponding pageview data and backend service call data based on the routing information and updates this data in real time. For example, if a user visits an order page and triggers a call to the order service, the tracking service increments the pageview data for that page by 1 and the call data for the order service by 1, thereby dynamically recording the correlation between user behavior and service calls.

[0027] More specifically, in one embodiment, suppose a user visits the "order confirmation page" of an e-commerce website (routed as order.html). The tracking code embedded in the page sends a GET request to the tracking service interface with the request parameter / track?router=order.html. Upon receiving the request, the tracking service first updates the page views (PV) of order.html to 1. If the user clicks the "Submit Order" button on that page, triggering a call to the order service interface, the tracking service further updates the call count (SC) of the order service from 0 to 1.

[0028] In step S2, based on the visit data and the call data, the current conversion rate of each target page to the corresponding backend service is calculated, and the current service load value of the corresponding backend service after routing conversion is calculated by combining the current conversion rate and the average visit volume.

[0029] The current conversion rate (CR_current) refers to the proportion of backend service calls triggered by users visiting the target page. It is calculated as the ratio of call volume data (SC_current) to page view data (PV_current), reflecting the efficiency of converting page traffic into service requests. Among them, the current service load value is evaluated by comprehensively considering the current conversion rate and average visits, and the actual load-bearing pressure of the backend service after page routing conversion is evaluated. It is the core indicator for determining whether dynamic expansion is needed.

[0030] Specifically, the system first calculates the current conversion rate (CR_current) based on the target page's visits (PV_current) and the corresponding backend service's calls (SC_current). For example, if a page has 100 visits and triggers 20 service calls, the current conversion rate is 20%. Next, the current service load value is calculated by combining the current conversion rate with the average number of visits per minute (SC_change_count). The average number of visits per minute is derived from historical data and the current conversion rate, reflecting the actual number of requests per minute for the service. If the current conversion rate is high and the average number of visits per minute is large, the service load value will increase significantly, indicating that the backend service is facing great pressure and may trigger dynamic capacity expansion.

[0031] More specifically, in one embodiment, an e-commerce website's "Order Confirmation Page" was visited 300 times within 15 minutes (PV_current = 300), triggering 60 calls to the order service (SC_current = 60). The current conversion rate is 60 / 300 = 20%. If the service's historical average call volume per minute (SC_average) is 10, combined with the current conversion rate, the average visit volume is calculated as: SC_change_count = 20% × 10 = 2 times / minute. At this point, the current service load is 2 times / minute, indicating two requests per minute. If the combined load values of multiple pages exceed the service load threshold (different target pages may correspond to the same backend service, and the final load is determined based on the total load value of the corresponding backend services), the system will determine that dynamic capacity expansion is required to cope with the traffic pressure.

[0032] In step S3, it is determined whether the current service load value is greater than a preset threshold value. If the current service load value is greater than the preset threshold value, a historical data set corresponding to the preset time period in the historical database is retrieved.

[0033] Specifically, the system first determines whether the current service load exceeds a preset threshold. If so, it indicates that the service pressure has exceeded normal operating limits, and further data sets matching the preset time period are retrieved from the historical database. By comparing current data with historical patterns, the system can assist in determining the degree of traffic anomaly and the need for capacity expansion.

[0034] More specifically, the historical data set includes the historical average of page views, the average of conversion rates, and the page view change trend for the same time period. In the embodiment of the present application, if the current service load value is greater than a preset threshold, the step of retrieving the historical data set corresponding to the preset time period from the historical database includes: Obtain the historical average visit volume and historical call volume data for all the same time periods in the historical cycle corresponding to the preset time period in the historical database, and calculate the average historical conversion rate of the target page to the corresponding backend service based on the historical average visit volume and the historical call volume data.

[0035] The historical average visits per minute refers to the average number of calls per minute to the backend service corresponding to the target page during the same period as the current preset time period (for example, the time period from 2:00 PM to 2:15 PM every day for 30 days) over multiple historical periods in the past (for example, within 30 days). The historical call volume data refers to the total number of calls to the corresponding backend service interface triggered by the target page in the historical period, which is used to calculate the historical average conversion rate. The historical average conversion rate is the average conversion efficiency from the target page to the backend service calculated based on the call volume data and visit volume data of multiple historical periods. Specifically, if the current service load exceeds a preset threshold, the system needs to retrieve historical data to assist in decision-making. First, it extracts data from the historical database for all historical periods (e.g., the past 30 days) corresponding to the current preset time period (e.g., 10:00-10:15 on a particular day), including historical average visits and call volume data.

[0036] Based on the pageview data of the same time window in multiple historical periods, the pageview change trend of the target page is analyzed.

[0037] The visit volume change trend is determined by analyzing the visit volume data of the same time window in multiple historical periods to determine the growth or decline of the target page visit volume in unit time.

[0038] Among them, multiple (for example, 4 consecutive) consecutive 15-minute time periods following the current preset time period (for example, if the current time is 10:00-10:15, the subsequent windows are 10:15-10:30, 10:30-10:45, etc.) are used to capture traffic change trends.

[0039] Specifically, the system extracts traffic data from the historical database for the four 15-minute periods following the current preset time period over the past 30 days and calculates the mean per-minute traffic volume (PV_historical_mean) for each period. For example, if the current time period is 10:00-10:15, historical data is extracted for the following four periods: 10:15-10:30, 10:30-10:45, 10:45-11:00, and 11:00-11:15. The system then compares each period's traffic mean with the current service load value (SC_change_count). If the mean for any period is greater than the current value, an upward trend is determined (PV_historical_Trend = 1); if the mean for all periods is less than the current value, a downward trend is determined (PV_historical_Trend = -1). This analysis combines horizontal (same window for different periods) and vertical (time series) analysis to identify abnormal traffic fluctuations or periodic patterns.

[0040] More specifically, in one embodiment, assuming the current time period is 15:00-15:15 and the current service load value (SC_change_count) is 12 times per minute, the system extracts the average visit volume of the past 30 days for the following four 15-minute periods (15:15-15:30, 15:30-15:45, 15:45-16:00, and 16:00-16:15) from the historical database. The results are: 15:15-15:30: average 10 times / minute; 15:30-15:45: average 15 times / minute; 15:45-16:00: average 8 times / minute; 16:00-16:15: average 11 times / minute; Compare the current load value of 12 times / minute with the average value for each time period. The average value for the 3:30-3:45 period is 15>12, triggering a growth trend. The average values for all other time periods are less than 12. Because any time period average is greater than the current value, the system determines that PV_historical_Trend = 1, indicating that subsequent traffic growth may continue. A decision on capacity expansion needs to be made based on other indicators.

[0041] Alternatively, you can analyze visit data for the same time window across multiple historical periods and compare the numerical changes (e.g., daily increases or decreases) across different periods to determine visit trends. For example, if you analyze visit trends and find that visits for a specific time window have increased by 5% daily over the past five days, you can determine that the trend is upward.

[0042] The historical average visits, the historical conversion rate average and the visit change trend are integrated into the historical data set output.

[0043] Specifically, the historical average visits, historical conversion rate averages, and visit trends are integrated into a structured historical data set and output to the subsequent judgment module for comparison with current data to evaluate the degree of traffic anomalies and capacity expansion needs.

[0044] In step S4, based on the historical data set, the average visits per point and the current conversion rate are comprehensively considered to determine whether the expansion trigger condition is met. If so, dynamic expansion of the corresponding backend service is triggered.

[0045] Specifically, based on the historical data set, the current average visits per minute are first compared horizontally with the historical average visits per minute. If the current value is significantly higher than the historical average, it indicates that the service load has exceeded the historical normal level. At the same time, the vertical comparison of the current conversion rate and the historical average conversion rate is used to determine whether the traffic conversion efficiency has increased abnormally. For example, if the current conversion rate is higher than the historical average, it may mean that user behavior is more active or that business logic optimization has led to a surge in service calls. In addition, the trend of changes in visit volume (such as continuous growth or sudden peaks) further verifies the persistence risk of traffic anomalies. When the three are comprehensively determined to meet the expansion trigger conditions, the system triggers the dynamic expansion of the corresponding backend service, allocates idle resources through AI algorithms, and adjusts the load balancing strategy to cope with potential overload pressure.

[0046] More specifically, in the embodiment of the present application, the step of determining whether the expansion trigger condition is met based on the historical data set and comprehensively considering the average page views and the current conversion rate includes: After calculating the difference between the average visits per minute and the historical average visits per minute, the ratio of the difference to the historical average visits per minute is used as the visit change rate; If the visit volume change rate exceeds the first threshold, the current conversion rate is higher than the second threshold of the historical conversion rate average, and the visit volume trend data shows an upward trend, it is determined that the expansion trigger condition of the corresponding back-end service is met, and the second threshold is a positive gain value.

[0047] Among them, the first threshold is the critical value of the visit volume change rate (such as 20%), which is used to determine whether the current load deviates significantly from the historical norm; the second threshold is the positive gain value of the current conversion rate relative to the historical conversion rate average (such as 5%), which is used to determine whether the conversion efficiency has increased abnormally, that is, the benchmark value for determining whether the conversion rate increase is too large.

[0048] Specifically, based on the historical data set, the system first calculates the current visit volume change rate (PV_change_rate). If it exceeds the first threshold (for example, the first threshold is 20%, and the current visit volume change rate is 50%), it indicates that the traffic is significantly higher than the historical norm. At the same time, the current conversion rate (CR_current) must be higher than the second threshold of the historical conversion rate average (such as a 20% positive gain), indicating that the traffic conversion efficiency has increased abnormally. In addition, the visit volume trend data must show an upward trend (PV_historical_Trend=1) to verify the sustainability of traffic growth. When all three are met at the same time, it is determined that the corresponding backend service needs to trigger dynamic expansion, allocate resources through AI algorithms, and adjust the load balancing strategy to cope with service pressure under high conversion efficiency.

[0049] More specifically, in one embodiment, suppose an e-commerce page has a current 15-minute pageview (PV_current) of 300 and a historical mean (PV_historical_mean) of 200. The pageview change rate is (300 - 200) / 200 = 50%, exceeding the first threshold (50% > 0.5). The current conversion rate (CR_current) is 25%, and the historical mean (CR_historical_mean) is 20%, meeting the second threshold (25% > 20% × 1.2 = 24%). Pageview trend data shows a 5% increase in pageviews over the past four periods (e.g., every 15 minutes), resulting in PV_historical_Trend = 1. Because the three conditions of "traffic exceeding the threshold," "significant improvement in conversion efficiency," and "increasing trend" are simultaneously met, the system triggers dynamic scaling of the order service, automatically deploying new service instances and updating configurations to divert requests to the newly added resources, ensuring service stability.

[0050] More specifically, if the visit volume change rate is less than a first threshold value, and the conversion rate change is within a preset controllable range of the historical average, then the corresponding backend service is determined to be in a normal traffic state. In one possible scenario, there is a situation where the visit volume change rate exceeds the first threshold value while the conversion rate change is small or even decreases. To address this situation, in an embodiment of the present application, after determining whether the expansion trigger condition is met based on the historical data set and the average visit volume and the current conversion rate, the method further includes: If the visit volume change rate exceeds a first threshold, and the current conversion rate is less than a third threshold of the historical conversion rate average, the corresponding backend service is determined to be an abnormal service, and the third threshold is a negative gain value.

[0051] The third threshold is the negative gain of the current conversion rate relative to the historical average conversion rate (e.g., -20%), requiring the current conversion rate to be a certain percentage lower than the historical average. Abnormal service refers to when the number of visits increases significantly but the conversion rate decreases abnormally, indicating that the backend service may have a call anomaly or business process obstruction, requiring close monitoring. The abnormal service is monitored in real time, and the access data and call data of the abnormal service are continuously collected to form an integrated output.

[0052] Specifically, if the rate of change in visit volume exceeds a first threshold (e.g., 50%), but the current conversion rate is below a third threshold (e.g., -20%) of the historical average, the corresponding backend service is determined to be an abnormal service. For example, a surge in visit volume but a sudden drop in conversion rate may indicate a service interface failure, response delays, or a blocked business process. Immediately, enhanced monitoring mode is activated for the abnormal service, continuously collecting its visit data (e.g., requests per second) and call data (e.g., interface failure rate), and integrating them into a real-time monitoring report. This report includes key metrics such as timestamps, peak visit volume, and call failure rate, allowing for quick identification of the root cause of the problem, such as a database table lock or downtime in a dependent service, to facilitate intervention and adjustment by relevant personnel.

[0053] More specifically, in one embodiment, suppose a payment page has a current 15-minute pageview volume (PV_current) of 450, a historical average (PV_historical_mean) of 300, and a pageview change rate of (450 - 300) / 300 = 50%, exceeding the first threshold (50% > 0.5). The current conversion rate (CR_current) is 15%, and the historical average (CR_historical_mean) is 25%, meeting the third threshold (15% < 25% × 0.8 = 20%). At this point, the system deems the payment service abnormal, potentially due to an interface timeout or order processing failure, leading to a sudden drop in conversion rate.

[0054] In this case, the system can start real-time monitoring of the service. First, the collection granularity can be increased from per minute to per second. Assume that the number of visits (such as a peak of 60 times / second) and call volume (such as the payment interface failure rate soaring from 5% to 30%) are recorded at this time. Then, this data is integrated and output as a monitoring report, showing "The number of visits reached a peak of 60 times / second at 15:30:15 seconds, the payment interface failure rate was 30%, and the error log indicated a database connection timeout." The operation and maintenance personnel quickly checked the report and found that the database master database was overloaded. They immediately switched to the backup database and optimized SQL to restore normal service.

[0055] If it is determined that a backend service meets the dynamic expansion triggering condition, that is, it is in a state of large traffic influx and active business conversion, the dynamic expansion step is triggered accordingly. In this embodiment of the present application, the step of triggering the dynamic expansion of the corresponding backend service includes: Obtaining the current number of load balancing nodes, and determining the capacity expansion quantity based on the number of load balancing nodes, the average number of visits, and the preset threshold; Scan the performance parameters of all idle resources, sort all the idle resources in descending order according to the performance parameters, and select the first N idle resources as candidate servers, where N is the expansion number.

[0056] The number of load balancing nodes is the total number of load balancing nodes currently responsible for distributing backend service requests, reflecting the existing service carrying capacity; the number of expansions indicates the number of new service instances that need to be added; idle resources refer to unused server or container resources, and their performance parameters include the number of CPU cores, memory capacity, network bandwidth, etc.; candidate servers refer to one or more servers with the best performance selected from idle resources, which are used to deploy new service instances; Each of the candidate servers is configured, and after all the candidate servers are configured, a reload configuration instruction is output, and in response to the reload configuration instruction, the dynamic expansion of the corresponding backend service is achieved.

[0057] Specifically, the current number of load balancing nodes is obtained, and the real-time average visit volume and the preset threshold are combined to calculate the number of service instances to be expanded. For example, if the current number of nodes is 5, the average visit volume is 100 visits / minute, and the preset threshold is 80 visits / minute, the number of service instances to be expanded is (100-80) / 80 = 2.5, rounded up to 3.

[0058] Then, the performance parameters of all idle resources (such as the number of CPU cores and memory) are scanned, sorted in descending order of performance, and the top N (the number of expansions) resources are selected as candidate servers.

[0059] Specifically, when the system determines that additional services are needed, it can use AI to drive an automated process. First, it scans idle resources through the server management API and uses machine learning algorithms to analyze their performance parameters (such as CPU, memory, and bandwidth) to screen out the optimal backup resources.

[0060] Next, the candidate servers are configured, including deploying the backend service code, initializing the runtime environment, and registering them with the load balancer. Once all candidate servers are configured, the system issues a reload configuration command, triggering the load balancer to update its configuration and add the newly added instances to the request dispatch queue, enabling dynamic capacity expansion.

[0061] Specifically, an automated script is used to remotely connect to the selected server, match and download the required software (such as Web server software) from the software repository, automatically set parameters such as ports and document root directories according to the configuration template, and install dependent components such as database drivers and runtime environments through the dependency graph.

[0062] Furthermore, during the load balancing policy adjustment phase, the AI system reads the Nginx configuration file, analyzes the existing algorithms (such as round-robin and weighted round-robin) and the backend server list. Based on the traffic prediction model's predictions, it dynamically adjusts the algorithm (for example, switching to an IP hashing algorithm to accommodate user session persistence) and adds the new instance's IP and port to the Nginx (HTTP and reverse proxy web server) block. Finally, the system automatically sends a reload command to implement the new configuration, ensuring balanced request distribution between the new and existing instances.

[0063] More specifically, in the embodiment of the present application, in the step of determining the capacity expansion amount based on the number of load balancing nodes, the average number of visits, and the preset threshold, the formula used is: .

[0064] More specifically, in one embodiment, assume the current number of load balancing nodes is 4, the average real-time traffic is 95 hits / minute, and the preset threshold is 80 hits / minute. The calculated capacity expansion factor is (95 - 80) / 80 = 1.875, rounded up to 2. The system scans idle resources and discovers three servers with performance parameters: Server A (16 cores / 64GB), Server B (8 cores / 32GB), and Server C (4 cores / 16GB). After sorting them in descending order of performance, the top two servers (A and B) are selected as candidate servers. Subsequently, order service instances are deployed on Servers A and B, Nginx load balancing rules are configured, and both are registered with the service registry. After configuration is complete, the system sends a reload configuration command to Nginx, updates the polling list, and enables the newly added instances to begin accepting requests. This increases the number of load balancing nodes from 4 to 6, improving the service's carrying capacity and enabling it to handle subsequent traffic growth.

[0065] Reference Figure 2 , Figure 2It is a specific flow chart of the service dynamic expansion method provided in the embodiment of the present application. It revolves around the judgment and execution of dynamic expansion of traffic, takes scheduled task detection as the trigger point as a whole, and finally decides whether to start the AI expansion service through multi-dimensional data statistics, calculation and comparative analysis. The specific process is as follows: First, the system triggers the detection mechanism through a scheduled task, and starts the data collection and analysis process every preset time period of minutes. Subsequently, the system counts the visit data (PV_current) of each page route in the current time period and the back-end service call data (SC_current) triggered by each page route, and calculates the conversion rate (CR_current) of the page route to the corresponding back-end service in the current time period based on these two data. The system then obtains the average value of the number of visits per minute for each service in the recent time period (SC_average), and further calculates the converted number of visits per minute (SC_change_count) of the service in combination with the current conversion rate to more accurately reflect the actual load of the service.

[0066] After completing basic data statistics and calculations, the system enters the traffic status assessment phase: First, the system compares the current page route visits with the historical averages for the same time period within the historical cycle to calculate the visit change rate (PV_change_rate). It also compares the current conversion rate with the historical average conversion rate for the same time period, combining these two indicators to determine traffic status. If a significant increase in page visits is detected, along with a simultaneous increase in conversion rate, the system further checks whether the converted service visits (SC_change_count) exceed the preset threshold and determines traffic growth trends based on historical longitudinal data trends (i.e., the average of historical visits across multiple subsequent windows of the same length). If all of the above conditions are met (a surge in visits, an increase in conversion rate, service load exceeding the threshold, and a growing traffic trend), the AI capacity expansion service is triggered.

[0067] Reference Figure 3 , Figure 3 : is a virtual structural diagram of a service dynamic expansion device provided by the present application. A second aspect of the present application provides a service dynamic expansion device, comprising: The tracking data acquisition module 100 is used to obtain the visit volume data of multiple target pages and the call volume data of the corresponding backend services within a preset time period, and calculate the average visit volume of each backend service within the preset time period based on the call volume data; The service status acquisition module 200 is used to calculate the current conversion rate of each target page to the corresponding backend service based on the pageview data and the call volume data, and to calculate the current service load value of the corresponding backend service after routing conversion by combining the current conversion rate and the average pageview volume; The service adjustment determination module 300 is configured to determine whether the current service load value is greater than a preset threshold, and if so, retrieve a historical data set corresponding to the preset time period from a historical database; The dynamic expansion trigger module 400 is used to determine whether the expansion trigger condition is met based on the historical data set, the average page views and the current conversion rate, and if so, trigger the dynamic expansion of the corresponding backend service.

[0068] The service dynamic expansion device described in the embodiment of the present application can execute the service dynamic expansion method provided in the above embodiment. The service dynamic expansion device has the corresponding functional steps and beneficial effects of the service dynamic expansion method described in the above embodiment. Please refer to the embodiment of the above-mentioned service dynamic expansion method for details. The embodiment of the present application will not be repeated here.

[0069] The present application also provides an electronic device. Figure 4 , Figure 4 : is a structural diagram of an electronic device provided in an embodiment of the present application. The electronic device may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned chips. The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the service dynamic expansion method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, implementing the service dynamic expansion method in the above-mentioned method embodiment.

[0070] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The one or more modules are stored in the memory, and when executed by the processor, the service dynamic expansion method as in the above-mentioned method embodiment is executed. The specific details of the above-mentioned electronic device can be understood by corresponding to the corresponding descriptions and effects in the above-mentioned method embodiment, and will not be repeated here. Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. The storage medium may be a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above types of memory.

[0071] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be put into practice without these specific details. In some instances, known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description. It should be noted that the above-described embodiments illustrate the present application rather than limit it, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims.

Claims

1. A method for dynamic service expansion, characterized in that: The method comprises: Obtaining visit volume data of multiple target pages and call volume data of corresponding backend services within a preset time period, and calculating the average visit volume of each backend service within the preset time period based on the call volume data; Calculate the current conversion rate of each target page to the corresponding backend service based on the pageview data and the call volume data, and calculate the current service load value of the corresponding backend service after routing conversion by combining the current conversion rate and the average pageview volume; Determining whether the current service load value is greater than a preset threshold, and if the current service load value is greater than the preset threshold, retrieving a historical data set corresponding to the preset time period in a historical database; Based on the historical data set, the average page views and the current conversion rate are comprehensively considered to determine whether the expansion trigger condition is met. If so, dynamic expansion of the corresponding backend service is triggered.

2. The method for dynamic service expansion according to claim 1, wherein: Before the step of obtaining the pageview data of multiple target pages and the call volume data of the corresponding backend services within a preset time period, the method includes: In response to a user accessing the target page, a network request including page routing information is sent to a tracking service interface through a tracking code pre-deployed on the target page; In response to the network request, the tracking service updates the access data and the call data of the corresponding backend service through the current access record.

3. The method for dynamic service expansion according to claim 1, wherein: The step of retrieving a historical data set corresponding to the preset time period from a historical database if the current service load value is greater than a preset threshold value includes: Obtaining historical average page views and historical call volume data for all identical time periods within a historical period corresponding to the preset time period in the historical database, and calculating an average historical conversion rate of the target page to the corresponding backend service based on the historical average page views and the historical call volume data; Analyze the visit volume change trend of the target page based on the visit volume data of the same time window in multiple historical periods; The historical average visits, the historical conversion rate average and the visit change trend are integrated into the historical data set output.

4. The method for dynamic service expansion according to claim 3, wherein: The step of determining whether the expansion trigger condition is met based on the historical data set and comprehensively considering the average page views and the current conversion rate includes: After calculating the difference between the average visits per minute and the historical average visits per minute, the ratio of the difference to the historical average visits per minute is used as the visit change rate; If the visit volume change rate exceeds the first threshold, the current conversion rate is higher than the second threshold of the historical conversion rate average, and the visit volume trend data shows an upward trend, it is determined that the expansion trigger condition of the corresponding backend service is met, and the second threshold is a positive gain value.

5. The method for dynamic service expansion according to claim 4, characterized in that: After the step of determining whether the expansion trigger condition is met based on the historical data set and comprehensively considering the average page views and the current conversion rate, the method further includes: If the visit volume change rate exceeds the first threshold, and the current conversion rate is less than a third threshold of the historical conversion rate average, the corresponding backend service is determined to be an abnormal service, and the third threshold is a negative gain value; The abnormal service is monitored in real time, and the access data and call data of the abnormal service are continuously collected to form an integrated output.

6. The method for dynamic service expansion according to claim 1, wherein: The steps of triggering dynamic capacity expansion of the corresponding backend service include: Obtaining the current number of load balancing nodes, and determining the capacity expansion quantity based on the number of load balancing nodes, the average number of visits, and the preset threshold; Scan the performance parameters of all idle resources, sort all the idle resources in descending order according to the performance parameters, and select the top N idle resources as candidate servers, where N is the expansion number; Each of the candidate servers is configured, and after all the candidate servers are configured, a reload configuration instruction is output, and in response to the reload configuration instruction, the dynamic expansion of the corresponding backend service is achieved.

7. The method for dynamic service expansion according to claim 6, characterized in that: In the step of determining the capacity expansion quantity based on the number of load balancing nodes, the average number of visits, and the preset threshold, the formula used is: 。 8. A device for dynamic service expansion, characterized in that: include: The tracking data acquisition module is used to obtain the visit volume data of multiple target pages and the call volume data of the corresponding backend services within a preset time period, and calculate the average visit volume of each backend service within the preset time period based on the call volume data; A service status acquisition module is used to calculate the current conversion rate of each target page to the corresponding backend service based on the pageview data and the call volume data, and to calculate the current service load value of the corresponding backend service after routing conversion by combining the current conversion rate and the average pageview volume; a service adjustment determination module, configured to determine whether the current service load value is greater than a preset threshold, and if so, retrieve a historical data set corresponding to the preset time period from a historical database; The dynamic expansion trigger module is used to determine whether the expansion trigger condition is met based on the historical data set, the average visits per point and the current conversion rate. If so, it triggers the dynamic expansion of the corresponding backend service.

9. An electronic device, characterized in that: include: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a program or instruction, and when the program or instruction is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Node dynamic capacity expansion method and system based on platform real-time page view

    CN115883376A

  • Capacity expansion method and device, electronic equipment and readable storage medium

    CN117271118A

  • Capacity expansion and contraction method and device of cloud platform, equipment and storage medium

    CN117675828A

  • Method and system for distributed processing of web traffic analytics data

    US20110225287A1

Cited By

  • Resource processing method and device of resource node, electronic equipment and storage medium

    CN121441919A