Method, apparatus and storage medium for managing communication resources

By placing the connection protocols in the cloud platform's communication resource pool into a stack structure and dynamically managing idle connections, the problem of wasted connection resources in the Secure Shell protocol is solved, and the storage resource management and device access capabilities after cloud platform expansion are improved.

CN116633954BActive Publication Date: 2025-11-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310511036.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2025-11-25
Estimated Expiration
2043-05-08

AI Technical Summary

Technical Problem

In cloud computing scenarios, once a Secure Shell protocol connection is created, it is never released, leading to a waste of resources. Especially when business is not busy, the storage side cannot create new connections after reaching the limit of the number of connections, which affects the expansion of the cloud platform.

Method used

The target connection protocol in the communication resource pool is placed in the stack. By releasing idle connections when the communication traffic is less than a threshold, the most recently used connections are given priority, and connection resources are dynamically managed.

Benefits of technology

This effectively avoids resource waste, ensures that more nodes can manage storage resources after the cloud platform is expanded, and improves the access capability of storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633954B_ABST
    Figure CN116633954B_ABST
Patent Text Reader

Abstract

The application relates to the communication field and discloses a communication resource management method, device, equipment and storage medium, which comprises the following steps: placing all target connection protocols in a pool into a stack; when the current communication traffic is less than a communication traffic threshold, releasing the target connection protocols in the idle state in the stack, and using the target connection protocols used in a preset time for communication; the application can actively release the target connection protocols in the idle state, avoid occupying too many target connection protocol resources in a storage system, enable more nodes to manage storage resources through the target connection protocols after the subsequent expansion of a cloud platform, and enable a storage device to access more cloud platforms simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and more specifically to a method, apparatus, device, and storage medium for managing communication resources. Background Technology

[0002] In cloud computing scenarios, a large number of servers and storage devices are needed to build a cloud environment. These servers also need to map volumes from the storage devices onto the servers as storage resources. Therefore, a cloud platform is typically deployed on these servers. When a request arrives, the cloud platform retrieves an available SecureShell protocol connection from the head of the queue to process the request. Once the request is completed, the SecureShell protocol connection is placed at the tail of the queue.

[0003] However, in the aforementioned cloud platform scenarios, due to the way secure shell protocol connections are stored in the connection pool and the keep-alive mechanism, once a secure shell protocol connection is created, it will never be released. Even when the cloud platform is not busy, these secure shell protocol connections will remain active, leading to resource waste. Furthermore, the number of secure shell protocol connections on the storage side is capped; once this limit is reached, no new secure shell protocol connections can be created. Subsequently, as cloud platform nodes expand, the storage will be unable to connect to other cloud platforms. Summary of the Invention

[0004] In view of this, the present invention provides a method, apparatus, device and storage medium for managing communication resources to solve the problem that existing Secure Shell protocol connections, once created, are never released and remain active even when the cloud platform is not busy, resulting in resource waste.

[0005] Firstly, this invention provides a method for managing communication resources. The method includes: placing all target connection protocols in a communication resource pool onto a stack; when the current communication traffic volume is less than a communication traffic volume threshold, releasing the idle target connection protocols in the stack, and using target connection protocols used within a preset time period for communication. Through this process, target connection protocol connections can be proactively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also enables a single storage device to connect to more cloud platforms simultaneously.

[0006] In one alternative implementation, determining that the target connection protocol within the stack is in an idle state includes:

[0007] Get the usage frequency of each target connection protocol in the stack within a preset time period;

[0008] When the usage frequency of the target connection protocol is less than the frequency threshold within a preset time, the target connection protocol is determined to be in an idle state.

[0009] In an alternative implementation, after releasing the target connection protocol that is idle in the stack, the method further includes:

[0010] Reset the usage frequency of each target connection protocol in the stack to its initial value.

[0011] In one alternative implementation, the method further includes:

[0012] When a communication request is received that communicates via the target connection protocol, count the number of target connection protocols already stored in the stack.

[0013] When the number of target connection protocols already stored in the stack is empty, a new target connection protocol is created in the communication resource pool to handle the communication request;

[0014] If the number of target connection protocols already stored in the stack is not empty, then a target connection protocol is retrieved from the top of the stack.

[0015] In one alternative implementation, after creating a new target connection protocol to process the request, the method further includes:

[0016] When the number of target connection protocols stored in the stack is less than the protocol number threshold, after the communication request is processed, the new target connection protocol is inserted into the stack and the usage frequency is updated.

[0017] When the number of target connection protocols stored in the stack equals the protocol count threshold, the new target connection protocol is released directly after the request is processed.

[0018] In one alternative implementation, after obtaining a target connection protocol from the top of the stack, the method includes:

[0019] When the target connection protocol is valid, the request is processed using the target connection protocol. After the request is processed, the target connection protocol is placed on top of the stack and its usage frequency is updated.

