Network connection processing method, apparatus, device, and medium

By judging and initializing the session variables of the network connection during the connection return event, the access error problem caused by connection pool pollution is solved, and the effective reuse of connections and reduction of network latency are achieved.

CN115712665BActive Publication Date: 2026-03-27BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-18
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In large or complex application systems, connection pool contamination can lead to errors in subsequent network access services.

Method used

When the connection return event is triggered, the session variables of the network connection are retrieved, it is determined whether the connection variables have been modified, and if they have been modified, they are initialized and then returned to the connection pool.

Benefits of technology

It effectively avoids connection pool pollution, prevents subsequent access errors, improves connection reusability, and reduces network latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115712665B_ABST
    Figure CN115712665B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a network connection processing method, device, equipment and medium. The network connection processing method comprises: when a connection return event for a target network connection is triggered, obtaining a target session variable corresponding to the target network connection; in the case where the target session variable indicates that a target connection variable of the target network connection has been modified, initializing the connection variable of the target network connection to obtain an initialized target network connection; and returning the initialized target network connection to a connection pool. According to the embodiment of the present disclosure, in the process of returning the network connection to the connection pool, in the case where the connection variable that is easy to affect access has been modified, the network connection can be reset and then returned to the connection pool, effectively avoiding the pollution of the connection pool, and further avoiding the subsequent access error.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a network connection processing method and device, equipment and medium. BACKGROUND

[0002] In some large or complex application systems, connection pool technology can be used to store connection resources, so as to avoid repeated connection and disconnection overheads in subsequent network access service provision, and achieve connection multiplexing.

[0003] In the related art, when a connection is put back into a connection pool after providing the connection for network access service, the connection pool may be polluted due to historical modifications to the connection, thereby affecting subsequent network access service errors. SUMMARY

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a network connection processing method and device, equipment and medium.

[0005] In a first aspect, the present disclosure provides a network connection processing method, comprising:

[0006] When a connection return event for a target network connection is triggered, a target session variable corresponding to the target network connection is obtained;

[0007] In a case where the target session variable indicates that a target connection variable of the target network connection has been modified, a connection variable of the target network connection is initialized to obtain an initialized target network connection;

[0008] The initialized target network connection is put back into the connection pool.

[0009] In a second aspect, the present disclosure provides a network connection processing device, comprising:

[0010] A variable obtaining module is configured to obtain a target session variable corresponding to a target network connection when a connection return event for the target network connection is triggered;

[0011] An initialization module is configured to initialize a connection variable of the target network connection in a case where the target session variable indicates that a target connection variable of the target network connection has been modified, to obtain an initialized target network connection;

[0012] A first return module is configured to put the initialized target network connection back into the connection pool.

[0013] In a third aspect, the present disclosure provides a network connection processing equipment, comprising:

[0014] A processor;

[0015] a memory for storing executable instructions;

[0016] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the network connection processing method of the first aspect.

[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing a computer program, when the computer program is executed by a processor, the processor implements the network connection processing method of the first aspect.

[0018] Compared with the prior art, the technical solutions provided by the embodiments of the present disclosure have the following advantages:

[0019] The network connection processing method, device, equipment and medium provided by the embodiments of the present disclosure can determine whether the target session variable corresponding to the target network connection indicates that the target connection variable of the target network connection has been modified when triggering the connection return event of the target network connection. If the target session variable indicates that the target connection variable of the target network connection has been modified, the connection variable of the target network connection is initialized to obtain the initialized target network connection, and the initialized target network connection is returned to the connection pool. In the process of returning the network connection to the connection pool, in the case where the connection variable that is easy to affect access has been modified, the network connection can be reset and then returned to the connection pool, which effectively avoids the pollution of the connection pool, and further avoids triggering subsequent access errors. BRIEF DESCRIPTION OF DRAWINGS

[0020] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the following specific embodiments with reference to the attached drawings. Throughout the drawings, the same or similar reference numerals refer to the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn according to the scale.

[0021] Figure 1 A network connection processing diagram in the related art;

[0022] Figure 2 Another network connection processing diagram in the related art;

[0023] Figure 3 A network connection processing scenario provided by the embodiments of the present disclosure;

[0024] Figure 4 A flowchart of a network connection processing method provided by the embodiments of the present disclosure;

[0025] Figure 5 Another flowchart of a network connection processing method provided by the embodiments of the present disclosure;

[0026] Figure 6 A processing schematic diagram of network connection provided for an embodiment of the present disclosure;

[0027] Figure 7 A structural schematic diagram of a processing apparatus of network connection provided for an embodiment of the present disclosure;

[0028] Figure 8 A structural schematic diagram of a processing device of network connection provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure will be described in more detail with reference to the drawings. While certain embodiments of the present disclosure will be shown and described below, it is to be understood that the present disclosure can be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided as part of the disclosure to convey the principles and subtleties of the present disclosure to those skilled in the art.

[0030] It should be understood that each step recited in the method embodiments of the present disclosure can be executed in different order and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.

[0031] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related definitions will be given in the description below.

[0032] It should be noted that the terms "first", "second", and the like in the present disclosure are used only to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.

[0034] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0035] In some large or complex application systems, connection pooling technology can be used to manage connection resources, so as to avoid the overhead of repeated connection establishment and disconnection when providing network access services, thus achieving the purpose of connection reuse. For example, proxy-based database middleware initializes a connection pool for the database cluster at startup to provide database access services.

