CN115292012A - Thread pool management method and system, intelligent terminal and storage medium - Google Patents

Thread pool management method and system, intelligent terminal and storage medium Download PDF

Info

Publication number
CN115292012A
CN115292012A CN202210890037.0A CN202210890037A CN115292012A CN 115292012 A CN115292012 A CN 115292012A CN 202210890037 A CN202210890037 A CN 202210890037A CN 115292012 A CN115292012 A CN 115292012A
Authority
CN
China
Prior art keywords
thread pool
thread
operation data
management method
set threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210890037.0A
Other languages
Chinese (zh)
Inventor
杨博研
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210890037.0A priority Critical patent/CN115292012A/en
Publication of CN115292012A publication Critical patent/CN115292012A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3086Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves the use of self describing data formats, i.e. metadata, markup languages, human readable formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Abstract

The application discloses a management method and a system of a thread pool, an intelligent terminal and a storage medium, wherein the management method of the thread pool comprises the following steps: acquiring current operation data of a thread pool; responding to the condition that the running data does not meet the preset condition, and adjusting the running parameters of the thread pool according to the running data; and sending the operation data to the operation and maintenance management terminal so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data. By the aid of the scheme, the management method of the thread pool can dynamically adjust the running parameters of the thread pool to the application requirements most suitable for the current network service through artificial intelligence automatic analysis and decision, code modification or application restart is not needed, various indexes in the running process of the thread pool can be visible in real time, and the site can be restored afterwards.

Description