[0020] If the target connection protocol is invalid, it will be removed from the stack, and its usage frequency information will be cleared.

[0021] In an optional implementation, when the target connection protocol is invalid, the method further includes removing the target connection protocol from the stack and clearing its usage frequency information, after which:

[0022] Create a new target connection protocol to handle communication requests. After the communication request is processed, insert the new target connection protocol into the stack and update its usage frequency.

[0023] Secondly, this invention provides a communication resource management device, which mainly includes a connection protocol processing module and a connection protocol release module. The connection protocol processing module places all target connection protocols in the communication resource pool into a stack. The connection protocol release module releases idle target connection protocols from the stack when the current communication traffic volume is less than a communication traffic volume threshold, and uses target connection protocols used within a preset time period for communication. Through this process, target connection protocol connections can be actively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also enables a single storage device to connect to more cloud platforms simultaneously.

[0024] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the communication resource management method of the first aspect or any corresponding embodiment described above.

[0025] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the communication resource management method of the first aspect or any corresponding embodiment described above. Attached Figure Description

[0026] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram of an application environment according to an embodiment of the present invention;

[0028] Figure 2 This is a flowchart illustrating the communication resource management method according to an embodiment of the present invention;

[0029] Figure 3 This is a flowchart illustrating another method for managing communication resources according to an embodiment of the present invention;

[0030] Figure 4This is a flowchart illustrating another method for managing communication resources according to an embodiment of the present invention;

[0031] Figure 5 This is a data flow diagram of another communication resource management method according to an embodiment of the present invention;

[0032] Figure 6 This is a structural block diagram of a communication resource management device according to an embodiment of the present invention;

[0033] Figure 7 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] The terms "first" and "second" in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses. The term "multiple" in this invention can mean at least two, for example, two, three, or more, and the embodiments of this invention are not limited thereto.

[0036] Please see Figure 1 , Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present invention. The schematic diagram includes a terminal 100, which may include a display 101, a processor 102, and a memory 103. The terminal 100 can communicate with a server 200 via a network 300. The server 200 can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database 201 can be set up on or independently of the server 200 to provide data storage services to the server 200. In addition, a processing engine 202 can run on the server 200, which can be used to execute the steps performed by the server 200.

[0037] Optionally, terminal 100 may be, but is not limited to, a terminal capable of computing data, such as a mobile terminal (e.g., a mobile phone, tablet computer), a laptop computer, a PC (Personal Computer), etc. The aforementioned network may include, but is not limited to, a wireless network or a wired network. The wireless network includes Bluetooth, Wi-Fi (Wireless Fidelity), and other networks that enable wireless communication. The aforementioned wired network may include, but is not limited to, a wide area network (WAN), a metropolitan area network (MAN), and a local area network (LAN). The aforementioned server 200 may include, but is not limited to, any hardware device capable of computing.

[0038] Furthermore, in this embodiment, the above-described communication resource management method can also be applied to, but is not limited to, a powerful independent processing device without the need for data interaction. For example, the processing device can be, but is not limited to, a powerful terminal device; that is, the various operations in the above-described communication resource management method can be integrated into a single independent processing device. The above is merely an example, and no limitation is made in this embodiment.

[0039] Optionally, in this embodiment, the above-mentioned communication resource management method can be executed by server 200, terminal 100, or jointly by server 200 and terminal 100. The communication resource management method of this embodiment can also be executed by a client installed on terminal 100.

[0040] According to an embodiment of the present invention, a method for managing communication resources is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0041] This embodiment provides a method for managing communication resources, which can be used on the aforementioned server, on which a cloud platform is deployed. Figure 2 This is a flowchart of a communication resource management method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0042] Step S201: Place all target connection protocols in the communication resource pool into the stack.

[0043] In this embodiment, all target connection protocols in the communication resource pool are placed in a stack. This allows the data structure storing the target connection protocols to be changed from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially. The aforementioned target connection protocols are secure shell protocols.

[0044] In one optional implementation, the cloud platform deployed on the server can use the ssh_utils module to initialize a communication resource pool (a connection pool storing target connection protocols), with a pool size of N (N being the parameter passed by the client). Then, each target connection protocol is placed on a stack. Before placing each target connection protocol on the stack, it can be numbered, resulting in uniquely numbered target connection protocols. These uniquely numbered target connection protocols are then placed on the stack sequentially. This changes the data structure storing target connection protocols from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially, and providing the necessary conditions for timely release of idle target connection protocols.

[0045] It's also worth noting that cloud computing requires a large number of servers and storage devices to build a cloud environment. These servers also need to map volumes from the storage devices onto the servers as storage resources. Therefore, it's typically necessary to deploy cloud platforms on these servers, such as the OpenStack cloud platform. OpenStack is an open-source cloud computing management platform that provides scalable and elastic cloud computing services for private or public clouds.