[0036] For example, Figure 1 This is a schematic diagram of a network connection process in related technologies, such as... Figure 1 As shown, when an access request (such as a query request) arrives, the database middleware can retrieve a backend connection from the connection pool, correct the retrieved backend connection based on client variables, and return the backend connection to the connection pool after use. However, the lack of any processing on the connection upon return can lead to connection pool pollution.

[0037] To illustrate this, an example will be provided. Figure 2 This is a schematic diagram of another network connection process in related technologies, such as... Figure 2 As shown, user A can obtain connection 2 from the connection pool through client A to execute Structured Query Language (SQL), and set the system variable (Foreign_Key_Checks, FKC) for enabling and disabling foreign key constraints to 0. Then, connection 2 is returned to the connection pool, causing connection pollution. Subsequently, when user B retrieves a connection from the connection pool through client B, it may receive connection 2 that user A just returned with FKC = 0. Furthermore, user B's client variables have not been set for FKC, which may cause errors in user B's subsequent SQL execution.

[0038] To address the aforementioned technical problems, this disclosure provides a network connection processing solution, exemplarily, Figure 3 This is a scenario diagram of network connection processing provided in an embodiment of the present disclosure, such as... Figure 3 As shown, the client can send an access request to the middleware. The middleware can retrieve a network connection from the connection pool and use the network connection to execute the access operation corresponding to the access request. When the access operation ends and a connection return event for the network connection is triggered, the middleware can obtain the session variable corresponding to the network connection. If the session variable indicates that the connection variable of the network connection, which is likely to affect access, has been modified, the middleware can initialize the connection variable of the network connection and return the initialized network connection to the connection pool. This can achieve the reset of the network connection variable, effectively avoiding pollution of the connection pool and thus avoiding subsequent access errors.

[0039] In order to better understand the inventive concept of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure are described below in combination with exemplary embodiments.

[0040] Figure 4 A flowchart of a network connection processing method provided by the embodiments of the present disclosure is shown in FIG. 4. The method can be executed by a network connection processing apparatus. The apparatus can be implemented by software and / or hardware, and can be integrated in an electronic device, for example, a device including a middleware, such as a database middleware. Figure 3 As shown in FIG. 4, the method includes the following steps. Figure 4

[0041] In step 401, when a connection playback event for a target network connection is triggered, a target session variable corresponding to the target network connection is obtained.

[0042] The network connection can be understood as a connection saved in a connection pool of the middleware, which needs to be managed by the middleware and is used to provide a quick connection function for access.

[0043] Taking a database access scenario as an example, the middleware can be a database middleware, and the network connection processing method in the embodiments of the present disclosure can be executed by the middleware in the database middleware. The connection playback event can be an event of putting the network connection back to the connection pool. The session variable can be a variable existing only in a connection for one access between a client and a database server, and the target session variable can be a variable existing in a current connection for access between the current client and the database server based on the target network connection. Figure 3

