Method and system for dynamic expansion and contraction of lightweight distributed thread pool

CN115562864BActive Publication Date: 2026-09-04INSPUR SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211229461.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2026-09-04
Estimated Expiration
2042-10-08

AI Technical Summary

Technical Problem

[0004]但是,每次调整都要重启应用,重启相关的所有组件,体验度大打折扣,并且,严重影响业务进程,客户端体验极差,可能会造成一定的损失

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115562864B_ABST
    Figure CN115562864B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of thread pool dynamic data, in particular to a lightweight distributed thread pool dynamic expansion and contraction implementation method which comprises the following steps: a distributed component registers a unique Beanld of itself to a JVM container; a self-defined communication gate is created, and a thread pool of a business component is configured; a data concentrator is created; thread pool information on a Pod node is bound to the Beanld of the distributed business component; node data is refreshed in real time through H5; the size of the thread pool in the JVM on the Pod is refreshed; thread pool information is early warned; the lightweight distributed thread pool dynamic expansion and contraction implementation method and system have the beneficial effects that in a high-concurrency, multi-service application complex correlation scene, the traditional centralized thread pool management thought is broken, different business application component core thread pool application management is cut, and thread pool scheduling in each core business component of the business application is concentrated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dynamic data technology for thread pools, specifically to a method and system for implementing dynamic expansion and contraction of lightweight distributed thread pools. Background Technology

[0002] A thread pool is a form of multithreaded processing where tasks are added to a queue and then automatically started after threads are created. Thread pool threads are all background threads. Each thread uses a default stack size, runs at a default priority, and exists within a multithreaded unit.

[0003] In existing technologies, for dynamic scaling and compression adjustment of thread pools in centralized structures under multi-concurrency business scenarios, many scenarios implement thread pool strategies for single-node applications to dynamically scale and compress and adjust.

[0004] However, each adjustment requires restarting the application and all related components, which greatly reduces the user experience and severely impacts business processes, resulting in a poor client experience and potentially causing some losses. Summary of the Invention

[0005] The purpose of this invention is to provide a lightweight distributed thread pool dynamic expansion and contraction implementation method and system to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a lightweight distributed thread pool dynamic expansion and contraction implementation method, which includes the following steps:

[0007] Distributed components register their own unique Beanld with the JVM container;

[0008] Customize the communication gateway and configure thread pools for business components;

[0009] Create a data aggregator;

[0010] Bind the thread pool information on the Pod node to the Beanld of the distributed business component;

[0011] Node data is refreshed in real time via H5;

[0012] Refresh the thread pool size in the JVM on the Pod;

[0013] Warning thread pool information.

[0014] Preferably, when configuring thread pools for custom communication gateways and business components, the JVM uniformly sets the basic parameters of the virtual thread pool. These parameters are global and default.

[0015] Each business component loads and initializes its own thread pool based on Beanld, and each business component customizes its thread size and warning threshold.

[0016] Preferably, when creating a data aggregator, thread pool information from different Pod nodes is collected uniformly.

[0017] Preferably, node data is refreshed in real time via H5, and the basic parameters of the current node's thread pool are adjusted to an appropriate size.

[0018] Preferably, the thread pool size in the JVM on the Pod is dynamically refreshed using a communication gateway and the Beanld of the current node;

[0019] Based on Pod node information and business component Beanld dynamic warning thread pool information.

[0020] A lightweight distributed thread pool dynamic expansion and contraction implementation system is provided, which consists of a registration module, a custom module, a creation module, a binding module, a node data refresh module, a thread pool refresh module, and an early warning module.

[0021] The registration module is used for distributed components to register their own unique Beanlds to the JVM container;

[0022] Custom modules are used to customize communication gateways and configure thread pools for business components;

[0023] Create a module for creating a data aggregator;

[0024] The binding module is used to bind thread pool information on Pod nodes to the Beanld of distributed business components;

[0025] The node data refresh module is used to refresh node data in real time via H5;

[0026] The thread pool refresh module is used to refresh the thread pool size in the JVM on the Pod;

[0027] The early warning module is used to issue early warnings about thread pool information.

[0028] Preferably, when configuring the thread pool for the custom module, custom communication gateway, and business components, the JVM uniformly sets the basic parameters of the virtual thread pool, and the parameters are global and default.

[0029] Each business component loads and initializes its own thread pool based on Beanld, and each business component customizes its thread size and warning threshold.

[0030] Preferably, when creating the data aggregator, the creation module collects thread pool information from different Pod nodes in a unified manner.

[0031] Preferably, the node data refresh module refreshes node data in real time via H5, adjusting the basic parameters of the current node thread pool to an appropriate size.

[0032] Preferably, the thread pool refresh module dynamically refreshes the thread pool size in the JVM on the Pod using a communication gateway and the Beanld of the current node;