Thread pool management method and system, intelligent terminal and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and a system for managing a thread pool, an intelligent terminal, and a storage medium.
Background
Today, in java (an object-oriented programming language) development, a thread pool is a basic technology that is generally selected by 99% of developers when it is needed to improve system performance, but in the use of a common thread pool, the following problems are generally encountered: a plurality of thread pools may be created in a project, and different service types have different characteristics, some are IO (hard disk memory) intensive, some are CPU (processor) intensive, and the thread pool parameters are not well determined; all indexes in the running process of the thread pool can not be generally sensed, and the requirements of early warning in advance, index checking in the process, field backtracking in the future and the like can not be met; high availability cannot be achieved, and when the parameters are required to be adjusted, developers are required to modify codes to achieve the purpose.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a management method and system of a thread pool, an intelligent terminal and a storage medium, so that the problems that in the prior art, the thread pool cannot be perceived by operation and maintenance personnel to operate parameters in the operation process, so that the requirements of early warning in advance, index checking in advance, backtracking to the site after the event and the like cannot be met, and high availability cannot be met are solved.
In order to solve the above problem, a first aspect of the present application provides a method for managing a thread pool, where the method for managing the thread pool includes: acquiring current operation data of the thread pool; responding to the condition that the running data does not meet the preset condition, and adjusting the running parameters of the thread pool according to the running data; and sending the operation data to the operation and maintenance management terminal so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data.
The running data comprises the number proportion of a first thread which is not loaded with the service in the thread pool, and the step of adjusting the running parameters of the thread pool according to the running data comprises the following steps of in response to the running data not meeting the preset condition: in response to the number ratio being less than a first set threshold, a first set number of new threads are added to the thread pool.
The management method further comprises the following steps: releasing a second set number of first threads in the thread pool in response to the number ratio being greater than a second set threshold; wherein the second set threshold is greater than the first set threshold.
Wherein, the management method further comprises: acquiring the maximum thread accommodating number of a thread pool; and sending alarm information to the operation and maintenance management terminal in response to the fact that the sum of the first set number and the number of the second threads loaded with the services in the thread pool is larger than the maximum thread accommodating number.
Wherein, the management method further comprises: triggering a first rejection strategy of the thread pool in response to the fact that the sum of the first set quantity and the second thread quantity is larger than the maximum thread accommodating quantity, so that the thread pool adds a third set quantity of services to the set queue; wherein the third set number is equal to or greater than the first set number.
The management method further comprises the following steps: and triggering a second rejection strategy of the thread pool in response to the number ratio being smaller than a third set threshold value, so that the thread pool rejects to load the new service within the first set time length.
The method comprises the following steps that running data comprise task execution duration of each type of service loaded into a thread pool, and in response to the fact that the running data do not meet preset conditions, the step of adjusting running parameters of the thread pool according to the running data comprises the following steps: and responding to the fact that the task execution time length is larger than a fourth set threshold value, and adding part of the service loaded into the thread pool into the set queue.
The management method further comprises the following steps: and sending alarm information to the operation and maintenance management terminal in response to the fact that the task execution time length is larger than a fifth set threshold, wherein the fifth set threshold is larger than a fourth set threshold.
The operation data comprises the service rejection number of the thread pool in a second set time length, and the step of adjusting the operation parameters of the thread pool according to the operation data comprises the following steps in response to the operation data not meeting the preset condition: and responding to the service rejection number larger than a sixth set threshold value, and adding new threads with a fourth set number into the thread pool.
In order to solve the above problem, a second aspect of the present application provides a thread pool management system, wherein the thread pool management system includes: the thread pool is used for loading at least one service; the configuration central processor is used for acquiring the current operation data of the thread pool so as to adjust the operation parameters of the thread pool according to the operation data when the operation data does not meet the preset condition; and the operation and maintenance management terminal receives the operation data sent by the configuration center processor so as to generate and display a corresponding statistical analysis chart based on the operation data.
In order to solve the foregoing problem, a third aspect of the present application provides an intelligent terminal, where the intelligent terminal includes a memory and a processor, which are coupled to each other, and the processor is configured to execute program instructions stored in the memory, so as to implement the thread pool management method according to the first aspect.
In order to solve the above problem, a fourth aspect of the present application provides a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the thread pool management method of the first aspect is implemented.
The invention has the beneficial effects that: different from the situation in the prior art, the management method for the thread pool provided by the application can acquire the current operation data of the thread pool, so that when the operation data does not meet the preset condition, the operation parameters of the thread pool are adjusted according to the operation data, the operation parameters of the thread pool can be dynamically adjusted to the application requirements most suitable for the current network service through artificial intelligence automatic analysis and decision, and the code does not need to be modified or the application does not need to be restarted. In addition, the operation data are sent to the operation and maintenance management terminal, so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data, various indexes in the operation process of the thread pool can be visible in real time, and the site can be recovered afterwards.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a method for managing thread pools according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a thread pool management method according to the present application;
FIG. 3 is a block diagram of an embodiment of a management system for thread pools according to the present invention;
FIG. 4 is a block diagram of an embodiment of a smart terminal according to the present application;
FIG. 5 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
In order to make the technical problems solved, the technical solutions adopted, and the technical effects achieved by the present application clearer, the technical solutions of the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of a method for managing a thread pool according to the present application. Specifically, the following steps may be included:
s11: and acquiring the current running data of the thread pool.
With the rapid development of java technology, network services based on thread pools are gradually popularized and fall to the ground. Particularly, when the overall performance of the network service system needs to be improved, how to make the operating parameters of the thread pool always best fit with the application requirements of the current network service becomes a key factor influencing the network service enjoyed by the user.
It should be noted that the thread pool is a form of multi-thread processing, and tasks are added to the queue during processing and then automatically started after the thread is created. The threads in the thread pool are all background threads. Each thread uses a default stack size, runs at a default priority, and is in a multi-threaded unit. If a thread is idle in managed code, such as waiting for an event, the thread pool will insert another helper thread to keep all processors busy. If all threads in the thread pool remain busy all the time, but the queue contains pending work, the thread pool will create another helper thread after a period of time, but the number of threads never exceeds the maximum. And threads that exceed the maximum value may be queued in the store queue, but need to wait until other threads are completed before starting.
It can be understood that the management method of the thread pool in this embodiment is a method for managing each index and operation parameter in the running process of the thread pool by a configuration center processor, so that when at least one network service, that is, a project, is loaded in the thread pool, the operation parameter of the thread pool can be adjusted in real time, so that the thread pool best fits the application requirement of the current network service, and there is no need to modify a code or restart the application.
Specifically, the central processor is configured to obtain the current operation data of the thread pool in real time.
Optionally, the configuration center processor may specifically make some extensions on a TPE (thread pool factory class) of an original thread pool, and obtain the extensions in combination with a mainstream configuration center, such as a Nacos (micro service platform architecture), an Apollo (distributed configuration center), and the like, to implement distributed acquisition and adjustment of thread pool parameters, and enable online configuration of the thread pool without modifying codes or restarting applications.
S12: and responding to the condition that the running data does not meet the preset condition, and adjusting the running parameters of the thread pool according to the running data.
Further, the configuration center processor adjusts the operation parameters of the thread pool when determining that the current operation data of the thread pool does not satisfy a preset condition, for example, the total number of the services loaded in the thread pool exceeds a preset number, and/or the execution duration of each service exceeds a preset duration, and/or does not satisfy any other reasonable preset condition, and maintains the current operation parameters unchanged when the operation data satisfies the preset condition, so that the operation parameters of the thread pool most conform to the application requirements of the current network service at each moment.
S13: and sending the operation data to the operation and maintenance management terminal so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data.
And further, the running data of the thread pool, which is obtained at each moment, is sent to the operation and maintenance management terminal while the running parameters of the thread pool are adjusted, so that the operation and maintenance management terminal can perform statistical analysis on the running data, and further a proper statistical analysis chart is prepared and displayed to corresponding operation and maintenance management personnel.
It can be understood that, when viewing the statistical analysis chart, the operation and maintenance staff can interpret and read the current operating status of the thread pool and the operating characteristic information of the thread pool at different times, for example, the traffic loaded in the thread pool in different time periods every day, so that the operation and maintenance staff can intervene in real time in the operation of the thread pool to correct the possible situations of misdecision of the configuration center processor, and summarize the operating rules of the thread pool, so as to set different operating parameters and/or preset conditions for the thread pool at different times, for example, set that the thread pool correspondingly creates a smaller number of threads in the morning with a smaller traffic each day, and create a larger number of threads in the evening, or set any other reasonable operating parameters and/or preset conditions, so as to form a control closed loop with artificial intelligence, that is, the parameter effect decided by the configuration center processor, which is not limited in this application.
Optionally, the operation and maintenance management terminal may be any reasonable intelligent terminal, such as a background computer, a background server, or a tablet computer, which performs operation and maintenance management on at least one server running with a thread pool, and is correspondingly configured with a display to correspondingly display a statistical analysis chart generated based on the running data of the thread pool, which is not limited in the present application.
According to the scheme, the current operation data of the thread pool is obtained, so that when the operation data do not meet the preset conditions, the operation parameters of the thread pool are adjusted according to the operation data, the operation parameters of the thread pool can be dynamically adjusted to the application requirements most fitting the current network service through artificial intelligence automatic analysis decision, and the codes do not need to be modified or the application does not need to be restarted. In addition, the operation data are sent to the operation and maintenance management terminal, so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data, various indexes in the operation process of the thread pool can be visible in real time, and the site can be recovered afterwards.
Further, in an embodiment, the running data specifically includes a number ratio of the first thread, which is not loaded with the service, in the thread pool, and the S12 may further include: in response to the number ratio being less than a first set threshold, a first set number of new threads are added to the thread pool.
For convenience of understanding, the description is given by taking an example that the thread pool specifically includes a first thread and a second thread, and the first thread is an idle thread which is not currently loaded with a service in the thread pool, and the second thread is another part of threads loaded with a service, it can be known that the number of the first thread in the thread pool directly affects the efficiency of currently processing the service request, for example, when the traffic is large, and the available first threads in the thread pool are less and will be exhausted soon, a proper threshold needs to be preset, and a coping process needs to be performed in time.
When the number ratio of the first threads in the thread pool is smaller than a first set threshold, it can be determined that the current service request is more, the idle threads in the thread pool do not meet the current service processing requirement, and new threads with the first set number need to be added in the thread pool, so as to ensure that the subsequent service can be processed smoothly and timely.
It can be understood that the first set number may be any reasonable number that can ensure that the number of the first threads in the thread pool is greater than the first set threshold after adjustment and is not too large to cause excessive idle of the computing resources, which is not limited in the present application.
Optionally, the first set threshold may specifically be any reasonable value from 25% to 35%, which is not limited in this application.
Further, in an embodiment, the S12 may specifically further include: and releasing a second set number of first threads in the thread pool in response to the number ratio being greater than a second set threshold.
It can be understood that, when the number of the first threads in the idle state in the thread pool is greater and the number ratio thereof is greater than the second set threshold, it is determined that the current service request is less, and a part of the first threads needs to be released in the thread pool, so as to reduce the computational resources.
The second set threshold is greater than the first set threshold, and the second set number may be any reasonable number that can ensure that the number of the first threads in the thread pool is greater than the first set threshold after adjustment, but is less than the second set threshold, which is not limited in the present application.
Optionally, the second set threshold may specifically be any reasonable value from 75% to 85%, which is not limited in this application.
It should be noted that, limited by the hardware performance of the server running the thread pool, the number of threads correspondingly integrated in the thread pool generally has a maximum thread accommodating number and a minimum thread accommodating number, that is, the specific number of threads added and released by the configuration central processor in the thread pool cannot exceed a value interval defined by the maximum thread accommodating number and the minimum thread accommodating number.
Further, in an embodiment, the S12 may specifically include: and triggering a second rejection strategy of the thread pool in response to the number ratio being smaller than a third set threshold value, so that the thread pool rejects to load the new service within the first set time length.
It can be understood that, when the number of the first threads in the thread pool is small and the number ratio is smaller than the third set threshold, the second rejection policy of the thread pool may be specifically triggered, so that the thread pool rejects to load the new service within the first set duration, that is, the service loading of the thread pool is limited, so as to relieve the service processing pressure of the thread pool until the number ratio of the first threads is larger than the third set threshold.
Further, in an embodiment, the running data specifically includes a task execution duration of each type of service loaded into the thread pool, and the S12 may further include: and responding to the fact that the task execution time length is larger than a fourth set threshold value, and adding part of the service loaded into the thread pool into the set queue.
It can be understood that if the task execution time of the partial or all kinds of services existing in the thread pool is too long and is greater than the fourth set threshold, it may be determined that the current service processing efficiency of the thread pool is low, and it is necessary to appropriately reduce the operation burden of the thread pool at a time to be able to add part of the services loaded into the thread pool to the set queue to wait for processing in sequence, so as to reduce the number of second threads loaded with services in the thread pool.
In other embodiments, when there is a task execution time greater than the fourth set threshold, the configuration central processor may further add a new thread in the thread pool, so as to increase the service processing efficiency of the thread pool.
Further, in an embodiment, the S12 may specifically include: and responding to the fact that the task execution time length is larger than a fifth set threshold value, and sending alarm information to the operation and maintenance management terminal, wherein the fifth set threshold value is larger than a fourth set threshold value.
It can be understood that if the task execution time of some or all kinds of services in the thread pool is too long and is greater than the fifth set threshold, it may be determined that the server running the thread pool may have a fault and alarm information needs to be sent to the operation and maintenance management terminal, for example, any reasonable alarm information such as a pop-up window request and an audible and visual alarm signal request is sent to the operation and maintenance management terminal, so as to remind the operation and maintenance personnel of manual intervention.
In other embodiments, when there is a task execution time that is longer than the fifth set threshold, the configuration central processor may also specifically and directly send an alarm message to a mobile phone or a tablet computer of an operation and maintenance worker, which is not limited in the present application.
Further, in an embodiment, the operation data may specifically include a service rejection number of the thread pool in a second set time duration, and the S12 may specifically include: and responding to the service rejection number larger than a sixth set threshold value, and adding new threads with a fourth set number into the thread pool.
It can be understood that, when the number of service rejections in the thread pool within the second set duration is too large to be greater than the sixth set threshold, it may be determined that the current service processing efficiency of the thread pool is low or the service requests to be processed are too many, and therefore, a fourth set number of new threads need to be added to the thread pool to relieve the service processing pressure of the thread pool.
In a specific embodiment, the current operation data of the thread pool acquired by the configuration central processor may specifically include one or more of any reasonable operation data such as an idle thread in the physical machine, a number ratio of a first thread, which is not loaded with a service, in the thread pool, a service type loaded into the thread pool, an average throughput TPS (transactionapseccond per second) of the application interface, RT (Response Time), a capacity threshold percentage, task rejection data, and a task execution Time. The configuration central processor may specifically introduce an intelligent decision algorithm of AI (Artificial Intelligence), so as to perform statistical analysis on the operation data according to the service characteristics of the application, and adjust the corresponding operation parameters and execution strategies of the thread pool in real time according to the intelligent decision algorithm of AI.
Further, the configuration central processor may further provide multiple monitoring indexes, for example, dynamic parameter adjustment of the thread pool, activity alarm, capacity threshold alarm, policy trigger alarm rejection, overtime alarm of task execution duration, and send corresponding alarm information to the operation and maintenance management terminal, so that a developer or an operation and maintenance worker can grasp the operation condition of the thread pool at the first time, and can form a closed loop with the parameter effect of intelligent dynamic adjustment of the AI, feed back the operation condition and provide data reference for manual intervention.
The active alarm specifically refers to an alarm mechanism that a thread pool or a corresponding server runs too few threads, and needs to perform thread release or service migration to send alarm information to an operation and maintenance management terminal. It can be understood that different alarm mechanisms may specifically be different for sending alarm information to the operation and maintenance management terminal, so as to remind development or operation and maintenance personnel to perform different adjustment strategies.
The operation and maintenance management terminal may specifically perform rolling recording on the operation data of the thread pool to be used for data traffic analysis or thread recurrence afterwards.
Referring to fig. 2, fig. 2 is a flowchart illustrating a thread pool management method according to a second embodiment of the present disclosure. The method for managing a thread pool in this embodiment is a flowchart of a detailed embodiment of the method for managing a thread pool in fig. 1, and includes the following steps:
s21: and acquiring the maximum thread accommodating number of the thread pool.
It is understood that, limited by the hardware performance of the server running the thread pool, the number of threads correspondingly integrated in the thread pool generally has a maximum thread-holding number and a minimum thread-holding number, that is, the specific number of threads added and released by the configuration center processor in the thread pool cannot exceed the value interval defined by the maximum thread-holding number and the minimum thread-holding number.
Specifically, the configuration center processor obtains the maximum thread capacity of the thread pool.
S22: and acquiring the current running data of the thread pool.
S22 is the same as S11 in fig. 1, and please refer to S11 and the related text description thereof, which are not repeated herein.
S23: and sending alarm information to the operation and maintenance management terminal in response to the fact that the sum of the first set number and the number of the second threads loaded with the services in the thread pool is larger than the maximum thread accommodating number.
It can be understood that, when new threads with a first set number need to be added into the thread pool, so that the number proportion of the first threads which do not load services in the thread pool is smaller than a first set threshold, but the sum of the first set number and the number of the second threads which load services in the thread pool is greater than the maximum thread accommodating number, it may be determined that the configuration center processor cannot directly solve the current running difficulty of the thread pool by adding the new threads into the thread pool, and needs to send alarm information to the operation and maintenance management terminal to request manual intervention.
S24: and sending the operation data to the operation and maintenance management terminal so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data.
S24 is the same as S13 in fig. 1, and please refer to S13 and the related text description thereof, which are not repeated herein.
Further, in an embodiment, the step S21 may also be executed after the step S22 and before the step S23, which is not limited in this application.
Further, in an embodiment, in the above S23, specifically, the method may further include: and triggering a first rejection strategy of the thread pool in response to the sum of the first set number and the second thread number being greater than the maximum thread accommodating number, so that the thread pool adds a third set number of services to the set queue.
It can be understood that, when new threads with a first set number need to be added to the thread pool, so that the number proportion of the first threads which do not load services in the thread pool is smaller than a first set threshold, but the sum of the first set number and the number of the second threads which load services in the thread pool is greater than a maximum thread accommodating number, it may be determined that the configuration central processor cannot directly solve the current running difficulty of the thread pool by adding new threads in the thread pool, and the thread pool needs to add services with a third set number to the set queue to wait for sequential processing, or refuse to load new services within a certain time, so as to alleviate the current service processing pressure.
Wherein the third set number is equal to or greater than the first set number.
Referring to fig. 3, fig. 3 is a schematic diagram of a framework of an embodiment of a management system for thread pools according to the present invention. In the present embodiment, the thread pool management system 31 includes: a thread pool 311, a configuration center processor 312 and an operation and maintenance management terminal 313.
Specifically, the thread pool 311 is used for loading at least one service; the configuration central processor 312 is configured to obtain current operation data of the thread pool 311, so as to adjust operation parameters of the thread pool 311 according to the operation data when the operation data does not meet a preset condition; the operation and maintenance management terminal 313 receives the operation data sent by the configuration center processor 312, and generates and displays a corresponding statistical analysis chart based on the operation data.
According to the scheme, the current operation data of the thread pool 311 is obtained, so that when the operation data does not meet the preset condition, the operation parameters of the thread pool 311 are adjusted according to the operation data, the operation parameters of the thread pool 311 can be dynamically adjusted to the application requirements most fitting the current network service through artificial intelligence automatic analysis and decision, and the code does not need to be modified or the application does not need to be restarted. In addition, the operation data is sent to the operation and maintenance management terminal 313, so that the operation and maintenance management terminal 313 generates and displays a corresponding statistical analysis chart based on the operation data, and various indexes in the operation process of the thread pool 311 can be visible in real time, and further, the site can be recovered afterwards.
In some embodiments, the operation data specifically includes a ratio of the number of the first threads, which are not loaded with services, in the thread pool 311, and the configuration central processor 312 may be further specifically configured to: in response to the number ratio being less than a first set threshold, a first set number of new threads are added to the thread pool 311.
In some embodiments, the configuration central processor 312 may be further configured to: releasing a second set number of new threads in the thread pool 311 in response to the number ratio being greater than a second set threshold; wherein the second set threshold is greater than the first set threshold.
In some embodiments, the configuration central processor 312 may be further configured to: acquiring the maximum thread accommodating number of the thread pool 311; and sending alarm information to the operation and maintenance management terminal 313 in response to the fact that the sum of the first set number and the number of the second threads loaded with the services in the thread pool 311 is greater than the maximum thread accommodating number.
In some embodiments, the configuration central processor 312 may be further configured to: in response to the sum of the first set number and the second thread number being greater than the maximum thread accommodating number, triggering a first rejection policy of the thread pool 311, so that the thread pool 311 adds a third set number of services to the set queue; wherein the third set number is equal to or greater than the first set number.
In some embodiments, the configuration center processor 312 may be further configured to: and in response to the number ratio being smaller than the third set threshold, triggering a second rejection policy of the thread pool 311, so that the thread pool 311 rejects loading the new service within the first set time length.
In some embodiments, the operation data further includes a task execution duration of each type of service loaded into the thread pool 311, and the configuration central processor 312 is further configured to: and in response to the fact that the execution time of the task is longer than a fourth set threshold value, adding part of the service loaded into the thread pool 311 into the set queue.
In some embodiments, the configuration central processor 312 may be further configured to: and sending alarm information to the operation and maintenance management terminal 313 in response to the fact that the task execution time length is greater than a fifth set threshold, wherein the fifth set threshold is greater than a fourth set threshold.
In some embodiments, the operation data specifically further includes a service rejection count of the thread pool 311 in a second set time duration, and the configuration central processor 312 may be further specifically configured to: in response to the number of service rejections being greater than the sixth set threshold, a fourth set number of new threads are added to the thread pool 311.
Referring to fig. 4, fig. 4 is a schematic diagram of a framework of an embodiment of an intelligent terminal according to the present application. The intelligent terminal 41 includes a memory 411 and a processor 412 coupled to each other, and the processor 412 is configured to execute program instructions stored in the memory 411 to implement the steps of any one of the embodiments of the thread pool management method described above.
In one specific implementation scenario, the intelligent terminal 41 may include, but is not limited to: any reasonable intelligent terminal such as a computer, a tablet computer, a smart phone and a smart watch is not limited in the application.
In particular, the processor 412 is configured to control itself and the memory 411 to implement the steps of any of the above-described embodiments of the video display method. Processor 412 may also be referred to as a CPU (Central Processing Unit). The processor 412 may be an integrated circuit chip having signal processing capabilities. The Processor 412 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Additionally, the processor 412 may be commonly implemented by integrated circuit chips.
Referring to fig. 5, fig. 5 is a block diagram illustrating an embodiment of a computer readable storage medium according to the present invention. The computer readable storage medium 51 stores program instructions 511 that can be executed by the processor, the program instructions 511 being for implementing the steps of any of the embodiments of the thread pool management method described above.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is only one type of logical division, and other divisions may be implemented in practice, for example, the unit or component may be combined or integrated with another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a network unit. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (12)

