Methods, devices, and equipment for adjusting the number of allocated connections in a network element connection pool
By uniformly adjusting the number of connections allocated to the network element connection pool through the management module, the problem of long connection adjustment latency in the network element connection pool is solved, and the adjustment efficiency and communication efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the connection adjustment of network element connection pools involves a large number of interactions, resulting in long connection adjustment delays and low efficiency.
The management module obtains the current allocated connection count and limit connection count of multiple network element connection pools, updates the allocated connection count based on the limit connection count, and ensures that the total allocated connection count after the update is less than or equal to the limit connection count, thereby achieving unified adjustment of the network element connection pools.
It improves the efficiency of adjusting the number of connections allocated in the network element connection pool, reduces the connection adjustment latency, and improves communication efficiency.
Smart Images

Figure CN116800809B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for adjusting the number of allocated connections in a network element connection pool. Background Technology
[0002] Communication is the exchange and transmission of information between people through some medium. A network is a data link that connects isolated workstations or hosts together using physical links. A communication network refers to a link that physically connects isolated devices to enable information exchange between people, between people and computers, and between computers, thereby achieving the purpose of resource sharing and communication.
[0003] Modern communication networks are systems organically built by specialized organizations using communication equipment (hardware) and related operating procedures (software). They encompass a range of communication services provided to individuals, businesses, and society. A network element is an element within the network; network devices are the smallest units that can be monitored and managed in network management.
[0004] In conventional network element communication methods, network elements need to repeatedly create communication connections. A network element connection pool is used to store a certain number of network element connections. Therefore, the application of a network element connection pool avoids recreating connections during communication, thus improving efficiency. Multiple network element connection pools can be established for the same network element. However, in existing technologies, adjusting connections across multiple network element connection pools involves a large number of interactions, resulting in long connection adjustment delays and low efficiency. Summary of the Invention
[0005] Based on this, it is necessary to provide a method, apparatus, computer equipment, storage medium, and computer program product for adjusting the number of allocated connections in a network element connection pool, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a method for adjusting the number of allocated connections in a network element connection pool, applied to a management module connected to multiple network element connection pools. The method includes:
[0007] Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element;
[0008] If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for the target network element in each target network element connection pool;
[0009] Based on the limit number of connections, the current allocated connection counts are updated to obtain the updated allocated connection counts for each target network element connection pool for the target network element. The updated allocated connection counts are then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust its allocated connection count to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit number of connections.
[0010] In one embodiment, the plurality of target network element connection pools include a new connection pool and an existing connection pool; the connection allocation adjustment condition includes receiving a new request for the new connection pool and meeting the condition for adding the new connection pool; the step of obtaining the current allocated connection number for the target network element in each target network element connection pool when the target network element meets the connection allocation adjustment condition includes: obtaining the first maximum connection number of the new connection pool and obtaining the current allocated connection number of the existing connection pool when a new request for the new connection pool is received and the condition for adding the new connection pool is met.
[0011] In one embodiment, updating the current allocated connection count according to the limited connection count to obtain the updated allocated connection count for each target network element connection pool for the target network element, and sending the updated allocated connection count to the corresponding target network element connection pool, includes: obtaining the sum of the current allocated connection counts for the target network element; determining a first candidate connection pool for adjusting the allocated connection count in the existing connection pool based on the first maximum connection count, the current allocated connection count of the existing connection pool, and the sum of the current allocated connection counts, and updating the current allocated connection count of the first candidate connection pool to obtain the updated allocated connection count for the target network element connection pool. A candidate connection pool updates the number of allocated connections for the target network element; the updated number of allocated connections is sent to the first candidate connection pool; the first candidate connection pool adjusts its number of allocated connections to the updated number of allocated connections, and obtains the number of network element connections to be released based on the updated number of allocated connections; the number of network element connections to be released is sent to the new connection pool; the new connection pool establishes new network element connections that satisfy the number of network element connections to be released; and the updated allocation connection information for the target network element is obtained from the new connection pool for each target network element connection pool.
[0012] In one embodiment, before obtaining the current number of allocated connections for the target network element in each target network element connection pool when the target network element meets the conditions for adjusting the number of allocated connections, the method further includes: upon receiving a new request for the new connection pool, obtaining resource information of the target network element and obtaining the resource requirement for adding the new connection pool; if the resource amount contained in the resource information is greater than the resource requirement, determining that the target network element meets the conditions for adding the new connection pool, preparing the network element environment for adding the new connection pool, and creating the new connection pool; if the resource amount contained in the resource information is less than or equal to the resource requirement, determining that the target network element does not meet the conditions for adding the new connection pool, and determining that the new request is not approved.
[0013] In one embodiment, the condition for adjusting the number of allocated connections includes the existence of an abnormal connection pool among the plurality of target network element connection pools; the plurality of target network element connection pools include the abnormal connection pool and the normal connection pool; the step of updating the current allocated connection number according to the limited connection number to obtain the updated allocated connection number for each target network element connection pool for the target network element, and sending the updated allocated connection number to the corresponding target network element connection pool, includes: obtaining the second maximum connection number of the normal connection pool, and obtaining the sum of the current allocated connection numbers for the target network element; determining the connection pool to be adjusted in the normal connection pool according to the limited connection number, the sum of the current allocated connection numbers, the current allocated connection number of the abnormal connection pool, and the second maximum connection number. A second candidate connection pool is allocated a number of connections, and the current number of allocated connections in the second candidate connection pool is updated to obtain the updated number of allocated connections for the target network element. The updated number of allocated connections is sent to the second candidate connection pool. The second candidate connection pool is used to adjust its number of allocated connections to the updated number of allocated connections. Based on the updated number of allocated connections, the number of new network element connections in the second candidate connection pool is obtained. The number of new network element connections and the updated allocation connection information for the target network element in each target network element connection pool are returned to the management module. The updated allocation connection information for the target network element in each target network element connection pool is obtained from the second candidate connection pool.
[0014] Secondly, this application provides a method for adjusting the number of allocated connections in a network element connection pool, applied to a target network element connection pool associated with a target network element and connected to a management module. The method includes:
[0015] The management module receives the updated allocated connection count for the target network element from the management module. The management module, when the target network element meets the allocated connection count adjustment conditions, obtains the current allocated connection count for the target network element from each target network element connection pool, and obtains the limited connection count for the target network element. Based on the limited connection count, it updates the current allocated connection count of the target network element connection pool to obtain the updated allocated connection count for the target network element. The updated allocated connection count is then sent to the target network element connection pool so that the sum of the updated allocated connection counts for the target network element from each target network element connection pool is less than or equal to the limited connection count for the target network element.
[0016] The current number of allocated connections for the target network element is adjusted to the updated number of allocated connections.
[0017] In one embodiment, the condition for adjusting the number of allocated connections includes receiving a new request for a new connection pool and meeting the condition for adding the new connection pool; adjusting the current number of allocated connections of the target network element to the updated number of allocated connections includes: determining the network element connections to be released associated with the target network element based on the updated number of allocated connections; releasing the network element connections to be released so that the number of allocated connections in the target network element connection pool is the updated number of allocated connections; sending the number of connections to be released to the new connection pool; the new connection pool is used to establish new network element connections that meet the number of connections to be released, and returns the number of allocated connections in the new connection pool and the updated allocated connection information of each target network element connection pool for the target network element to the management module.
[0018] In one embodiment, the condition for adjusting the number of allocated connections includes the existence of abnormal connection pools among multiple target network element connection pools; the multiple target network element connection pools include the abnormal connection pools and normal connection pools; adjusting the current number of allocated connections for the target network element to the updated number of allocated connections includes: determining new network element connections associated with the target network element based on the updated number of allocated connections; adding the new network element connections so that the number of allocated connections in the target network element connection pool is the updated number of allocated connections; and returning the number of connections of the new network element connections and the updated allocated connection information for the target network element in each target network element connection pool to the management module.
[0019] Thirdly, this application provides a device for adjusting the number of allocated connections in a network element connection pool, applied to a management module connected to multiple network element connection pools. The device includes:
[0020] The acquisition module is used to acquire the multiple target network element connection pools associated with the target network element, as well as the limit number of connections of the target network element;
[0021] The processing module is used to obtain the current number of connections allocated to the target network element by each target network element connection pool when the target network element meets the conditions for adjusting the number of allocated connections;
[0022] The update module is used to update the current allocated connection count according to the limit connection count, to obtain the updated allocated connection count for the target network element in each target network element connection pool, and to send the updated allocated connection count to the corresponding target network element connection pool; the target network element connection pool is used to adjust the allocated connection count of the target network element connection pool to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit connection count.
[0023] Fourthly, this application provides a device for adjusting the number of allocated connections in a network element connection pool, applied to a target network element connection pool associated with a target network element and connected to a management module. The device includes:
[0024] The receiving module is configured to receive the updated allocated connection count for the target network element from the management module; the management module is configured to, when the target network element meets the allocated connection count adjustment conditions, obtain the current allocated connection count for the target network element in each target network element connection pool, and obtain the limited connection count for the target network element, and update the current allocated connection count of the target network element connection pool according to the limited connection count to obtain the updated allocated connection count for the target network element in each target network element connection pool; and send the updated allocated connection count to the target network element connection pool so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limited connection count for the target network element.
[0025] The adjustment module is used to adjust the current number of allocated connections of the target network element to the updated number of allocated connections.
[0026] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0027] Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element;
[0028] If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for the target network element in each target network element connection pool;
[0029] Based on the limit number of connections, the current allocated connection counts are updated to obtain the updated allocated connection counts for each target network element connection pool for the target network element. The updated allocated connection counts are then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust its allocated connection count to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit number of connections.
[0030] And / or, receive the updated allocated connection count for the target network element from the management module; the management module is configured to, when the target network element meets the allocated connection count adjustment conditions, obtain the current allocated connection count for the target network element in each target network element connection pool, and obtain the limited connection count for the target network element, and update the current allocated connection count of the target network element connection pool according to the limited connection count to obtain the updated allocated connection count for the target network element in the target network element connection pool; send the updated allocated connection count to the target network element connection pool, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limited connection count for the target network element;
[0031] The current number of allocated connections for the target network element is adjusted to the updated number of allocated connections.
[0032] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0033] Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element;
[0034] If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for the target network element in each target network element connection pool;
[0035] Based on the limit number of connections, the current allocated connection counts are updated to obtain the updated allocated connection counts for each target network element connection pool for the target network element. The updated allocated connection counts are then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust its allocated connection count to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit number of connections.
[0036] And / or, receive the updated allocated connection count for the target network element from the management module; the management module is configured to, when the target network element meets the allocated connection count adjustment conditions, obtain the current allocated connection count for the target network element in each target network element connection pool, and obtain the limited connection count for the target network element, and update the current allocated connection count of the target network element connection pool according to the limited connection count to obtain the updated allocated connection count for the target network element in the target network element connection pool; send the updated allocated connection count to the target network element connection pool, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limited connection count for the target network element;
[0037] The current number of allocated connections for the target network element is adjusted to the updated number of allocated connections.
[0038] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0039] Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element;
[0040] If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for the target network element in each target network element connection pool;
[0041] Based on the limit number of connections, the current allocated connection counts are updated to obtain the updated allocated connection counts for each target network element connection pool for the target network element. The updated allocated connection counts are then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust its allocated connection count to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit number of connections.
[0042] And / or, receive the updated allocated connection count for the target network element from the management module; the management module is configured to, when the target network element meets the allocated connection count adjustment conditions, obtain the current allocated connection count for the target network element in each target network element connection pool, and obtain the limited connection count for the target network element, and update the current allocated connection count of the target network element connection pool according to the limited connection count to obtain the updated allocated connection count for the target network element in the target network element connection pool; send the updated allocated connection count to the target network element connection pool, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limited connection count for the target network element;
[0043] The current number of allocated connections for the target network element is adjusted to the updated number of allocated connections.
[0044] In the aforementioned method, apparatus, computer device, storage medium, and computer program product for adjusting the number of allocated connections in a network element connection pool, the management module can associate multiple network element connection pools, wherein the one associated with the target network element is the target network element connection pool. First, the multiple target network element connection pools and the limit number of connections for the target network element can be obtained. Then, if the target network element meets the conditions for adjusting the number of allocated connections, the current number of allocated connections for the target network element in each target network element connection pool can be obtained. Therefore, based on the limit number of connections, the current number of allocated connections can be adjusted and updated to obtain the updated number of allocated connections for the target network element in each target network element connection pool. The updated number of allocated connections is then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust its number of allocated connections to the updated number of allocated connections, so that the sum of the updated number of allocated connections for the target network element in each target network element connection pool is less than or equal to the limit number of connections. In the method provided in this application embodiment, a management module can be introduced to uniformly adjust the number of allocated connections for the target network element. When the target network element meets the conditions for adjusting the number of allocated connections, the management module can reallocate and adjust the number of allocated connections for the target network element according to the current number of allocated connections and the limited number of connections for the target network element in each target network element connection pool. This can improve the efficiency of adjusting the number of allocated connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency. Attached Figure Description
[0045] Figure 1 An application environment diagram of a method for adjusting the number of allocated connections in a network element connection pool, provided in one embodiment;
[0046] Figure 2 A flowchart illustrating a method for adjusting the number of allocated connections in a network element connection pool, provided in one embodiment;
[0047] Figure 3 A flowchart illustrating a method for adjusting the number of allocated connections in a network element connection pool, provided in another embodiment;
[0048] Figure 4 A flowchart illustrating a method for adjusting the number of allocated connections in a network element connection pool, as provided in yet another embodiment;
[0049] Figure 5 A schematic diagram of the structure of a network element connection pool allocation and connection number adjustment device provided in one embodiment;
[0050] Figure 6 A schematic diagram of the structure of the network element connection pool allocation connection number adjustment device provided in yet another embodiment;
[0051] Figure 7 An internal structural diagram of a computer device provided for one embodiment. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0053] The method for adjusting the number of allocated connections in the network element connection pool provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown illustrates this. The management module connects to multiple network element connection pools and can communicate with them via the network. The connection pools can also communicate with each other; the connection pool associated with the target network element is the target network element connection pool. The data storage system stores the data that the management module needs to process. The data storage system can be integrated into the management module or located in the cloud or on other network servers.
[0054] The management module first obtains the multiple target network element connection pools and the limit number of connections for each target network element. Then, if the target network element meets the conditions for adjusting the number of allocated connections, it obtains the current number of allocated connections for each target network element connection pool. Based on the limit number of connections, it adjusts and updates the current number of allocated connections to each target network element connection pool, resulting in an updated number of allocated connections for each target network element connection pool. This ensures that the sum of the updated number of allocated connections for each target network element connection pool is less than or equal to the limit number of connections. Finally, the updated number of allocated connections is sent to the corresponding target network element connection pool.
[0055] The target network element connection pool can receive the updated allocated connection count for the target network element from the management module; and adjust the current allocated connection count of the target network element to the updated allocated connection count.
[0056] In one embodiment, such as Figure 2 As shown, a method for adjusting the number of allocated connections in a network element connection pool is provided. This embodiment illustrates the application of this method to a management module connected to multiple network element connection pools.
[0057] Step S201: Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element.
[0058] A network element consists of one or more chassis or boards, capable of independently performing certain transmission functions. A network element can be a network component or device, and is the smallest unit that can be monitored and managed in network management. The management module can be a module of the network element management system. This module can connect to multiple network element connection pools, each corresponding to a different network element. One network element can correspond to multiple connection pools. In typical network element communication methods, network elements need to repeatedly create communication connections; therefore, connection pools can be set up to store a certain number of network element connections. The management system can manage multiple network elements, with the target network element being any one of these multiple network elements. This target network element can correspond to multiple target network element connection pools, which are used to store the network element connections of the target network element. Each target network element connection pool has a maximum number of connections, i.e., an upper limit on the number of network element connections it can store. The target network element also has a limit on the number of connections it can establish, which is the upper limit on the number of network element connections that the target network element can establish.
[0059] Step S202: If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for each target network element connection pool for the target network element.
[0060] The connection allocation adjustment condition can be a pre-set condition for readjusting the number of connections allocated to each target network element connection pool for that target network element. In some possible implementations, this connection allocation adjustment condition may include a connection pool adjustment condition, which may include a change in the number of multiple target network element connection pools while maintaining the total current number of connections allocated to the target network element from each connection pool. Specifically, when the target network element meets the connection pool adjustment condition, a target connection pool and other connection pools can be determined from among the multiple target network element connection pools; the target connection pool is a newly added or abnormal connection pool included in the connection pool adjustment condition; the other connection pools are connection pools other than the target connection pool from among the multiple target network element connection pools; the connection information corresponding to the target connection pool is obtained, as well as the current number of connections allocated to the other connection pools; the total current number of connections allocated to the target network element from each connection pool is obtained; and the current number of connections allocated to the other connection pools is adjusted based on the connection limit, the total current number of connections allocated, and the connection information. In some other possible implementations, the condition for adjusting the number of allocated connections may also include that the number of multiple target network element connection pools remains unchanged, and the total number of currently allocated connections for the target network element in each target network element connection pool remains unchanged. In this case, the number of allocated connections for each target network element connection pool can be adjusted based on the total number of currently allocated connections for the target network element in each target network element connection pool. In yet another possible implementation, the condition for adjusting the number of allocated connections may also include that the number of multiple target network element connection pools remains unchanged. In this case, the total number of currently allocated connections for the target network element in each target network element connection pool may change, and the number of allocated connections for each target network element connection pool can be adjusted based on adding or reducing the number of allocated connections. The current number of allocated connections for the target network element in each target network element connection pool may be the number of network element connections for the target network element stored in each target network element connection pool within the current time period.
[0061] Step S203: Update the current number of connections according to the limit number of connections to obtain the updated number of connections allocated to each target network element connection pool for the target network element, and send the updated number of connections allocated to the corresponding target network element connection pool.
[0062] Next, the target network element connection pool can adjust its allocated connection count to the updated allocated connection count, ensuring that the total updated allocated connection count for the target network element from all target network element connection pools is less than or equal to the limit connection count. The management module can determine candidate connection pools from among multiple target network element connection pools for which the allocated connection count needs adjustment, based on the limit connection count for the target network element and the maximum connection count of each target network element connection pool. Based on the number of newly added or released connections and the maximum connection count of the candidate connection pool, the allocated connection count of the candidate connection pool is readjusted to obtain the updated allocated connection count for that candidate connection pool. This updated allocated connection count is then sent to the candidate connection pool. The candidate connection pool can then obtain the number of released or added connections based on the updated allocated connection count and perform the release or addition of connections that meet the required number. Finally, the newly added network element connection count and the updated allocated connection information for the target network element from each target network element connection pool can be returned to the management module.
[0063] In this embodiment, the management module can associate multiple network element connection pools, where the one associated with the target network element is the target network element connection pool. First, the multiple target network element connection pools and the limit number of connections for the target network element can be obtained. If the target network element meets the conditions for adjusting the number of allocated connections, the current number of allocated connections for the target network element in each target network element connection pool can be obtained. Then, based on the limit number of connections, the current number of allocated connections can be adjusted and updated to obtain the updated number of allocated connections for the target network element in each target network element connection pool. The updated number of allocated connections is then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust the number of allocated connections in the target network element connection pool to the updated number of allocated connections, so that the sum of the updated number of allocated connections for the target network element in each target network element connection pool is less than or equal to the limit number of connections. In the method provided in this application embodiment, a management module can be introduced to uniformly adjust the number of allocated connections for the target network element. When the target network element meets the conditions for adjusting the number of allocated connections, the management module can reallocate and adjust the number of allocated connections for the target network element according to the current number of allocated connections and the limited number of connections for the target network element in each target network element connection pool. This can improve the efficiency of adjusting the number of allocated connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency.
[0064] In some embodiments, step S202 may include:
[0065] If a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the first maximum number of connections for the new connection pool is obtained, and the current number of allocated connections for the existing connection pool is obtained.
[0066] Among them, the multiple target network element connection pools include new connection pools and existing connection pools; the conditions for adjusting the number of allocated connections include receiving a new request for a new connection pool and meeting the conditions for adding the new connection pool.
[0067] Specifically, upon receiving a request from the network element management system to add a new connection pool, it can be further determined whether the target network element meets the conditions for adding the new connection pool. In some possible implementations, determining whether the target network element meets the conditions for adding the new connection pool may include: upon receiving a request to add a new connection pool, obtaining the resource information of the target network element and the resource requirement for adding the new connection pool; if the resource amount contained in the resource information is greater than the resource requirement, determining that the target network element meets the conditions for adding the new connection pool, preparing the network element environment for adding the new connection pool, and creating the new connection pool; if the resource amount contained in the resource information is less than or equal to the resource requirement, determining that the target network element does not meet the conditions for adding the new connection pool, and determining that the request to add the new connection pool is rejected. Based on the above judgments, when a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the first maximum number of connections for the new connection pool and the current number of connections allocated to the existing connection pool are obtained. The first maximum number of connections may be the upper limit of the number of network element connections that the new connection pool can allocate to store the target network element. The current number of connections allocated may be the number of network element connections of the target network element stored in the existing connection pool in the current time period.
[0068] In some embodiments, step S203 may include:
[0069] Obtain the total number of currently allocated connections for the target network element; determine the first candidate connection pool for adjusting the number of connections in the existing connection pool, and update the current allocated connection number of the first candidate connection pool to obtain the updated allocated connection number for the target network element in the first candidate connection pool; send the updated allocated connection number to the first candidate connection pool; the first candidate connection pool is used to adjust the allocated connection number of the first candidate connection pool to the updated allocated connection number, and obtain the number of network element connections to be released in the first candidate connection pool based on the updated allocated connection number; and send the number of network element connections to be released to the new connection pool; the new connection pool is used to establish new network element connections that meet the number of network element connections to be released; obtain the updated allocated connection information for the target network element from each target network element connection pool in the new connection pool.
[0070] The management module can combine the first maximum number of connections in the newly added connection pool, the total number of currently allocated connections for the target network element in each target network element connection pool, and the limit number of connections for the target network element. It then determines a first candidate connection pool from the existing connection pools to adjust the number of connections to be adjusted, and identifies the connections to be released in the first candidate connection pool. Based on the number of connections to be released, the updated allocated connections for the target network element in the first candidate connection pool are determined, and the updated allocated connection count is sent to the first candidate connection pool. Upon receiving the updated allocated connection count from the management module, the first candidate connection pool can release the connections to be released and send the number of connections to be released to the newly added connection pool. The newly added connection pool can establish new network element connections that meet the number of network element connections to be released, and return the updated allocated connection information for the target network element from each target network element connection pool to the management module. The management module obtains the updated allocated connection information for the target network element from each target network element connection pool in the newly added connection pool.
[0071] In this embodiment, when a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the management module can determine a first candidate connection pool for adjusting the number of connections in the existing connection pools based on the first maximum number of connections, the current allocated number of connections in the existing connection pools, and the sum of the current allocated number of connections. The module then updates the current allocated number of connections in the first candidate connection pool to obtain the updated allocated number of connections for the target network element. The updated allocated number of connections is sent to the first candidate connection pool to uniformly adjust the allocated number of connections in the new connection pool and the existing connection pools. This can improve the efficiency of adjusting the allocated number of connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency.
[0072] In some embodiments, step S203 may include:
[0073] The system retrieves the second maximum number of connections in the normal connection pool and the total number of currently allocated connections for the target network element. Based on the limited number of connections, the total number of currently allocated connections, the current number of allocated connections in the abnormal connection pool, and the second maximum number of connections, it determines a second candidate connection pool in the normal connection pool whose allocated connection number needs to be adjusted, and updates the current number of allocated connections in the second candidate connection pool to obtain the updated number of allocated connections for the target network element. The updated number of allocated connections is sent to the second candidate connection pool. The second candidate connection pool is used to adjust its allocated connection number to the updated number of allocated connections. Based on the updated number of allocated connections, the system retrieves the number of new network element connections in the second candidate connection pool. The system returns the number of new network element connections and the updated allocated connection information for each target network element connection pool to the management module. Finally, the system retrieves the updated allocated connection information for each target network element connection pool from the second candidate connection pool.
[0074] Among them, the conditions for adjusting the number of allocated connections include the existence of abnormal connection pools in multiple target network element connection pools; the multiple target network element connection pools include abnormal connection pools and normal connection pools.
[0075] When abnormal connection pools exist among multiple target network element connection pools, the allocated connections of the abnormal connection pools need to be redistributed to the normal connection pools. This situation corresponds to a change in the number of multiple target network element connection pools in the connection pool adjustment conditions, while the total number of currently allocated connections for the target network element in each target network element connection pool remains unchanged. In this case, the management module can determine a second candidate connection pool for adjusting the allocated connections from the normal connection pools by combining the second maximum number of currently allocated connections in the normal connection pools, and determine the newly added network element connections and the number of newly added network element connections in the second candidate connection pool, thereby determining the updated allocated connection number for the second candidate connection pool; and send the updated allocated connection number of the second candidate connection pool to the second candidate connection pool. After receiving the updated allocated connection number, the second candidate connection pool processes the newly added connections; and returns the number of newly added network element connections and the updated allocated connection information for the target network element in each target network element connection pool to the management module; the management module then obtains the updated allocated connection information for the target network element in each target network element connection pool from the second candidate connection pool.
[0076] In this embodiment, when a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the management module can determine a second candidate connection pool in the normal connection pool based on the second maximum number of connections in the normal connection pool, the current allocated number of connections in the normal connection pool, and the sum of the current allocated number of connections. The module then updates the current allocated number of connections in the second candidate connection pool to obtain the updated allocated number of connections for the target network element. The updated allocated number of connections is then sent to the second candidate connection pool to uniformly adjust the allocated number of connections in the abnormal connection pool and the normal connection pool. This improves the efficiency of adjusting the allocated number of connections for the target network element, and the ability for each target network element connection pool to communicate further enhances the adjustment efficiency.
[0077] In another embodiment, such as Figure 3 As shown, a method for adjusting the number of allocated connections in a network element connection pool is provided. This embodiment illustrates this method by applying it to a target network element connection pool associated with a target network element connected to a management module.
[0078] Step S301: Receive the updated number of allocated connections for the target network element from the management module.
[0079] The management module is used to obtain the current number of allocated connections for the target network element from each target network element connection pool, as well as the limit number of connections for the target network element, when the target network element meets the conditions for adjusting the number of allocated connections. Based on the limit number of connections, the module updates the current number of allocated connections for the target network element connection pool to obtain the updated number of allocated connections for the target network element. The updated number of allocated connections is then sent to the target network element connection pool to ensure that the sum of the updated number of allocated connections for the target network element from each target network element connection pool is less than or equal to the limit number of connections for the target network element.
[0080] Step S302: Adjust the current number of allocated connections of the target network element to the updated number of allocated connections.
[0081] The system can obtain the number of connections to be released or added based on the updated number of allocated connections, and release or add connections that meet the required number of connections to be released or added. Then, it can return the number of new network element connections and the updated allocation connection information of each target network element connection pool to the management module.
[0082] In this embodiment, the management module can associate multiple network element connection pools, where the one associated with the target network element is the target network element connection pool. First, the multiple target network element connection pools and the limit number of connections for the target network element can be obtained. If the target network element meets the conditions for adjusting the number of allocated connections, the current number of allocated connections for the target network element in each target network element connection pool can be obtained. Then, based on the limit number of connections, the current number of allocated connections can be adjusted and updated to obtain the updated number of allocated connections for the target network element in each target network element connection pool. The updated number of allocated connections is then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust the number of allocated connections in the target network element connection pool to the updated number of allocated connections, so that the sum of the updated number of allocated connections for the target network element in each target network element connection pool is less than or equal to the limit number of connections. In the method provided in this application embodiment, a management module can be introduced to uniformly adjust the number of allocated connections for the target network element. When the target network element meets the conditions for adjusting the number of allocated connections, the management module can reallocate and adjust the number of allocated connections for the target network element according to the current number of allocated connections and the limited number of connections for the target network element in each target network element connection pool. This can improve the efficiency of adjusting the number of allocated connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency.
[0083] In one embodiment, step S302 may include:
[0084] Based on the updated allocated connection count, determine the network element connections to be released associated with the target network element; release the network element connections to be released so that the allocated connection count of the target network element is the updated allocated connection count; send the connection count of the network element connections to be released to the new connection pool; the new connection pool is used to establish new network element connections that meet the connection count of the network element connections to be released, and return the allocated connection count of the new connection pool, as well as the updated allocated connection information of each target network element connection pool for the target network element, to the management module.
[0085] In this embodiment, when a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the management module can determine a first candidate connection pool for adjusting the number of connections in the existing connection pools based on the first maximum number of connections, the current allocated number of connections in the existing connection pools, and the sum of the current allocated number of connections. The module then updates the current allocated number of connections in the first candidate connection pool to obtain the updated allocated number of connections for the target network element. The updated allocated number of connections is sent to the first candidate connection pool to uniformly adjust the allocated number of connections in the new connection pool and the existing connection pools. This can improve the efficiency of adjusting the allocated number of connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency.
[0086] In another embodiment, step S302 may further include:
[0087] Based on the updated allocated connection count, determine the new network element connections associated with the target network element; add the new network element connections so that the allocated connection count of the target network element is the updated allocated connection count; return the connection count of the new network element connections and the updated allocated connection information of each target network element connection pool for the target network element to the management module.
[0088] In this embodiment, when a new request for a new connection pool is received and the conditions for adding the new connection pool are met, the management module can determine a second candidate connection pool in the normal connection pool based on the second maximum number of connections in the normal connection pool, the current allocated number of connections in the normal connection pool, and the sum of the current allocated number of connections. The module then updates the current allocated number of connections in the second candidate connection pool to obtain the updated allocated number of connections for the target network element. The updated allocated number of connections is then sent to the second candidate connection pool to uniformly adjust the allocated number of connections in the abnormal connection pool and the normal connection pool. This improves the efficiency of adjusting the allocated number of connections for the target network element, and the ability for each target network element connection pool to communicate further enhances the adjustment efficiency.
[0089] In yet another embodiment, such as Figure 4 As shown, a method for adjusting the number of allocated connections in a network element connection pool is provided, which may include:
[0090] Step S401: Obtain the multiple target network element connection pools associated with the target network element from the multiple network element connection pools, as well as the limit number of connections for the target network element.
[0091] A network element consists of one or more chassis or boards, capable of independently performing certain transmission functions. A network element can be a network component or device, and is the smallest unit that can be monitored and managed in network management. The management module can be a module of the network element management system. This module can connect to multiple network element connection pools, each corresponding to a different network element. One network element can correspond to multiple connection pools. In typical network element communication methods, network elements need to repeatedly create communication connections; therefore, connection pools can be set up to store a certain number of network element connections. The management system can manage multiple network elements, with the target network element being any one of these multiple network elements. This target network element can correspond to multiple target network element connection pools, which are used to store the network element connections of the target network element. Each target network element connection pool has a maximum number of connections, i.e., an upper limit on the number of network element connections it can store. The target network element also has a limit on the number of connections it can establish, which is the upper limit on the number of network element connections that the target network element can establish.
[0092] Step S402: If the target network element meets the conditions for adjusting the number of allocated connections, obtain the current number of allocated connections for each target network element connection pool for the target network element.
[0093] The connection allocation adjustment condition can be a pre-set condition for readjusting the number of connections allocated to each target network element connection pool for that target network element. In some possible implementations, this connection allocation adjustment condition may include a connection pool adjustment condition, which may include a change in the number of multiple target network element connection pools while maintaining the total current number of connections allocated to the target network element from each connection pool. Specifically, when the target network element meets the connection pool adjustment condition, a target connection pool and other connection pools can be determined from among the multiple target network element connection pools; the target connection pool is a newly added or abnormal connection pool included in the connection pool adjustment condition; the other connection pools are connection pools other than the target connection pool from among the multiple target network element connection pools; the connection information corresponding to the target connection pool is obtained, as well as the current number of connections allocated to the other connection pools; the total current number of connections allocated to the target network element from each connection pool is obtained; and the current number of connections allocated to the other connection pools is adjusted based on the connection limit, the total current number of connections allocated, and the connection information. In some other possible implementations, the condition for adjusting the number of allocated connections may also include that the number of multiple target network element connection pools remains unchanged, and the total number of currently allocated connections for the target network element in each target network element connection pool remains unchanged. In this case, the number of allocated connections for each target network element connection pool can be adjusted based on the total number of currently allocated connections for the target network element in each target network element connection pool. In yet another possible implementation, the condition for adjusting the number of allocated connections may also include that the number of multiple target network element connection pools remains unchanged. In this case, the total number of currently allocated connections for the target network element in each target network element connection pool may change, and the number of allocated connections for each target network element connection pool can be adjusted based on adding or reducing the number of allocated connections. The current number of allocated connections for the target network element in each target network element connection pool may be the number of network element connections for the target network element stored in each target network element connection pool within the current time period.
[0094] Step S403: Update the current number of connections according to the limit number of connections to obtain the updated number of connections allocated to each target network element connection pool for the target network element, and send the updated number of connections allocated to the corresponding target network element connection pool.
[0095] Next, the target network element connection pool can adjust its allocated connection count to the updated allocated connection count, ensuring that the total updated allocated connection count for the target network element from all target network element connection pools is less than or equal to the limit connection count. The management module can determine candidate connection pools from among multiple target network element connection pools for which the allocated connection count needs adjustment, based on the limit connection count for the target network element and the maximum connection count of each target network element connection pool. Based on the number of newly added or released connections and the maximum connection count of the candidate connection pool, the allocated connection count of the candidate connection pool is readjusted to obtain the updated allocated connection count for that candidate connection pool. This updated allocated connection count is then sent to the candidate connection pool. The candidate connection pool can then obtain the number of released or added connections based on the updated allocated connection count and perform the release or addition of connections that meet the required number. Finally, the newly added network element connection count and the updated allocated connection information for the target network element from each target network element connection pool can be returned to the management module.
[0096] Step S404: The target network element connection pool receives the updated number of allocated connections for the target network element from the management module.
[0097] Step S405: Adjust the current number of allocated connections of the target network element to the updated number of allocated connections.
[0098] In some possible implementations, the following may be included: determining the network element connections to be released associated with the target network element based on the updated allocated connection count; releasing the network element connections to be released so that the allocated connection count of the target network element is the updated allocated connection count; sending the connection count of the network element connections to be released to the new connection pool; the new connection pool is used to establish new network element connections that meet the connection count of the network element connections to be released, and returning the allocated connection count of the new connection pool, as well as the updated allocated connection information of each target network element connection pool for the target network element, to the management module. In other possible implementations, the following may also be included: determining the new network element connections associated with the target network element based on the updated allocated connection count; adding new network element connections so that the allocated connection count of the target network element is the updated allocated connection count; returning the connection count of the new network element connections, as well as the updated allocated connection information of each target network element connection pool for the target network element, to the management module.
[0099] In this embodiment, the management module can associate multiple network element connection pools, where the one associated with the target network element is the target network element connection pool. First, the multiple target network element connection pools and the limit number of connections for the target network element can be obtained. If the target network element meets the conditions for adjusting the number of allocated connections, the current number of allocated connections for the target network element in each target network element connection pool can be obtained. Then, based on the limit number of connections, the current number of allocated connections can be adjusted and updated to obtain the updated number of allocated connections for the target network element in each target network element connection pool. The updated number of allocated connections is then sent to the corresponding target network element connection pool. The target network element connection pool is used to adjust the number of allocated connections in the target network element connection pool to the updated number of allocated connections, so that the sum of the updated number of allocated connections for the target network element in each target network element connection pool is less than or equal to the limit number of connections. In the method provided in this application embodiment, a management module can be introduced to uniformly adjust the number of allocated connections for the target network element. When the target network element meets the conditions for adjusting the number of allocated connections, the management module can reallocate and adjust the number of allocated connections for the target network element according to the current number of allocated connections and the limited number of connections for the target network element in each target network element connection pool. This can improve the efficiency of adjusting the number of allocated connections for the target network element, and the connection pools of each target network element can communicate with each other, which can further improve the adjustment efficiency.
[0100] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0101] Based on the same inventive concept, this application also provides a device for adjusting the number of allocated connections in a network element connection pool to implement the above-described method for adjusting the number of allocated connections in a network element connection pool. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the device for adjusting the number of allocated connections in a network element connection pool provided below can be found in the limitations of the method for adjusting the number of allocated connections in a network element connection pool described above, and will not be repeated here.
[0102] In one embodiment, such as Figure 5As shown, a device for adjusting the number of allocated connections in a network element connection pool is provided, comprising: an acquisition module 501, a processing module 502, and an update module 503, wherein:
[0103] The acquisition module 501 is used to acquire the multiple target network element connection pools associated with the target network element, and the limit number of connections of the target network element;
[0104] Processing module 502 is used to obtain the current number of connections allocated to the target network element by each target network element connection pool when the target network element meets the conditions for adjusting the number of allocated connections;
[0105] The update module 503 is used to update the current allocated connection count according to the limit connection count, to obtain the updated allocated connection count for the target network element in each target network element connection pool, and to send the updated allocated connection count to the corresponding target network element connection pool; the target network element connection pool is used to adjust the allocated connection count of the target network element connection pool to the updated allocated connection count, so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limit connection count.
[0106] The processing module 502 is further configured to: upon receiving a new request for the new connection pool and meeting the conditions for adding the new connection pool, obtain the first maximum number of connections for the new connection pool and obtain the current number of allocated connections for the existing connection pool.
[0107] The update module 503 is further configured to: obtain the total number of currently allocated connections for the target network element; determine a first candidate connection pool in the existing connection pool whose number of allocated connections needs to be adjusted based on the first maximum number of connections, the current number of allocated connections in the existing connection pool, and the total number of currently allocated connections, and update the current number of allocated connections in the first candidate connection pool to obtain the updated number of allocated connections for the target network element in the first candidate connection pool; send the updated number of allocated connections to the first candidate connection pool; the first candidate connection pool is used to adjust the number of allocated connections in the first candidate connection pool to the updated number of allocated connections, obtain the number of network element connections to be released in the first candidate connection pool based on the updated number of allocated connections; and send the number of released network element connections to the new connection pool; the new connection pool is used to establish new network element connections that meet the number of released network element connections; and obtain the updated allocated connection information for the target network element from the new connection pool for each target network element connection pool.
[0108] The processing module 502 is further configured to: upon receiving a new request for the new connection pool, obtain resource information of the target network element and obtain the resource requirement for adding the new connection pool; if the resource amount contained in the resource information is greater than the resource requirement, determine that the target network element meets the conditions for adding the new connection pool, prepare the network element environment for adding the new connection pool, and create the new connection pool; if the resource amount contained in the resource information is less than or equal to the resource requirement, determine that the target network element does not meet the conditions for adding the new connection pool, and determine that the new request is not approved.
[0109] The update module 503 is further configured to: obtain the second maximum number of connections in the normal connection pool and obtain the total number of currently allocated connections for the target network element; determine a second candidate connection pool in the normal connection pool whose allocated connection number needs to be adjusted based on the limited number of connections, the total number of currently allocated connections, the current number of allocated connections in the abnormal connection pool, and the second maximum number of connections, and update the current number of allocated connections in the second candidate connection pool to obtain the updated number of allocated connections for the target network element in the second candidate connection pool; send the updated number of allocated connections to the second candidate connection pool; the second candidate connection pool is used to adjust the number of allocated connections in the second candidate connection pool to the updated number of allocated connections; obtain the number of new network element connections in the second candidate connection pool based on the updated number of allocated connections; and return the number of new network element connections and the updated allocated connection information of each target network element connection pool for the target network element to the management module; and obtain the updated allocated connection information of each target network element connection pool for the target network element from the second candidate connection pool.
[0110] In another embodiment, such as Figure 6 As shown, a device for adjusting the number of allocated connections in a network element connection pool is provided, comprising: a receiving module 601 and an adjusting module 602, wherein:
[0111] The receiving module 601 is configured to receive the updated allocated connection count for the target network element from the management module; the management module is configured to, when the target network element meets the allocated connection count adjustment conditions, obtain the current allocated connection count for the target network element in each target network element connection pool, and obtain the limited connection count for the target network element, and update the current allocated connection count of the target network element connection pool according to the limited connection count to obtain the updated allocated connection count for the target network element in each target network element connection pool; and send the updated allocated connection count to the target network element connection pool so that the sum of the updated allocated connection counts for the target network element in each target network element connection pool is less than or equal to the limited connection count for the target network element.
[0112] The adjustment module 602 is used to adjust the current number of allocated connections of the target network element to the updated number of allocated connections.
[0113] The adjustment module 602 is further configured to: determine the network element connection to be released associated with the target network element based on the updated allocated connection number; release the network element connection to be released so that the allocated connection number of the target network element connection pool is the updated allocated connection number; send the connection number of the network element connection to be released to the new connection pool; the new connection pool is used to establish a new network element connection that satisfies the connection number of the network element connection to be released, and return the allocated connection number of the new connection pool and the updated allocated connection information of each target network element connection pool for the target network element to the management module.
[0114] The adjustment module 602 is further configured to: determine the newly added network element connection associated with the target network element based on the updated allocated connection number; add the newly added network element connection so that the allocated connection number of the target network element connection pool is the updated allocated connection number; and return the connection number of the newly added network element connection and the updated allocated connection information of each target network element connection pool for the target network element to the management module.
[0115] Each module in the aforementioned network element connection pool allocation and connection number adjustment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independently of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0116] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data related to adjusting the number of allocated connections in the network element connection pool. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for adjusting the number of allocated connections in the network element connection pool.
[0117] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0118] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0119] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0120] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0122] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0123] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0124] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for adjusting the number of allocated connections of a connection pool of a network element, characterized in that The method is applied to a management module connected with a plurality of network element connection pools, and the method comprises the following steps: Obtaining a plurality of target network element connection pools associated with a target network element in the plurality of network element connection pools and a limit connection number of the target network element; In the case that the target network element meets an allocation connection number adjustment condition, obtaining a current allocation connection number of each target network element connection pool for the target network element; the allocation connection number adjustment condition comprises an abnormal connection pool in the plurality of target network element connection pools; the plurality of target network element connection pools comprise the abnormal connection pool and a normal connection pool; Obtaining a second maximum connection number of the normal connection pool and obtaining a current allocation connection number total sum for the target network element; determining a second candidate connection pool of the normal connection pool for the to-be-adjusted allocation connection number according to the limit connection number, the current allocation connection number total sum, a current allocation connection number of the abnormal connection pool and the second maximum connection number, and determining new network element connections and a new network element connection number of the second candidate connection pool according to the new network element connections and the new network element connection number of the second candidate connection pool, and determining an updated allocation connection number of the second candidate connection pool for the target network element; sending the updated allocation connection number to the second candidate connection pool; the second candidate connection pool is used for adjusting the allocation connection number of the second candidate connection pool to the updated allocation connection number, performing new connection processing on the new network element connections, returning the new network element connection number and the updated allocation connection information of each target network element connection pool for the target network element to the management module, and obtaining the updated allocation connection information of each target network element connection pool for the target network element from the second candidate connection pool; the target network element connection pool is used for adjusting the allocation connection number of the target network element connection pool to the updated allocation connection number, so that the updated allocation connection number total sum of each target network element connection pool for the target network element is less than or equal to the limit connection number.
2. The method of claim 1, wherein, Each of the network element connection pools communicates with each other.
3. The method of claim 1, wherein, The limit connection number of the target network element is an upper limit of the number of network element connections that can be established by the target network element.
4. The method of claim 1, wherein, The current allocation connection number of the target network element connection pool for the target network element is the number of network element connections stored in the target network element connection pool for the target network element in a current time period.
5. A method for adjusting the number of allocated connections of a connection pool of a network element, characterized in that The method is applied to a target network element connection pool associated with a target network element connected with a management module, and the method comprises the following steps: receive an updated allocated connection number for the target network element from the management module; the management module is configured to acquire a current allocated connection number of each target network element connection pool for the target network element and acquire a limit connection number of the target network element in a case that the target network element meets an allocated connection number adjustment condition; the allocated connection number adjustment condition comprises an abnormal connection pool existing in a plurality of target network element connection pools associated with the target network element; the plurality of target network element connection pools comprise the abnormal connection pool and a normal connection pool; the management module is configured to acquire a second maximum connection number of the normal connection pool and acquire a current allocated connection number total sum for the target network element; determine a second candidate connection pool of the normal connection pool to be adjusted allocated connection number and determine new network element connections and a new network element connection number of the second candidate connection pool according to the limit connection number, the current allocated connection number total sum, a current allocated connection number of the abnormal connection pool and the second maximum connection number, determine an updated allocated connection number of the second candidate connection pool for the target network element according to the new network element connections and the new network element connection number of the second candidate connection pool, and send the updated allocated connection number to the second candidate connection pool; the second candidate connection pool is configured to adjust the allocated connection number of the second candidate connection pool to the updated allocated connection number, perform new connection processing on the new network element connections, return the new network element connection number and the updated allocated connection information of each target network element connection pool for the target network element to the management module; and the management module is configured to acquire the updated allocated connection information of each target network element connection pool for the target network element from the second candidate connection pool; adjust the allocated connection number of the target network element connection pool to the updated allocated connection number, so that the updated allocated connection number total sum of each target network element connection pool for the target network element is less than or equal to the limit connection number.
6. An apparatus for adjusting the number of allocated connections of a connection pool of a network element, characterized in that The application is applied to a management module connected with a plurality of network element connection pools, and the device comprises: an acquisition module configured to acquire a plurality of target network element connection pools associated with a target network element and a limit connection number of the target network element in the plurality of network element connection pools; a processing module configured to acquire a current allocated connection number of each target network element connection pool for the target network element in a case that the target network element meets an allocated connection number adjustment condition; the allocated connection number adjustment condition comprises an abnormal connection pool existing in the plurality of target network element connection pools; and the plurality of target network element connection pools comprise the abnormal connection pool and a normal connection pool. The updating module is configured to acquire a second maximum connection number of the normal connection pool and acquire a current total allocated connection number for the target network element; determine a second candidate connection pool of the adjusted allocated connection number in the normal connection pool according to the limit connection number, the current total allocated connection number, a current allocated connection number of the abnormal connection pool, and the second maximum connection number, and determine new network element connections and a new network element connection number of the second candidate connection pool; determine an updated allocated connection number of the second candidate connection pool for the target network element according to the new network element connections and the new network element connection number of the second candidate connection pool, and send the updated allocated connection number to the second candidate connection pool; the second candidate connection pool is configured to adjust the allocated connection number of the second candidate connection pool to the updated allocated connection number, and perform new connection processing on the new network element connections; return the new network element connection number and the updated allocated connection information of each target network element connection pool for the target network element to the management module; acquire the updated allocated connection information of each target network element connection pool for the target network element from the second candidate connection pool; and the target network element connection pool is configured to adjust the allocated connection number of the target network element connection pool to the updated allocated connection number, so that a total of the updated allocated connection numbers of each target network element connection pool for the target network element is less than or equal to the limit connection number.
7. A device for adjusting the number of allocated connections of a connection pool of a network element, characterized in that The application is applied to a target network element connection pool connected with a management module, and the device comprises: The receiving module is configured to receive the updated allocated connection number for the target network element from the management module. The management module is configured to acquire the current allocated connection number of each target network element connection pool for the target network element and acquire the limit connection number of the target network element when the target network element meets an allocated connection number adjustment condition. The allocated connection number adjustment condition includes an abnormal connection pool existing in a plurality of target network element connection pools associated with the target network element. The plurality of target network element connection pools include the abnormal connection pool and a normal connection pool. The management module is configured to acquire a second maximum connection number of the normal connection pool and acquire a current allocated connection number total for the target network element. According to the limit connection number, the current allocated connection number total, a current allocated connection number of the abnormal connection pool, and the second maximum connection number, a second candidate connection pool of the normal connection pool to be adjusted is determined, and new network element connections and a new network element connection number of the second candidate connection pool are determined. According to the new network element connections and the new network element connection number of the second candidate connection pool, an updated allocated connection number of the second candidate connection pool for the target network element is determined, and the updated allocated connection number is sent to the second candidate connection pool. The second candidate connection pool is configured to adjust the allocated connection number of the second candidate connection pool to the updated allocated connection number, perform new connection processing on the new network element connections, return the new network element connection number and the updated allocated connection information of each target network element connection pool for the target network element to the management module. The management module is configured to acquire the updated allocated connection information of each target network element connection pool for the target network element from the second candidate connection pool. The adjusting module is configured to adjust the allocated connection number of the target network element connection pool to the updated allocated connection number, so that the updated allocated connection number total of each target network element connection pool for the target network element is less than or equal to the limit connection number. 8.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-7. The processor executes the computer program to implement the steps of the method of any one of claims 1-5.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5. The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.
Citation Information
Patent Citations
Connection method, device and system of multivariate dynamic connection pool
CN112732441A