Method and device for dynamically adjusting the number of long connections

By dynamically comparing and adjusting the number of long connections in the host memory table, the problem that the number of long connections cannot be dynamically adjusted in the existing technology is solved, and resource optimization and business continuity guarantee are achieved when business volume changes.

CN115134400BActive Publication Date: 2024-11-19INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210750089.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2024-11-19
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The prior art cannot dynamically adjust the number of long connections between the host and the platform server when the traffic volume changes, resulting in waste of resources and business continuity.

Method used

By comparing the number of configured long connections and the number of started long connections that read the host memory table, dynamically start or stop long connections, ensuring that the number of long connections is consistent with the number of configurations, and avoid restarting the middleware system.

Benefits of technology

It realizes dynamic adjustment of the number of long connections without affecting business continuity, improves emergency efficiency, and reduces the impact on business during abnormal periods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115134400B_ABST
    Figure CN115134400B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for dynamically adjusting the number of long connections, which relates to the field of computer communication technology and can be used in the financial field. The method includes: obtaining the number of configured long connections according to a connection call signal; reading the host memory table to obtain the number of activated long connections, and comparing the number of activated long connections with the number of configured long connections; in response to the number of activated long connections being less than the number of configured long connections, starting several new long connections so that the number of activated long connections is equal to the number of configured long connections; in response to the number of activated long connections being greater than the number of configured long connections, stopping several activated long connections so that the number of activated long connections is equal to the number of configured long connections. The present application can dynamically adjust the number of host long connections according to the business volume. The adjustment process does not require modification of the assembly table or restarting of the host middleware system. The adjustment of the number of communication long connections can be completed without affecting business continuity. When the business is abnormal, the emergency efficiency can be improved and the impact on the business during the abnormal period can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer communication technology and can be used in the financial field, and in particular to a method and device for dynamically adjusting the number of long connections. Background Art

[0002] In order to improve the communication efficiency between the host and the platform server and reduce the consumption of the host, the host and the platform server generally use long connections for communication. "Long connection" means that the client and the server only need to establish a connection once, and then they can communicate multiple times. Compared with short connections (one connection only communicates once), using long connections can effectively reduce the time and number of times the host establishes connections with other platforms, save resource overhead, and improve communication efficiency, but it will also increase the operation and maintenance costs of the host.

[0003] The host acts as a client, and its business transaction will simultaneously start multiple communication long connection processes to communicate with the platform server. After the connection is established, the business transaction will call the communication interface through the application to realize the communication with the platform server.

[0004] The number of long connections for host communication is preset in the host assembly table in advance. When the host middleware system starts, the system automatically loads the preset values ​​of the assembly table into the memory table and starts the corresponding number of long connections according to the values ​​in the memory table. During the normal operation of the host middleware system, the total number of long connections will not change.

[0005] In the host middleware system, starting a long connection is starting a long transaction. Each transaction will occupy a certain amount of system resources. Therefore, in actual applications, the number of long connections needs to be reasonably evaluated according to the business volume. When the business volume grows rapidly, the number of long communication connections also needs to be adjusted accordingly to support the growth of business volume. According to the existing technical solution, modifying the number of long connections requires modifying the assembly table and restarting the host middleware system to take effect. During the restart period, no external services can be provided, which will affect the continuity of business transactions. Summary of the invention

[0006] In view of this, the present invention provides a method and device for dynamically adjusting the number of long connections to solve at least one of the above-mentioned problems.

[0007] In order to achieve the above object, the present invention adopts the following scheme:

[0008] According to a first aspect of the present invention, a method for dynamically adjusting the number of long connections is provided, the method comprising: obtaining the configured number of long connections according to a connection call signal; reading a host memory table to obtain the number of started long connections, and comparing the number of started long connections with the configured number of long connections; in response to the number of started long connections being less than the configured number of long connections, starting several new long connections to make the number of started long connections equal to the configured number of long connections; in response to the number of started long connections being greater than the configured number of long connections, stopping several started long connections to make the number of started long connections equal to the configured number of long connections.