1. A management method for a thread pool is characterized in that the management method comprises the following steps:
acquiring current operating data of the thread pool;
responding to the fact that the running data do not meet preset conditions, and adjusting running parameters of the thread pool according to the running data;
and sending the operation data to an operation and maintenance management terminal so that the operation and maintenance management terminal generates and displays a corresponding statistical analysis chart based on the operation data.
2. The management method according to claim 1, wherein the operation data includes a ratio of a number of first threads in the thread pool, which are not loaded with the service, to the number of first threads in the thread pool, and the step of adjusting the operation parameters of the thread pool according to the operation data in response to the operation data not satisfying a preset condition includes:
in response to the number ratio being less than a first set threshold, adding a first set number of new threads in the thread pool.
3. The management method according to claim 2, wherein the management method further comprises:
releasing a second set number of the first threads in the thread pool in response to the number ratio being greater than a second set threshold; wherein the second set threshold is greater than the first set threshold.
4. The management method according to claim 2, wherein the management method further comprises:
acquiring the maximum thread accommodating number of the thread pool;
and sending alarm information to the operation and maintenance management terminal in response to the fact that the sum of the first set number and the number of the second threads loaded with the services in the thread pool is larger than the maximum thread accommodating number.
5. The management method according to claim 4, wherein the management method further comprises:
in response to the sum of the first set number and the second thread number being greater than the maximum thread accommodating number, triggering a first rejection policy of the thread pool, so that the thread pool adds a third set number of services to a set queue; wherein the third set number is equal to or greater than the first set number.
6. The management method according to claim 2, wherein the management method further comprises:
and triggering a second rejection strategy of the thread pool in response to the number ratio being smaller than a third set threshold value, so that the thread pool rejects to load new services within a first set time length.
7. The management method according to claim 1, wherein the operation data includes a task execution duration of each type of service loaded into the thread pool, and the step of adjusting the operation parameters of the thread pool according to the operation data in response to the operation data not satisfying a preset condition comprises:
and responding to the fact that the task execution time length is larger than a fourth set threshold value, and adding part of the services loaded into the thread pool into a set queue.
8. The management method according to claim 7, further comprising:
and sending alarm information to the operation and maintenance management terminal in response to the fact that the task execution duration is larger than a fifth set threshold, wherein the fifth set threshold is larger than the fourth set threshold.
9. The method according to claim 1, wherein the operation data includes a service rejection number of the thread pool within a second set time period, and the step of adjusting the operation parameters of the thread pool according to the operation data in response to the operation data not satisfying a preset condition includes:
and responding to the fact that the service rejection number is larger than a sixth set threshold value, and adding new threads with a fourth set number into the thread pool.
10. A thread pool management system, the thread pool management system comprising:
the thread pool is used for loading at least one service;
the configuration central processor is used for acquiring the current operation data of the thread pool so as to adjust the operation parameters of the thread pool according to the operation data when the operation data does not meet the preset conditions;
and the operation and maintenance management terminal receives the operation data sent by the configuration center processor, and generates and displays a corresponding statistical analysis chart based on the operation data.
11. An intelligent terminal, characterized in that the intelligent terminal comprises a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the management method according to any one of claims 1 to 9.
12. A computer-readable storage medium having stored thereon program instructions, which, when executed by a processor, implement the management method of any one of claims 1-9.
CN202210890037.0A 2022-07-25 2022-07-25 Thread pool management method and system, intelligent terminal and storage medium Pending CN115292012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210890037.0A CN115292012A (en) 2022-07-25 2022-07-25 Thread pool management method and system, intelligent terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210890037.0A CN115292012A (en) 2022-07-25 2022-07-25 Thread pool management method and system, intelligent terminal and storage medium