[0033] The early warning module dynamically alerts thread pool information based on Pod node information and the Beanld of the business component.

[0034] Compared with the prior art, the beneficial effects of the present invention are:

[0035] This invention proposes a lightweight distributed thread pool dynamic expansion and contraction implementation method and system to solve the problem of high concurrency and complex interrelationships among multiple business applications. It breaks away from the traditional centralized thread pool management approach by dividing the core thread pool application management of different business application components and aggregating the thread pool scheduling of each core business component. It unifies the underlying core scheduling data into a single component, realizing the dynamic unified management, expansion, and compression of the distributed thread pool. Combined with H5 technology, it enables real-time switching data of the distributed dynamic thread pool to be switched to the front end. It transforms the traditional single thread pool monitoring and adjustment strategy into distributed, multi-node, real-time monitoring and adjustment, without requiring the restart of business applications, greatly avoiding the risk of business loss and improving business productivity and performance. Attached Figure Description

[0036] Figure 1 This is a flowchart of the method of the present invention;

[0037] Figure 2 This is a schematic diagram illustrating the principle of dynamic strategy adjustment for distributed components in this invention.

[0038] Figure 3 This is a diagram illustrating the dynamic adjustment structure of the core thread pool in the distributed component of this invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the present invention clear and complete, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only some, not all, embodiments of the present invention, and are merely illustrative of the embodiments of the present invention. They are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] Example 1

[0041] Please see Figure 1This invention provides a technical solution: a lightweight distributed thread pool dynamic expansion and contraction implementation method, which includes the following steps:

[0042] Distributed components register their own unique Beanld with the JVM container;

[0043] Custom communication gateways and thread pool configurations for business components; JVM uniformly sets basic parameters for the virtual thread pool, which are global and default; each business component loads and initializes its own thread pool based on Beanld, and each business component customizes its thread size and warning threshold.

[0044] Create a data aggregator to collect thread pool information from different Pod nodes in a unified manner;

[0045] Bind the thread pool information on the Pod node to the Beanld of the distributed business component;

[0046] The node data is refreshed in real time via H5, and the basic parameters of the current node's thread pool are adjusted to an appropriate size.

[0047] The thread pool size in the JVM on the Pod is dynamically refreshed using the communication gateway and the Beanld of the current node.

[0048] Based on Pod node information and business component Beanld dynamic warning thread pool information.

[0049] Example 2

[0050] A lightweight distributed thread pool dynamic expansion and contraction implementation system is provided, which consists of a registration module, a custom module, a creation module, a binding module, a node data refresh module, a thread pool refresh module, and an early warning module.

[0051] The registration module is used for distributed components to register their own unique Beanlds to the JVM container;

[0052] A custom module is used to customize the communication gateway, configure thread pools for business components, and uniformly set the basic parameters of the virtual thread pool in the JVM. These parameters are global and default. Each business component loads and initializes its own thread pool based on Beanld, and each business component customizes the thread size and warning threshold.

[0053] Create a module to create a data aggregator, which collects thread pool information from different Pod nodes in a unified manner;

[0054] The binding module is used to bind thread pool information on Pod nodes to the Beanld of distributed business components;

[0055] The node data refresh module refreshes node data in real time via H5 and adjusts the basic parameters of the current node thread pool to an appropriate size.

[0056] The thread pool refresh module dynamically refreshes the thread pool size in the JVM on the Pod by using the communication gateway and the Beanld of the current node.

[0057] The early warning module dynamically alerts thread pool information based on Pod node information and the Beanld of the business component.

[0058] Example 3

[0059] This invention addresses the challenge of dynamically adjusting distributed tasks in multi-node, high-concurrency scenarios, a problem that traditional centralized thread pool scheduling cannot solve. It creatively combines task orchestration technology with H5 page rendering to set dynamic strategies for different task component nodes, enabling the adjustment of the core strategy of a multi-node thread pool. For detailed principles, please refer to the appendix. Figure 2 As shown.

[0060] (2) This invention targets distributed business application components. First, there is a core scheduling engine. The scheduling engine comes with a basic thread pool configuration strategy and global thread pool configuration parameters. It is a core client jar package. This core package is attached to each distributed business core component. The business components are isolated and have no direct relationship. The business component configures its own dedicated thread pool. Then, its own thread pool dynamic information is aggregated to the data aggregation collector through the communication gateway. The data aggregation collector collects the core thread pool data of each business component in a unified manner. The strategy adjuster, in conjunction with the communication gateway, realizes the thread pool strategy adjustment of each business node and renders the result to the H5 page. At the same time, the H5 page also creatively realizes the reverse adjustment of data, assigning the originally hidden core data to a certain node, realizing the page data driving the backend dynamic components, and achieving the purpose of adjusting the strategy.