[0009] According to a second aspect of the present invention, there is provided a device for dynamically adjusting the number of long connections, the device comprising: a configuration acquisition unit, for acquiring the number of configured long connections according to a connection call signal; a memory reading unit, for reading a host memory table to obtain the number of started long connections, and comparing the number of started long connections with the number of configured long connections; a connection starting unit, for starting a number of new long connections in response to the number of started long connections being less than the number of configured long connections so that the number of started long connections is equal to the number of configured long connections; a connection stopping unit, for stopping a number of started long connections in response to the number of started long connections being greater than the number of configured long connections so that the number of started long connections is equal to the number of configured long connections.

[0010] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for dynamically adjusting the number of long connections as described above are implemented.

[0011] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for dynamically adjusting the number of long connections as described above are implemented.

[0012] According to a fifth aspect of the present invention, there is provided a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method for dynamically adjusting the number of long connections as described above.

[0013] As described above, this application can dynamically adjust the number of host long connections according to the business volume. The adjustment process does not require modifying the assembly table or restarting the host middleware system. The number of communication long connections can be adjusted without affecting business continuity. When the business is abnormal, it can improve emergency response efficiency and greatly reduce the impact on the business during the abnormal period. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0015] Figure 1 It is a flowchart of a method for dynamically adjusting the number of long connections provided in an embodiment of the present application;

[0016] Figure 2 This is a schematic diagram of a process of stopping a long connection provided in an embodiment of the present application;

[0017] Figure 3 is a flowchart of a method for dynamically adjusting the number of long connections provided by another embodiment of the present application;

[0018] Figure 4 It is a structural schematic diagram of a device for dynamically adjusting the number of long connections provided in an embodiment of the present application;

[0019] Figure 5 It is a schematic block diagram of the system structure of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0020] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0021] It should be noted that the method and device for dynamically adjusting the number of long connections disclosed in the present application can be used in the financial field, and can also be used in any field other than the financial field. The present application does not limit the application field of the method and device for dynamically adjusting the number of long connections disclosed in the present application.

[0022] like Figure 1 The figure shows a flow chart of a method for dynamically adjusting the number of long connections provided by an embodiment of the present application. This embodiment describes the present application from the host side. The host may be, for example, a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. The method comprises the following steps:

[0023] Step S101: Obtain the number of configured long connections according to a connection calling signal.

[0024] In this embodiment, the number of configured long connections refers to the total number of long connections that need to be configured in the host according to the business volume requirements. It is a parameter that is dynamically adjusted according to the business requirements. Specifically, the parameter can be configured manually or automatically adjusted by software, such as by monitoring the business volume and calculating it by an artificial intelligence model. The connection call signal can be sent by a timer, that is, the number of configured long connections is obtained once every period of time. Of course, in this embodiment, the connection call signal can also be sent by the program monitoring the business volume when the business volume suddenly changes. This embodiment does not limit this.

[0025] Preferably, the configured long connection number can be placed in a database table, and the configuration long connection number can be updated by manually executing SQL statements to update the database. This step can further be specifically as follows: querying the database table according to the connection call timing signal to obtain the configuration long connection number.

[0026] Preferably, in order to facilitate production operation and maintenance management, the configuration long connection number of this embodiment can be placed in the configuration center, which manages the parameter and provides an application programming interface (Application Programming Interface, API) to dynamically refresh the configuration long connection number. This step S101 can be further specified as: calling the configuration center API interface according to the connection call timing signal, querying the configuration long connection number of the configuration center, and importing the configuration long connection number into the host memory. In this embodiment, by placing the configuration long connection number in the configuration center and importing it into the memory by the application system, it is possible to quickly and conveniently obtain the configuration long connection number without affecting the performance of the database, and meet the needs of dynamic refresh.

[0027] Step S102: read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections.