[0044] In some embodiments of the present disclosure, when an access result is obtained after a corresponding access operation is performed based on the target network connection according to an access request sent by a target device, a connection playback event for the target network connection can be triggered. In other embodiments of the present disclosure, when a connection playback instruction for the target network connection sent by another device is received or any other preset connection playback event is triggered, the connection playback event for the target network connection can also be triggered.

[0045] Specifically, when it is determined that the connection playback event for the target network connection is triggered, the middleware can obtain the target session variable of the target network connection stored in the memory of the middleware, or call the target session variable of the target network connection stored in a background server.

[0046] In step 402, when the target session variable indicates that a target connection variable of the target network connection has been modified, the connection variable of the target network connection is initialized to obtain an initialized target network connection.

[0047] ​​The connection variables can be variables related to network connection execution access. In the embodiments of the present disclosure, the connection variables can include at least one of a user variable, a system variable, and a library state variable. The user variable can be a user-defined variable, for example, the user variable includes query content, etc. The system variable can be understood as a variable for configuring a running environment of a service end provided by a system, for example, for a relational database management system MySQL, the variable can be a variable for configuring a running environment of a MySQL server, for example, the system variable can include a character set variable, etc. The library state variable can be used to indicate a variable of a database queried by a user, for example, the library state variable can include a database name, a database code, etc. The target connection variable refers to a current connection variable corresponding to the target network connection. The target connection variable is modified or unmodified.

[0048] In the embodiments of the present disclosure, the target connection variable can be a connection variable that is easy to affect access.

[0049] Optionally, the target connection variable can include a target sub-variable in the user variable and / or the system variable, and the target sub-variable includes a variable other than the character set variable. When the network connection is established in the connection pool initialization phase, the character set variable has been set, and the character set variable can include a client character set variable (character_set_client), a connection character set variable (character_set_connection), and a result character set variable (character_set_results), etc. The client character set variable can be used to set a character set used by a client, the connection character set variable can be used to set a character set when a database is connected, and the result character set variable can be an encoding format used by a database when a result is returned to a client.

[0050] When the target connection variable includes the target sub-variable in the user variable and the system variable, and the target sub-variable includes a variable other than the character set variable, after obtaining the target session variable corresponding to the target network connection, the method further includes: in a case where it is detected that the user variable in the target session variable is empty and all the target sub-variables in the target session variable are empty, determining that the target session variable indicates that the target connection variable of the target network connection is unmodified; and in a case where it is detected that the user variable in the target session variable is not empty and / or at least one of the target sub-variables in the target session variable is not empty, determining that the target session variable indicates that the target connection variable of the target network connection is modified.

[0051] Specifically, the middleware can determine whether the setting value of the target sub-variable and the setting value of the user variable exist in the target session variable. If any setting value of the target sub-variable, or any setting value of the user variable, or any setting value of the target sub-variable and any setting value of the user variable exist, it is determined that the target session variable indicating the target connection variable of the target network connection has been modified. Otherwise, it can be determined that the target session variable indicating the target connection variable of the target network connection has not been modified.

[0052] In this way, after obtaining the target session variable corresponding to the target network connection, the modification of the target network connection can be determined.

[0053] In the embodiment of the present disclosure, in the case where the target session variable indicates that the target connection variable of the target network connection has been modified, the connection variable of the target network connection can be initialized to obtain the initialized target network connection, that is, the connection variable of the target network connection is reset.

[0054] In step 403, the initialized target network connection is put back into the connection pool.

[0055] The connection pool can be a container for including a plurality of network connections. The connection pool can include a certain number of network connections, which are idle network connections not used for processing access requests, that is, valid network connections. In this way, when processing an access request, a network connection does not need to be created in real time, but a usable network connection can be selected from the connection pool to process the access request, thereby shortening the time required by the client to establish a network connection with the server.

[0056] Taking a database access scenario as an example, the connection pool can be a database connection pool, which is used to connect to a database.

[0057] In the embodiment of the present disclosure, after the middleware obtains the initialized target network connection, the initialized target network connection can be put back into the connection pool, thereby avoiding subsequent access errors under the premise of avoiding connection pollution.

[0058] In the embodiment of the present disclosure, when a connection return event for the target network connection is triggered, it can be determined whether the target session variable corresponding to the target network connection indicates that the target connection variable of the target network connection has been modified. If the target session variable indicates that the target connection variable of the target network connection has been modified, the connection variable of the target network connection is initialized to obtain the initialized target network connection, and the initialized target network connection is put back into the connection pool. In this way, in the process of putting the network connection back into the connection pool, in the case where the connection variable that is easy to affect access has been modified, the network connection can be reset in variable before being put back into the connection pool, thereby effectively avoiding pollution of the connection pool and further avoiding subsequent access errors.

[0059] In some embodiments of the present disclosure, after obtaining the target session variable corresponding to the target network connection, the processing method of the network connection can further include: in a case where the target session variable indicates that the target connection variable of the target network connection is not modified, returning the target network connection to the connection pool.

[0060] Specifically, when it is determined that there is at least one target sub-variable and / or user variable in the target session variable, it can be determined that the target session variable indicates that the target connection variable of the target network connection is not modified, and at this time, the target network connection can be directly returned to the connection pool.

[0061] Since the frequency of modification of the character set variable is generally small, if there is no variable other than the character set variable in the target session variable, the target network connection can be returned to the connection pool, and the effective connection of the commonly used user variable and character set variable can be retained under the premise of avoiding connection pollution, thereby increasing the reusability of the connection.

[0062] In some embodiments of the present disclosure, triggering the connection return event for the target network connection can include: receiving an access request sent by a target device, the access request carrying a target session variable; modifying a connection variable of the target network connection according to the target session variable; executing an access operation corresponding to the access request by using the target network connection; and triggering the connection return event for the target network connection when an access result corresponding to the access operation is obtained.

[0063] The target device can be an electronic device of any client. The middleware can receive an access request sent by a target device, take out a target network connection from the connection pool, modify a connection variable of the target network connection according to the target session variable in the access request, execute a corresponding access operation by using the target network connection, and after obtaining an access result corresponding to the access operation, the target network connection needs to be returned to the connection pool, that is, the connection return event for the target network connection is triggered.

[0064] In some embodiments, after receiving the access request sent by the target device, the processing method of the network connection can further include: storing the target session variable in association with the target network connection; wherein obtaining the target session variable corresponding to the target network connection includes: obtaining the target session variable stored in association with the target network connection.

[0065] Specifically, the middleware can further store the target session variable in the access request in association with the target network connection after receiving the access request sent by the target device, so that the target session variable of the target network connection stored locally can be directly obtained subsequently.

[0066] In some embodiments, after triggering the connection return event for the target network connection, the method for processing the network connection can further include: feeding back the access result to the target device.

[0067] Specifically, after triggering the connection return event for the target network connection, the middleware can perform the process of returning the target network connection to the connection pool in parallel with feeding back the access result to the target device, thereby achieving connection recycling in an asynchronous manner and avoiding network time consumption caused by variable resetting of the network connection.

[0068] Figure 5 Another flowchart of a method for processing a network connection is provided for the embodiments of the present disclosure. Based on the above embodiments, the method for processing the network connection is further described. As shown in Figure 5 The method includes:

[0069] Step 501: receiving an access request sent by a target device.

[0070] The access request carries a target session variable.

[0071] Optionally, after receiving the access request sent by the target device, the method for processing the network connection can further include: storing the target session variable in association with the target network connection.

[0072] Step 502: modifying a connection variable of the target network connection according to the target session variable.

[0073] The connection variable includes at least one of a user variable, a system variable, and a library state variable.

[0074] Step 503: performing an access operation corresponding to the access request by using the target network connection.

[0075] Step 504: triggering a connection return event for the target network connection when an access result corresponding to the access operation is obtained.

[0076] After step 504, steps 505-509 and step 510 can be performed in parallel.

[0077] Step 505: obtaining a target session variable corresponding to the target network connection.

[0078] Optionally, obtaining the target session variable corresponding to the target network connection includes: obtaining the target session variable stored in association with the target network connection.

[0079] The target connection variable is the connection variable of the target network connection. The target connection variable can include a target sub-variable in the user variable and / or the system variable. The target sub-variable includes variables other than the character set variable.

[0080] After step 505, when the target connection variable includes the target sub-variable in the user variable and the system variable, and the target sub-variable includes the variable other than the character set variable, it can be judged whether the target connection variable of the target network connection is modified through step 506.

[0081] Step 506, it is judged whether the user variable in the target session variable is empty and whether the target sub-variable in the target session variable is empty, if yes, step 507 is executed; otherwise, step 509 is executed.

[0082] Step 507, it is determined that the target session variable indicates that the target connection variable of the target network connection is not modified, the connection variable of the target network connection is initialized, and the initialized target network connection is obtained.

[0083] Step 508, the initialized target network connection is put back to the connection pool.

[0084] Step 509, it is determined that the target session variable indicates that the target connection variable of the target network connection is not modified, and the target network connection is put back to the connection pool.

[0085] Step 510, the access result is fed back to the target device.

[0086] In the embodiment of the present disclosure, when the access result is obtained after the corresponding access operation is performed on the target network connection based on the access request sent by the target device, the connection return event for the target network connection can be triggered, and then the target network connection can be put back to the connection pool and the access result can be fed back to the target device in an asynchronous manner. In the process of putting the network connection back to the connection pool, in the case where it is determined that the connection variable that is easy to affect the access has been modified, the network connection can be reset in variables before being put back to the connection pool, which effectively avoids the pollution to the connection pool and further avoids triggering the subsequent access error; and in the case where it is determined that the connection variable that is easy to affect the access has not been modified, the effective connection of the commonly used user variable and the character set variable can be preserved, and the reusability of the connection is increased; at the same time, the connection recycling can be performed in an asynchronous manner, which avoids the network time consumption caused by the variable reset of the network connection.

[0087] An exemplary network connection processing schematic diagram provided by the embodiment of the present disclosure is shown in FIG. 1. Figure 6 As shown in FIG. 1, compared with the prior art, Figure 6 the embodiment of the present disclosure can effectively avoid the pollution to the connection pool caused by the variable reset of the network connection, and further avoid triggering the subsequent access error. Figure 2The processing scheme of the network connection in the embodiment of the present disclosure increases the judgment of whether the user variable in the session variable of the current network connection is empty and whether only the character set variable is contained in the system variable in the process of putting the connection back to the connection pool. If yes, the network connection is directly put back to the connection pool. Otherwise, the current network connection is reset and then put back to the connection pool. That is, whether any system variable or any user variable except the character set variable has a set value in the session variable of the current network connection is judged. If yes, the current network connection is reset and then put back to the connection pool. Otherwise, the network connection is directly put back to the connection pool. In this way, whether the network connection is reset is determined by checking the content of the system variable of the network connection when the network connection is recycled, so as to maximize the reusability of the connection under the premise of avoiding connection pollution.

[0088] Meanwhile, as shown in Figure 6 , the connection recycling can be performed in an asynchronous manner according to the following steps: 1, returning a client response result; 2, performing initialization (reset connection) on the current network connection; 3, putting the current network connection back to the connection pool. By using the asynchronous recycling manner in the recycling stage of the network connection, the network time consumption of the Round-Trip Time (RTT) possibly introduced in the previous step for the query process is avoided.

[0089] In summary, in the embodiment of the present disclosure, the problem of connection pool pollution can be solved, the pollution to the connection pool is effectively avoided, and the subsequent access error is further avoided; and the effective connection of the commonly used user variable and character set variable is preserved, the reusability of the connection is improved; meanwhile, the connection recycling is performed in an asynchronous manner, and the network time consumption caused by the variable reset of the network connection possibly introduced is avoided.

[0090] Figure 7 A structural schematic diagram of a network connection processing apparatus provided in the embodiment of the present disclosure is shown in Figure 7 , which can be implemented by software and / or hardware and can be integrated in an electronic device. As shown in the figure, the network connection processing apparatus 700 includes:

[0091] A variable obtaining module 701 is configured to obtain a target session variable corresponding to a target network connection when a connection putting back event for the target network connection is triggered;

[0092] An initialization module 702 is configured to initialize a connection variable of the target network connection to obtain an initialized target network connection in a case where the target session variable indicates that the target connection variable of the target network connection has been modified;

[0093] A first putting back module 703 is configured to put the initialized target network connection back to a connection pool.

[0094] The embodiment of the present disclosure can determine whether the target session variable corresponding to the target network connection indicates that the target connection variable of the target network connection has been modified when triggering the connection put-back event of the target network connection. If the target session variable indicates that the target connection variable of the target network connection has been modified, the connection variable of the target network connection is initialized to obtain an initialized target network connection, and the initialized target network connection is put back to the connection pool. In the process of putting the network connection back to the connection pool, the network connection can be reset in the case where the connection variable that is easy to affect access has been modified, thereby effectively avoiding the pollution of the connection pool and further avoiding triggering subsequent access errors.

[0095] Optionally, the network connection processing apparatus 700 further comprises a second put-back module, configured to:

[0096] After obtaining the target session variable corresponding to the target network connection, in the case where the target session variable indicates that the target connection variable of the target network connection has not been modified, the target network connection is put back to the connection pool.

[0097] Optionally, the target connection variable comprises target sub-variables in user variables and / or system variables, and the target sub-variables comprise variables other than character set variables.

[0098] Optionally, the target connection variable comprises target sub-variables in user variables and system variables, and the target sub-variables comprise variables other than character set variables.

[0099] The network connection processing apparatus 700 further comprises a variable judgment module, which comprises a first judgment unit and a second judgment unit.

[0100] The first judgment unit is configured to, after obtaining the target session variable corresponding to the target network connection, determine that the target session variable indicates that the target connection variable of the target network connection has not been modified in the case where it is detected that the user variable in the target session variable is empty and all target sub-variables in the target session variable are empty.

[0101] The second judgment unit is configured to, after obtaining the target session variable corresponding to the target network connection, determine that the target session variable indicates that the target connection variable of the target network connection has been modified in the case where it is detected that the user variable in the target session variable is not empty and / or at least one target sub-variable in the target session variable is not empty.

[0102] Optionally, the connection variable comprises at least one of user variables, system variables and library state variables.

[0103] Optionally, the variable acquisition module 701 is specifically configured to:

[0104] receive an access request sent by the target device, the access request carrying a target session variable;

[0105] modify a connection variable of the target network connection according to the target session variable;

[0106] perform an access operation corresponding to the access request by using the target network connection;

[0107] trigger a connection return event for the target network connection when an access result corresponding to the access operation is obtained.

[0108] Optionally, the processing apparatus 700 of the network connection further includes a storage module, configured to:

[0109] store the target session variable in association with the target network connection after receiving the access request sent by the target device;

[0110] The variable obtaining module 701 is specifically configured to:

[0111] obtain the target session variable stored in association with the target network connection.

[0112] Optionally, the processing apparatus 700 of the network connection further includes a feedback module, configured to:

[0113] feed back the access result to the target device after triggering the connection return event for the target network connection.

[0114] The processing apparatus of the network connection provided in the embodiments of the present disclosure can perform the processing method of the network connection provided in any of the embodiments of the present disclosure, and has the corresponding function modules and beneficial effects of performing the method.

[0115] Figure 8 A structural schematic diagram of a processing device of a network connection provided in the embodiments of the present disclosure is shown in FIG. 8. Figure 8 As shown in FIG. 8, the processing device 800 of the network connection includes one or more processors 801 and a memory 802.

[0116] The processor 801 can be a central processing unit (CPU) or other forms of processing units having data processing and / or instruction execution capabilities, and can control other components in the processing device 800 of the network connection to perform desired functions.

[0117] The memory 802 can include one or more computer program products that can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache memory, and / or the like. The non-volatile memory, for example, can include read only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage media, and the processor 801 can execute the program instructions to implement the network-connected processing method of the embodiments of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, and the like can also be stored in the computer-readable storage media.

[0118] In one example, the network-connected processing device 800 can further include an input device 803 and an output device 804, which are interconnected through a bus system and / or other forms of connection mechanism (not shown).

[0119] In addition, the input device 803 can further include, for example, a keyboard, a mouse, and the like.

[0120] The output device 804 can output various information to the outside, including the determined distance information, direction information, and the like. The output device 804 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0121] Of course, in order to simplify, Figure 8 Only some of the components related to the present disclosure in the network-connected processing device 800 are shown in the figure, and components such as buses, input / output interfaces, and the like are omitted. In addition, the network-connected processing device 800 can further include any other appropriate components according to specific application cases.

[0122] In addition to the above method and device, the embodiments of the present disclosure can also provide a computer program product including computer program instructions, which, when executed by a processor, cause the processor to perform the network-connected processing method provided by the embodiments of the present disclosure.

[0123] The computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. The embodiments of the present disclosure can be a computer program product, which can include a computer program tangibly embodied in a machine readable storage medium.

[0124] In addition, an embodiment of the present disclosure can also be a computer readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the video processing method provided by the embodiments of the present disclosure.

[0125] The computer readable storage medium can be any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the above. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0126] It should be noted that, in this document, the terms such as "first" and "second" and the like are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0127] The foregoing is merely illustrative of the various implementations of the present disclosure and the general principles thereof. Numerous modifications can be made to these illustrations, and equivalents can be substituted therefor, without departing from the scope of the present disclosure. The specific embodiments commensurate with the specific application are intended to be illustrative only and not limiting of the scope of the application as set forth in the following claims.

Claims

1. A method for processing network connections, characterized in that, include: When a connection return event for a target network connection is triggered, the target session variable corresponding to the target network connection is obtained; If the target session variable indicates that the target connection variable of the target network connection has been modified, the connection variable of the target network connection is initialized to obtain the initialized target network connection. The target connection variable includes target sub-variables in user variables and system variables. The target sub-variables include variables other than character set variables. Return the initialized target network connection to the connection pool; After obtaining the target session variable corresponding to the target network connection, the method further includes: If it is detected that the user variable in the target session variable is empty and all the target sub-variables in the target session variable are empty, it is determined that the target connection variable indicating the target network connection of the target session variable has not been modified; If it is detected that the user variable in the target session variable is not empty and / or at least one target sub-variable in the target session variable is not empty, it is determined that the target connection variable indicating the target network connection has been modified.

2. The method according to claim 1, characterized in that, After obtaining the target session variable corresponding to the target network connection, the method further includes: If the target connection variable indicating the target network connection has not been modified, the target network connection is returned to the connection pool.

3. The method according to claim 1, characterized in that, The target connection variable includes target sub-variables among user variables and / or system variables, and the target sub-variables include variables other than character set variables.

4. The method according to claim 1, characterized in that, The connection variables include at least one of user variables, system variables, and library state variables.

5. The method according to claim 1, characterized in that, The event that triggers the connection return event for the target network connection includes: Receive an access request sent by the target device, the access request carrying the target session variable; Modify the connection variables of the target network connection according to the target session variables; Utilize the target network connection to execute the access operation corresponding to the access request; When the access result corresponding to the access operation is obtained, a connection return event for the target network connection is triggered.

6. The method according to claim 5, characterized in that, After receiving the access request sent by the target device, the method further includes: The target session variable is associated with and stored in relation to the target network connection; Wherein, obtaining the target session variable corresponding to the target network connection includes: Retrieve the target session variables that are stored in association with the target network connection.

7. The method according to claim 5, characterized in that, After triggering the connection return event for the target network connection, the method further includes: The access result is fed back to the target device.

8. A network connection processing apparatus, characterized in that, include: The variable acquisition module is configured to acquire the target session variable corresponding to the target network connection when a connection return event for the target network connection is triggered. An initialization module is configured to initialize the connection variables of the target network connection when the target session variable indicates that the target connection variable of the target network connection has been modified, thereby obtaining the initialized target network connection. The target connection variables include target sub-variables in user variables and system variables, and the target sub-variables include variables other than character set variables. The first return module is configured to return the initialized target network connection to the connection pool. The device further includes a variable judgment module, which includes a first judgment unit and a second judgment unit. The first determining unit is configured to, after obtaining the target session variable corresponding to the target network connection, determine that the target connection variable indicating the target network connection has not been modified if it detects that the user variable in the target session variable is empty and all the target sub-variables in the target session variable are empty; The second determination unit is configured to determine that the target connection variable indicating the target network connection has been modified if it is detected that the user variable in the target session variable is not empty and / or at least one target sub-variable in the target session variable is not empty.

9. A network connection processing device, characterized in that, include: processor; Memory, used to store executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the network connection processing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, causes the processor to implement the network connection processing method according to any one of claims 1-7.