[0046] The OpenStack cloud platform comprises numerous services and components. Among them, the Cinder service (the block device service component in the OpenStack cloud platform) primarily interacts with storage, managing and controlling the use of storage devices and their resources. Each storage vendor provides its own Cinder driver, which defines the connection method to the storage device and implements the standard OpenStack interfaces. Within these interfaces, the Cinder driver calls the storage's interfaces to complete specific operations. Integrating the Cinder driver into the OpenStack cloud platform enables the cloud platform to manage storage devices. The Cinder driver is deployed on the control nodes of the OpenStack cloud platform. For high availability, a cloud platform typically has multiple control nodes, each deploying the Cinder driver. Simultaneously, a cloud platform also has multiple control node compute nodes used to create and deploy virtual machines (VMs). The nova-compute service is deployed on these compute nodes, and all VMs run on these compute nodes. nova-compute is a crucial daemon responsible for creating and terminating VM instances, effectively managing their lifecycle.

[0047] To avoid frequently establishing Secure Shell protocol connections with storage, the Cinder driver uses connection pooling. Several Secure Shell connections are pre-created in the connection pool. When interaction with the storage device is needed, an available connection is obtained from the pool. After the interaction is complete, the connection is returned to the pool for other requests.

[0048] However, in the aforementioned cloud platform scenarios, due to the way secure shell protocol connections are stored in the connection pool and the keep-alive mechanism, once a secure shell protocol connection is created, it will never be released. Even when the cloud platform is not busy, these secure shell protocol connections will remain active, leading to resource waste. Furthermore, the number of secure shell protocol connections on the storage side is capped; once this limit is reached, no new secure shell protocol connections can be created. Subsequently, as cloud platform nodes expand, the storage will be unable to connect to other cloud platforms.

[0049] Therefore, in this embodiment, the data structure for storing target connection protocols is changed from a queue structure to a stack structure to ensure that the most recently used target connection protocols are used first, thus providing the necessary conditions for releasing target connection protocols that are in an idle state.

[0050] Step S202: When the current communication traffic volume is less than the communication traffic volume threshold, release the target connection protocol that is idle in the stack and use the target connection protocol that has been used within a preset time for communication.

[0051] In this embodiment, if the current communication traffic volume is less than the communication traffic volume threshold (i.e., the communication traffic is not busy), and the target connection protocol in the stack is idle (i.e., not used or used infrequently), the target connection protocol is released from the stack, and communication is performed using the target connection protocol used within a preset time period. This allows the target connection protocol to be actively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This ensures that after a cloud platform expands, more nodes can manage storage resources through the target connection protocol, and a single storage device can simultaneously connect to more cloud platforms. The communication traffic volume threshold can be determined based on the capabilities of the server providing the service and can also be dynamically adjusted according to the communication traffic of the cloud platform.

[0052] In one optional implementation, the system can be adjusted based on whether a large number of virtual machines are created within a short period. For example, if a user needs to create 100 virtual machines, the cloud platform will have a lot of direct interaction with the storage device during this period. After these 100 virtual machines are created, the cloud platform will only query the communication resource pool information once every 60 seconds. This is equivalent to a low-load state. Simultaneously, the system can determine whether a target connection protocol in the stack is idle based on its usage frequency within a preset time. If the usage frequency of a target connection protocol within the preset time is less than a frequency threshold or it is not used, then the target connection protocol is determined to be idle. In this case, the target connection protocol can be released from the stack.

[0053] The communication resource management method provided in this embodiment changes the data structure of the target connection protocols from a queue structure to a stack structure by placing all target connection protocols in the communication resource pool into a stack. This ensures that the most recently used target connection protocols are used first, providing the necessary conditions for releasing idle target connection protocols. When the current communication traffic volume is less than the communication traffic volume threshold, the idle target connection protocols in the stack are released, and communication is performed using target connection protocols used within a preset time. This achieves the proactive release of target connection protocol connections when idle, avoiding the occupation of too many target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also enables a single storage device to connect to more cloud platforms simultaneously.

[0054] This embodiment provides a method for managing communication resources, which can be used on the aforementioned server, on which a cloud platform is deployed. Figure 3 This is a flowchart of a communication resource management method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:

[0055] Step S301: Place all target connection protocols in the communication resource pool into the stack.

[0056] In this embodiment, by placing all target connection protocols in the communication resource pool onto a stack, the data structure currently storing the target connection protocols is changed from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially. The aforementioned target connection protocols are secure shell protocols.

[0057] In one optional implementation, the cloud platform deployed on the server can use the ssh_utils module to initialize a communication resource pool (a communication resource pool storing target connection protocols), with a pool size of N (N being the parameter passed by the client). Then, each target connection protocol is placed on a stack. Before placing each target connection protocol on the stack, it can be numbered, resulting in uniquely numbered target connection protocols. These uniquely numbered target connection protocols are then placed on the stack sequentially. This changes the data structure storing the target connection protocols from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used first, and providing the necessary conditions for timely release of idle target connection protocols.

