CN115348305A - Connection management method, system, computer device and storage medium - Google Patents

Connection management method, system, computer device and storage medium Download PDF

Info

Publication number
CN115348305A
CN115348305A CN202210833985.0A CN202210833985A CN115348305A CN 115348305 A CN115348305 A CN 115348305A CN 202210833985 A CN202210833985 A CN 202210833985A CN 115348305 A CN115348305 A CN 115348305A
Authority
CN
China
Prior art keywords
state
queue
management
input
operation instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210833985.0A
Other languages
Chinese (zh)
Inventor
张砚凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210833985.0A priority Critical patent/CN115348305A/en
Publication of CN115348305A publication Critical patent/CN115348305A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Abstract

The application relates to a connection management method, a system, a computer device and a storage medium. The method comprises the steps of obtaining excitation parameters of a management queue; determining a corresponding second management queue state and a management queue operation instruction from a preset state conversion table; executing the management queue operation instruction to create a management queue, and converting a first management queue state of the state machine into a second management queue state; acquiring excitation parameters of an input and output queue; determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table; and executing the input and output queue operation instruction, and converting the first input and output queue state of the state machine into a corresponding second input and output queue state. The method can simplify the process of establishing the connection and is convenient to maintain.

Description

Connection management method, system, computer device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a connection management method, a connection management system, a computer device, and a storage medium.
Background
The network transmission technology makes full use of the transmission capability of different channels to form a complete transmission system, so that information can be reliably transmitted. The Connection Management (CM) is an important component of a network transmission system, and is used to provide some events in the Connection establishment process, and a user can know what phase the current Connection is in during the Connection establishment process so as to perform corresponding processing subsequently.
In a complex network environment, connection scenarios are complex, the number of connections is large, and there is a possibility of faced with network anomalies and connection cancellation at any time, for example, in a Non-Volatile Memory host controller interface specification (NVMe for short), a connection process includes establishment of a management queue and an input/output queue (IO queue), a scene faced in a connection establishment process is complex, an error may occur in each step and a corresponding error processing is required, and a CM simply provides some events at a connection stage and cannot string the whole connection establishment process, so it is a complex task to cope with various emergencies in the connection process.
Disclosure of Invention
Based on the method, the system, the computer equipment and the storage medium, the connection management method and the system are convenient to implement and maintain.
In one aspect, a connection management method is provided, including:
acquiring excitation parameters of a management queue;
determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine;
executing the management queue operation instruction to create a management queue, and converting a first management queue state of the state machine into a second management queue state;
acquiring excitation parameters of an input and output queue;
determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table according to the excitation parameters of the input/output queue and the first input/output queue state of the state machine;
and executing the input and output queue operating instruction to bind the input and output queue under the created management queue, and converting the first input and output queue state of the state machine into a corresponding second input and output queue state.
In one embodiment, the state machine comprises a one-level state machine;
the determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine includes:
and determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the primary state machine.
In one embodiment, the state machines further comprise a secondary state machine;
determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table according to the excitation parameter of the input/output queue and the first input/output queue state of the state machine, including:
and determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table according to the excitation parameters of the management queue and the first input/output queue state of the secondary state machine.
In one embodiment, before obtaining the excitation parameters of the management queue, the method further includes:
acquiring an excitation parameter established by management;
determining a corresponding second management establishment state and a management establishment operation instruction from a preset state transition table according to the excitation parameters established by management and the first management establishment state of the state machine;
and executing the management establishing operation instruction to realize the establishment of connection management and converting the first management establishing state of the state machine into a second management establishing state.
In one embodiment, the determining, according to the excitation parameter of the management queue and the first management queue state of the state machine, a corresponding second management queue state and a management queue operation instruction from a preset state transition table, and determining, according to the excitation parameter of the input/output queue and the first input/output queue state of the state machine, a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table further includes:
judging whether the excitation parameters of the management queue or the input and output queue are established or not; and if so, determining a corresponding second management queue state and a management queue operation instruction, or a corresponding second input/output queue state and an input/output queue operation instruction.
In one embodiment, the determining, according to the excitation parameter of the management queue and the first management queue state of the state machine, a corresponding second management queue state and a management queue operation instruction from a preset state transition table, and determining, according to the excitation parameter of the input/output queue and the first input/output queue state of the state machine, a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table further includes:
judging whether the excitation parameter of the management queue or the excitation parameter of the input and output queue is an abnormal type; if yes, determining that the corresponding second management queue state or the corresponding second input/output queue state is a specific state, and determining that the corresponding management queue operation instruction or the corresponding input/output queue operation instruction is a specific operation instruction.
In one embodiment, after the input/output queue is bound under the created management queue, the method further includes:
acquiring excitation parameters of disconnection;
determining a corresponding third management queue state and a disconnection instruction from a preset state conversion table according to the excitation parameter of disconnection;
and executing the disconnection instruction, and converting the second management queue state of the state machine into a third management queue state.
In another aspect, a connection management system is provided, the system comprising:
the excitation parameter acquisition module is used for acquiring excitation parameters, and the excitation parameters comprise excitation parameters of a management queue or excitation parameters of an input/output queue;
the state machine module is used for determining a corresponding operation instruction and a second state from a preset state transition table according to the excitation parameter and the current state of the state machine, wherein the operation instruction comprises a management queue operation instruction or an input/output queue operation instruction, and the second state comprises a second management queue state or a second input/output queue state;
and the execution module is used for executing the management queue operation instruction to create a management queue and convert a first management queue state of the state machine into a corresponding second management queue state, or executing the input and output queue operation instruction to bind the input and output queue under the created management queue and convert the first input and output queue state of the state machine into the corresponding second input and output queue state.
In a further aspect, a computer device is provided, which comprises a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
A computer-readable storage medium is also provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method.
According to the connection management method, the connection management device, the computer equipment and the storage medium, various conditions and corresponding schemes for management queue creation and input/output queue creation in the connection process are respectively established through the state conversion table of the state machine, so that the realization of the connection process and the corresponding process of complex events are simplified.
Drawings
FIG. 1 is a diagram of an application environment of a connection management method in one embodiment;
FIG. 2 is a flow diagram illustrating a method for connection management in one embodiment;
FIG. 3 is a diagram of a state transition table in one embodiment;
FIG. 4 is a flow diagram illustrating the CM establishment phase in one embodiment;
FIG. 5 is a flow diagram illustrating the start of a protocol layer setup phase in one embodiment;
FIG. 6 is a flow diagram illustrating a protocol layer setup phase in one embodiment;
FIG. 7 is a schematic block diagram of a connection management system in one embodiment;
FIG. 8 is a diagram of an internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The connection management method provided by the application can be applied to the application environment shown in fig. 1. Wherein, the request end 102 communicates with the target end 104 through the network. Before data is sent, two parties communicating with each other need to establish a connection, and after the data is sent, the two parties communicating with each other need to be disconnected, so that connection management is a guarantee for realizing reliable transmission of the two parties.
The requesting end 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the target end 104 may be implemented by an independent server or a server cluster composed of a plurality of servers.
The CM plays a very important role in the process of establishing a connection by using a transmission technology, which implements some events on the drive side, and a user can know what phase the current connection is in the process of establishing the connection by using the events so as to perform corresponding processing subsequently, where the transmission technology includes RDMA (Remote-Direct Memory Access).
The RDMA technology has the advantages of an emerging network Transmission technology, the basic principle of which is similar to that of the traditional TCP technology (Transmission Control Protocol), and a connection establishing process is also provided.
The RDMA technology allows direct access from the memory of one host to the memory of another host, and the process of establishing a connection is greatly different from the conventional transmission technology, and besides the connection establishment phase, there is a protocol layer establishment phase, which is complex in the process of establishing a connection and requires corresponding error handling when an error may occur in each step.
In one embodiment, as shown in fig. 2, there is provided a connection management method, including the steps of:
in step 201, the connection manager obtains the excitation parameters of the management queue.
The excitation parameters of the management queue can be regarded as events in the creation process of the management queue, and different events represent the excitation parameters of different management queues.
Illustratively, when an event of an anomaly or power failure occurs in the peer network, the event may be regarded as obtaining the CONN _ DISCONNECT, which is an excitation parameter.
Step 202, determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine.
The state transition table is a two-dimensional array table, as shown in fig. 3, where a row element represents a possible management queue state, at a certain time, the state machine is in one of the management queue states, the management queue state is a first management queue state, a column element represents different scenarios occurring in the management queue creation (i.e., obtained excitation parameters of different management queues), and a certain structure array is determined by the row element and the column element, and the elements of the structure array include: the next state to jump (i.e., the second managed queue state) and the managed queue operation instruction.
The management queue operation command is a set of necessary operation commands required for completing the state transition, and is determined by the transmission technology itself.
Step 203, the connection manager executes the management queue operation instruction to create a management queue, and converts the first management queue state of the state machine into a second management queue state.
Illustratively, when the first management queue state is the "initial state", the excitation parameter of the management queue, which is the "request for creating the management queue", is acquired, it is determined that the management queue operation instruction is "prepare resource", the request end is notified that the connection request has been received, the management queue is created, and the second management queue state is "create complete", the management queue operation instruction is executed, and the first management queue state "initial state" of the state machine is converted into the second management queue state "create complete".
Step 204, the connection manager obtains excitation parameters of the IO queue.
The excitation parameters of the IO queue (i.e. IO queue) can be regarded as events in the IO queue creation process, and different events represent the excitation parameters of different IO queues.
Step 205, determining a corresponding second IO queue state and an IO queue operation instruction from the state transition table according to the excitation parameter of the IO queue and the first IO queue state of the state machine.
It can be understood that, in the state transition table, a row element further has an element representing an IO queue state where the state machine may be located, at a certain time, the state machine is in a certain IO queue state, the IO queue state is a first IO queue state, a column element further has an element representing different scenarios occurring in the creation of the IO queue (that is, excitation parameters of different IO queues can be considered to be obtained), and the row element and the column element together determine a certain structure array, where the elements of the array structure include: the next state to jump (i.e. the second IO queue state) and some operations (i.e. IO queue state operation instructions) required to implement this state jump.
And step 206, the connection manager executes the IO queue operation instruction to bind the IO queue to the created management queue, and converts the first IO queue state of the state machine into a corresponding second IO queue state.
In the connection management method, aiming at the management queue creation and IO queue creation in the protocol layer establishment process, the state machine is adopted to realize the state jump in the whole process, and relevant scenes and states in the protocol layer establishment process are packaged in the state conversion table, so that compared with the traditional code compiling mode, the method simplifies the implementation mode of a program, reduces the number of codes and has clearer logic; and the addition of the new scene task can be realized only by maintaining the content in the two-dimensional array at the later stage.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In the actual connection process, the faced scenario is more complex, and exemplarily illustrates that the first management queue state has an inheritance relationship with the second management queue state, and in one embodiment, there are three management queue states:
state 1: idle 'disconnect';
and 2, state: establishing a connection;
state 3: is connected.
At the same time, there are three possible occurrences (i.e., stimulus parameters that manage the queue):
excitation parameters 1: establishing a connection request;
excitation parameters 2: completing connection establishment;
excitation parameters 3: the link request is broken.
The state machine is started in the state 1: the idle 'disconnection' is a first management queue state, and the excitation parameter 1 is obtained: establishing a connection request, executing a corresponding management queue operation instruction 1 'to prepare resources, notifying a request end that the connection request is received', and converting the state of the first management queue into a second management state, namely, converting the state 1: idle 'off' transitions to state 2: establishing a connection;
thereafter, "state 2: in establishing a connection, "as a new first management queue state, after obtaining the excitation parameter 2: when the connection is established, executing a corresponding management queue operation instruction 2 'informing a user that a command can be transmitted and a resource for sending the command is prepared'; and converts the new first managed queue state to a new second managed queue state "state 3: connected ".
As above, when obtaining the excitation parameter 3: after the link request is disconnected, executing a management queue operation instruction 3 "disconnect and destroy resources", and setting a first management queue state "state 3" of the state machine: connected "transition to" state 1: idle 'disconnect'.
In one embodiment, the state machine is a multi-stage state machine comprising a one-stage state machine for instructing management of queue state jumps and providing operational instructions for implementing state transitions;
the determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine includes:
and determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the primary state machine.
And a first-level state machine is adopted to independently realize the state conversion of the management queue creating process and record the current state of the management queue creating process.
In one embodiment, the state machines further comprise a secondary state machine;
determining a corresponding second IO queue state and an IO queue operation instruction from the state transition table according to the excitation parameter of the IO queue and the first IO queue state of the state machine, including:
and determining a corresponding second IO queue state and an IO queue operation instruction from the state conversion table according to the excitation parameters of the management queue and the first IO queue state of the secondary state machine.
And a secondary state machine is adopted to independently realize state conversion in the IO queue creating process and record the current state in the IO queue creating process.
In the above embodiment, the current state created by the management queue and the current state created by the IO queue are respectively recorded by setting a multi-stage state machine, the same state transition table is used by the first-stage state machine and the second-stage state machine, the implementation manner is simple, and in the later maintenance, the application of a new scene can be implemented by only adding elements to one state transition table.
In the RDMA transmission technology, two phases of connection establishment include a protocol layer establishment phase and a CM establishment phase performed before the protocol layer establishment phase, where the CM establishment phase is used to parse IP, route, initiate a connection request, and the like, so as to establish RDMA transmission, and the existing CM establishment phase is implemented by using traditional code writing.
In one embodiment, a state machine is employed to implement state transitions in the CM setup phase.
Before obtaining the excitation parameters of the management queue, the method further comprises the following steps:
acquiring an excitation parameter established by management;
determining a corresponding second management establishment state and a management establishment operation instruction from a preset state transition table according to the excitation parameters established by management and the first management establishment state of the state machine;
and executing the management establishment operation instruction to realize management establishment and converting the first management establishment state of the state machine into a second management establishment state.
In the above embodiment, the state transition table of the state machine further includes a row element representing the current management setup state and different scenarios (i.e. obtained excitation parameters of different management setups) occurring in the management setup stage, and the rows and the columns jointly determine a structure array, where the elements of the structure array include: the next management setup state to jump (i.e., the second management setup state) and the management setup operation instructions needed to implement the state jump.
In the above embodiment, the state machine completes the state transition in the CM establishment phase, and thus effective control of the complex connection scene can be realized.
In one embodiment, the state machine includes a first state machine and a second state machine, the first state machine and the second state machine are respectively used for creating a management queue and an IO queue, the first state machine and the second state machine perform state conversion in a CM establishment phase at the same time, and management establishment operations such as analyzing IP, routing and initiating a connection request are performed before the management queue and the IO queue are created to establish RDMA transmission.
Referring to fig. 4, in one embodiment, the CM establishment phase is shifted from the initial state (CONN _ FREE) to the ESTABLISHED state (ESTABLISHED) state, and a plurality of management establishment operation commands are executed to complete a plurality of state shifts.
Illustratively, in fig. 4, in the initial state (CONN _ FREE), when a stimulus parameter (RESOLVE _ ADDR, RESOLVE target IP request) is obtained, the connection manager performs corresponding operations, RESOLVEs the target IP, and checks whether the network is clear, and jumps to the next management establishment state: the address is RESOLVED (ADDR _ RESOLVED).
Taking the ADDR _ RESOLVED state as a new first management establishing state, and when acquiring a new excitation parameter, RESOLVE _ ROUTE (analyzing a ROUTE request), the connection manager executes corresponding operations, analyzes the ROUTE, and checks whether the ROUTE is problematic, and jumps to the next management establishing state: ROUTE _ RESOLVED (ROUTE RESOLVED).
According to the above flow, the state machine sequentially acquires excitation parameters CONNECT (request connection), CONN _ ESTABLISHED (connection establishment), and sequentially jumps to the CONNECTING state and the CONNECTED state.
It should be noted that upon receiving the CONN ESTABLISHED excitation parameter, the CM setup phase is complete and ready for subsequent issuance of commands.
As shown in fig. 5, in one embodiment, the STATE machine (including the primary STATE machine and the secondary STATE machine) goes through some pre-preparation STATEs, entering the transport ready STATE indicates that protocol layer establishment can be started, in some embodiments, the pre-preparation STATE can be entered by a STATE _ CONNECTED STATE jump in the CM establishment phase, in the transport ready STATE, when the STATE machine acquires the SET _ connect _ TYPE excitation parameter, it determines that the management queue is a management queue according to the message queue identifier being 1, for example, in the REPORT _ connect excitation parameter, it switches to the ADMIN _ log STATE, in this process, the primary STATE machine records the current STATE of the management queue creation, and after the management queue creation is completed, the secondary STATE machine starts to run the IO queue creation flow, for example, in the BIND _ connect excitation parameter, and switches to the IO _ connect _ BOUND STATE.
When the primary state machine enters an NVMF _ ADMIN _ CONN state, the creation of the management queue is completed, and the NVMF _ ADMIN _ CONN state is the last state of the primary state machine in a normal connection state;
when the secondary state machine enters the NVMF _ IO _ CONN state, the NVMF _ IO _ CONN state indicates that the creation and binding of the IO queue is completed and is the last state of the secondary state machine under normal connection.
In an embodiment, the determining, according to the excitation parameter and the current state, a corresponding next state and an operation instruction for implementing the next state transition from a preset state transition table further includes determining whether the obtained excitation parameter is satisfied, and if so, determining a corresponding second state and an operation instruction, completing the state transition of the state machine, and executing the operation instruction.
It will be appreciated that the state machine determines whether to perform a state jump by determining whether a condition is established.
Illustratively, in the CM establishment phase, in the CONN _ FREE state, if the obtained excitation parameter is not the resolution _ ADDR, the excitation parameter is not established, and the state machine still maintains the state.
In the protocol layer setup phase, the stage one state machine in the transport state does not transition to the ADMIN _ CONN state due to acquisition of the SET _ CONN _ TYPE (false) excitation parameter, but remains in the current state. Similarly, the secondary state machine in the transition state does not transition to the IO _ CONN state due to the acquisition of the SET _ CONN _ TYPE (true) excitation parameter.
In one embodiment of the present invention,
the determining a corresponding next state and an operation instruction for implementing the transition to the next state from a preset state transition table according to the excitation parameter and the current state further includes: judging whether the excitation parameters are abnormal types or not; if so, determining that the corresponding next state is a specific state, and the corresponding operation instruction to be executed is a specific operation instruction.
Illustratively, in fig. 4-6, each time an event of an anomaly or power failure occurs in the peer network, the connection manager may be regarded as acquiring the excitation parameter CONN _ DISCONNECT of the anomaly type, and perform a unified operation: disconnecting and destroying resources, and the state machine is converted into a specific state: DISCONNECTED. In the above embodiment, the excitation parameter CONN _ DISCONNECT may be generated passively and not controlled manually.
In one embodiment, the operation instructions encapsulated by the state transition table may further include a log of state transition, which is convenient for the administrator to maintain.
Illustratively, in one embodiment, the connection manager initiates the disconnection process by obtaining an incentive parameter for the disconnection.
Illustratively, it includes:
acquiring excitation parameters of disconnection;
determining a corresponding third management queue state and a disconnection instruction from a preset state conversion table according to the excitation parameter of disconnection;
and executing the disconnection instruction to complete disconnection operation and converting the second management queue state of the state machine into a third management queue state.
As shown in fig. 6, in which the excitation parameter of the disconnection can be regarded as the active excitation parameter CONN _ DISCONNECT, which is generated by the operation of the manager, the primary state machine obtains the excitation parameter CONN _ DISCONNECT in the NVMF _ ADMIN _ connect state, and converts to the ADMIN _ CONN _ DISC _ PENDING state, and the executing of the disconnection instruction includes putting the management queue aside, waiting for the completion of the disconnection of the IO queue, and then destroying the management queue resource. And the secondary state machine acquires the excitation parameter CONN _ DISCONNECT in the NVMF _ IO _ CONN state, DISCONNECTs and destroys the resource, and informs the management queue to cancel the binding relationship.
It will be appreciated that in the above embodiments, the stimulus parameters may be from the requesting end or the destination end, i.e. the event may occur at the requesting end or the destination end.
In one embodiment, as shown in fig. 7, there is provided a connection management system including: an excitation parameter obtaining module 701, a state machine module 702, and an executing module 703, wherein:
an excitation parameter obtaining module 701, configured to obtain excitation parameters, where the excitation parameters include excitation parameters of a management queue or excitation parameters of an IO queue.
The state machine module 702 is configured to determine, according to the excitation parameter and the current state of the state machine, a corresponding operation instruction and a second state from a preset state transition table, where the operation instruction includes a management queue operation instruction or an IO queue operation instruction, and the second state includes a second management queue state or a second IO queue state.
The executing module 703 is configured to execute the management queue operating instruction to create a management queue and convert the first management queue state of the state machine into a corresponding second management queue state, or execute the IO queue operating instruction to bind an IO queue under the created management queue and convert the first IO queue state of the state machine into a corresponding second IO queue state.
In the connection management system, aiming at the management queue creation and the IO queue creation in the protocol layer establishing process, the state machine is adopted to realize the state jump in the whole process, and the related scenes and states in the protocol layer establishing process are packaged in the state conversion table, so that the characteristics of concise codes and strong readability are effectively realized under the condition of complicated scenes in the protocol layer establishing connection process, and the code maintenance is convenient.
In one embodiment, the state machine module 702 includes a primary state machine and a secondary state machine, and the primary state machine is configured to determine a corresponding second management queue state and a management queue operating instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the primary state machine.
And the secondary state machine is used for determining a corresponding second IO queue state and an IO queue operation instruction from the state conversion table according to the excitation parameters of the management queue and the first IO queue state of the secondary state machine.
In the above embodiment, a multi-stage state machine is adopted to record different states in the management queue creation process and different states in the IO queue creation process, and the two stage state machines share the same state transition table, and only the state transition table needs to be maintained in the later stage, and the addition of a new scene task can be realized by calling an operation instruction.
In one embodiment, the excitation parameters further include an excitation parameter for representing management establishment in a CM establishment stage, and the state machine module 702 determines a corresponding second management establishment state and a management establishment operation instruction from a preset state transition table according to the excitation parameter established by management and a first management establishment state of a state machine; the execution module 703 is configured to execute the management establishment operation instruction, so as to implement establishment of connection management, and convert a first management establishment state of the state machine into a second management establishment state.
In one embodiment, the state machine module 702 is further configured to determine whether the excitation parameter is satisfied, and if so, determine a corresponding second state and an operation instruction.
Illustratively, when the current STATE of the primary STATE machine is STATE _ a, the STATE transition table encapsulates a condition for transitioning from STATE _ a to the second management queue STATE _ B, and the primary STATE machine maintains the current STATE when the obtained excitation parameters do not satisfy the condition.
In one embodiment, the excitation parameters further include an excitation parameter of disconnection, the state machine module 702 determines a corresponding third management queue state and a disconnection instruction from a preset state transition table according to the excitation parameter of disconnection, and the execution module 703 executes the disconnection instruction and converts the second management queue state of the state machine into the third management queue state.
The various modules in the connection management system described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a connection management method.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step A, obtaining excitation parameters of a management queue;
b, determining a corresponding second management queue state and a management queue operation instruction from a preset state conversion table according to the excitation parameter of the management queue and the first management queue state of the state machine;
step C, executing the management queue operation instruction to create a management queue, and converting the first management queue state of the state machine into a second management queue state;
step D, obtaining excitation parameters of the IO queue;
step E, determining a corresponding second IO queue state and an IO queue operation instruction from the state conversion table according to the excitation parameters of the IO queue and the first IO queue state of the state machine;
and step F, the connection manager executes the IO queue operation instruction to bind the IO queue under the created management queue, and converts the first IO queue state of the state machine into a corresponding second IO queue state.
In the connection management method, aiming at the management queue creation and IO queue creation in the protocol layer establishment stage, the state machine is adopted to realize the state jump in the whole process, and the related scenes and states in the protocol layer establishment process are packaged in the state conversion table, so that compared with the traditional code compiling mode, the method simplifies the program implementation mode, reduces the code quantity and has clearer logic; and the addition of the new scene task can be realized only by maintaining the content in the two-dimensional array at the later stage.
In one embodiment, a computer device is provided, the processor of which when executing the computer program further performs the steps of:
and determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the primary state machine.
And determining a corresponding second IO queue state and an IO queue operation instruction from the state conversion table according to the excitation parameters of the management queue and the first IO queue state of the secondary state machine.
In the embodiment, the creation states of the management queue and the IO queue are respectively recorded by adopting a multi-stage state machine, and the two-stage state machines share the same state transition table, so that convenience is provided for code debugging.
In one embodiment, the computer device completes the CM setup phase through a state machine.
Illustratively, the processor of the computer program further implements the following steps when executing the computer program:
acquiring an excitation parameter established by management;
determining a corresponding second management establishment state and a management establishment operation instruction from a preset state transition table according to the excitation parameters established by management and the first management establishment state of the state machine;
executing the management establishment operation instruction to realize establishment of connection management, and converting the first management establishment state of the state machine into the second management establishment state
In one embodiment, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described connection management method, comprising the steps of:
step A, obtaining excitation parameters of a management queue;
b, determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine;
step C, executing the management queue operation instruction to create a management queue, and converting the first management queue state of the state machine into a second management queue state;
step D, obtaining excitation parameters of the IO queue;
step E, determining a corresponding second IO queue state and an IO queue operation instruction from the state conversion table according to the excitation parameters of the IO queue and the first IO queue state of the state machine;
and step F, the connection manager executes the IO queue operation instruction to bind the IO queue under the created management queue, and converts the first IO queue state of the state machine into a corresponding second IO queue state.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for connection management, comprising:
acquiring excitation parameters of a management queue;
determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the state machine;
executing the management queue operation instruction to create a management queue and converting a first management queue state of the state machine into a second management queue state;
acquiring excitation parameters of an input and output queue;
determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table according to the excitation parameters of the input/output queue and the first input/output queue state of the state machine;
and executing the input and output queue operation instruction to bind the input and output queue under the created management queue, and converting the first input and output queue state of the state machine into a corresponding second input and output queue state.
2. A connection management method according to claim 1, wherein said state machine comprises a primary state machine;
the determining, according to the excitation parameter of the managed queue and the first managed queue state of the state machine, a corresponding second managed queue state and a managed queue operation instruction from a preset state transition table includes:
and determining a corresponding second management queue state and a management queue operation instruction from a preset state transition table according to the excitation parameter of the management queue and the first management queue state of the primary state machine.
3. The method of claim 2, wherein the state machines further comprise a secondary state machine;
the determining, according to the excitation parameter of the input/output queue and the state of the first input/output queue of the state machine, the corresponding state of the second input/output queue and the operation instruction of the input/output queue from the state transition table includes:
and determining a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table according to the excitation parameter of the management queue and the first input/output queue state of the secondary state machine.
4. The connection management method according to claim 1,
before obtaining the excitation parameters of the management queue, the method further comprises the following steps:
acquiring an excitation parameter established by management;
determining a corresponding second management establishment state and a management establishment operation instruction from a preset state transition table according to the excitation parameters established by management and the first management establishment state of the state machine;
and executing the management establishing operation instruction to realize the establishment of connection management and converting the first management establishing state of the state machine into a second management establishing state.
5. The connection management method according to claim 1,
the determining, according to the excitation parameter of the management queue and the first management queue state of the state machine, a corresponding second management queue state and a management queue operation instruction from a preset state transition table, and determining, according to the excitation parameter of the input/output queue and the first input/output queue state of the state machine, a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table, further includes:
judging whether the excitation parameters of the management queue or the input and output queue are established or not; if yes, determining a corresponding second management queue state and a management queue operation instruction, or a corresponding second input/output queue state and an input/output queue operation instruction.
6. A connection management method according to claim 5, characterized in that:
the determining, according to the excitation parameter of the management queue and the first management queue state of the state machine, a corresponding second management queue state and a management queue operation instruction from a preset state transition table, and determining, according to the excitation parameter of the input/output queue and the first input/output queue state of the state machine, a corresponding second input/output queue state and an input/output queue operation instruction from the state transition table, further includes:
judging whether the excitation parameter of the management queue or the excitation parameter of the input and output queue is an abnormal type; if yes, determining that the corresponding second management queue state or the corresponding second input/output queue state is a specific state, and determining that the corresponding management queue operation instruction or the corresponding input/output queue operation instruction is a specific operation instruction.
7. The connection management method according to claim 1, further comprising, after the i/o queue is bound under the created management queue:
acquiring excitation parameters of disconnection;
determining a corresponding third management queue state and a disconnection instruction from a preset state conversion table according to the excitation parameter of disconnection;
and executing the disconnection instruction, and converting the second management queue state of the state machine into a third management queue state.
8. A connection management system, characterized in that the system comprises:
the excitation parameter acquisition module is used for acquiring excitation parameters, and the excitation parameters comprise excitation parameters of a management queue or excitation parameters of an input/output queue;
the state machine module is used for determining a corresponding operation instruction and a second state from a preset state transition table according to the excitation parameter and the current state of the state machine, wherein the operation instruction comprises a management queue operation instruction or an input/output queue operation instruction, and the second state comprises a second management queue state or a second input/output queue state;
and the execution module is used for executing the management queue operation instruction to create a management queue and convert a first management queue state of the state machine into a corresponding second management queue state, or executing the input and output queue operation instruction to bind the input and output queue under the created management queue and convert the first input and output queue state of the state machine into the corresponding second input and output queue state.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202210833985.0A 2022-07-14 2022-07-14 Connection management method, system, computer device and storage medium Withdrawn CN115348305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210833985.0A CN115348305A (en) 2022-07-14 2022-07-14 Connection management method, system, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210833985.0A CN115348305A (en) 2022-07-14 2022-07-14 Connection management method, system, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN115348305A true CN115348305A (en) 2022-11-15