[0061] (3) The innovation of this patent lies in its abandonment of the drawbacks of traditional centralized management of business components. Instead, it leverages a distributed approach to distribute the same business application in multi-task, multi-concurrency scenarios across different server nodes. At the underlying level, a self-developed core scheduler and data aggregator uniformly collect and manage the core thread pool scheduling data of the business components, facilitating adjustments and enabling dynamic adjustment strategies for specific applications and nodes without affecting the customer's business experience. (See Appendix) Figure 3 As shown.

[0062] Example 4

[0063] A lightweight distributed thread pool dynamic expansion and contraction strategy implementation method based on H5 is characterized by: real-time on-demand dynamic adjustment of the distributed thread pool engine. The core technology is to distinguish core business and core application according to the business system and dynamically switch the most suitable scheduling engine to achieve zero failure rate and efficient scheduling of business application services.

[0064] First, there is a core scheduling engine, which comes with basic thread pool configuration strategies and global thread pool configuration parameters. It is a core client JAR file. This core file is attached to the dependencies of various distributed business core components. The business components are isolated and have no direct relationship with each other.

[0065] Secondly, a custom communication gateway is required. Business components configure their own dedicated thread pools, and then aggregate the dynamic information of their thread pools to the data aggregation collector through the communication gateway.

[0066] There needs to be a data aggregator to collect the core thread pool data of various business components in a unified manner, and a policy adjuster combined with a communication gateway to adjust the thread pool policy of each business node.

[0067] It also requires the use of the H5 core engine to render the data, and creatively implements reverse data adjustment on the H5 page, assigning the originally hidden core data to a certain node, so as to realize the page data driving the backend dynamic components and achieve the purpose of adjusting the strategy.

[0068] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A lightweight distributed thread pool dynamic expansion and contraction implementation method, characterized by: The method includes the following steps: Distributed components register their own unique Beanld with the JVM container; Customize the communication gateway and configure thread pools for business components; Create a data aggregator; Bind the thread pool information on the Pod node to the Beanld of the distributed business component; By refreshing node data in real time via H5, and implementing reverse data adjustment on the H5 page, the core data that was originally hidden can be assigned to a specific node. This allows page data to drive dynamic backend components, achieving the goal of adjusting the strategy. Refresh the thread pool size in the JVM on the Pod; Warning thread pool information; When configuring thread pools for custom communication gateways and business components, the JVM uniformly sets the basic parameters of the virtual thread pool. These parameters are global and default. Each business component loads and initializes its own thread pool based on Beanld, and each business component customizes its thread size and warning threshold. When creating a data aggregator, thread pool information from different Pod nodes is collected uniformly. The system refreshes node data in real time via H5, adjusting the basic parameters of the current node's thread pool to an appropriate size; it dynamically refreshes the thread pool size in the JVM on the Pod using the communication gateway and the current node's Beanld; and it dynamically alerts thread pool information based on Pod node information and business component Beanld.

2. A lightweight distributed thread pool dynamic expansion and contraction implementation system as described in claim 1, characterized in that: The system consists of a registration module, a customization module, a creation module, a binding module, a node data refresh module, a thread pool refresh module, and an early warning module. The registration module is used for distributed components to register their own unique Beanlds to the JVM container; Custom modules are used to customize communication gateways and configure thread pools for business components; Create a module for creating a data aggregator; The binding module is used to bind thread pool information on Pod nodes to the Beanld of distributed business components; The node data refresh module is used to refresh node data in real time via H5; The thread pool refresh module is used to refresh the thread pool size in the JVM on the Pod; The early warning module is used to issue early warnings about thread pool information.

3. The lightweight distributed thread pool dynamic expansion and contraction implementation system according to claim 2, characterized in that: When configuring thread pools for custom modules, custom communication gateways, and business components, the JVM uniformly sets the basic parameters of the virtual thread pool. These parameters are global and default. Each business component loads and initializes its own thread pool based on Beanld, and each business component customizes its thread size and warning threshold.

4. The lightweight distributed thread pool dynamic expansion and contraction implementation system according to claim 3, characterized in that: When creating the data aggregator, the creation module collects thread pool information from different Pod nodes in a unified manner.

5. The lightweight distributed thread pool dynamic expansion and contraction implementation system according to claim 4, characterized in that: The node data refresh module refreshes node data in real time via H5, adjusting the basic parameters of the current node thread pool to an appropriate size.

6. The lightweight distributed thread pool dynamic expansion and contraction implementation system according to claim 5, characterized in that: The thread pool refresh module dynamically refreshes the thread pool size in the JVM on the Pod by using the communication gateway and the Beanld of the current node. The early warning module dynamically alerts thread pool information based on Pod node information and the Beanld of the business component.

Citation Information

Patent Citations

  • Cross-domain information system-oriented real-time on-demand data aggregation method and system

    CN111949717A

  • Method and system for dynamically setting thread pool parameters, and equipment

    CN113590285A