[0058] Step S302: When the current communication traffic volume is less than the communication traffic volume threshold, release the target connection protocol that is idle in the stack and use the target connection protocol that has been used within a preset time for communication.

[0059] In this embodiment, if the current communication traffic volume is less than the communication traffic volume threshold (i.e., the communication traffic is not busy), and the target connection protocol in the stack is idle (i.e., not used or used infrequently), the target connection protocol is released from the stack, and communication is performed using the target connection protocol used within a preset time period. This allows the target connection protocol to be actively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This ensures that after a cloud platform expands, more nodes can manage storage resources through the target connection protocol, and a single storage device can simultaneously connect to more cloud platforms. The communication traffic volume threshold can be determined based on the capabilities of the server providing the service and can also be dynamically adjusted according to the communication traffic of the cloud platform.

[0060] In one optional implementation, the system can be adjusted based on whether a large number of virtual machines are created within a short period. For example, if a user needs to create 100 virtual machines, the cloud platform will have a lot of direct interaction with the storage device during this period. After these 100 virtual machines are created, the cloud platform will only query the communication resource pool information once every 60 seconds. This is equivalent to a low-load state. Simultaneously, the system can determine whether a target connection protocol in the stack is idle based on its usage frequency within a preset time. If the usage frequency of a target connection protocol within the preset time is less than a frequency threshold or it is not used, then the target connection protocol is determined to be idle. In this case, the target connection protocol can be released from the stack.

[0061] Specifically, step S302 above, which determines that the target connection protocol in the stack is in an idle state, includes:

[0062] Step S3021: Obtain the usage frequency of each target connection protocol in the stack within a preset time period.

[0063] In this embodiment, the usage frequency of each target connection protocol in the stack within a preset time is obtained to determine whether each target connection protocol is in an idle state, thereby providing the necessary conditions for releasing the target connection protocols in an idle state.

[0064] In one optional implementation, a counter can be maintained within the communication resource pool. This counter is a dictionary structure, where the key of the dictionary is the name of the target connection protocol, and the value is the number of times that target connection protocol has been used. When initializing the communication resource pool storing the target connection protocols, a probe thread can be created. The probe thread runs periodically, irregularly, or according to a running instruction to check the number of times each target connection protocol in the communication resource pool has been used.

[0065] Optionally, the aforementioned probe thread can run once every 10 minutes in a periodic running state. It is understood that the running time of the aforementioned probe thread can be adjusted according to actual needs in other embodiments. Simultaneously, when obtaining the number of times each target connection protocol in the communication resource pool is used, a data push thread can also be created in the communication resource pool to push the usage counts of each target connection protocol in the communication resource pool to the subscribers.

[0066] Step S3022: When the usage frequency of the target connection protocol within a preset time is less than the frequency threshold, it is determined that the target connection protocol is in an idle state.

[0067] In this embodiment, by comparing the usage frequency of the target connection protocol within a preset time period with a frequency threshold, target connection protocols with a usage frequency less than the frequency threshold within the preset time period are defined as idle target connection protocols. This provides the necessary condition for timely release of idle target connection protocols from the stack. The usage frequency of a target connection protocol within the preset time period is the number of times the target connection protocol is used within the preset time period divided by the total number of times all target connection protocols are used. The frequency threshold can range from 0 to 0.3.

[0068] In one optional implementation, when a probe thread detects the usage frequency of target connection protocols in the communication resource pool within a preset time period, the probe thread can run every 10 minutes to check the number of times each target connection protocol in the communication resource pool has been used. If the number is greater than 0, the connection is considered to have been recently used, and the target connection protocol is not released. If the number is equal to 0, the connection is considered to have been recently idle, and the target connection protocol is released. Optionally, if the usage frequency is less than 0.3, the connection is considered to have been recently idle, and the target connection protocol is released; if the usage frequency is greater than 0.3, the connection is considered to have been recently used, and the target connection protocol is not released.

[0069] In one optional implementation, the target connection protocols that are idle in the stack are released, and the usage frequency of each target connection protocol in the stack is reset to its initial value to ensure the accuracy and fairness of the usage frequency statistics of each target connection protocol in the next round. The reset of the usage frequency of each target connection protocol in the stack to its initial value can be simultaneous with the release of the idle target connection protocols from the stack; or it can be before the release of the target connection protocols from the stack, but at this point the instruction to release the target connection protocols from the stack has already been generated.

[0070] For example, when a counter is used to count the number of times each target connection protocol is used in the stack, and a probe thread is used to check the number of times the target connection protocol is used in the communication resource pool, after the probe thread finishes running, the counter is updated and the number of times each target connection protocol is used is reset to 0.