Family

ID=83948140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210833985.0A Withdrawn CN115348305A (en) 2022-07-14 2022-07-14 Connection management method, system, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN115348305A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499489A (en) * 2022-11-16 2022-12-20 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for managing sub-network in link

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499489A (en) * 2022-11-16 2022-12-20 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for managing sub-network in link

Similar Documents

Publication Publication Date Title
WO2016184175A1 (en) Database processing method and apparatus
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN111612614A (en) Public link-based sub-chain service system
CN112350861B (en) Log acquisition method, device, computer equipment and storage medium
CN112600924B (en) IoT terminal data storage system, method, computer device and storage medium
CN115348305A (en) Connection management method, system, computer device and storage medium
CN115277727B (en) Data disaster recovery method, system, device and storage medium
CN114926163A (en) Resource cross-chain transfer method and device
EP2445171B1 (en) File transfer protocol client and implementing method thereof
CN107301053B (en) Picture configuration method and device and electronic terminal
CN109982315A (en) Log method for uploading and relevant device
CN111447136B (en) Message pushing method and device, computer equipment and storage medium
CN110365649B (en) Data transmission method, data access device, data output device and system
CN112217845B (en) Data transmission method based on Netconf protocol and related equipment
CN112130889A (en) Resource management method and device, storage medium and electronic device
CN112287265B (en) Asynchronous event driven based file conversion method and system
CN116009984A (en) Security arrangement and automatic response processing method and device and electronic equipment
CN111342932B (en) Data transmission method, device, equipment and computer readable storage medium
CN110557374B (en) Power data acquisition method and device, computer equipment and storage medium
JP2022530953A (en) How to manage remote devices by management device
CN112165529A (en) Method, device, equipment and medium for low-cost cross-network data exchange
US8234487B2 (en) Server apparatus and startup control method
CN113076151B (en) Application program interaction method, device, computer equipment and storage medium
CN115086421B (en) Distributed optimization multi-intelligent-agent cooperation method and related equipment
CN111614649B (en) Method and device for closing TCP short connection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20221115