CN114401204A - Link pool management method and device, computer equipment and storage medium - Google Patents

Link pool management method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114401204A
CN114401204A CN202210040395.2A CN202210040395A CN114401204A CN 114401204 A CN114401204 A CN 114401204A CN 202210040395 A CN202210040395 A CN 202210040395A CN 114401204 A CN114401204 A CN 114401204A
Authority
CN
China
Prior art keywords
link
preset
pool
links
utilization rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210040395.2A
Other languages
Chinese (zh)
Other versions
CN114401204B (en
Inventor
乐伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210040395.2A priority Critical patent/CN114401204B/en
Publication of CN114401204A publication Critical patent/CN114401204A/en
Application granted granted Critical
Publication of CN114401204B publication Critical patent/CN114401204B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms

Abstract

The embodiment of the invention discloses a link pool management method, a device, computer equipment and a storage medium, wherein the method is applied to a server side and comprises the steps of receiving and responding a first link request which is sent by a client side and matched with the link used for detecting activity through the used link at intervals of preset interval time if the fact that the link in a current link pool is used is detected, so as to ensure that the used link is in a connection state; detecting the link utilization rate in the current link pool; judging whether the detected link utilization rate is greater than a first preset value or not; if yes, a preset expansion script is called and operated, so that the capacity of the link pool is expanded, and the corresponding link quantity is increased. The method and the system can ensure the continuous availability of the link, improve the utilization efficiency of the link and the use experience of the user, and can be applied to scenes such as intelligent government affairs and the like, thereby promoting the construction of intelligent cities.

Description

Link pool management method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for managing a link pool, a computer device, and a storage medium.
Background
In the industry, Http policy is a popular Http protocol three-party tool, but there is a great defect in Http policy for connection pool management, for example, when a user requests a long link type from a server through a client, a requested long link is recovered to a corresponding link pool after being used up, so that the user can continue to use the link pool next time, but some long links are actively closed by the server under the condition that the user does not know the long link type. Generally, in the use process of a long link connection, a client and a server are required to be simultaneously maintained, but when the connection number of the server reaches an upper limit or the space connection maintaining time reaches overtime, the server will actively close the long link, so that the client will have a problem when continuously using the long link, that is, in an actual application scenario, if the long link connection needs to be used for uploading or downloading a related task request, an uploading failure or a downloading failure will occur.
Disclosure of Invention
Embodiments of the present invention provide a link pool management method and apparatus, a computer device, and a storage medium, which can ensure continuous availability of links, and improve utilization efficiency of the links and user experience.
In a first aspect, an embodiment of the present invention provides a link pool management method, where the method is applied to a server and includes:
if detecting that a link in the current link pool is used, receiving and responding to a first link request which is sent by a client and matched with the used link at preset intervals, so as to ensure that the used link is in a connection state;
detecting the link utilization rate in the current link pool;
judging whether the detected link utilization rate is greater than a first preset value or not;
if yes, a preset expansion script is called and operated, so that the capacity of the link pool is expanded, and the corresponding link quantity is increased.
In a second aspect, an embodiment of the present invention further provides a link pool management apparatus, where the link pool management apparatus is applied to a server, and the link pool management apparatus includes:
the system comprises a live detecting unit, a link detecting unit and a link detecting unit, wherein the live detecting unit is used for receiving and responding to a first link request which is sent by a client and matched with the first link request for live detection at preset intervals if detecting that a link is used in a current link pool, so as to ensure that the used link is in a connection state;
the detection unit is used for detecting the link utilization rate in the current link pool;
the judging unit is used for judging whether the detected link utilization rate is greater than a first preset value or not;
and the capacity expansion unit is used for calling and running a preset capacity expansion script if the link pool is in the expanded state, so that the capacity of the link pool is expanded and the corresponding link quantity is increased.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides a link pool management method and device, computer equipment and a storage medium. Wherein the method comprises the following steps: if detecting that a link in the current link pool is used, receiving and responding to a first link request which is sent by a client and matched with the used link at preset intervals, so as to ensure that the used link is in a connection state; detecting the link utilization rate in the current link pool; judging whether the detected link utilization rate is greater than a first preset value or not; if yes, a preset expansion script is called and operated, so that the capacity of the link pool is expanded, and the corresponding link quantity is increased. The embodiment of the invention can realize the quick and effective management of the link pool, can ensure the continuous availability of the link, and improves the utilization efficiency of the link and the use experience effect of a user.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a link pool management method according to an embodiment of the present invention;
fig. 1a is a schematic view of an application scenario of a link pool management method according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow diagram of a link pool management method according to an embodiment of the present invention;
fig. 3 is a sub-flow diagram of a link pool management method according to an embodiment of the present invention;
fig. 4 is a sub-flow diagram of a link pool management method according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a link pool management apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a detection unit of a link pool management apparatus according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of an expansion unit of a link pool management apparatus according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a capacity reduction unit of a link pool management apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Referring to fig. 1 and fig. 1a, fig. 1 is a schematic flowchart of a method for managing a link pool according to an embodiment of the present application, and fig. 1a is a schematic view of a scenario of the method for managing the link pool according to the embodiment of the present application. The link pool management method is applied to the server 10. The server 10 can perform communication connection with the client 20, the user sends a link access request through the client 20, so as to call a link in a link pool of the server 10, and the server 10 can return response information according to the request of the client 20; if the server 10 detects that a link in the current link pool is used, receiving a first link request for detecting activity, which is sent by the client 20, through the used link at preset intervals and responding to the first link request, which is sent by the client 20, so as to ensure that the used link is in a connection state; when the link utilization rate in the current link pool is detected, whether the detected link utilization rate is greater than a first preset value or not can be judged, if yes, the server 10 can call and run a preset expansion script, so that the expansion of the link pool is realized, the corresponding link quantity is increased, the quick and effective management of the link pool is effectively realized, and meanwhile, the continuous availability of the link is ensured. The steps of the link pool management method will be described in detail below from the perspective of the server 10.
As shown in fig. 1, in this embodiment, the method for managing a link pool may specifically include steps S101 to S103.
Step S101, if it is detected that a link in the current link pool is used, receiving and responding to a first link request for detecting activity, which is sent by a client and matched with the link, through the used link at preset intervals, so as to ensure that the used link is in a connection state.
In this embodiment, in order to prevent the used link from being recycled by the link pool due to being idle, the server and the client need to maintain the available connection state of the link by setting a corresponding active mechanism. That is, if the server detects that a link in the current link pool is used, at this time, the server may receive and respond to a first link request for detecting activity, which is sent by the client and matched with the first link request, at preset intervals, so as to ensure that the used link is in a connection state; at this time, according to a preset rule, after the link request finally used in the formal mode is sent, the client sends the first link request for detecting activity through the used link at preset intervals, and therefore the link is ensured to be in a used state.
Step S102, detecting the link utilization rate in the current link pool.
In this embodiment, the server can receive a link use request sent by the client to the link pool of the server, so as to call a corresponding link to implement information interaction with the client. Generally, the size of the link pool can be set, and the total number of links in the link pool and the number of used links called can be determined, so that the server can detect the link usage rate in the current link pool.
For example, when the total number of the links in the link pool can be 100, the server may detect the number of used links, and in order to ensure that the use of the links in the link pool is not tight, it may be ensured that at least 20% of the links are in an idle state, so that the current link usage rate needs to be detected.
As shown in FIG. 2, in one embodiment, the step S102 includes steps S201 to S202.
In step S201, a preset link detection thread is called to obtain the total number of links and the number of used links in the link pool.
In this embodiment, the server can call one of the existing threads as a preset link detection thread, so as to obtain the total number of links in the link pool according to the preset link detection thread and obtain the number of used links at the same time. For example, the connection state of each link in the link pool can be acquired at intervals through the link detection thread, so that the number of used connections and the total number of links in the link pool can be updated and determined in time.
In step S202, the ratio of the number of used links to the total number of links is determined as the link utilization rate.
Specifically, the server determines the ratio as the link utilization rate by calculating the ratio of the number of used links to the total number of links, so as to rapidly manage the link pool and ensure the connection of the used links.
Step S103, determining whether the detected link utilization rate is greater than a first preset value.
In this embodiment, the server further needs to determine whether the detected connection usage rate is greater than a first preset threshold. The first preset threshold value can be set according to the actual use requirement of the user.
And step S104, if the detected link utilization rate is greater than a first preset value, calling and running a preset expansion script so as to expand the capacity of the link pool and increase the corresponding link quantity.
In this embodiment, if the detected connection usage rate is greater than the first preset value, it indicates that the load of the link pool is excessive, and the server may call and run a preset expansion script in order to ensure that the used connection can be continuously used and avoid being withdrawn by the server. In this embodiment, the preset capacity expansion script can be set according to the user requirement, so that after the capacity expansion script is run, the capacity expansion of the link pool can be performed, that is, the capacity expansion of the link pool can be performed, so that the corresponding number of links is increased, the situation that the number of idle links in the link pool is too small is avoided, the use experience of a user is improved, the link pool is effectively managed quickly and effectively, and the continuous availability of the links is ensured.
As shown in FIG. 3, in one embodiment, the step S104 includes steps S301-S303.
Step S301, a preset expansion script is called to obtain a corresponding configuration file.
In this embodiment, the preset expansion script may include a configuration file, and the configuration file may record related expansion parameters, so that the server needs to call the corresponding configuration file to expand the link pool.
Step S302, determining the corresponding link quantity according to the capacity increasing parameters preset in the configuration file.
In this embodiment, the server can determine the corresponding number of links according to the capacity increase parameter in the acquired configuration file. For example, when the first preset value is 80%, the link pool may be expanded by 20%. Of course, the first preset value is not limited to 80%, may also be 70%, and more may be 90%, which is not limited in this embodiment.
Step S303, expanding the link pool to increase the determined number of links.
In this embodiment, the server may expand the volume of the link pool, so as to increase the number of links in the link pool, that is, alleviate the connection pressure of the link pool, and improve the user experience.
In a further embodiment, the method may further comprise the steps of:
step S105, if the detected link utilization rate is less than or equal to a first preset value, determining whether the detected link utilization rate is less than a second preset value, wherein the first preset value is greater than the second preset value.
In this embodiment, if the detected link utilization rate is less than or equal to the first preset value, it may be determined again whether the detected link utilization rate is less than the second preset value, so as to perform the distinguishing process. Wherein the first predetermined value is greater than said second predetermined value.
And step S106, if the detected link utilization rate is smaller than a second preset value, calling and running a preset capacity reduction script so as to reduce the capacity of the link pool and reduce the corresponding link quantity.
In this embodiment, if the detected link utilization rate is less than the second preset value, it indicates that the number of idle links in the link pool is sufficient, and at this time, the used link may be closed by the server because the client does not initiate a connection state in time, especially, the firewall of the server may also be closed by the firewall because the idle time of the link is long, and at this time, the server may call and run the preset abbreviated script. In this embodiment, the preset capacity reduction script can be set according to the user requirement, so the capacity reduction script is run, namely, can be right the link pool capacity reduction, thereby reducing the corresponding link quantity, avoiding excessive idle links in the link pool, improving the user experience, effectively realizing the quick and effective management of the link pool, and simultaneously ensuring the continuous availability of the link.
As shown in FIG. 4, in one embodiment, the step S106 includes steps S401 to S403.
Step S401, a preset capacity reduction script is called to obtain a corresponding configuration file.
In this embodiment, the preset capacity reduction script may include a corresponding configuration file, and the configuration file may record related capacity reduction parameters, so that the server needs to call the corresponding configuration file to implement capacity reduction on the link pool.
Step S402, determining the corresponding link quantity according to the preset capacity shrinkage parameters in the configuration file.
In this embodiment, the server can determine the corresponding number of links according to the capacity reduction parameters in the acquired configuration file. For example, when the second preset value is 20%, the link pool may be scaled by 50%. Of course, the second preset value is not limited to 20%, may also be 10%, and more may be 30%, which is not limited in this embodiment.
Step S403, performing a reduction on the link pool to reduce the determined number of links.
In this embodiment, the server may reduce the volume of the link pool, so as to reduce the number of links in the link pool, that is, improve the user experience.
In still further embodiments, the method may further comprise the steps of:
step S107, if the detected link utilization rate is greater than or equal to a second preset value and the waiting time after the used link is detected to respond to the previous link request is greater than the preset interval time, monitoring whether the waiting time reaches preset timeout time; the preset interval time is less than the preset timeout time, and the previous link request comprises a first link request.
In this embodiment, if the detected link utilization rate is greater than or equal to the second preset value, it is known that the link utilization rate is between the first preset value and the second preset value, so that theoretically, the server can receive and respond to the first link request, sent by the client at preset intervals, for detecting the used link, so that the server can determine that the used link is in a used state, thereby avoiding the recovery of the used link pool, and ensuring that the client can also connect to the server through the used link. The preset interval time may be 1s or 2s, but the preset interval time is not limited herein in this embodiment. The preset interval time is less than the preset timeout time, which may be 4s or 5s, and is not limited in this embodiment. If the waiting time after the used link is detected to respond to the previous link request is longer than the preset interval time, the previous link request can represent a normal link request initiated from the client to the server under a general condition or can be a first link request for detecting activity, at this time, whether the waiting time reaches preset timeout time needs to be monitored, if so, a warning is given, and if not, reverse activity detection can be initiated.
Step S108, if the waiting time is monitored not to reach the preset timeout, a second link request for reverse activity detection is initiated to the client through the used link, so that the client is controlled to respond to the first link request for generating a response.
In this embodiment, if the waiting time after the server detects that the used link responds to the previous link request is longer than the preset interval time, it indicates that the link request for detecting activity does not directly pass through the used link of the server at this time, so to avoid closing the used link by the server, it is necessary to monitor whether the waiting time reaches the preset timeout time, and if the preset timeout time is not reached, it indicates that the used link is in an available and unaffected state. That is, if it is monitored that the waiting time does not reach the preset timeout, the server can send a second link request for reverse activity detection to the client through the used link, so that the client is controlled to generate and send a corresponding first link request after receiving the second link request, thereby realizing bidirectional activity detection between the server and the client, and improving the utilization efficiency of the link of the embodiment.
In still further embodiments, the method may further comprise the steps of:
step S109, if the waiting time reaches the preset overtime, generating early warning information and sending the early warning information to the client so that the user can select whether to stop the used link.
In this embodiment, if the server monitors that the waiting time reaches the preset timeout time, the server may generate the warning information and send the warning information to the client, so that the user can select whether to deactivate the used link, thereby ensuring the continuous availability of the link, and improving the utilization efficiency of the link and the user experience.
In summary, the embodiment of the present invention can realize fast and effective management of the link pool, and can ensure continuous availability of the link, and improve utilization efficiency of the link and user experience.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Referring to fig. 5, in response to the above-mentioned link pool management method, an embodiment of the present invention further provides a link pool management apparatus, where the apparatus 100 includes: the device comprises an activation unit 101, a detection unit 102, a first judgment unit 103 and a capacity expansion unit 104.
The revival unit 101 is configured to, if it is detected that a link in the current link pool is used, receive a first link request for revival through the used link at preset intervals and respond to the first link request, which is sent by the client and is matched with the first link request, so as to ensure that the used link is in a connected state.
In this embodiment, in order to prevent the used link from being recycled by the link pool due to being idle, the server and the client need to maintain the available connection state of the link by setting a corresponding active mechanism. That is, if the server detects that a link in the current link pool is used, at this time, the server may receive and respond to a first link request for detecting activity, which is sent by the client and matched with the first link request, at preset intervals, so as to ensure that the used link is in a connection state; at this time, according to a preset rule, after the link request finally used in the formal mode is sent, the client sends the first link request for detecting activity through the used link at preset intervals, and therefore the link is ensured to be in a used state.
The detecting unit 102 is configured to detect a link usage rate in a current link pool.
In this embodiment, the server can receive a link use request sent by the client to the link pool of the server, so as to call a corresponding link to implement information interaction with the client. Generally, the size of the link pool can be set, and the total number of links in the link pool and the number of used links called can be determined, so that the server can detect the link usage rate in the current link pool.
As shown in fig. 6, in an embodiment, the detecting unit 102 includes a calling unit 201 and a ratio unit 202.
The invoking unit 201 is configured to invoke a preset link detection thread to obtain the total number of links and the number of used links in the link pool.
In this embodiment, the server can call one of the existing threads as a preset link detection thread, so as to obtain the total number of links in the link pool according to the preset link detection thread and obtain the number of used links at the same time. For example, the connection state of each link in the link pool can be acquired at intervals through the link detection thread, so that the number of used connections and the total number of links in the link pool can be updated and determined in time.
A ratio unit 202, configured to determine a ratio of the number of used links to the total number of links as the link utilization.
Specifically, the server determines the ratio as the link utilization rate by calculating the ratio of the number of used links to the total number of links, so as to rapidly manage the link pool and ensure the connection of the used links.
The first determining unit 103 is configured to determine whether the detected link utilization is greater than a first preset value.
In this embodiment, the server further needs to determine whether the detected connection usage rate is greater than a first preset threshold. The first preset threshold value can be set according to the actual use requirement of the user.
And the capacity expansion unit 104 is configured to, if the detected link utilization rate is greater than a first preset value, invoke and run a preset capacity expansion script, so as to expand the capacity of the link pool and increase the corresponding link quantity.
In this embodiment, if the detected connection usage rate is greater than the first preset value, it indicates that the load of the link pool is excessive, and the server may call and run a preset expansion script in order to ensure that the used connection can be continuously used and avoid being withdrawn by the server. In this embodiment, the preset capacity expansion script can be set according to the user requirement, so that after the capacity expansion script is run, the capacity expansion of the link pool can be performed, that is, the capacity expansion of the link pool can be performed, so that the corresponding number of links is increased, the situation that the number of idle links in the link pool is too small is avoided, the use experience of a user is improved, the link pool is effectively managed quickly and effectively, and the continuous availability of the links is ensured.
As shown in fig. 7, in an embodiment, the capacity expansion unit 104 includes a first obtaining unit 301, a first determining unit 302, and an increasing unit 303.
The first obtaining unit 301 is configured to call a preset expansion script to obtain a corresponding configuration file.
In this embodiment, the preset expansion script may include a configuration file, and the configuration file may record related expansion parameters, so that the server needs to call the corresponding configuration file to expand the link pool.
The first determining unit 302 is configured to determine a corresponding number of links according to a capacity increase parameter preset in the configuration file.
In this embodiment, the server can determine the corresponding number of links according to the capacity increase parameter in the acquired configuration file.
An increment unit 303, configured to expand the link pool to increase the determined number of links.
In this embodiment, the server may expand the volume of the link pool, so as to increase the number of links in the link pool, that is, alleviate the connection pressure of the link pool, and improve the user experience.
In a further embodiment, the apparatus 100 may further include the following units:
the second determining unit 105 is configured to determine whether the detected link utilization rate is smaller than a second preset value if the detected link utilization rate is smaller than or equal to the first preset value, where the first preset value is larger than the second preset value.
In this embodiment, if the detected link utilization rate is less than or equal to the first preset value, it may be determined again whether the detected link utilization rate is less than the second preset value, so as to perform the distinguishing process. Wherein the first predetermined value is greater than said second predetermined value.
And a capacity reduction unit 106, configured to, if the detected link utilization rate is smaller than a second preset value, call and run a preset capacity reduction script, so as to reduce the capacity of the link pool and reduce the number of corresponding links.
In this embodiment, if the detected link utilization rate is less than the second preset value, it indicates that the number of idle links in the link pool is sufficient, and at this time, the used link may be closed by the server because the client does not initiate a connection state in time, especially, the firewall of the server may also be closed by the firewall because the idle time of the link is long, and at this time, the server may call and run the preset abbreviated script. In this embodiment, the preset capacity reduction script can be set according to the user requirement, so the capacity reduction script is run, namely, can be right the link pool capacity reduction, thereby reducing the corresponding link quantity, avoiding excessive idle links in the link pool, improving the user experience, effectively realizing the quick and effective management of the link pool, and simultaneously ensuring the continuous availability of the link.
As shown in fig. 8, in an embodiment, the capacity reduction unit 106 includes a second obtaining unit 401, a second determining unit 402, and a decrement unit 403.
A second obtaining unit 401, configured to call a preset abbreviated script to obtain a corresponding configuration file.
In this embodiment, the preset capacity reduction script may include a corresponding configuration file, and the configuration file may record related capacity reduction parameters, so that the server needs to call the corresponding configuration file to implement capacity reduction on the link pool.
A second determining unit 402, configured to determine a corresponding number of links according to a preset capacity reduction parameter in the configuration file.
In this embodiment, the server can determine the corresponding number of links according to the capacity reduction parameters in the acquired configuration file.
A decrement unit 403, configured to reduce the link pool by the determined number of links.
In this embodiment, the server may reduce the volume of the link pool, so as to reduce the number of links in the link pool, that is, improve the user experience.
In a further embodiment, the apparatus 100 may further include the following units:
a time determining unit 107, configured to monitor whether the waiting time reaches a preset timeout time if the detected link utilization is greater than or equal to a second preset value and the waiting time after the used link is detected to respond to the previous link request is greater than the preset interval time; the preset interval time is less than the preset timeout time, and the previous link request comprises a first link request.
In this embodiment, if the detected link utilization rate is greater than or equal to the second preset value, it is known that the link utilization rate is between the first preset value and the second preset value, so that theoretically, the server can receive and respond to the first link request, sent by the client at preset intervals, for detecting the used link, so that the server can determine that the used link is in a used state, thereby avoiding the recovery of the used link pool, and ensuring that the client can also connect to the server through the used link. The preset interval time may be 1s or 2s, but the preset interval time is not limited herein in this embodiment. The preset interval time is less than the preset timeout time, which may be 4s or 5s, and is not limited in this embodiment. If the waiting time after the used link is detected to respond to the previous link request is longer than the preset interval time, the previous link request can represent a normal link request initiated from the client to the server under a general condition or can be a first link request for detecting activity, at this time, whether the waiting time reaches preset timeout time needs to be monitored, if so, a warning is given, and if not, reverse activity detection can be initiated.
And a reverse activity detection unit 108, configured to initiate a second link request for reverse activity detection to the client through the used link if the monitored waiting time does not reach the preset timeout, so as to control the client to respond to the first link request for generating a response.
In this embodiment, if the waiting time after the server detects that the used link responds to the previous link request is longer than the preset interval time, it indicates that the link request for detecting activity does not directly pass through the used link of the server at this time, so to avoid closing the used link by the server, it is necessary to monitor whether the waiting time reaches the preset timeout time, and if the preset timeout time is not reached, it indicates that the used link is in an available and unaffected state. That is, if it is monitored that the waiting time does not reach the preset timeout, the server can send a second link request for reverse activity detection to the client through the used link, so that the client is controlled to generate and send a corresponding first link request after receiving the second link request, thereby realizing bidirectional activity detection between the server and the client, and improving the utilization efficiency of the link of the embodiment.
In a further embodiment, the apparatus 100 may further include the following units:
and the generating unit 109 is configured to generate early warning information and send the early warning information to the client, so that the user can select whether to deactivate the used link, if the waiting time reaches the preset timeout.
It should be noted that, as can be clearly understood by those skilled in the art, for the specific implementation process of the link pool management device 100 and each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
As can be seen from the above description, in terms of hardware implementation, the foregoing detecting unit 101, the detecting unit 102, the first determining unit 103, the capacity expanding unit 104, and the like may be embedded in the link pool management apparatus in a hardware form or independent from the link pool management apparatus, or may be stored in a memory of the link pool management apparatus in a software form, so that the processor calls and executes operations corresponding to the foregoing units. The processor can be a Central Processing Unit (CPU), a microprocessor, a singlechip and the like.
The above-mentioned link pool management means may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 9.
Fig. 9 is a schematic structural diagram of a computer device according to the present invention. The device may be a server, where the server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 9, the computer device 500 includes a processor 502, a memory, an internal memory 504, and a network interface 505 connected by a system bus 501, wherein the memory may include a nonvolatile storage medium 503 and the internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032 that, when executed, may cause the processor 502 to perform a link pool management method.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute a link pool management method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run a computer program 5032 stored in the memory to implement the steps of the link pool management method as described above.
It should be understood that in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program which, when executed by a processor, causes the processor to perform the steps in the link pool management method as described above.
The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for managing a link pool is applied to a server side, and comprises the following steps:
if detecting that a link in the current link pool is used, receiving and responding to a first link request which is sent by a client and matched with the used link at preset intervals, so as to ensure that the used link is in a connection state;
detecting the link utilization rate in the current link pool;
judging whether the detected link utilization rate is greater than a first preset value or not;
and if the detected link utilization rate is greater than a first preset value, calling and running a preset expansion script so as to expand the capacity of the link pool and increase the corresponding link quantity.
2. The link pool management method of claim 1, wherein the method further comprises:
if the detected link utilization rate is smaller than or equal to a first preset value, judging whether the detected link utilization rate is smaller than a second preset value, wherein the first preset value is larger than the second preset value;
and if the detected link utilization rate is smaller than a second preset value, calling and running a preset capacity reduction script so as to reduce the capacity of the link pool and reduce the corresponding link quantity.
3. The link pool management method of claim 2, wherein the method further comprises:
if the detected link utilization rate is larger than or equal to a second preset value and the waiting time after the used link is detected to respond to the previous link request is larger than the preset interval time, monitoring whether the waiting time reaches preset overtime time or not; the preset interval time is less than the preset timeout time, and the previous link request comprises a first link request;
and if the waiting time is monitored not to reach the preset timeout, initiating a second link request for reverse activity detection to the client through the used link so as to control the client to respond to the first link request for generating a response.
4. The link pool management method of claim 3, wherein the method further comprises:
and if the waiting time reaches the preset overtime, generating early warning information and sending the early warning information to the client so that the user can select whether to stop the used link.
5. The method for managing a link pool according to claim 1, wherein the step of detecting the link usage rate in the current link pool comprises:
calling a preset link detection thread to obtain the total number of links and the number of used links in the link pool;
the ratio of the number of used links to the total number of links is determined as the link usage rate.
6. The method of claim 1, wherein the step of calling and running a preset expansion script to expand the link pool and increase the corresponding number of links comprises:
calling a preset expansion script to obtain a corresponding configuration file;
determining the corresponding number of links according to capacity increasing parameters preset in the configuration file;
the link pool is augmented to increase the determined number of links.
7. The method of claim 2, wherein the step of invoking and running a preset capacity reduction script to reduce the capacity of the link pool and reduce the corresponding number of links comprises:
calling a preset capacity reduction script to obtain a corresponding configuration file;
determining the corresponding link quantity according to the preset capacity shrinkage parameters in the configuration file;
the link pool is scaled down to reduce the determined number of links.
8. A link pool management device, which is applied to a server, the device comprising:
the system comprises a live detecting unit, a link detecting unit and a link detecting unit, wherein the live detecting unit is used for receiving and responding to a first link request which is sent by a client and matched with the first link request for live detection at preset intervals if detecting that a link is used in a current link pool, so as to ensure that the used link is in a connection state;
the detection unit is used for detecting the link utilization rate in the current link pool;
the judging unit is used for judging whether the detected link utilization rate is greater than a first preset value or not;
and the capacity expansion unit is used for calling and running a preset capacity expansion script if the detected link utilization rate is greater than a first preset value so as to expand the capacity of the link pool and increase the corresponding link quantity.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the method according to any one of claims 1-7.
CN202210040395.2A 2022-01-14 2022-01-14 Link pool management method, device, computer equipment and storage medium Active CN114401204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210040395.2A CN114401204B (en) 2022-01-14 2022-01-14 Link pool management method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210040395.2A CN114401204B (en) 2022-01-14 2022-01-14 Link pool management method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114401204A true CN114401204A (en) 2022-04-26
CN114401204B CN114401204B (en) 2024-01-23

Family

ID=81230148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210040395.2A Active CN114401204B (en) 2022-01-14 2022-01-14 Link pool management method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114401204B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117176612A (en) * 2023-10-30 2023-12-05 腾讯科技(深圳)有限公司 Network quality detection method, device and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070268910A1 (en) * 2006-05-18 2007-11-22 Jinmei Shen Recovering a Pool of Connections
US20180019922A1 (en) * 2016-07-15 2018-01-18 Ebay Inc. Preemptive connection pool adjustments
WO2019019644A1 (en) * 2017-07-24 2019-01-31 深圳壹账通智能科技有限公司 Push server allocation method and apparatus, and computer device and storage medium
CN111679968A (en) * 2020-04-28 2020-09-18 平安普惠企业管理有限公司 Interface calling abnormity detection method and device, computer equipment and storage medium
CN112231601A (en) * 2020-10-14 2021-01-15 深圳前海微众银行股份有限公司 Link management method, device, equipment and computer storage medium
US20210126964A1 (en) * 2019-10-23 2021-04-29 Salesforce.Com, Inc. Connection pool anomaly detection mechanism
WO2021258753A1 (en) * 2020-06-24 2021-12-30 广东浪潮智慧计算技术有限公司 Service processing method and apparatus, and electronic device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070268910A1 (en) * 2006-05-18 2007-11-22 Jinmei Shen Recovering a Pool of Connections
US20180019922A1 (en) * 2016-07-15 2018-01-18 Ebay Inc. Preemptive connection pool adjustments
WO2019019644A1 (en) * 2017-07-24 2019-01-31 深圳壹账通智能科技有限公司 Push server allocation method and apparatus, and computer device and storage medium
US20210126964A1 (en) * 2019-10-23 2021-04-29 Salesforce.Com, Inc. Connection pool anomaly detection mechanism
CN111679968A (en) * 2020-04-28 2020-09-18 平安普惠企业管理有限公司 Interface calling abnormity detection method and device, computer equipment and storage medium
WO2021258753A1 (en) * 2020-06-24 2021-12-30 广东浪潮智慧计算技术有限公司 Service processing method and apparatus, and electronic device and storage medium
CN112231601A (en) * 2020-10-14 2021-01-15 深圳前海微众银行股份有限公司 Link management method, device, equipment and computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117176612A (en) * 2023-10-30 2023-12-05 腾讯科技(深圳)有限公司 Network quality detection method, device and computer readable storage medium
CN117176612B (en) * 2023-10-30 2024-02-09 腾讯科技(深圳)有限公司 Network quality detection method, device and computer readable storage medium

Also Published As

Publication number Publication date
CN114401204B (en) 2024-01-23

Similar Documents

Publication Publication Date Title
CN111818159B (en) Management method, device, equipment and storage medium of data processing node
CN108989352B (en) Firewall implementation method and device, computer equipment and storage medium
CN107846316B (en) Cloud mobile phone management system and exception handling method thereof
EP3209005B1 (en) Task processing device, intelligent apparatus, task processing method and baseband processor
CN109726062B (en) Off-line method of proxy server and control server
CN114401204A (en) Link pool management method and device, computer equipment and storage medium
CN110191016B (en) Cloud platform service monitoring method, device, equipment and system and readable storage medium
CN111124761B (en) Equipment restarting method, device, equipment and medium
CN115150460A (en) Node secure registration method, device, equipment and readable storage medium
CN114168071B (en) Distributed cluster capacity expansion method, distributed cluster capacity expansion device and medium
CN106506278B (en) Service availability monitoring method and device
JP4313800B2 (en) TERMINAL DEVICE, TERMINAL DEVICE CONTROL METHOD, NETWORK SYSTEM, ITS CONTROL METHOD, PROGRAM, AND RECORDING MEDIUM
CN106897128B (en) Distributed application quitting method, system and server
WO2020223862A1 (en) Mounting processing method and apparatus, electronic device, and computer readable storage medium
CN111064636B (en) Control method, device and system for connection of front-end processor and computer equipment
CN109634787B (en) Distributed file system monitor switching method, device, equipment and storage medium
CN110851258B (en) API calling method, API calling device, computer equipment and storage medium
CN110737320B (en) Power consumption detection method and device, electronic equipment and storage medium
CN114116203A (en) Resource calling control method, resource calling control device and storage medium
CN113254062A (en) Method, device, equipment and medium for configuring and taking effect of BMC (baseboard management controller) parameters
CN110955579A (en) Ambari-based large data platform monitoring method
CN110704461A (en) Data verification method and device, computer equipment and readable storage medium
CN110837431A (en) Service control method, service control device, computer equipment and computer-readable storage medium
WO2022257128A1 (en) Macro command execution method and control device
CN117033084B (en) Virtual machine backup method and device, electronic equipment and storage medium

Legal Events

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