[0071] The communication resource management method provided in this embodiment changes the data structure of the target connection protocols from a queue structure to a stack structure by placing all target connection protocols in the communication resource pool into a stack. This ensures that the most recently used target connection protocols are used first, providing the necessary conditions for releasing idle target connection protocols. After releasing the idle target connection protocols in the stack, the usage frequency of each target connection protocol in the stack is reset to the initial value to ensure the accuracy and fairness of the determination of the usage frequency of each target connection protocol in the next round. When the current communication traffic volume is less than the communication traffic volume threshold, the idle target connection protocols in the stack are released, and communication is carried out using target connection protocols used within a preset time. This achieves the active release of target connection protocol connections when idle, avoiding the occupation of too many target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also enables a single storage device to connect to more cloud platforms simultaneously.

[0072] This embodiment provides a method for managing communication resources, which can be used on the aforementioned server, on which a cloud platform is deployed. Figure 4 This is a flowchart of a communication resource management method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:

[0073] Step S401: Place all target connection protocols in the communication resource pool into the stack.

[0074] In this embodiment, by placing all target connection protocols in the communication resource pool onto a stack, the data structure currently storing the target connection protocols is changed from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially. The aforementioned target connection protocols are secure shell protocols.

[0075] In one optional implementation, the cloud platform deployed on the server can use the ssh_utils module to initialize a communication resource pool (a connection pool storing target connection protocols), with a pool size of N (N being the parameter passed by the client). Then, each target connection protocol is placed on a stack. Before placing each target connection protocol on the stack, it can be numbered, resulting in uniquely numbered target connection protocols. These uniquely numbered target connection protocols are then placed on the stack sequentially. This changes the data structure storing target connection protocols from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially, and providing the necessary conditions for timely release of idle target connection protocols.

[0076] Step S402: When a communication request for communication via a target connection protocol is received, count the number of target connection protocols already stored in the stack.

[0077] In this embodiment, when a request to obtain a target connection protocol is received, the number of target connection protocols currently stored in the stack is counted to determine whether there is a usable target connection protocol in the current stack.

[0078] Step S403: When the number of target connection protocols stored in the stack is empty, create a new target connection protocol in the communication resource pool to handle the communication request.

[0079] In this embodiment, when it is determined that the number of target connection protocols in the stack is empty, that is, there are no available target connection protocols in the current stack, a new target connection protocol is created to handle the above communication request, so as to improve the timeliness of communication processing.

[0080] Step S404: When the number of target connection protocols stored in the stack is less than the protocol number threshold, after the communication request is processed, insert the new target connection protocol into the stack and update the usage frequency.

[0081] In this embodiment, when the number of target connection protocols already stored in the stack is less than the protocol quantity threshold, meaning there is still space to store a new target protocol, the new target connection protocol is inserted into the stack and its usage frequency is updated after the communication request is processed. Optionally, when the number of target connection protocols already stored in the stack is less than the protocol quantity threshold, the new target connection protocol is inserted at the top of the stack and its usage frequency is updated after the request is processed, so as to provide an opportunity for the release of other target connection protocols in the stack, while ensuring that the new target connection protocol can be used preferentially.

[0082] For example, if the number of target connection protocols stored in the stack is less than N, that is, the number of target connection protocols created is less than N, then after the request is processed, the new target connection protocol is inserted at the top of the stack, and the counter is updated by setting the corresponding key value to 1.

[0083] Step S405: When the number of target connection protocols stored in the stack is equal to the protocol number threshold, the new target connection protocol is released directly after the request is processed.

[0084] In this embodiment, when the number of target connection protocols stored in the stack is equal to the protocol quantity threshold, such as N, that is, the number of target connection protocols created is equal to N, the new target connection protocol is released directly after the request is processed, so as to avoid the overflow of other target connection protocols in the stack when the new target connection protocol is forcibly pushed onto the stack.

[0085] Step S406: When the current communication traffic volume is less than the communication traffic volume threshold, release the target connection protocol that is idle in the stack and use the target connection protocol that has been used within a preset time for communication.

[0086] In this embodiment, if the current communication traffic volume is less than the communication traffic volume threshold (i.e., the communication traffic is not busy), and the target connection protocol in the stack is idle (i.e., not used or used infrequently), the target connection protocol is released from the stack, and communication is performed using the target connection protocol used within a preset time period. This allows the target connection protocol to be actively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This ensures that after a cloud platform expands, more nodes can manage storage resources through the target connection protocol, and a single storage device can simultaneously connect to more cloud platforms. The communication traffic volume threshold can be determined based on the capabilities of the server providing the service and can also be dynamically adjusted according to the communication traffic of the cloud platform.

[0087] In one optional implementation, the system can be adjusted based on whether a large number of virtual machines are created within a short period. For example, if a user needs to create 100 virtual machines, the cloud platform will have a lot of direct interaction with the storage device during this period. After these 100 virtual machines are created, the cloud platform will only query the communication resource pool information once every 60 seconds. This is equivalent to a low-load state. Simultaneously, the system can determine whether a target connection protocol in the stack is idle based on its usage frequency within a preset time. If the usage frequency of a target connection protocol within the preset time is less than a frequency threshold or it is not used, then the target connection protocol is determined to be idle. In this case, the target connection protocol can be released from the stack.

[0088] The communication resource management method provided in this embodiment changes the data structure of the target connection protocols from a queue structure to a stack structure by placing all target connection protocols in the communication resource pool into a stack. This ensures that the most recently used target connection protocols are used first, providing the necessary conditions for releasing idle target connection protocols. When a request to acquire a target connection protocol is received, the number of target connection protocols currently stored in the stack is counted to determine if there is an available target connection protocol in the stack. If it is determined that the number of target connection protocols in the stack is empty, i.e., there is no available target connection protocol in the stack, a new target connection protocol is created to handle the above communication request, thereby improving the timeliness of communication processing. If the number of target connection protocols stored in the stack is less than the protocol quantity threshold, i.e., there is still space to store a new target protocol, the new target connection protocol is created after the communication request is processed. The target connection protocol is inserted into the stack and its usage frequency is updated to provide opportunities for the release of other target connection protocols in the stack, while ensuring that new target connection protocols can be used preferentially. When the number of target connection protocols stored in the stack equals the protocol quantity threshold, the new target connection protocol is released directly after the request is processed to avoid overflow of other target connection protocols in the stack when the new target connection protocol is forcibly pushed onto the stack. By releasing the target connection protocols in the stack that are idle when the current communication traffic is less than the communication traffic threshold, and using the target connection protocols that have been used within a preset time for communication, the target connection protocol connection is actively released when idle, avoiding the occupation of too many target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also allows a storage device to connect to more cloud platforms at the same time.

[0089] This embodiment provides a method for managing communication resources, which can be used on the aforementioned server, on which a cloud platform is deployed. Figure 5 This is a flowchart of a communication resource management method according to an embodiment of the present invention, such as... Figure 5As shown, the process includes the following steps:

[0090] Step S501: Place all target connection protocols in the communication resource pool into the stack.

[0091] In this embodiment, by placing all target connection protocols in the communication resource pool onto a stack, the data structure currently storing the target connection protocols is changed from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially. The aforementioned target connection protocols are secure shell protocols.

[0092] In one optional implementation, the cloud platform deployed on the server can use the ssh_utils module to initialize a communication resource pool (a connection pool storing target connection protocols), with a pool size of N (N being the parameter passed by the client). Then, each target connection protocol is placed on a stack. Before placing each target connection protocol on the stack, it can be numbered, resulting in uniquely numbered target connection protocols. These uniquely numbered target connection protocols are then placed on the stack sequentially. This changes the data structure storing target connection protocols from a queue structure to a stack structure, ensuring that the most recently used target connection protocols are used preferentially, and providing the necessary conditions for timely release of idle target connection protocols.

[0093] Step S502: When a communication request for communication via a target connection protocol is received, count the number of target connection protocols already stored in the stack.

[0094] In this embodiment, when a request to obtain a target connection protocol is received, the number of target connection protocols currently stored in the stack is counted to determine whether there is a usable target connection protocol in the current stack.

[0095] Step S503: If the number of target connection protocols stored in the stack is not empty, then a target connection protocol is obtained from the top of the stack.

[0096] In this embodiment, when it is determined that the number of target connection protocols in the stack is not empty, that is, there are available target connection protocols in the current stack, a target connection protocol is directly obtained from the top of the stack to process the above request, so as to ensure that the most recently used target connection protocol is used first when processing each request, so that other target connection protocols are released when the business is not busy because they have not been used for a long time.

[0097] Step S504: When the target connection protocol is valid, the target connection protocol is used to process the request, and after the request is processed, the target connection protocol is inserted at the top of the stack and the usage frequency is updated.

[0098] In this embodiment, when the target connection protocol obtained at the top of the stack is valid, the target connection protocol is used to process the request. After the request is processed, the target connection protocol is inserted into the top of the stack and its usage frequency is updated to ensure that the most recently used target connection protocol is used first when processing each request. This allows other target connection protocols to be released when they have not been used for a long time during periods of low business activity.

[0099] For example, if the target connection protocol obtained at the top of the stack is available, then after the request is processed, the new target connection protocol is inserted at the top of the stack, and the counter is updated by incrementing the corresponding key value by 1.

[0100] In step S505, if the target connection protocol is invalid, the target connection protocol is removed from the stack, and the usage frequency information of the target connection protocol is cleared.

[0101] In this embodiment, when the target connection protocol is invalid or unavailable, the target connection protocol is removed from the stack, and the usage frequency information of the target connection protocol is cleared, such as clearing the corresponding record in the counter, thereby providing space for the addition of a new target protocol.

[0102] In one optional implementation, when the target connection protocol is invalid, it is removed from the stack, and the corresponding record in the counter is cleared. Simultaneously, a new target connection protocol is created to handle the communication request. After the communication request is processed, the new target connection protocol is inserted at the top of the stack, and its usage frequency is updated, such as by updating the counter and setting the corresponding key value to 1.

[0103] Step S506: When the current communication traffic volume is less than the communication traffic volume threshold, release the target connection protocol that is idle in the stack and use the target connection protocol that has been used within a preset time for communication.

[0104] In this embodiment, if the current communication traffic volume is less than the communication traffic volume threshold (i.e., the communication traffic is not busy), and the target connection protocol in the stack is idle (i.e., not used or used infrequently), the target connection protocol is released from the stack, and communication is performed using the target connection protocol used within a preset time period. This allows the target connection protocol to be actively released when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This ensures that after a cloud platform expands, more nodes can manage storage resources through the target connection protocol, and a single storage device can simultaneously connect to more cloud platforms. The communication traffic volume threshold can be determined based on the capabilities of the server providing the service and can also be dynamically adjusted according to the communication traffic of the cloud platform.

[0105] In one optional implementation, the system can be adjusted based on whether a large number of virtual machines are created within a short period. For example, if a user needs to create 100 virtual machines, the cloud platform will have a lot of direct interaction with the storage device during this period. After these 100 virtual machines are created, the cloud platform will only query the communication resource pool information once every 60 seconds. This is equivalent to a low-load state. Simultaneously, the system can determine whether a target connection protocol in the stack is idle based on its usage frequency within a preset time. If the usage frequency of a target connection protocol within the preset time is less than a frequency threshold or it is not used, then the target connection protocol is determined to be idle. In this case, the target connection protocol can be released from the stack.

[0106] The communication resource management method provided in this embodiment changes the data structure of the target connection protocols from a queue structure to a stack structure by placing all target connection protocols in the communication resource pool into a stack. This ensures that the most recently used target connection protocols are used first, providing the necessary conditions for releasing idle target connection protocols. When a request to obtain a target connection protocol is received, the number of target connection protocols currently stored in the stack is counted to determine if there is an available target connection protocol in the stack. If it is determined that the number of target connection protocols in the stack is not empty, that is, there is an available target connection protocol in the stack, a target connection protocol is directly obtained from the top of the stack to process the above request. This ensures that the most recently used target connection protocol is used first when processing each request, so that other target connection protocols that have not been used for a long time can be released when the business is not busy. When the target connection protocol obtained from the top of the stack is valid, the target connection protocol is used. The protocol processes requests and, upon completion, places the target connection protocol at the top of the stack and updates its usage frequency. This ensures that the most recently used target connection protocol is prioritized for each request, releasing other target connection protocols that have not been used for a long time when business is not busy. When a target connection protocol is invalid or unavailable, it is removed from the stack, and its usage frequency information is cleared, making room for the addition of new target protocols. When the current communication traffic is less than the communication traffic threshold, idle target connection protocols in the stack are released, and communication is performed using target connection protocols that have been used within a preset time. This proactively releases target connection protocol connections when idle, avoiding excessive occupation of target connection protocol resources in the storage system. This allows more nodes to manage storage resources through target connection protocols after a cloud platform is expanded, and also enables a single storage device to connect to more cloud platforms simultaneously.

[0107] This embodiment also provides a communication resource management device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0108] This embodiment provides a communication resource management device, such as... Figure 6 As shown, it includes:

[0109] The connection protocol processing module 601 is used to place all target connection protocols in the communication resource pool into the stack.

[0110] In some alternative implementations, the connection protocol processing module 601 includes:

[0111] The frequency acquisition unit is used to acquire the usage frequency of each target connection protocol in the stack within a preset time period.

[0112] The idle state confirmation unit determines that the target connection protocol is in an idle state when the usage frequency of the target connection protocol is less than the frequency threshold within a preset time.

[0113] The frequency reset unit is used to reset the usage frequency of each target connection protocol in the stack to its initial value after releasing the target connection protocol that is in an idle state in the stack.

[0114] The connection protocol release module 602 is used to release the target connection protocol that is idle in the stack when the current communication traffic volume is less than the communication traffic volume threshold, and to use the target connection protocol that has been used within a preset time for communication.

[0115] In some alternative embodiments, the above-described apparatus further includes

[0116] The protocol count module is used to count the number of target connection protocols stored in the stack when a communication request is received that communicates through the target connection protocol.

[0117] The request creation module is used to create a new target connection protocol in the communication resource pool to handle communication requests when the number of target connection protocols already stored in the stack is empty.

[0118] Optionally, the above-mentioned request creation module includes:

[0119] The first protocol insertion unit is used to insert a new target connection protocol into the stack and update its usage frequency after the communication request is processed, when the number of target connection protocols stored in the stack is less than the protocol number threshold.

[0120] The protocol release unit is used to release the new target connection protocol directly after the request is processed when the number of target connection protocols stored in the stack is equal to the protocol number threshold.

[0121] The stack top protocol acquisition module is used to acquire a target connection protocol from the top of the stack when the number of target connection protocols in the stack is not empty.

[0122] Optionally, the above-mentioned stack top protocol acquisition module includes:

[0123] The second protocol insertion unit is used to process the request using the target connection protocol when the target connection protocol is valid, and after the request is processed, insert the target connection protocol at the top of the stack and update the usage frequency.

[0124] The connection protocol deletion unit is used to remove the target connection protocol from the stack when the target connection protocol is invalid, and at the same time clear the usage frequency information of the target connection protocol. Then, a new target connection protocol is created to handle the request. After the communication request is processed, the new target connection protocol is inserted into the stack and its usage frequency is updated.

[0125] In this embodiment, the communication resource management device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0126] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0127] This invention also provides a computer device having the above-described features. Figure 6 The device shown is a management device for communication resources.

[0128] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.

[0129] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0130] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0131] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0132] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0133] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0134] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0135] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for managing communication resources, characterized in that, The method includes: Place all target connection protocols in the communication resource pool into the stack in a last-in-first-out order; When the current communication traffic volume is less than the communication traffic volume threshold, the target connection protocols that are idle or unused in the stack are actively released, and the target connection protocols that have been used most recently within a preset time are used for communication. This is so that after the platform is expanded, more nodes can manage storage resources through the target connection protocols, and a single storage device can be connected to more cloud platforms at the same time. When a communication request is received that communicates through the target connection protocol, the number of target connection protocols stored in the stack is counted. When the number of target connection protocols already stored in the stack is empty, a new target connection protocol is created in the communication resource pool to handle the communication request; If the number of target connection protocols already stored in the stack is not empty, then a target connection protocol is obtained from the top of the stack; When the target connection protocol is valid, the request is processed using the target connection protocol, and after the request is processed, the target connection protocol is inserted at the top of the stack and its usage frequency is updated. If the target connection protocol is invalid, the target connection protocol is removed from the stack, and the usage frequency information of the target connection protocol is cleared. Determining that the target connection protocol within the stack is in an idle state includes: Obtain the usage frequency of each target connection protocol in the stack within a preset time period; When the usage frequency of the target connection protocol is less than a frequency threshold within a preset time, the target connection protocol is determined to be in an idle state.

2. The method according to claim 1, characterized in that, After releasing the target connection protocol that is idle in the stack, the method further includes: Reset the usage frequency of each target connection protocol in the stack to its initial value.

3. The method according to claim 1, characterized in that, After creating a new target connection protocol, the method further includes: When the number of target connection protocols stored in the stack is less than the protocol number threshold, after the communication request is processed, the new target connection protocol is inserted into the stack and its usage frequency is updated. When the number of target connection protocols stored in the stack equals the protocol quantity threshold, the new target connection protocol is released directly after the request is processed.

4. The method according to claim 3, characterized in that, If the target connection protocol is invalid, the method further includes removing the target connection protocol from the stack and clearing its usage frequency information. A new target connection protocol is created to handle communication requests. After the communication request is processed, the new target connection protocol is inserted into the stack and its usage frequency is updated.

5. A communication resource management device, characterized in that, The device includes: The connection protocol processing module is used to place all target connection protocols in the communication resource pool into the stack in a last-in-first-out order; The connection protocol release module is used to actively release the target connection protocols that are idle or unused in the stack when the current communication traffic is less than the communication traffic threshold, and to prioritize the use of the target connection protocols that have been used most recently within a preset time for communication, so that after the platform is expanded, more nodes can manage storage resources through the target connection protocols, and at the same time, a storage device can be connected to more cloud platforms at the same time. When a communication request is received that communicates through the target connection protocol, the number of target connection protocols stored in the stack is counted. When the number of target connection protocols already stored in the stack is empty, a new target connection protocol is created in the communication resource pool to handle the communication request; If the number of target connection protocols already stored in the stack is not empty, then a target connection protocol is obtained from the top of the stack; When the target connection protocol is valid, the request is processed using the target connection protocol, and after the request is processed, the target connection protocol is inserted at the top of the stack and its usage frequency is updated. If the target connection protocol is invalid, the target connection protocol is removed from the stack, and the usage frequency information of the target connection protocol is cleared. Determining that the target connection protocol within the stack is in an idle state includes: Obtain the usage frequency of each target connection protocol in the stack within a preset time period; When the usage frequency of the target connection protocol is less than a frequency threshold within a preset time, the target connection protocol is determined to be in an idle state.

6. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 4.