Publications (1)

Publication Number Publication Date
CN115292012A true CN115292012A (en) 2022-11-04

Family

ID=83824743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210890037.0A Pending CN115292012A (en) 2022-07-25 2022-07-25 Thread pool management method and system, intelligent terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115292012A (en)

Similar Documents

Publication Publication Date Title
KR101551611B1 (en) Method for preemptively restarting software in a multisubsystem mobile communication device to increase mean time between failures
US20120144392A1 (en) Resource Manager for Managing Hardware Resources
CN111427675B (en) Data processing method and device and computer readable storage medium
CN111209110B (en) Task scheduling management method, system and storage medium for realizing load balancing
CN112486642B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
CN111343275B (en) Resource scheduling method and system
CN109800261A (en) Dynamic control method, device and the relevant device of double data library connection pool
US20040133680A1 (en) System and method for processing hardware or service usage data
WO2022095862A1 (en) Thread priority adjusting method, terminal, and computer readable storage medium
CN116560834A (en) Method and device for built-in monitoring alarm of dynamic thread pool
EP3916554A1 (en) A throughput-optimized, quality-of-service aware power capping system
CN115964153A (en) Asynchronous task processing method, device, equipment and storage medium
CN114461385A (en) Thread pool scheduling method, device and equipment and readable storage medium
CN111538585A (en) Js-based server process scheduling method, system and device
CN113590285A (en) Method, system and equipment for dynamically setting thread pool parameters
CN115292012A (en) Thread pool management method and system, intelligent terminal and storage medium
CN111309494A (en) Multithreading event processing assembly
CN116643858A (en) Service priority pod-based rescheduling method, device, equipment and medium
US20230273833A1 (en) Resource scheduling method, electronic device, and storage medium
US11966273B2 (en) Throughput-optimized, quality-of-service aware power capping system
CN117492988A (en) Task execution method, device, electronic equipment and storage medium
CN116301986A (en) Dynamic upgrading method for container application based on controller mode
CN117251269A (en) Jenkins resource management method, device, equipment and storage medium
CN114416318A (en) Task scheduling method, device and medium
CN117707758A (en) Thread pool dynamic self-adaptive adjustment method, system, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination