Protocol channel connection method and device, storage medium and electronic device

By adopting three-level connection protocol channel method and coroutine technology in the SDN network, the scalability and efficiency problems caused by netconf channel resource consumption are solved, and efficient processing of data requests and system expansion are achieved.

CN118802436BActive Publication Date: 2024-12-24CHINA TELECOM CORP LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411266734.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-24
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

In the SDN network architecture, as the network scale increases, the resource consumption of the netconf channel limits the scalability and efficiency of the SDN controller, resulting in the failure of configuration dispatch or the long data acquisition cycle.

Method used

The protocol channel method using three-level connections includes virtual connections, named connections and entity connection channels. The message queue and coroutine scheduling queue are managed through coroutine technology, flexibly regulate the number of entity connection channels, and achieve elastic scaling of channel capabilities.

Benefits of technology

It improves the convenience and efficiency of data request processing, ensures the normal issuance of data requests, and can expand the system processing capabilities by adding named connections and entity connection channels when the network scale is expanded, without the need to modify upper-level applications on a large scale.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802436B_ABST
    Figure CN118802436B_ABST
Patent Text Reader

Abstract

The present disclosure provides a connection method and device for a protocol channel, a storage medium, and an electronic device. The method includes: creating a first virtual connection in response to a first data request for network configuration of a first network device generated by a first upper-layer application; the first data request has a first tag type; determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection; establishing a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection, and the first physical connection channel. The method can construct a three-level connected protocol channel, simplify the interactive mode of sending upper-layer application requests, and can flexibly adjust the number of physical connection channels under the named connection to meet the requirements of elastic scalability of channel capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the SDN (Software Defined Network) network architecture, upper-layer applications can be configured and managed based on network devices using the Netconf (Network Configuration Protocol) protocol.

[0003] In related technologies, as the scale of the network increases, SDN controllers are increasingly faced with high-concurrency scenarios. The resource consumption of the Netconf channel greatly limits the scalability and efficiency of the SDN controller. Problems such as configuration failure or very long data collection cycle often occur due to Netconf channel blocking.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a connection method and device for a protocol channel, a storage medium and an electronic device, which can construct a three-level connection protocol channel, simplify the interaction mode of sending upper-layer application requests, and flexibly adjust the number of physical connection channels under the named connection to meet the demand for elastic scalability of channel capabilities and ensure the normal sending of data requests.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a connection method for a protocol channel is provided, including: creating a first virtual connection in response to a first data request for network configuration of a first network device generated by a first upper-layer application; the first data request has a first tag type; determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection; establishing a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel.

[0008] In one embodiment of the present disclosure, the first physical connection channel is created through a coroutine; wherein, the first data request is sent to the first network device through the first virtual connection, the first named connection and the first physical connection channel, including: storing the first data request in the message queue of the first named connection through the first virtual connection; generating a first processing task corresponding to the first data request, and storing the first processing task in the coroutine scheduling queue corresponding to the first physical connection channel; in response to the first processing task in the coroutine scheduling queue being consumed, the first physical connection channel consumes the first data request from the message queue of the first named connection, and sends the first data request to the first network device.

[0009] In one embodiment of the present disclosure, determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection, include: determining the named connection pool corresponding to the first network device; in response to the absence of a named connection matching the first tag type in the named connection pool, creating a first named connection matching the first tag type in the named connection pool, and creating a first physical connection channel under the first named connection.

[0010] In one embodiment of the present disclosure, creating a first named connection matching the first tag type in the named connection pool includes: acquiring named connection configuration data; the named connection configuration data includes: a channel concurrency threshold and a named connection timeout threshold corresponding to the first tag type; and creating a first named connection matching the first tag type in the named connection pool according to the named connection configuration data.

[0011] In one embodiment of the present disclosure, the connection method of the protocol channel further includes: in response to the absence of a physical connection channel under the first named connection and the idle time of the first named connection exceeding the named connection timeout threshold, destroying the first named connection.

[0012] In one embodiment of the present disclosure, creating a first physical connection channel under the first named connection includes: acquiring physical connection configuration data; the physical connection configuration data includes a physical connection timeout threshold; and creating the first physical connection channel under the first named connection according to the physical connection timeout threshold.

[0013] In one embodiment of the present disclosure, the protocol channel connection method further includes: in response to an idle time length of the first physical connection channel exceeding the physical connection timeout threshold, destroying the first physical connection channel.

[0014] In one embodiment of the present disclosure, creating a first virtual connection includes: acquiring virtual connection configuration data; the virtual connection configuration data includes a virtual connection timeout threshold; and creating the first virtual connection according to the virtual connection timeout threshold.

[0015] In one embodiment of the present disclosure, the connection method of the protocol channel also includes: in response to the idle time of the first virtual connection not exceeding the virtual connection timeout threshold, maintaining the binding relationship and maintaining the existence of a physical connection channel under the first named connection; in response to the idle time of the first virtual connection exceeding the virtual connection timeout threshold, releasing the binding relationship and destroying the first virtual connection.

[0016] In one embodiment of the present disclosure, the connection method of the protocol channel also includes: when the physical connection channel under the first named connection has reached the channel concurrency threshold, in response to the data request for the first network device satisfying the channel expansion condition, adjusting the channel concurrency threshold configured for the first named connection based on the channel volume threshold supported by the first network device; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0017] In one embodiment of the present disclosure, determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection, include: in response to the existence of a named connection matching the first tag type in the named connection pool, determining the existing named connection matching the first tag type as the first named connection; in response to the existence of an idle physical connection channel under the first named connection, determining the idle physical connection channel as the first physical connection channel; in response to the absence of an idle physical connection channel under the first named connection and the physical connection channel under the first named connection does not exceed a channel concurrency threshold, creating a first physical connection channel under the first named connection; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0018] In one embodiment of the present disclosure, the method also includes: creating a second virtual connection in response to a second data request from a second upper layer application for network configuration of the first network device; the second data request has the first tag type; establishing a binding relationship between the second virtual connection and the first named connection; and sending the second data request to the first network device through the second virtual connection, the first named connection and the first physical connection channel.

[0019] According to another aspect of the present disclosure, a connection device for a protocol channel is provided, including: a creation unit, used to create a first virtual connection in response to a first data request generated by a first upper-layer application for network configuration of a first network device; the first data request has a first tag type; a determination unit, used to determine a first named connection matching the first tag type in a named connection pool, and determine a first physical connection channel under the first named connection; a binding unit, used to establish a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel.

[0020] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method for connecting the protocol channels is implemented.

[0021] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned method for connecting the protocol channel by executing the executable instructions.

[0022] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the above-mentioned method for connecting the protocol channels is implemented.

[0023] The connection method of the protocol channel provided by the embodiment of the present disclosure can divide the protocol channel connection into three levels: virtual connection, named connection, and physical connection channel, so that the upper-layer application can interact with the SDN controller only through the virtual connection, and thus does not need to care about the creation, maintenance, and destruction of the underlying connection, thereby improving the convenience of data request processing; and, in the three-level connection mode, the number of physical connection channels under the named connection can also be flexibly adjusted to meet the needs of elastic scalability of channel capabilities, making the processing and forwarding of network configuration requests more efficient and flexible, and ensuring the normal issuance of data requests. In addition, as the scale of the network expands and the number of upper-layer applications increases, this method can easily expand the processing capacity of the system by increasing the number of named connections and physical connection channels without large-scale modification or reconstruction of upper-layer applications.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0026] Figure 1 A schematic diagram of an exemplary scenario is shown in which the connection method of the protocol channel of the embodiment of the present disclosure can be applied.

[0027] Figure 2 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0028] Figure 3 A flowchart of processing a first data request in a protocol channel connection method according to an embodiment of the present disclosure is shown.

[0029] Figure 4 A flowchart of processing a data request through a coroutine in a protocol channel connection method according to an embodiment of the present disclosure is shown.

[0030] Figure 5 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0031] Figure 6 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0032] Figure 7 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0033] Figure 8 A schematic diagram showing a three-level NETCONF connection in a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0034] Fig. 9 A block diagram of a protocol channel connection device according to an embodiment of the present disclosure is shown.

[0035] Fig.10 A structural block diagram of a computer device connected to a protocol channel in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0037] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0038] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0039] In related technologies, as the scale of the network increases, SDN controllers are increasingly faced with high-concurrency scenarios. For example, metropolitan area network controllers (i.e., SDN controllers) often need to initiate multiple scheduled collection tasks (such as collecting device data, manufacturer model / version / board information data, interface traffic statistics data, SRv6 Policy traffic data, etc.) for thousands of network devices through the Netconf channel at the same time. At the same time, the Netconf channel needs to respond to a large number of service activation, service diagnosis, operation and maintenance requests.

[0040] Figure 1 FIG. 1 is a schematic diagram showing an exemplary scenario in which the connection method of the protocol channel of the embodiment of the present disclosure can be applied. Figure 1 As shown, it includes: upper layer application 100, SDN control 101, self-consistent system 102, self-consistent system 103, the self-consistent system 102 has network devices 104, 105, 106, and the self-consistent system 103 has network devices 107, 108.

[0041] refer to Figure 1The SDN controller 101 can establish a NETCONF protocol channel with the network devices 105, 106, and 108, and can concurrently send configuration or data collection and other control instructions generated by the upper-layer application 100 to the network devices 105, 106, and 108 based on the NETCONF protocol.

[0042] In an exemplary embodiment, the network devices may include routers (such as border routers) and switches.

[0043] In an exemplary embodiment, the process of the SDN control 101 for implementing the connection method of the protocol channel may be: the SDN control 101 creates a first virtual connection in response to a first data request for network configuration of a first network device generated by an upper-layer application 100; the first data request has a first label type; the SDN control 101 determines a first named connection matching the first label type in a named connection pool, and determines a first physical connection channel under the first named connection; the SDN control 101 establishes a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the network device 108 in the self-consistent system 103 through the first virtual connection, the first named connection and the first physical connection channel.

[0044] In addition, it should be noted that Figure 1 What is shown is only one application environment of the connection method of the protocol channel provided by the present disclosure. Figure 1 The number of upper-layer applications, self-consistent systems, and network devices is merely illustrative, and any number of upper-layer applications, self-consistent systems, and network devices may be provided according to actual needs.

[0045] Figure 2 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be performed as follows: Figure 1 The SDN control 101 is shown as executing, but the present disclosure is not limited thereto.

[0046] In the following examples, the SDN control 101 is used as an execution subject for example description.

[0047] like Figure 2 As shown, the connection method of the protocol channel provided by the embodiment of the present disclosure may include the following steps.

[0048] Step S201: creating a first virtual connection in response to a first data request for performing network configuration on a first network device generated by a first upper layer application; the first data request has a first tag type.

[0049] In the disclosed embodiment, the first upper layer application may be an operator orchestrator, a data management platform, etc. The first data request may be a Netconf request generated by the first upper layer application based on actual business needs. Netconf (Network Configuration Protocol) is a network device configuration and management protocol that provides a standardized method to access the configuration and status information of network devices. Through the Netconf protocol, administrators can remotely configure network devices, obtain device information, and monitor and manage the operating status of network devices.

[0050] The first network device is a managed network device in network management, including but not limited to routers, switches, firewalls, servers, storage devices, etc. The first data request may be a configuration delivery instruction, a data collection instruction, or other control instructions, and the first data request may include specific configuration information that needs to be sent to the first network device.

[0051] Each data request may carry a specific tag type, which is used to distinguish different request types for subsequent corresponding processing. In an exemplary embodiment, the tag type may be one of the following: configuration delivery type, data collection type, and default type.

[0052] In an exemplary embodiment, after the first upper layer application generates an original request, the network mapping service of the SDN controller may be used to translate the original request, and the netconf message obtained by the translation is used as the first data request.

[0053] In the disclosed embodiment, a first virtual connection can be dynamically created in response to the generation of the first data request. This virtual connection is a logical connection that can be used to manage the data request generated by the first upper layer application and to establish a communication path with a specific network device in subsequent steps.

[0054] In an exemplary embodiment, the process of creating a first virtual connection may involve configuring a first tag type, generating a virtual connection name (such as a unique identifier), allocating necessary resources (such as memory space, database records, etc.), and setting properties of the named connection (such as a timeout threshold, etc.).

[0055] In the embodiment of the present disclosure, a service node can be selected in the SDN service cluster according to a preset scheduling policy as a service instance for implementing the first virtual connection. The service node can process a data request that the first upper layer application wants to process through the first virtual connection.

[0056] In an exemplary embodiment, if the first upper layer application already has a virtual connection, the virtual connection may be directly used as the first virtual connection.

[0057] Through this embodiment, the first upper layer application can interact with the SDN controller through the first virtual connection without worrying about the creation, maintenance and destruction of the underlying connection, and all data requests sent through the first virtual connection can be easily retrieved and managed.

[0058] Step S203: determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection.

[0059] In the disclosed embodiment, a named connection pool may be maintained for the first network device, and the named connection pool may contain multiple named connections, each of which matches a tag type and can be used to process a corresponding type of data request for the first network device. The number of physical connection channels under the named connection may also be flexibly adjusted to meet the need for elastic scalability of channel capacity. The maximum number of physical connection channels allowed under the first named connection may be a preconfigured channel concurrency threshold.

[0060] In an exemplary embodiment, each managed network device may be configured with a corresponding named connection pool. When determining the named connection for a data request and its underlying physical connection channel, the determination may be made in the named connection pool corresponding to the issuing network device object of the data request.

[0061] Among them, the named connection can be regarded as an abstract representation of the underlying physical connection channel, which facilitates the management of the physical connection channel. The named connection can provide a simple, easy-to-understand and manage name or identifier for the complex physical connection channel, so that the upper-layer application can send and receive data by referencing the named connection without having to care about the actual connection details.

[0062] According to the first tag type in the data request, it is possible to search in the named connection pool whether there is a matching first named connection. If so, the first physical connection channel corresponding to the named connection can be further determined; if not, a first named connection matching the first tag type can be created, and a first physical connection channel can be created.

[0063] The first named connection and the first physical connection channel under it can be considered to have a strong binding relationship. The physical connection channel under the named connection is a physical or logical channel actually used for data transmission, which can be directly connected to the target network device (such as the first network device).

[0064] Step S205: establishing a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel.

[0065] In the disclosed embodiment, a binding relationship may be established between the previously created first virtual connection and the determined first named connection to form a three-level connection consisting of the first virtual connection, the first named connection, and the first physical connection channel. The three-level connection may be used as a complete communication path to connect the upper-layer application with the actual network device.

[0066] Through the communication path of virtual connection→named connection→physical connection channel, the first data request can be sent to the first network device, so that the first network device makes corresponding network configuration adjustments according to the received instructions.

[0067] In an exemplary embodiment, the "virtual connection-named connection-physical connection channel" can be regarded as a long connection between an upper-layer application and a managed network device.

[0068] In an exemplary embodiment, an upper layer should have only one virtual connection. When the upper layer application generates data requests with multiple tag types, the virtual connection can be bound to the named connections with multiple tag types to process data requests with various tag types through the virtual connection and the bound multiple named connections and the physical connection channels under them.

[0069] In an exemplary embodiment, multiple virtual connections corresponding to multiple upper-layer applications can be bound to a named connection to send data requests of a certain type of tag generated by multiple upper-layer applications to corresponding network devices through their respective virtual connections and the bound named connection and the physical connection channel under it.

[0070] In an exemplary embodiment, the virtual connection may be a "virtual netconf connection", the named connection may be a "netconf named connection", and the physical connection channel may be a "physical netconf connection".

[0071] Through the disclosed embodiment, a virtual connection can be created for the upper layer application that generates a data request, a named connection and a physical connection channel that match the tag type of the data request can be found, and the virtual connection and the named connection can be bound to form a three-level connection consisting of a virtual connection, a named connection and a physical connection channel, so as to send the data request to the corresponding network device. It can be seen that the disclosed embodiment can divide the protocol channel connection into three levels: virtual connection, named connection, and physical connection channel, so that the upper layer application can interact with the SDN controller only through the virtual connection, and then there is no need to care about the creation, maintenance and destruction of the underlying connection, which improves the convenience of data request processing; and in the three-level connection mode, the number of physical connection channels under the named connection can also be flexibly adjusted to meet the needs of elastic scalability of the channel capacity, so that the processing and forwarding of the network configuration request is more efficient and flexible, and the normal sending of the data request is guaranteed. In addition, with the expansion of the network scale and the increase in the number of upper layer applications, the method can easily expand the processing capacity of the system by increasing the number of named connections and physical connection channels without large-scale modification or reconstruction of the upper layer applications.

[0072] Figure 3 FIG. 1 is a flow chart showing a method for connecting a protocol channel according to an embodiment of the present disclosure for processing a first data request. Figure 3 As shown, in some embodiments, sending the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel may include the following steps.

[0073] Step S301: Store the first data request in the message queue of the first named connection through the first virtual connection.

[0074] In the embodiment of the present disclosure, the service node for implementing the first virtual connection may process all data requests received by the first virtual connection, and send the data requests to the message queue of the first named connection.

[0075] A message queue may be set for each named connection to store data requests received by all virtual connections bound to the named connection from corresponding upper layer applications.

[0076] Step S303: Generate a first processing task corresponding to the first data request, and store the first processing task in a coroutine scheduling queue corresponding to the first physical connection channel.

[0077] In the embodiment of the present disclosure, the first physical connection channel is created through a coroutine.

[0078] The physical connection channel for communicating with network devices is built based on coroutine technology. Coroutine is a lightweight thread that can execute multiple tasks in a single thread and improve the concurrent performance of the program through cooperative multitasking. Using coroutines to create connection channels can more effectively manage and schedule network communication tasks.

[0079] In the disclosed embodiment, the first processing task may indicate that the first physical connection channel consumes the first data request from the message queue of the first named connection and sends the first data request to the first network device, that is, the first processing task represents the operation of sending the data request to the network device. After the first processing task is generated, it will be added to the coroutine scheduling queue corresponding to the first physical connection channel, and the coroutine scheduling queue can manage the execution of the tasks therein.

[0080] In the disclosed embodiment, all physical connection channels under the named connection are created through coroutines, and each physical connection channel corresponds to a coroutine scheduling queue. In the Goroutine scheduling mechanism, P (Processor) represents a virtual processor, which can be used to manage a set of local queues (i.e., coroutine scheduling queues), which contain G (Goroutines) coroutines to be executed (i.e., the first processing task). M (Machine) represents a machine bound to an operating system thread, and each M is responsible for executing a G coroutine on the bound thread. M can execute the G coroutine in the local queue managed by P after establishing an association with P. Among them, one M can be associated with one P at a time, and M can also switch between multiple Ps.

[0081] Step S305 , in response to the first processing task in the coroutine scheduling queue being consumed, the first physical connection channel consumes the first data request from the message queue of the first named connection, and sends the first data request to the first network device.

[0082] In the disclosed embodiment, when there are multiple concurrent physical connection channels under a named connection, all physical connection channels under the named connection will continuously and concurrently consume data requests in the message queue of the named connection, and concurrently send the data requests to the corresponding network devices until all data requests in the message queue are consumed. The above process embodies the combination of asynchronous processing and message transmission, ensuring that data requests can be processed and sent in a predetermined order and timing, thereby achieving efficient and orderly data transmission.

[0083] Through this embodiment, the coroutine technology is introduced on the slow protocol communication such as netconf, so that the requests in the message queue of the named connection can be efficiently processed. These coroutines are responsible for sending the data requests in the message queue of the named connection to the network device using the physical connection channel in a high-concurrency manner. Through the lightweight and efficient switching characteristics of the coroutine, the system can quickly respond to and process a large number of concurrent data requests, ensuring the high concurrency performance of the SDN controller.

[0084] In an exemplary embodiment, this solution is not only applicable to the netconf protocol, but also applicable to other slow protocol scenarios such as ssh, telnet, snmp, etc., and the present disclosure does not limit this.

[0085] Figure 4 A flowchart of processing a data request through a coroutine in a method for connecting a protocol channel according to an embodiment of the present disclosure is shown. Figure 4 As shown, it is a data request processing scenario with a concurrency of 4 for a physical connection channel, which includes: a task production unit 400, machines M1, M2, M3, M4, virtual processors P1, P2, P3, P4, and coroutine scheduling queues 401, 402, 403, and 404, wherein the coroutine scheduling queues 401, 402, 403, and 404 each have 4 G coroutines to be executed (i.e., processing tasks).

[0086] In an exemplary embodiment, Figure 4 A schematic diagram showing four entity connection channels performing data request processing simultaneously under Goroutine scheduling is shown.

[0087] Among them, M (Machine) represents the machine, that is, the operating system thread. In Go, each M is bound to an operating system thread and is responsible for executing the G (Goroutines) coroutine on the thread. Each M can run a G coroutine at a time. The G coroutine in this solution includes computing tasks such as "the physical netconf connection (that is, the physical connection channel) consumes the netconf request (that is, the data request) from the message queue of the netconf named connection (that is, the named connection) and sends the request to the physical network element device (that is, the network device)", and the task of the physical netconf connection listening to the device message.

[0088] P (Processor) stands for virtual processor, which is part of the Go scheduler. The role of P is to manage a set of local queues, which contain G coroutines to be executed. Each P is associated with an M, but an M can switch between multiple Ps, which is an optimization of the Go runtime system. After obtaining P, M can execute the G code (i.e. G coroutine) in the P queue.

[0089] Local queue (i.e. coroutine scheduling queue): The local queue is a queue associated with P, and the queue elements are G coroutine computing tasks to be executed. These queues are usually first-in-first-out (FIFO), but in the Go concurrency model, different Ps manage the execution of G coroutines in different ways. P takes the G coroutine out of the local queue and executes it on its associated M.

[0090] refer to Figure 4 , the workflow of Go coroutine to implement concurrency can include the following steps.

[0091] Step 1) When a Netconf data request (i.e., data request) is sent to the Netconf service layer, a new computing task of "the physical Netconf connection consumes the Netconf request from the message queue of the Netconf named connection and sends the request to the physical network element device" is created and placed in a local queue through P as a G coroutine, which is a linear queue (FIFO).

[0092] Step 2) M (operating system thread) continuously consumes G coroutines from the local queue of P associated with it and executes them. In this embodiment, a netconf named connection supporting a maximum of 4 concurrencies is used as an example for illustration, but the present disclosure is not limited to this. When 4 physical netconf connections are running concurrently, it is equivalent to executing up to 4 G computing tasks at the same time. These 4 G coroutines are continuously scheduled by M, and the G computing tasks are to continuously consume the netconf requests in the netconf named connection message queue. The 4 computing tasks will consume the netconf requests in the same message queue at the same time until the netconf requests are consumed. Afterwards, if the timeout duration of the netconf named connection reaches the preset threshold, it can be destroyed and deleted.

[0093] Step 3) If a G-coroutine needs to wait for I / O, sleep, or communication operations during execution (such as synchronous calls waiting for the device to return a response message), M can proactively give up execution and hand over control to other ready G-coroutines instead of blocking the entire thread. This has the effect that a thread can "simultaneously" execute multiple G-coroutines, that is, from a macro perspective, the effect of "M concurrently processing multiple G computing tasks in the local queue of P associated with M" is achieved.

[0094] Step 4) When a G coroutine finishes execution or the operation it is waiting for is completed, it can be removed from the queue to release resources.

[0095] Step 5) The G-routines in P's local queue can be executed concurrently because each M can find executable tasks in its local queue. This enables multiple G-routines to run simultaneously on different M's, achieving concurrent execution.

[0096] Figure 5 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0097] In the disclosed embodiment, Figure 5 In the connection method of the protocol channel shown in FIG. 1 , steps S501 and S507 are respectively Figure 2 Steps S201 and S205 in the connection method of the protocol channel shown correspond to each other and will not be repeated here.

[0098] In the embodiment of the present disclosure, Figure 2 Based on the connection method of the protocol channel shown, Figure 5 The connection method of the protocol channel shown may also include the following steps.

[0099] Step S503: determine the named connection pool corresponding to the first network device.

[0100] In the disclosed embodiment, each managed network device can be configured with a corresponding named connection pool. Configuring an independent named connection pool for each network device can ensure that configuration requests between different network devices are logically isolated. This helps reduce network problems caused by configuration errors or conflicts.

[0101] In an exemplary embodiment, different network devices may have different configuration requirements and performance requirements. By configuring an independent named connection pool for each network device, customized configuration can be performed according to the characteristics of the network device to optimize performance and resource utilization.

[0102] Step S505: in response to the absence of a named connection matching the first tag type in the named connection pool, creating a first named connection matching the first tag type in the named connection pool, and creating a first physical connection channel under the first named connection.

[0103] In the disclosed embodiment, if a named connection matching the tag type of the current request is not found in the named connection pool, a new named connection that meets the requirements can be created in the named connection pool, that is, a named connection matching the tag type of the current request is created. At the same time, the system also creates a physical connection channel for the named connection.

[0104] In an exemplary embodiment, configuration information of named connections matching different tag types may be preset, and the configuration information may include information such as the tag type, the maximum concurrent number of supported physical connection channels, and the like.

[0105] Figure 6 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0106] In the disclosed embodiment, Figure 6 In the connection method of the protocol channel shown in FIG. 1 , steps S601, S603, and S611 are respectively Figure 5 Steps S501, S503, and S507 in the connection method of the protocol channel shown correspond to each other and are not repeated here.

[0107] In the embodiment of the present disclosure, Figure 5 Based on the connection method of the protocol channel shown, Figure 6 The connection method of the protocol channel shown may also include the following steps.

[0108] Step S605, in response to the absence of a named connection matching the first tag type in the named connection pool, obtaining named connection configuration data; the named connection configuration data includes: a channel concurrency threshold and a named connection timeout threshold corresponding to the first tag type.

[0109] The named connection configuration data may be stored in a configuration file or a database. The channel concurrency threshold may represent the maximum number of physical connection channels that can be established simultaneously for the named connection of the first tag type. It may be used as an expansion limit to help the system control the concurrent access to the network device to prevent overload or resource exhaustion.

[0110] The named connection timeout threshold can indicate how long a named connection will be considered stale or invalid after no activity (i.e. no data or instructions are transmitted through it). It helps to free up resources that are no longer needed and reduce redundancy in the named connection pool.

[0111] Step S607: Create a first named connection matching the first tag type in the named connection pool according to the named connection configuration data.

[0112] In the disclosed embodiment, after obtaining the named connection configuration data, the system can create a first named connection matching the first tag type in the named connection pool. The creation process may involve allocating necessary resources (such as memory space, database records, etc.), setting properties of the named connection (such as channel concurrency threshold, timeout threshold, etc.), and adding it to the appropriate location of the named connection pool for subsequent search and use.

[0113] In an exemplary embodiment, named connections of different tag types may have different configuration contents. For example, assuming that in a certain business environment, the number of configuration delivery type control instructions for network devices is greater than the number of data collection type control instructions, a higher channel concurrency threshold may be set in the named connection configuration data of the tag type config (configuration delivery), and a lower channel concurrency threshold may be set in the named connection configuration data of the tag type collect (data collection), to adapt to the business environment where the number of configuration delivery instructions is greater than the number of data collection instructions, and to meet the large demand for configuration delivery.

[0114] Step S609: creating a first physical connection channel under the first named connection.

[0115] In the embodiment of the present disclosure, the first physical connection channel can be created within the allowed configuration range of the first named connection. For example, assuming that the physical connection channel existing under the first named connection has not reached the channel concurrency threshold, the physical connection channel can be created, otherwise the physical connection channel is not created.

[0116] Through the embodiments of the present disclosure, named connections can be flexibly created and managed according to the requirements of upper-layer applications and the configuration of network devices, thereby optimizing the connection efficiency and resource utilization of protocol channels.

[0117] In one embodiment of the present disclosure, the connection method of the protocol channel further includes: in response to the absence of a physical connection channel under the first named connection and the idle time of the first named connection exceeding the named connection timeout threshold, destroying the first named connection.

[0118] In the disclosed embodiment, the effectiveness management of named connections and resource utilization can be further improved by monitoring the idle time of named connections and destroying named connections that are no longer needed accordingly.

[0119] Through the disclosed embodiments, the connection method of the protocol channel can more effectively manage the resources in the named connection pool, avoiding waste of resources and unnecessary occupation. At the same time, the no longer needed named connections are destroyed in a timely manner, which can help improve the stability and performance of the system.

[0120] Figure 7 A flowchart of a method for connecting a protocol channel according to an embodiment of the present disclosure is shown.

[0121] In the disclosed embodiment, Figure 7 In the connection method of the protocol channel shown in FIG. 1 , steps S701, S703, and S711 are respectively Figure 5 Steps S501, S503, and S507 in the connection method of the protocol channel shown correspond to each other and are not repeated here.

[0122] In the embodiment of the present disclosure, Figure 5 Based on the connection method of the protocol channel shown, Figure 7 The connection method of the protocol channel shown may also include the following steps.

[0123] Step S705: In response to the absence of a named connection matching the first tag type in the named connection pool, create a first named connection matching the first tag type in the named connection pool.

[0124] Step S707, obtaining entity connection configuration data; the entity connection configuration data includes a physical connection timeout threshold.

[0125] In the embodiment of the present disclosure, before creating a physical connection channel, the system needs to obtain configuration data related to the physical connection. Such data may be stored in a configuration file or a database.

[0126] The entity connection timeout threshold can be used to define the length of time after which there is no activity (i.e. no data or instructions are transferred) on an entity connection before it is considered stale or invalid and may trigger a close or reclaim action.

[0127] Step S709: creating a first physical connection channel under the first named connection according to the physical connection timeout threshold.

[0128] In the process of creating the first physical connection channel, the system may configure the physical connection timeout threshold as an attribute of the connection channel, so that the system can monitor the activity of the channel.

[0129] In an exemplary embodiment, network configuration authentication information of the first network device may also be determined according to the first data request, such as user name, login password, etc. Then, a first physical connection channel under the first named connection is created based on the network configuration authentication information of the first network device.

[0130] Through this embodiment, it can be ensured that only authorized data requests can be processed and used to create named connections and physical connection channels. Through the connection method of the protocol channel including authentication, a higher level of security can be provided to ensure that only authorized requests can be processed and used to modify the configuration of network devices. This is crucial to protecting network infrastructure from unauthorized access and potential security threats.

[0131] In some embodiments, the connection method of the protocol channel further includes: in response to an idle time length of the first physical connection channel exceeding the physical connection timeout threshold, destroying the first physical connection channel.

[0132] In the disclosed embodiment, the idle time of the physical connection channel may refer to the time since the last data transmission through the channel. Monitoring the idle time of the physical connection channel and taking destruction measures when it exceeds the preset physical connection timeout threshold can more effectively manage the life cycle of the physical connection channel, ensure the rational use of resources, and improve the overall performance and security of the system.

[0133] In some embodiments, creating a first virtual connection includes: acquiring virtual connection configuration data; the virtual connection configuration data includes a virtual connection timeout threshold; and creating the first virtual connection according to the virtual connection timeout threshold.

[0134] In the embodiment of the present disclosure, in the process of creating a virtual connection, virtual connection configuration data may be obtained first, and the virtual connection timeout threshold included in the virtual connection configuration data may be used to define the maximum time that the virtual connection can remain open without any activity (such as processing data requests, data transmission). If this threshold is exceeded, the virtual connection will be automatically closed to release system resources.

[0135] In some embodiments, the connection method of the protocol channel also includes: in response to the idle time of the first virtual connection not exceeding the virtual connection timeout threshold, maintaining the binding relationship and maintaining the existence of a physical connection channel under the first named connection; in response to the idle time of the first virtual connection exceeding the virtual connection timeout threshold, releasing the binding relationship and destroying the first virtual connection.

[0136] In the disclosed embodiment, the system can continuously monitor the idle time of each virtual connection, that is, the time that has passed since the last time data was sent or received through the virtual connection. If the idle time of a virtual connection (such as the first virtual connection) does not exceed its corresponding virtual connection timeout threshold, the system will maintain the binding relationship between the virtual connection and the named connection, and retain the physical connection channel under the named connection. Among them, maintaining the existence of the physical connection channel and ensuring the availability of the connection are crucial to ensuring smooth network communication, which can ensure that communication can be quickly restored when needed, and avoid frequent establishment and destruction of the long connection of "virtual connection-named connection-physical connection channel".

[0137] In an exemplary embodiment, the method of maintaining the existence of a physical connection channel under a named connection may be: regularly detecting whether there is at least one physical connection channel under the bound named connection, and if there is no physical connection channel, creating a new physical connection channel under the bound named connection to maintain a long connection. For example, a heartbeat message may be regularly sent to the physical connection channel to detect whether the connection is still active. If a response is received, it means that the connection is normal; if there is no response or the response times out, the operation may be resumed, that is, a new physical connection channel may be created.

[0138] In an exemplary embodiment, a method for maintaining a physical connection channel under a named connection may also be: when there is only one physical connection channel under the named connection to which the virtual connection is bound, when the idle time of the physical connection channel exceeds the physical connection timeout threshold, it is possible to first detect whether the idle time of the virtual connection exceeds the virtual connection timeout threshold. If not, the physical connection channel is not destroyed, so as to retain the physical connection channel and maintain the physical connection channel under the named connection.

[0139] In the disclosed embodiment, if the idle time of a virtual connection exceeds its timeout threshold, the system will perform a series of cleanup operations. On the one hand, the binding relationship between the virtual connection and the named connection can be released, which means that the virtual connection will no longer be used to forward any request to the network device corresponding to the named connection. On the other hand, the system can destroy the virtual connection and release the system resources occupied by it, such as memory, file descriptors, etc., to reduce unnecessary resource occupation and improve the response speed and stability of the system.

[0140] Through the embodiments of the present disclosure, the existence or destruction of long connections can be managed by setting a virtual connection timeout threshold, and resource occupancy can be automatically adjusted, so that the system can more effectively utilize limited resources, reduce resource waste, and thus improve the overall efficiency and resource utilization of the system.

[0141] In some embodiments, the connection method of the protocol channel also includes: when the physical connection channel under the first named connection has reached the channel concurrency threshold, in response to the data request for the first network device satisfying the channel expansion condition, adjusting the channel concurrency threshold configured for the first named connection based on the channel volume threshold supported by the first network device; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0142] In the disclosed embodiments, the capability of the channel concurrency threshold can be dynamically adjusted to meet the network management requirements in different scenarios.

[0143] In an exemplary embodiment, when the physical connection channel under the named connection corresponding to the network device (such as the first network device) has reached its preset channel concurrency threshold (i.e., the maximum number of connections allowed), if it is found that the data request for the network device meets the channel expansion conditions (such as the number of requests continues to increase, the current request priority is higher, etc.), the channel concurrency threshold of the named connection can be updated and adjusted according to the channel threshold supported by the network device. This dynamic adjustment mechanism helps to make full use of the resources of the network device and improve the efficiency and flexibility of network management.

[0144] Through the embodiments of the present disclosure, the dynamic adjustment of the channel concurrency threshold can efficiently manage network communication resources and reduce resource waste and conflicts. As the network environment changes and the demand grows, this method can conveniently manage long connections and easily expand the coverage of long connections, meeting the complex and changeable configuration management requirements in the network environment.

[0145] Figure 8 FIG. 1 is a schematic diagram showing a three-level NETCONF connection in a method for connecting a protocol channel according to an embodiment of the present disclosure. Figure 8 As shown, it includes: a virtual Netconf connection 801 of a first upper layer application, a virtual Netconf connection 802 of a second upper layer application, a Netconf named connection 803 with a tag type of config type, and a Netconf named connection 804 with a tag type of collect type; wherein Netconf named connections 803 and 804 are both named connections in a named connection pool corresponding to the first network device; the virtual Netconf connection 801 has a binding relationship with the Netconf named connection 803, the virtual Netconf connection 801 has a binding relationship with the Netconf named connection 804, and the virtual Netconf connection 802 has a binding relationship with the Netconf named connection 804; there are 4 concurrent physical Netconf connections under the Netconf named connection 803, and there are 3 concurrent physical Netconf connections under the Netconf named connection 804.

[0146] refer to Figure 8 , the first upper layer application can process the data request generated by it for the first network device through the virtual netconf connection 801. When the first upper layer application generates a data request of the config type, the data request of the config type can be sent to the first network device through the virtual netconf connection 801, the netconf named connection 803 with the tag type of the config type bound to the virtual netconf connection 801, and one of the four physical netconf connections under the netconf named connection 803; when the first upper layer application generates a data request of the collect type, the data request of the collect type can be sent to the first network device through the virtual netconf connection 801, the netconf named connection 804 with the tag type of the collect type bound to the virtual netconf connection 801, and one of the three physical netconf connections under the netconf named connection 804.

[0147] Similarly, the second upper layer application can process the data request generated by it for the first network device through the virtual netconf connection 802. When the second upper layer application generates a collect type data request, the collect type data request can be sent to the first network device through the virtual netconf connection 802, the netconf named connection 804 with a tag type of collect bound to the virtual netconf connection 802, and one of the three physical netconf connections under the netconf named connection 804. When the second upper layer application generates a config type data request, it is necessary to first establish a binding relationship between the virtual netconf connection 802 and the netconf named connection 803 with a tag type of config, and then send the config type data request to the first network device through the virtual netconf connection 802, the netconf named connection 803 and the physical netconf connection under it.

[0148] refer to Figure 8 In an exemplary embodiment, the creation of a three-level Netconf connection may include the following three aspects: First, create a first-level connection: a "virtual Netconf connection". A "virtual Netconf connection" is triggered when an upper-layer application calls the underlying channel protocol (Netconf protocol) to send configurations to a network device. The purpose of creating a "virtual Netconf connection" includes: managing requests and managing long connections. A "virtual Netconf connection" may have the following attributes: workerid (service node id), devid (network device id), vcid (virtual connection id), idle_duration (maximum idle duration, i.e., virtual connection timeout threshold, Figure 8 It is assumed that the idle_duration is 1200 seconds as an example, but the present disclosure is not limited to this), the requested rpc message id information (remote procedure call id), the requested rpcs_id information (remote call instruction group id), the data tag type (data tag) carried by the request, create_time (connection creation time), existence_time (connection existence duration) and other attributes.

[0149] Next, create the second level connection: "netconf named connection". "Netconf named connection" is triggered when creating a "virtual netconf connection" and is used to manage the entity netconf connection channel. "Netconf named connection" can have the following attributes: workerid (service node id), devid (network device id), connet_name (named connection name), tag (tag type), max_count (maximum number of concurrent channels, i.e. channel concurrency threshold), count (current number of concurrent channels), max_ idle (named connection timeout threshold, Figure 8 In the example, it is assumed that max_idle is 60 seconds, but the present disclosure is not limited to this), data_tags (data tag set), connects_status (the current status of the physical connection channel under the named connection), check_period (check period), callback timeout (callback timeout), frame_max_size (frame maximum size), framming_method (frame format method), device_active_duration (device active duration) and other attributes. Through these attributes, the tag type of data request supported by the named connection, the maximum number of concurrent channels supported, the check period for checking whether the physical netconf connection is idle, the frame size that the physical netconf connection can send, the maximum idle time of the named connection, the maximum callback timeout of the request in the named connection, the threshold number of triggering compression requests or responses, etc. can be set.

[0150] for Figure 8 The tag type in the netconf named connection 803 is of the config type, and it is assumed that the max_count is 4 as an example, but the present disclosure is not limited to this. Figure 8 The tag type in the netconf named connection 804 is of collect type, and it is assumed that max_count is 3 as an example for illustration, but the present disclosure is not limited to this.

[0151] for Figure 8 The netconf named connection 803 and the netconf named connection 804 in the figure are both illustrated by assuming that max_idle is 60 seconds, but the present disclosure is not limited to this.

[0152] Finally, create the third level connection: "physical netconf connection". The "physical netconf connection" is triggered when creating a "netconf named connection". The creation actions include configuring the netconf client, creating a new netconfclient, establishing an SSH connection, performing authentication and authorization, sending hello messages to exchange capability information, establishing a session, etc.

[0153] The NetConf protocol usually uses the Secure Shell (SSH) protocol for secure communication, so it is necessary to establish an SSH connection to the network device. This process may include establishing a TCP connection with the device, performing an SSH handshake, and negotiating an encryption algorithm.

[0154] In an exemplary embodiment, the management and scheduling of level 3 netconf connections may include the following:

[0155] When configuring network devices or collecting data, you can trigger the creation of a "virtual netconf connection". When creating it, you can also set the idle time. Idle means that the virtual connection does not receive any request or response status. When the idle time exceeds the preset value, the "virtual netconf connection" will be destroyed.

[0156] The management of "virtual netconf connection" includes creating, destroying and querying "virtual netconf connection", using the created "virtual netconf connection" to make single remote calls, remote call instruction groups, issue batch instructions, query batch instruction execution status, etc.

[0157] "Netconf named connection" is triggered when creating "virtual Netconf connection". When creating "Netconf named connection", you can specify the inspection cycle and the maximum idle time of the tag channel (ie "physical Netconf connection") (ie physical connection timeout threshold). When each inspection cycle comes, the system will check whether the idle time of each physical Netconf connection under each tag channel is greater than or equal to the maximum idle time of the tag channel. If it is greater than or equal to the preset value, the timed-out physical Netconf connection will be closed and released, and the active_count of the tag channel will be reduced by 1 (ie from 1 to 0). When the active_count of all tag channels is 0, it means that all tag channels of this named connection have no requests being processed, and there is no physical Netconf connection channel in the open state under the named connection. Then it can be considered that the "Netconf named connection" is in an idle timeout state, and the "Netconf named connection" can be destroyed.

[0158] The management of "netconf named connection" can include the creation and destruction of named connection, the creation, modification, deletion and query of named connection control configuration table, etc. Among them, the elastic scaling of the processing capacity of the 3-level netconf connection can be achieved by setting the max_count parameter (maximum number of concurrent channels) of the "netconf named connection".

[0159] In some embodiments, determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection, include: in response to the existence of a named connection matching the first tag type in the named connection pool, determining an existing named connection matching the first tag type as the first named connection.

[0160] Furthermore, in the case where there is a named connection matching the first tag type in the named connection pool, in response to the existence of an idle physical connection channel under the first named connection, the idle physical connection channel may be determined as the first physical connection channel. Alternatively, in response to the absence of an idle physical connection channel under the first named connection and the physical connection channel under the first named connection not exceeding a channel concurrency threshold, a first physical connection channel may be created under the first named connection; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0161] In an exemplary embodiment, when there is a named connection matching the first tag type in the named connection pool, in response to the absence of an idle physical connection channel under the first named connection and the physical connection channel under the first named connection having reached a channel concurrency threshold, the first virtual connection is bound to the first named connection, and the physical connection channel may not be determined first.

[0162] Among them, there is no idle physical connection channel under the first named connection, and the physical connection channel under the first named connection has reached the channel concurrency threshold. It can be understood that the first named connection has currently reached the expansion limit of the physical connection channel and cannot immediately create a new idle physical connection channel to process the request. However, the created physical connection channel can still be reused. At this time, the first virtual connection is bound to the first named connection, and the first data request can be stored in the message queue of the first named connection, waiting for the concurrent physical connection channel to be processed under the coroutine mechanism.

[0163] In addition, if the physical connection channel under the first named connection has reached the channel concurrency threshold and the message queue of the first named connection is full, the first data request can be stored in the message queue of the first virtual connection. As other data requests are processed, a physical connection channel with processing capability will appear under the first named connection, and then the first data request in the message queue of the first virtual connection can be stored in the message queue of the first named connection to wait for being sent to the network device by the physical connection channel.

[0164] In the disclosed embodiments, in some cases, it is not necessary to create a physical connection channel. Instead, a reusable physical connection channel is intelligently found in a named connection pool, thereby improving the reuse rate of connections, reducing unnecessary connection creation, and effectively reducing the overhead of connection management.

[0165] In some embodiments, the connection method of the protocol channel also includes: creating a second virtual connection in response to a second data request from a second upper layer application for network configuration of the first network device; the second data request has the first tag type; establishing a binding relationship between the second virtual connection and the first named connection; and sending the second data request to the first network device through the second virtual connection, the first named connection and the first physical connection channel.

[0166] In the disclosed embodiment, a second virtual connection can be created for a second upper layer application in the same manner as the first virtual connection is created. Since a first named connection corresponding to the first network device and belonging to the first tag type has been determined before, when another data request (i.e., a second data request) from the second upper layer application that belongs to the first tag type and the request sending object is the first network device appears, the second virtual connection and the first named connection can be bound, and then the first named connection corresponding to the first network device and the first physical connection channel under the first named connection can be reused to process the second data request.

[0167] In the disclosed embodiment, the second virtual connection is newly created, and the first named connection and the first physical connection channel thereunder are shared. It can be seen that in this embodiment, by sharing the named connection and the physical connection channel, the resource consumption of establishing a separate connection channel for each data request can be reduced. In addition, since multiple virtual connections can share the same named connection and the physical connection channel thereunder, data requests from different upper layer applications can be processed faster and more flexibly, thereby improving communication efficiency.

[0168] In some embodiments, the connection method of the protocol channel also includes: receiving a third data request for network configuration of the second network device by the first upper layer application; determining a second named connection with the same tag type as the third data request in a named connection pool corresponding to the second network device, and determining a second physical connection channel under the second named connection; establishing a binding relationship between the first virtual connection and the second named connection, so as to send the third data request to the second network device through the first virtual connection, the second named connection and the second physical connection channel.

[0169] In the embodiment of the present disclosure, since the first virtual connection has been created for the first upper layer application, the first virtual connection can be reused to manage the third data request. After determining the second named connection suitable for the third data request and the second physical connection channel thereunder, the first virtual connection and the second named connection can be bound, and then the third data request can be processed through the first virtual connection, the second named connection corresponding to the second network device and the second physical connection channel thereunder.

[0170] According to the embodiments shown in the present disclosure, a virtual connection is created for an upper-layer application, and a named connection and a physical connection channel thereunder are created for a network device. In this way, data requests issued by different upper-layer applications to the same network device can be routed to the named connection corresponding to the network device through the virtual connection corresponding to each upper-layer application, and then the named connection and the physical connection channel corresponding to the network device are reused to send each data request to the network device. Data requests issued by the same upper-layer application to different network devices can reuse the virtual connection corresponding to this upper-layer application, and the virtual connection manages different data requests issued by the upper-layer application, and routes each data request to the named connection in the named connection pool corresponding to the corresponding network device, and then different named connections and the physical connection channels thereunder are used to send different data requests to the corresponding network devices.

[0171] In an exemplary embodiment, after the virtual connection and the named connection are bound, the name identifiers of both parties can be recorded on the other side. The association relationship between the virtual connection and the named connection can be maintained through a list, a pointer array or a similar data structure, so that the associated bound named connection can be quickly found on the virtual connection side; similarly, the data management component on the named connection side can also quickly find all virtual connections associated with the named connection, thereby efficiently implementing the routing, distribution and management of data requests.

[0172] In an exemplary embodiment, the session id of the virtual connection (such as session id, the virtual connection id in the aforementioned embodiment, vcid) can be used as a key to search for the corresponding named connection in the named connection pool. This design allows the system to quickly index the named connection associated with the virtual connection through the session id of the virtual connection, so that the system can quickly locate the named connection through a simple key value search.

[0173] In an exemplary embodiment, a connection method of a protocol channel may include the following steps.

[0174] Step 1: Create a "dummy netconf connection".

[0175] When the "virtual netconf connection" module receives a data sending request from an upper-layer application, it first creates a "virtual netconf connection" for the application and assigns a "virtual netconf connection" ID (vcid). The tag type is carried when it is created (for example, config or collect type, Req[Data tag: config,collect...]).

[0176] Step 2: Check whether there is a "netconf named connection" that matches the tag type.

[0177] Then, the "virtual netconf connection" module searches the "netconf named connection" pool module based on the tag type to see if there is a "netconf named connection" matching the tag type in the connection pool.

[0178] Step 3: Create a new "netconf named connection".

[0179] If the "netconf named connection" pool does not have a "netconf named connection" that matches the data tag, you can create a new "netconf named connection" based on the "virtual netconf connection" tag type and device address, the device's netconf login name, login password and other parameters. And create a "physical netconf connection" channel through the coroutine. After the coroutine successfully creates the "physical netconf connection" channel, it will continue to listen to messages and receive device messages.

[0180] Step 4: Connect and bind.

[0181] If there is a "netconf named connection" with a matching tag in the "netconf named connection" pool, further query whether there is an idle "physical netconf connection" channel. If there is, bind the "virtual netconf connection" to the matching "netconf named connection"; if there is no idle "physical netconf connection" channel and the current number of connections has not reached the maximum number of connections, create a new "physical netconf connection" channel and bind the "virtual netconf connection" to the matching "netconf named connection"; if there is no idle physical netconf connection channel and the current number of connections has reached the maximum number of connections (max_count), the virtual netconf connection will also be bound to the matching "netconf named connection", but no new "physical netconf connection" channel will be created, and the newly created "virtual netconf connection" will reuse the already created "physical netconf connection" channel.

[0182] Step 5: Start the sending task coroutine.

[0183] After the "physical netconf connection" channel is successfully created, the sending task coroutine of the "physical netconf connection" channel is started to process the message queue associated with the netconf named connection associated with the "physical netconf connection".

[0184] Step 6: The netconf request is queued.

[0185] The upper layer application uses the "virtual netconf connection" to send a netconf request. When a netconf request is sent, the request message is first saved in the message queue of the "netconf named connection" associated with the "virtual netconf connection". If the message queue of the associated "netconf named connection" is full, the request message will be saved in the message queue of the "virtual netconf connection" itself.

[0186] Step 7: Process netconf requests with high concurrency.

[0187] When the coroutine of the "physical netconf connection" is scheduled by the CPU, it will continuously take out the netconf data request from the message queue associated with the "netconf named connection" and send it to the physical network element through the "physical netconf connection". If the "netconf named connection" has multiple concurrent "physical netconf connection" channels, all the "physical netconf connection" channels under the "netconf named connection" will concurrently consume the message requests of the "netconf named connection" until all messages are consumed and the "physical netconf connection" channel is deleted due to idle timeout.

[0188] It should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0189] Fig. 9 FIG. 9 is a block diagram showing a protocol channel connection device 900 according to an embodiment of the present disclosure; Fig. 9 As shown, it includes: a creation unit 901, used to create a first virtual connection in response to a first data request for network configuration of a first network device generated by a first upper-layer application; the first data request has a first tag type; a determination unit 902, used to determine a first named connection matching the first tag type in a named connection pool, and determine a first physical connection channel under the first named connection; a binding unit 903, used to establish a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel.

[0190] Through the disclosed embodiment, a virtual connection can be created for the upper layer application that generates a data request, a named connection and a physical connection channel that match the tag type of the data request can be found, and the virtual connection and the named connection can be bound to form a three-level connection consisting of a virtual connection, a named connection and a physical connection channel, so as to send the data request to the corresponding network device. It can be seen that the disclosed embodiment can divide the protocol channel connection into three levels: virtual connection, named connection, and physical connection channel, so that the upper layer application can interact with the SDN controller only through the virtual connection, and then there is no need to care about the creation, maintenance and destruction of the underlying connection, which improves the convenience of data request processing; and in the three-level connection mode, the number of physical connection channels under the named connection can also be flexibly adjusted to meet the needs of elastic scalability of the channel capacity, so that the processing and forwarding of the network configuration request is more efficient and flexible, and the normal sending of the data request is guaranteed. In addition, with the expansion of the network scale and the increase in the number of upper layer applications, the method can easily expand the processing capacity of the system by increasing the number of named connections and physical connection channels without large-scale modification or reconstruction of the upper layer applications.

[0191] In some embodiments, the first physical connection channel is created through a coroutine; the connection device of the protocol channel also includes: a sending unit 904, which is used to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel, including: storing the first data request in the message queue of the first named connection through the first virtual connection; generating a first processing task corresponding to the first data request, and storing the first processing task in the coroutine scheduling queue corresponding to the first physical connection channel; in response to the first processing task in the coroutine scheduling queue being consumed, the first physical connection channel consumes the first data request from the message queue of the first named connection, and sends the first data request to the first network device.

[0192] In some embodiments, the determination unit 902 determines a first named connection matching the first tag type in a named connection pool, and determines a first physical connection channel under the first named connection, including: determining the named connection pool corresponding to the first network device; in response to the absence of a named connection matching the first tag type in the named connection pool, creating a first named connection matching the first tag type in the named connection pool, and creating a first physical connection channel under the first named connection.

[0193] In some embodiments, the determination unit 902 creates a first named connection matching the first tag type in the named connection pool, including: obtaining named connection configuration data; the named connection configuration data including: a channel concurrency threshold and a named connection timeout threshold corresponding to the first tag type; and creating a first named connection matching the first tag type in the named connection pool according to the named connection configuration data.

[0194] In some embodiments, the connection device of the protocol channel further includes: a destroying unit 906, configured to destroy the first named connection in response to the absence of a physical connection channel under the first named connection and the idle time of the first named connection exceeding the named connection timeout threshold.

[0195] In some embodiments, the determination unit 902 creates a first physical connection channel under the first named connection, including: obtaining physical connection configuration data; the physical connection configuration data includes a physical connection timeout threshold; and creating a first physical connection channel under the first named connection according to the physical connection timeout threshold.

[0196] In some embodiments, the destroying unit 905 is further configured to: in response to an idle time length of the first physical connection channel exceeding the physical connection timeout threshold, destroy the first physical connection channel.

[0197] In some embodiments, the creating unit 901 creates a first virtual connection, including: acquiring virtual connection configuration data; the virtual connection configuration data includes a virtual connection timeout threshold; and creating the first virtual connection according to the virtual connection timeout threshold.

[0198] In some embodiments, the connection device of the protocol channel also includes a maintaining unit 906, and the maintaining unit 906 is used to maintain the binding relationship and maintain the existence of a physical connection channel under the first named connection in response to the idle time of the first virtual connection not exceeding the virtual connection timeout threshold; the destruction unit 905 is also used to: in response to the idle time of the first virtual connection exceeding the virtual connection timeout threshold, release the binding relationship and destroy the first virtual connection.

[0199] In some embodiments, the connection device of the protocol channel also includes an expansion unit 907. When the physical connection channel under the first named connection has reached the channel concurrency threshold, the expansion unit 907 is used to respond to the data request for the first network device that meets the channel expansion condition, and adjust the channel concurrency threshold configured for the first named connection based on the channel volume threshold supported by the first network device; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0200] In some embodiments, the determination unit 902 determines a first named connection matching the first tag type in a named connection pool, and determines a first physical connection channel under the first named connection, including: in response to the existence of a named connection matching the first tag type in the named connection pool, determining the existing named connection matching the first tag type as the first named connection; in response to the existence of an idle physical connection channel under the first named connection, determining the idle physical connection channel as the first physical connection channel; in response to the absence of an idle physical connection channel under the first named connection and the physical connection channel under the first named connection does not exceed the channel concurrency threshold, creating a first physical connection channel under the first named connection; wherein the channel concurrency threshold indicates the maximum number of physical connection channels allowed to exist under the first named connection.

[0201] In some embodiments, the creation unit 901 is also used to create a second virtual connection in response to a second data request from a second upper layer application for network configuration of the first network device; the second data request has the first tag type; the binding unit 903 is also used to establish a binding relationship between the second virtual connection and the first named connection; the sending unit 904 is also used to send the second data request to the first network device through the second virtual connection, the first named connection and the first physical connection channel.

[0202] Fig. 9 For other contents of the embodiment, reference can be made to the other embodiments mentioned above.

[0203] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0204] Fig.10 The block diagram of the computer device connected to a protocol channel in the embodiment of the present disclosure is shown. It should be noted that the electronic device shown in the figure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.

[0205] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present invention will be described. Fig.10 The electronic device 1000 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0206] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).

[0207] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 2 The method shown in .

[0208] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .

[0209] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0210] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0211] The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or may communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1050. In addition, the electronic device 1000 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 through a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0212] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0213] The program product for implementing the above method according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0214] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0215] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0216] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0217] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0218] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0219] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0220] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0221] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned embodiments.

[0222] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A connection method for a protocol channel, characterized in that: include: In response to a first data request generated by a first upper layer application for performing network configuration on a first network device, creating a first virtual connection; the first data request having a first tag type; Determine a first named connection matching the first tag type in a named connection pool, and determine a first physical connection channel under the first named connection; Establishing a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel; in ; The first virtual connection corresponds to the first upper layer application in a one-to-one manner, and the first virtual connection is used to manage data requests generated by the first upper layer application; The named connection pool corresponds to the first network device in a one-to-one manner, and the named connection pool is used to process data requests for the first network device; The maximum number of entity connection channels allowed under the first named connection is a preconfigured channel concurrency threshold; The method further comprises: When different upper-layer applications need to send data requests to the same network device, each data request is routed to the named connection corresponding to the network device through the virtual connection corresponding to each upper-layer application, and then the named connection corresponding to the network device and multiple concurrent physical connection channels under it are reused to send each data request to the network device; When the same upper-layer application needs to send data requests to different network devices, the virtual connection corresponding to the upper-layer application is reused, and the virtual connection manages the different data requests sent by the upper-layer application, and each data request is routed to the named connection in the named connection pool corresponding to the corresponding network device, and then different named connections and the physical connection channels under them are used to send different data requests to the corresponding network devices.

2. The method according to claim 1, characterized in that The first entity connection channel is created by a coroutine; The step of sending the first data request to the first network device through the first virtual connection, the first named connection, and the first physical connection channel includes: storing the first data request in a message queue of the first named connection through the first virtual connection; Generate a first processing task corresponding to the first data request, and store the first processing task in a coroutine scheduling queue corresponding to the first physical connection channel; In response to the first processing task in the coroutine scheduling queue being consumed, the first physical connection channel consumes the first data request from the message queue of the first named connection, and sends the first data request to the first network device.

3. The method according to claim 1, characterized in that Determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection, includes: Determining the named connection pool corresponding to the first network device; In response to the absence of a named connection matching the first tag type in the named connection pool, creating a first named connection matching the first tag type in the named connection pool, and creating a first physical connection channel under the first named connection.

4. The method according to claim 3, characterized in that: Creating a first named connection matching the first tag type in the named connection pool includes: Acquire named connection configuration data; the named connection configuration data includes: a channel concurrency threshold and a named connection timeout threshold corresponding to the first tag type; wherein the channel concurrency threshold indicates the maximum number of entity connection channels allowed to exist under the first named connection; A first named connection matching the first tag type is created in the named connection pool according to the named connection configuration data.

5. The method according to claim 4, characterized in that The method further comprises: In response to the fact that no physical connection channel exists under the first named connection and the idle time of the first named connection exceeds the named connection timeout threshold, the first named connection is destroyed.

6. The method according to claim 3, characterized in that Creating a first physical connection channel under the first named connection includes: Acquire entity connection configuration data; the entity connection configuration data includes a entity connection timeout threshold; A first physical connection channel under the first named connection is created according to the physical connection timeout threshold.

7. The method according to claim 6, characterized in that The method further comprises: In response to an idle time duration of the first physical connection channel exceeding the physical connection timeout threshold, the first physical connection channel is destroyed.

8. The method according to claim 1, characterized in that Creating a first virtual connection, including: Acquire virtual connection configuration data; the virtual connection configuration data includes a virtual connection timeout threshold; The first virtual connection is created according to the virtual connection timeout threshold.

9. The method according to claim 8, characterized in that The method further comprises: In response to the idle time length of the first virtual connection not exceeding the virtual connection timeout threshold, maintaining the binding relationship and maintaining the existence of a physical connection channel under the first named connection; In response to the idle time length of the first virtual connection exceeding the virtual connection timeout threshold, the binding relationship is released and the first virtual connection is destroyed.

10. The method according to claim 1, characterized in that The method further comprises: When the physical connection channel under the first named connection has reached the channel concurrency threshold, in response to the data request for the first network device satisfying the channel expansion condition, adjusting the channel concurrency threshold configured for the first named connection based on the channel quantity threshold supported by the first network device; The channel concurrency threshold indicates the maximum number of entity connection channels allowed to exist under the first named connection.

11. The method according to claim 1, characterized in that: Determining a first named connection matching the first tag type in a named connection pool, and determining a first physical connection channel under the first named connection, includes: In response to the existence of a named connection matching the first tag type in the named connection pool, determining the existing named connection matching the first tag type as the first named connection; In response to the existence of an idle physical connection channel under the first named connection, determining the idle physical connection channel as the first physical connection channel; In response to the absence of idle physical connection channels under the first named connection and the physical connection channels under the first named connection not exceeding a channel concurrency threshold, a first physical connection channel is created under the first named connection; wherein the channel concurrency threshold indicates a maximum number of physical connection channels allowed to exist under the first named connection.

12. The method according to claim 1, characterized in that The method further comprises: In response to a second data request from a second upper layer application for performing network configuration on the first network device, creating a second virtual connection; the second data request having the first tag type; Establishing a binding relationship between the second virtual connection and the first named connection; The second data request is sent to the first network device through the second virtual connection, the first named connection and the first physical connection channel.

13. A connection device for a protocol channel, characterized in that: include: A creating unit, configured to create a first virtual connection in response to a first data request for performing network configuration on a first network device generated by a first upper layer application; The first data request has a first tag type; a determining unit, configured to determine a first named connection matching the first tag type in a named connection pool, and determine a first physical connection channel under the first named connection; a binding unit, configured to establish a binding relationship between the first virtual connection and the first named connection, so as to send the first data request to the first network device through the first virtual connection, the first named connection and the first physical connection channel; in ; The first virtual connection corresponds to the first upper layer application in a one-to-one manner, and the first virtual connection is used to manage data requests generated by the first upper layer application; The named connection pool corresponds to the first network device one by one, and the named connection pool is used to process data requests for the first network device; the maximum number of physical connection channels allowed under the first named connection is a preconfigured channel concurrency threshold; The connection device of the protocol channel is also used for: When different upper-layer applications need to send data requests to the same network device, each data request is routed to the named connection corresponding to the network device through the virtual connection corresponding to each upper-layer application, and then the named connection corresponding to the network device and multiple concurrent physical connection channels under it are reused to send each data request to the network device; When the same upper-layer application needs to send data requests to different network devices, the virtual connection corresponding to the upper-layer application is reused, and the virtual connection manages the different data requests sent by the upper-layer application, and each data request is routed to the named connection in the named connection pool corresponding to the corresponding network device, and then different named connections and the physical connection channels under them are used to send different data requests to the corresponding network devices.

14. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for connecting a protocol channel according to any one of claims 1 to 12 is implemented.

15. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the connection method of the protocol channel as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data acquisition method and network configuration method suitable for n target devices with same IP address, electronic device and data acquisition system

    CN116827777A