[0028] After obtaining the configured number of long connections through step S101, the number of long connections currently started can be obtained by reading the host memory table, and the number of long connections that have been started is compared with the configured number of long connections to determine whether the number of long connections currently started meets the demand or exceeds the demand, and then perform subsequent corresponding operations based on the judgment result.

[0029] Step S103: In response to the number of started long connections being less than the number of configured long connections, a number of new long connections are started to make the number of started long connections equal to the number of configured long connections.

[0030] When the result of step S102 shows that the number of activated long connections is less than the number of configured long connections, it indicates that the number of long connections needs to be expanded to meet business needs, so several new long connections need to be started so that the number of activated long connections is equal to the number of configured long connections.

[0031] Preferably, the number of persistent connections that need to be newly started can be obtained based on the comparison, and then the new persistent connections are started one by one, and the information of the newly started persistent connections is saved in the memory table in sequence until the number of started persistent connections is equal to the number of configured persistent connections. In this embodiment, the persistent connection information may include a connection identifier, a connection switch status, and an idle busy status.

[0032] Step S104: In response to the number of started long connections being greater than the number of configured long connections, stopping a number of started long connections to make the number of started long connections equal to the number of configured long connections.

[0033] When the result of step S102 shows that the number of activated long connections is greater than the number of configured long connections, it means that the number of long connections is excessive for the current business volume. Therefore, it is necessary to stop several activated long connections to make the number of activated long connections equal to the configured number of long connections, so that the host system resources can be released and the host load can be reduced.

[0034] Preferably, Figure 2 As shown, step S104 may further include the following sub-steps:

[0035] Step S1041: Find the last started persistent connection from the host memory table.

[0036] Step S1042: Turn off the connection switch of the last activated long connection.

[0037] Step S1043: waking up the blocking state of the last started persistent connection through a POST notification instruction, so that the last started persistent connection process ends automatically.

[0038] Step S1044: determine whether the number of activated long connections is equal to the configured long connection number. If so, end the operation and enter the dormant state. If not, return to step S1041.

[0039] In addition, if the comparison result of step S102 is that the number of started long connections is exactly equal to the number of configured long connections, no subsequent operation is required, and the system directly enters the dormant state and waits for the next connection call signal to arrive.

[0040] As described above, this application can dynamically adjust the number of host long connections according to the business volume, and the newly added long connection information is directly stored in the memory table. The entire adjustment process does not require modifying the assembly table or restarting the host middleware system, and the number of communication long connections can be adjusted without affecting business continuity. When the business is abnormal, it can improve emergency response efficiency and greatly reduce the impact on the business during the abnormal period.

[0041] The following describes this application in further detail by taking the configuration of long connection parameters set in the configuration center as an example. Figure 3 FIG. 1 is a flow chart of a method for dynamically adjusting the number of long connections provided by another embodiment of the present application. The implementation subject of this embodiment is a long connection dynamic adjustment device in a host. The method includes the following steps:

[0042] Step S301: a request for querying the number of configured long connections is initiated to a configuration center according to a timing signal of a timer. After receiving the request, the configuration center returns the number of configured long connections to the long connection dynamic adjustment device.

[0043] Step S302: query the host memory table to obtain information about all currently started persistent connections, which may include the total number of started persistent connections, the connection switch status of each persistent connection, and the like.

[0044] Step S303: Determine whether the number of started long connections is equal to the number of configured long connections. If so, proceed to step S304; if not, proceed to step S305.

[0045] Step S304: the long connection dynamic adjustment device enters a sleep state, and the sleep time can be set by a timer. When the timer sends a working signal, the long connection dynamic adjustment device can continue to work in step S301.

[0046] Step S305: Determine whether the number of started long connections is less than the configured number of long connections. If so, proceed to step S306; if not, proceed to step S307.

[0047] Step S306: Start a new persistent connection, update the new persistent connection information in the memory table, and then return to step S302.

[0048] Step S307: Find the last started long connection from the host memory table, turn off the corresponding connection switch, then update the memory table and go to step S308.

[0049] Step S308: Wake up the blocking state of the persistent connection through POST notification and return to step S302. When the persistent connection switch is in the closed state and in the blocked state, the persistent connection process will automatically end.

[0050] As described above, this application can dynamically adjust the number of host long connections according to the business volume, and the newly added long connection information is directly stored in the memory table. The entire adjustment process does not require modifying the assembly table or restarting the host middleware system, and the number of communication long connections can be adjusted without affecting business continuity. When the business is abnormal, it can improve emergency response efficiency and greatly reduce the impact on the business during the abnormal period.

[0051] like Figure 4 What is shown is a schematic diagram of the structure of a device for dynamically adjusting the number of long connections provided in an embodiment of the present application, the device comprising: a configuration acquisition unit 410, a memory reading unit 420, a connection start unit 430 and a connection stop unit 440, wherein the memory reading unit 420 is respectively connected to the configuration acquisition unit 410, the connection start unit 430 and the connection stop unit 440.

[0052] The configuration acquisition unit 410 is used to acquire the number of configured long connections according to the connection calling signal.

[0053] Preferably, the number of configured long connections in this embodiment can be set in the configuration center, and the corresponding configuration acquisition unit 410 can be specifically used to: call the configuration center API interface according to the connection call timing signal to query the number of configured long connections in the configuration center.

[0054] Preferably, the number of configured long connections in this embodiment may also be set in a database table, and the corresponding configuration acquisition unit 410 may be specifically configured to query the database table according to the connection call timing signal to acquire the number of configured long connections.

[0055] The memory reading unit 420 is used to read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections.

[0056] The connection initiating unit 430 is configured to initiate a number of new long connections to make the number of initiated long connections equal to the number of configured long connections in response to the number of initiated long connections being less than the number of configured long connections.

[0057] Preferably, the connection initiation unit 430 can be specifically used to: initiate new persistent connections one by one, and sequentially save the newly initiated persistent connection information to the memory table until the number of initiated persistent connections equals the number of configured persistent connections. The persistent connection information may include: connection identifier, connection switch status, and idle busy status.

[0058] The connection stopping unit 440 is configured to stop a number of started long connections so that the number of started long connections is equal to the number of configured long connections in response to the number of started long connections being greater than the number of configured long connections.

[0059] Preferably, the connection stopping unit 440 can be specifically used to perform the following steps:

[0060] Step a, finding the last started persistent connection from the memory table;

[0061] Step b, turning off the connection switch of the last started long connection;

[0062] Step c, waking up the blocking state of the last started persistent connection through a POST notification instruction, so that the last started persistent connection process ends automatically;

[0063] Repeat steps a to c until the number of started long connections is equal to the number of configured long connections.

[0064] For a detailed description of the above units, see Figure 1 The description in the corresponding method embodiment will not be repeated here.

[0065] As described above, the device for dynamically adjusting the number of long connections provided by the present application can dynamically adjust the number of long connections of the host according to the business volume, and the newly added long connection information is directly stored in the memory table. The entire adjustment process does not require modification of the assembly table, and does not require restarting the host middleware system. The number of communication long connections can be adjusted without affecting business continuity. When the business is abnormal, the emergency response efficiency can be improved, and the impact on the business during the abnormal period can be greatly reduced.

[0066] Figure 5 FIG. 1 is a schematic block diagram of a system structure of an electronic device 1100 provided in another embodiment of the present invention. Figure 5 As shown, the electronic device 1100 may include a central processor 1110 and a memory 1120; the memory 1120 is coupled to the central processor 1110. It is worth noting that Figure 5 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0067] In one embodiment, the method function for dynamically adjusting the number of long connections may be integrated into the central processor 1110 .

[0068] The CPU 1110 may be configured to perform the following control:

[0069] Step S101: Obtain the number of configured long connections according to the connection calling signal.

[0070] Step S102: read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections.

[0071] Step S103: In response to the number of started long connections being less than the number of configured long connections, a number of new long connections are started to make the number of started long connections equal to the number of configured long connections.

[0072] Step S104: In response to the number of started long connections being greater than the number of configured long connections, stopping a number of started long connections to make the number of started long connections equal to the number of configured long connections.

[0073] In another embodiment, the device for dynamically adjusting the number of long connections can be configured separately from the central processing unit 1110. For example, the device for dynamically adjusting the number of long connections can be configured as a chip connected to the central processing unit 1110, and the function of the method for dynamically adjusting the number of long connections can be implemented through the control of the central processing unit.

[0074] like Figure 5 As shown, the electronic device 1100 may further include: a communication module 1130, an input unit 1140, an audio processor 1150, a display 1160, and a power supply 1170. It is worth noting that the electronic device 1100 does not necessarily have to include Figure 5 In addition, the electronic device 1100 may also include Figure 5 For components not shown, reference may be made to the prior art.

[0075] like Figure 5 As shown, the central processor 1110 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 1110 receives inputs and controls the operations of various components of the electronic device 1100 .

[0076] The memory 1120 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The memory 1120 may store information related to the above-mentioned method for dynamically adjusting the number of long connections, and may also store a program for executing the related information. The CPU 1110 may execute the program stored in the memory 1120 to implement information storage or processing.

[0077] The input unit 1140 provides input to the CPU 1110. The input unit 1140 is, for example, a key or a touch input device. The power supply 1170 is used to provide power to the electronic device 1100. The display 1160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0078] The memory 1120 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 1120 may also be some other type of device. The memory 1120 includes a buffer memory 1121 (sometimes referred to as a buffer). The memory 1120 may include an application / function storage unit 1122, which is used to store application programs and function programs or processes for executing the operation of the electronic device 1100 through the central processor 1110.

[0079] The memory 1120 may also include a data storage unit 1123 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 1124 of the memory 1120 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0080] The communication module 1130 is a transmitter / receiver 1130 that transmits and receives signals via an antenna 1131. The communication module (transmitter / receiver) 1130 is coupled to the central processor 1110 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0081] Based on different communication technologies, multiple communication modules 1130 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 1130 is also coupled to a speaker 1151 and a microphone 1152 via an audio processor 1150 to provide an audio output via the speaker 1151 and receive an audio input from the microphone 1152, thereby realizing a common telecommunication function. The audio processor 1150 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 1150 is also coupled to the central processor 1110, so that recording can be performed on the local machine through the microphone 1152, and the sound stored on the local machine can be played through the speaker 1151.

[0082] The embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps in the method for dynamically adjusting the number of long connections in the above embodiment, where the execution subject is a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps in the method for dynamically adjusting the number of long connections in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0083] Step S101: Obtain the number of configured long connections according to the connection calling signal.

[0084] Step S102: read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections.

[0085] Step S103: In response to the number of started long connections being less than the number of configured long connections, a number of new long connections are started to make the number of started long connections equal to the number of configured long connections.

[0086] Step S104: In response to the number of started long connections being greater than the number of configured long connections, stopping a number of started long connections to make the number of started long connections equal to the number of configured long connections.

[0087] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application can dynamically adjust the number of long connections of the host according to the business volume, and the newly added long connection information is directly stored in the memory table. The entire adjustment process does not require modification of the assembly table, and does not require restarting the host middleware system. The number of long communication connections can be adjusted without affecting business continuity. When the business is abnormal, the emergency efficiency can be improved and the impact on the business during the abnormal period can be greatly reduced.

[0088] The embodiments of the present application also provide a computer program product capable of implementing all the steps in the method for dynamically adjusting the number of long connections in the above embodiment, where the execution subject is a client. When the computer program / instruction is executed by a processor, the steps of the method for dynamically adjusting the number of long connections are implemented. For example, the computer program / instruction implements the following steps:

[0089] Step S101: Obtain the number of configured long connections according to the connection calling signal.

[0090] Step S102: read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections.

[0091] Step S103: In response to the number of started long connections being less than the number of configured long connections, a number of new long connections are started to make the number of started long connections equal to the number of configured long connections.

[0092] Step S104: In response to the number of started long connections being greater than the number of configured long connections, stopping a number of started long connections to make the number of started long connections equal to the number of configured long connections.

[0093] From the above description, it can be seen that the computer program product provided by the embodiment of the present application can dynamically adjust the number of long connections of the host according to the business volume, and the newly added long connection information is directly stored in the memory table. The entire adjustment process does not require modification of the assembly table, and does not require restarting the host middleware system. The number of long communication connections can be adjusted without affecting business continuity. When the business is abnormal, the emergency efficiency can be improved and the impact on the business during the abnormal period can be greatly reduced.

[0094] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present invention, and the order of steps is not limited and can be appropriately adjusted as needed.

[0095] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0099] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for dynamically adjusting the number of long connections, characterized in that: The long connection is a long connection between the host and the platform server, and the method includes: Get the number of configured long connections based on the connection call signal; Read the host memory table to obtain the number of started long connections, and compare the number of started long connections with the number of configured long connections; In response to the number of started long connections being less than the number of configured long connections, starting a number of new long connections so that the number of started long connections is equal to the number of configured long connections; In response to the number of started long connections being greater than the number of configured long connections, stopping a number of started long connections to make the number of started long connections equal to the number of configured long connections; The step of stopping a number of started long connections so that the number of started long connections is equal to the number of configured long connections comprises: Step a, finding the last started persistent connection from the host memory table; Step b, turning off the connection switch of the last started long connection; Step c, waking up the blocking state of the last started persistent connection through a POST notification instruction, so that the last started persistent connection process ends automatically; Repeat steps a to c until the number of started long connections is equal to the number of configured long connections.

2. The method for dynamically adjusting the number of long connections according to claim 1, characterized in that: The acquiring and configuring the number of long connections according to the connection calling signal comprises: Call the configuration center API interface according to the connection call timing signal to query the number of configured long connections in the configuration center.

3. The method for dynamically adjusting the number of long connections according to claim 1, characterized in that: The acquiring and configuring the number of long connections according to the connection calling signal comprises: The database table is queried according to the connection call timing signal to obtain the number of configured long connections.

4. The method for dynamically adjusting the number of long connections according to claim 1, characterized in that: The starting of a number of new long connections so that the number of started long connections is equal to the number of configured long connections comprises: New persistent connections are started one by one, and the information of the newly started persistent connections is saved in the host memory table in sequence until the number of started persistent connections is equal to the number of configured persistent connections.

5. The method for dynamically adjusting the number of long connections according to claim 4, characterized in that: The long connection information includes: connection identification, connection switch status and idle busy status.

6. A device for dynamically adjusting the number of long connections, characterized in that: A long connection between a host and a platform server, the device comprising: A configuration acquisition unit, used for acquiring the number of configured long connections according to a connection call signal; A memory reading unit, used for reading a host memory table to obtain the number of started long connections, and comparing the number of started long connections with the number of configured long connections; a connection initiation unit, configured to, in response to the number of started long connections being less than the number of configured long connections, initiate a number of new long connections so that the number of started long connections is equal to the number of configured long connections; a connection stopping unit, configured to, in response to the number of started long connections being greater than the number of configured long connections, stop a number of started long connections so that the number of started long connections is equal to the number of configured long connections; The connection stopping unit stopping a number of started long connections so that the number of started long connections is equal to the number of configured long connections comprises: Step a, finding the last started persistent connection from the memory table; Step b, turning off the connection switch of the last started long connection; Step c, waking up the blocking state of the last started persistent connection through a POST notification instruction, so that the last started persistent connection process ends automatically; Repeat steps a to c until the number of started long connections is equal to the number of configured long connections.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for dynamically adjusting the number of long connections according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically adjusting the number of long connections described in any one of claims 1 to 5 are implemented.

9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method for dynamically adjusting the number of long connections described in any one of claims 1 to 5 are implemented.