WO2020177495A1 - Database connection management method and apparatus, and device - Google Patents

Database connection management method and apparatus, and device Download PDF

Info

Publication number
WO2020177495A1
WO2020177495A1 PCT/CN2020/073053 CN2020073053W WO2020177495A1 WO 2020177495 A1 WO2020177495 A1 WO 2020177495A1 CN 2020073053 W CN2020073053 W CN 2020073053W WO 2020177495 A1 WO2020177495 A1 WO 2020177495A1
Authority
WO
WIPO (PCT)
Prior art keywords
database connection
duration
database
application
transmission content
Prior art date
Application number
PCT/CN2020/073053
Other languages
French (fr)
Chinese (zh)
Inventor
高永露
周继恩
陈斌
雷平
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2020177495A1 publication Critical patent/WO2020177495A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Definitions

  • the invention relates to the field of databases, in particular to a method, device and equipment for database connection management.
  • One method in the prior art is to first put the database connection in the database connection pool, and when the application needs to use the database connection, it is directly obtained from the database connection pool.
  • the embodiments of the present application provide a database connection management method, device, and equipment, which solve the problem in the prior art that the leakage of the database connection pool cannot be automatically sensed, and the production service is interrupted after the leakage of the database connection pool occurs.
  • an embodiment of the present invention provides a database connection management method, which includes:
  • the determining the duration of time that the database connection is occupied by the application includes:
  • the current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  • the transmission content is not verified to be connected to the database, and further includes:
  • the current time is used to replace the start time.
  • Intercepting the database connection in an aspect and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
  • the database connection is kept unchanged.
  • the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
  • the duration of the occupied duration is recorded.
  • the application to the database connection is released Occupy, return the data block connection to the database connection pool to avoid the application has no transmission content but still occupy the database connection, causing other applications to be unable to use the connection.
  • an embodiment of the present invention provides a database connection management device, which includes:
  • the determining module is used to determine the duration of the database connection being occupied by the application when the database connection is occupied by the application;
  • the processing module is configured to release the application's occupation of the database connection if it is determined that the duration is greater than or equal to the first preset duration, and the database connection has no transmission content detected.
  • the determining module is specifically used for:
  • the current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  • processing module is further used for:
  • the current time is used to replace the start time.
  • processing module is specifically used for:
  • Intercepting the database connection in an aspect and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
  • processing module is further used for:
  • the database connection is kept unchanged.
  • processing module is specifically used for:
  • an embodiment of the present invention provides a database connection management device, including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the database connection management method described in the first aspect.
  • an embodiment of the present invention provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the Database connection management method.
  • an embodiment of the present invention provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are When executed by a computer, the computer is caused to execute the database connection management method described in the first aspect.
  • FIG. 1 is a flowchart of corresponding steps of a database connection management method proposed by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of module interaction corresponding to a database connection management method proposed by an embodiment of the present invention
  • FIG. 3 is a schematic diagram of obtaining a database connection by an application corresponding to a database connection management method proposed by an embodiment of the present invention
  • FIG. 4 is a schematic diagram of an application returning a database connection corresponding to a database connection management method proposed by an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a corresponding structure of a database connection management device proposed by an embodiment of the present invention.
  • Fig. 6 is a schematic structural diagram corresponding to a database connection management device proposed by an embodiment of the present invention.
  • One method in the prior art is to first put the database connection in the database connection pool, and when the application needs to use the database connection, it is directly obtained from the database connection pool.
  • Java server which is a kind of container, and the application needs to run on the Java server to complete the business.
  • Java servers include JAVA application servers, weblogic and open source tomcat and jboss servers.
  • a large number of low-level functions are encapsulated in the Java server, and applications complete services by calling the low-level functions in the Java server.
  • the embodiment of the present invention proposes a method for solving database connection leakage.
  • the database connection is automatically recovered.
  • the method can be specifically realized by a solution model.
  • the solution model is a code module that defines functions for handling various abnormal events in specific scenarios. For example, corresponding to any database connection pool that uses Java technology, the solution model is written in Java language.
  • the solution model can be summarized as follows: First, the middleware that automatically solves the database connection leakage needs to open the connection leakage, and then, when the application needs a database connection, it will be obtained from the database connection pool in the container, and the container will establish a connection with the database.
  • FIG. 1 it is a flowchart of steps corresponding to a method for database connection management proposed by an embodiment of the present invention.
  • Step 101 When a database connection is occupied by an application, determine the duration of time that the database connection is occupied by the application.
  • Step 102 If it is determined that the duration is greater than or equal to the first preset duration, and the database connection is not detected to have transmission content, release the application's occupation of the database connection.
  • the solution model needs to be opened.
  • the method of opening the solution model is hot opening, which takes effect immediately and does not need to restart the machine. For example, by entering a command on the command line to open the solution model.
  • FIG. 2 it is a schematic diagram of module interaction corresponding to a database connection management method proposed by an embodiment of the present invention.
  • the container shown in Figure 2 only takes the JAVA application server as an example.
  • the application runs on the container JAVA application server.
  • the database first establishes a connection with the database connection pool running in the JAVA application server. When the application needs to connect to the database , Get the database connection directly from the database connection pool.
  • step 101 is a schematic diagram of obtaining a database connection by an application corresponding to a database connection management method proposed in an embodiment of the present invention.
  • the application obtains the database connection from the database connection pool, that is, when the database connection is occupied, the solution model records the timestamp of obtaining the database connection, which is the timestamp of the database connection being occupied by the application, and the starting time of the occupation, starting from this The time starts to count and the duration is calculated.
  • An optional implementation is to record the start time of the database connection when the application is occupied, obtain the current time according to the first preset period, and subtract the current time
  • the duration of the de-start time is used as the duration; the first preset period is less than the first preset duration.
  • a timer is set to count the first preset period.
  • the duration of the timer can be set according to the specific scenario. For example, the timer duration is 1. second. When the timer reaches the corresponding duration, the current time minus the start time is used as the duration.
  • step 102 is a schematic diagram of an application returning a database connection corresponding to a database connection management method proposed in an embodiment of the present invention. Since in step 101, when the application obtains the database connection in the database connection pool, it has recorded the timestamp of obtaining the database connection and started timing. When the duration of the database connection occupied exceeds the first preset period of time, check whether the database connection is Has been returned to the database connection pool, that is to say whether the application has released the occupation of the database connection, if the database connection is not returned, the detection module will detect whether there is data transmission content on the database connection, and if there is no transmission content, the application is forcibly released Occupation of database connection.
  • calculating the duration and checking whether the database connection has transmission content can be performed simultaneously or asynchronously.
  • An optional implementation manner is that the duration timed in step 101 is greater than or equal to the first preset duration, checking whether the database connection has transmission content, and within the second preset duration, checking whether the database connection has transmission content, The start time of the second preset duration is after the start time of the first preset duration.
  • the time length for starting to check the database connection is determined according to the duration and the start time or end time of the first preset time length, and a trigger check time period for starting to check the transmission content of the database connection is set. It should be noted that the following time appears from the time when the database connection is occupied. For example, if the first preset duration is 10 seconds, the duration is greater than 8 seconds, and the trigger check duration is 8 seconds, then at the end of the 8th second of the duration, the database connection will be checked for transmission content.
  • aspect interception is a method of obtaining data transmitted in variables and database connections. Through this method, variable values and transmission content in database connections can be tracked, so that operation and maintenance personnel can analyze data changes and then troubleshoot The reason is investigated and located, which can be implemented by the data interceptor in the compilation environment. For example, the transmission content is intercepted through a Java interceptor.
  • the duration is greater than the first preset duration, if it is verified that the database is connected to the transmission content, if it is verified that the database is connected to the transmission content, the current time is used to replace the start time to re-determine the duration duration. Since the database connection has transmission content, it means that the application is still running normally and transmitting data normally. Therefore, the occupied duration needs to be re-timed. When the duration is greater than or equal to the first preset duration, it is still necessary to check whether the database connection exists Transfer content.
  • the database connection status includes occupied or unoccupied.
  • the default status of the database connection in the database connection pool is not occupied.
  • the database connection status will be changed from unoccupied to occupied, and the application occupying the database connection will also be recorded, the database occupied by an application
  • the connection cannot be acquired and used by other applications.
  • the application returns the occupied database connection, the status of the database connection will be changed from the occupied state to the unoccupied state, so that it can be occupied by the application again. If the database connection was occupied before, the application will be stored in the database Connect to a corresponding historical record library.
  • One possible implementation of whether the database connection status is occupied and the status of the database connection is modified is to configure a database connection status variable in the configuration file to mark whether the database connection is occupied.
  • the value of the variable T is used to indicate the database connection status.
  • the value of T includes 0 and 1.
  • a value of T of 0 indicates that the database connection is not occupied, and a value of T of 1 indicates that the database connection is occupied.
  • the database connection C1 is obtained from the database connection pool and occupied by the application APP1
  • the value of T is changed from 0 to 1, and C1 is recorded at this time.
  • T is 1, if another application APP2 tries to obtain C1, it will first read the value of T. When the value of T is 1, it will return to fail to obtain C1.
  • an optional implementation manner is to keep the database connection unchanged within a time period when it is determined that the duration is less than the first preset duration, or if it is verified that the database is connected with transmission content.
  • this model has a low probability of manslaughter. The core of this model is to add the time attribute to each connection retrieval, and then detect whether it has timed out, and then detect the data traffic again.
  • the embodiments of the present invention have strong versatility and scalability.
  • the application gets the connection, it can be used transparently according to the set return time and connection detection technology.
  • the application can also be transparent and unconscious, and automatically return the database connection Pool.
  • the method proposed in the embodiment of the present invention is applicable to any database connection pool, for example, it is applicable to a database connection pool of java technology.
  • the duration of the occupied duration is recorded.
  • the application to the database connection is released Occupy, return the data block connection to the database connection pool to avoid the application has no transmission content but still occupy the database connection, causing other applications to be unable to use the connection.
  • FIG. 5 it is a schematic diagram of a corresponding structure of a database connection management apparatus proposed by an embodiment of the present invention.
  • the embodiment of the present invention provides a database connection management device, which includes:
  • the determining module 501 is configured to determine the duration of the database connection occupied by the application when the database connection is occupied by the application;
  • the processing module 502 is configured to release the application's occupation of the database connection if it is determined that the duration is greater than or equal to the first preset duration, and the database connection has no transmission content detected.
  • the determining module 501 is specifically configured to:
  • the current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  • processing module 502 is further configured to:
  • the current time is used to replace the start time.
  • processing module 502 is specifically configured to:
  • Intercepting the database connection in an aspect and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
  • processing module 502 is further configured to:
  • the database connection is kept unchanged.
  • processing module 502 is specifically configured to:
  • the embodiment of the present invention provides a database connection management device. At least one processor; and, a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable The at least one processor can execute the database connection management method in the foregoing embodiment.
  • FIG. 6 is a structure of a database connection management device provided by an embodiment of the present invention.
  • the database connection management device 600 includes a transceiver 601, a processor 602, a memory 603, and a bus system 604;
  • the memory 603 is used to store programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 603 may be a random access memory (random access memory, RAM for short), or a non-volatile memory (non-volatile memory), such as at least one disk memory. Only one memory is shown in the figure. Of course, the memory can also be set to multiple as required.
  • the memory 603 may also be a memory in the processor 602.
  • the memory 603 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
  • Operating instructions including various operating instructions, used to implement various operations.
  • Operating system including various system programs, used to implement various basic services and process hardware-based tasks.
  • the foregoing database connection management method in the embodiment of the present invention may be applied to the processor 602, or implemented by the processor 602.
  • the processor 602 may be an integrated circuit chip with signal processing capabilities.
  • the steps of the database connection management method described above can be completed by hardware integrated logic circuits in the processor 602 or instructions in the form of software.
  • the aforementioned processor 602 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware Components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 603, and the processor 602 reads the information in the memory 603, and performs the following steps in combination with its hardware:
  • the processor 602 is configured to determine the duration of the database connection being occupied by the application when the database connection is occupied by the application; if it is determined that the duration of the database connection is greater than or equal to the first preset duration, and it is not checked If the database connection has transmission content, the application's occupation of the database connection is released.
  • the processor 602 is specifically configured to:
  • the current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  • the processor 602 is further configured to:
  • the current time is used to replace the start time.
  • the processor 602 is specifically configured to:
  • Intercepting the database connection in an aspect and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
  • the processor 602 is further configured to:
  • the database connection is kept unchanged.
  • the processor 602 is specifically configured to:
  • the database connection management device of the embodiment of the present invention exists in various forms, including but not limited to:
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has calculation and processing functions, and generally also has mobile Internet features.
  • Such terminals include: PDA, MID and UMPC devices, such as iPad.
  • the program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer). , A chip, etc.) or a processor (processor) executes all or part of the steps of the method in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
  • the present invention also provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the database described in any one of the above Connection management method.
  • the present invention also provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer , Enabling the computer to execute any one of the database connection management methods described above.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt 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 codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Abstract

The problem in the prior art of production service interruption resulting from that a database connection pool leakage phenomenon cannot be sensed automatically and thus database connection pool leakage occurs is solved. Disclosed in the present invention are a database connection management method and apparatus, and a device. The method comprises: when a database connection is occupied by an application, determining a duration when the database connection is occupied by the application; and if it is determined that the duration is greater than or equal to a first preset duration and no transmission content is detected in the database connection, releasing the occupation of the database connection by the application.

Description

一种数据库连接管理方法及装置、设备Database connection management method, device and equipment
相关申请的交叉引用Cross references to related applications
本申请要求在2019年03月05日提交中国专利局、申请号为201910163071.6、申请名称为“一种数据库连接管理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910163071.6, and the application name is "a method and device for database connection management" on March 5, 2019. The entire content is incorporated into this application by reference. in.
技术领域Technical field
本发明涉及数据库领域,尤其涉及一种数据库连接管理方法及装置、设备。The invention relates to the field of databases, in particular to a method, device and equipment for database connection management.
背景技术Background technique
应用在执行时,常常需要与数据库进行连接,以获取需要的数据,完成相应业务。现有技术中一种手段是,先将数据库连接放在数据库连接池中,应用需要使用数据库连接时,直接从数据库连接池中获取。When an application is executed, it often needs to be connected to the database to obtain the required data and complete the corresponding business. One method in the prior art is to first put the database connection in the database connection pool, and when the application needs to use the database connection, it is directly obtained from the database connection pool.
然而由于应用执行异常等原因,当应用使用数据库连接完毕后,也不将数据库连接归还至数据库连接池,这种现象称为数据库连接池泄露,当数据库连接池泄露频繁出现时,会造成数据库连接池中的数据库连接使用殆尽,造成后续应用连接数据库的请求无法得到服务。现有技术中,不能自动感知数据库连接池泄露现象,需要人力投入,查看应用状态与后台日志,当发生数据库连接池泄露后,采用重启服务器的方法,导致生产服务中断。However, due to abnormal application execution and other reasons, after the application uses the database connection, the database connection is not returned to the database connection pool. This phenomenon is called database connection pool leakage. When the database connection pool leaks frequently, it will cause database connections. The database connection in the pool is exhausted, causing subsequent applications to connect to the database request cannot be serviced. In the prior art, the leakage of the database connection pool cannot be automatically sensed, and human investment is required to check the application status and background logs. When the database connection pool is leaked, the method of restarting the server is adopted, resulting in interruption of production services.
因此,现有技术中,不能自动感知数据库连接池泄露现象,且数据库连接池泄露发生后导致生产服务中断,是一个亟待解决的问题。Therefore, in the prior art, the phenomenon of database connection pool leakage cannot be automatically sensed, and production services are interrupted after the database connection pool leakage occurs, which is an urgent problem to be solved.
发明内容Summary of the invention
本申请实施例提供了一种数据库连接管理方法及装置、设备,解决了现有技术中,不能自动感知数据库连接池泄露现象,且数据库连接池泄露发生后导致生产服务中断的问题。The embodiments of the present application provide a database connection management method, device, and equipment, which solve the problem in the prior art that the leakage of the database connection pool cannot be automatically sensed, and the production service is interrupted after the leakage of the database connection pool occurs.
第一方面,本发明实施例提供一种数据库连接管理方法,该方法包括:In the first aspect, an embodiment of the present invention provides a database connection management method, which includes:
当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;When a database connection is occupied by an application, determine the duration of time that the database connection is occupied by the application;
若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。If it is determined that the duration is greater than or equal to the first preset duration, and the database connection is not detected to have transmission content, then the application's occupation of the database connection is released.
可选的,所述确定所述数据库连接被所述应用占用的持续时长,包括:Optionally, the determining the duration of time that the database connection is occupied by the application includes:
所述数据库连接被所述应用占用时,被记录了占用的起始时刻;When the database connection is occupied by the application, the start time of the occupation is recorded;
按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
可选的,所述未检验到所述数据库连接有传输内容,还包括:Optionally, the transmission content is not verified to be connected to the database, and further includes:
若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
可选的,按照以下方式检验所述数据库连接是否有传输内容:Optionally, check whether the database connection has transmission content in the following manner:
对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
可选的,在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。Optionally, within a time period when it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
可选的,若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。Optionally, if the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
本发明实施例中,数据库连接被应用占用时记录了被占用的持续时长,当持续时长大于或等于第一预设时长时,且未检验到数据库连接有传输内容,则解除应用对数据库连接的占用,将该数据块连接归还至数据库连接池,避免应用已无传输内容却仍然占用数据库连接,导致其他应用不能使用该连接。In the embodiment of the present invention, when the database connection is occupied by the application, the duration of the occupied duration is recorded. When the duration is greater than or equal to the first preset duration and the transmission content of the database connection is not verified, the application to the database connection is released Occupy, return the data block connection to the database connection pool to avoid the application has no transmission content but still occupy the database connection, causing other applications to be unable to use the connection.
第二方面,本发明实施例提供一种数据库连接管理装置,该装置包括:In a second aspect, an embodiment of the present invention provides a database connection management device, which includes:
确定模块,用于当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;The determining module is used to determine the duration of the database connection being occupied by the application when the database connection is occupied by the application;
处理模块,用于若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。The processing module is configured to release the application's occupation of the database connection if it is determined that the duration is greater than or equal to the first preset duration, and the database connection has no transmission content detected.
可选的,所述确定模块,具体用于:Optionally, the determining module is specifically used for:
记录所述数据库连接被所述应用占用时的起始时刻;Record the starting time when the database connection is occupied by the application;
按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
可选的,所述处理模块,还用于:Optionally, the processing module is further used for:
若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
可选的,所述处理模块,具体用于:Optionally, the processing module is specifically used for:
对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
可选的,所述处理模块,还用于:Optionally, the processing module is further used for:
在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。When it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
可选的,所述处理模块,具体用于:Optionally, the processing module is specifically used for:
若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。If the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
第三方面,本发明实施例提供一种数据库连接管理设备,包括:In a third aspect, an embodiment of the present invention provides a database connection management device, including:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行第一方面所述的数据库连接管理方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the database connection management method described in the first aspect.
第三方面,本发明实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算 机执行第一方面所述的数据库连接管理方法。In a third aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the Database connection management method.
第三方面,本发明实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行第一方面所述的数据库连接管理方法。In a third aspect, an embodiment of the present invention provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are When executed by a computer, the computer is caused to execute the database connection management method described in the first aspect.
附图说明Description of the drawings
图1为本发明实施例提出的一种数据库连接管理方法对应的步骤流程图;FIG. 1 is a flowchart of corresponding steps of a database connection management method proposed by an embodiment of the present invention;
图2为本发明实施例提出的一种数据库连接管理方法对应的模块交互示意图;2 is a schematic diagram of module interaction corresponding to a database connection management method proposed by an embodiment of the present invention;
图3为本发明实施例提出的一种数据库连接管理方法对应的应用获取数据库连接的示意图;3 is a schematic diagram of obtaining a database connection by an application corresponding to a database connection management method proposed by an embodiment of the present invention;
图4为本发明实施例提出的一种数据库连接管理方法对应的应用归还数据库连接的示意图;4 is a schematic diagram of an application returning a database connection corresponding to a database connection management method proposed by an embodiment of the present invention;
图5为本发明实施例提出的一种数据库连接管理装置对应的结构示意图;5 is a schematic diagram of a corresponding structure of a database connection management device proposed by an embodiment of the present invention;
图6为本发明实施例提出的一种数据库连接管理设备对应的结构示意图。Fig. 6 is a schematic structural diagram corresponding to a database connection management device proposed by an embodiment of the present invention.
具体实施方式detailed description
为了更好的理解上述技术方案,下面将结合说明书附图及具体的实施方式对上述技术方案进行详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互结合。In order to better understand the above technical solutions, the above technical solutions will be described in detail below with reference to the drawings and specific implementations of the specification. It should be understood that the embodiments of the application and the specific features in the embodiments are detailed to the technical solutions of the application. Note, rather than limiting the technical solution of the present application, the embodiments of the present application and the technical features in the embodiments can be combined with each other if there is no conflict.
应用在执行时,常常需要与数据库进行连接,以获取需要的数据,完成相应业务。现有技术中一种手段是,先将数据库连接放在数据库连接池中,应用需要使用数据库连接时,直接从数据库连接池中获取。When an application is executed, it often needs to be connected to the database to obtain the required data and complete the corresponding business. One method in the prior art is to first put the database connection in the database connection pool, and when the application needs to use the database connection, it is directly obtained from the database connection pool.
然而由于应用执行异常等原因,当应用使用数据库连接完毕后,也不将 数据库连接归还至数据库连接池,这种现象称为数据库连接池泄露,当数据库连接池泄露频繁出现时,会造成数据库连接池中的数据库连接使用殆尽,造成后续应用连接数据库的请求无法得到服务。现有技术中,第一,没有自动感知数据库连接池泄露现象的方法,需要人力投入,查看应用状态与后台日志,当发生数据库连接池泄露后,采用重启服务器的方法,应用修改代码发布新的版本。第二、应用碰到数据库连接泄漏,只能不停的重启解决,该处理时间长,影响性大,导致生产服务中断,造成生产中断服务。一般来说,一个企业的应用系统会有成百上千个,在无数据库连接泄漏自动解决模型的情况下,一旦几个系统一起出现该问题,会需要大量的人力,且需要运维人员全身心观察应用,该模式由于大量的人工介入,出错的概率会放大到一定程度。上述问题的一种典型场景为Java服务器,Java服务器是一种容器,应用完成业务需要运行在Java服务器上。举例来说,Java服务器有JAVA应用服务器,weblogic和开源的tomcat、jboss服务器,Java服务器中封装了大量底层功能,应用通过调用Java服务器中的底层功能完成业务。However, due to abnormal application execution and other reasons, after the application uses the database connection, the database connection is not returned to the database connection pool. This phenomenon is called database connection pool leakage. When the database connection pool leaks frequently, it will cause database connections. The database connection in the pool is exhausted, causing subsequent applications to connect to the database request cannot be serviced. In the prior art, first, there is no method for automatically sensing database connection pool leakage. Human investment is required to check application status and background logs. When database connection pool leakage occurs, the method of restarting the server is adopted and the code is modified to release new ones. version. Second, when the application encounters a database connection leak, it can only be solved by restarting it continuously. The processing time is long and the impact is large, resulting in the interruption of the production service and the production interruption service. Generally speaking, there will be hundreds of application systems in an enterprise. In the case of automatic solution model without database connection leakage, once the problem occurs in several systems together, it will require a lot of manpower and a whole body of operation and maintenance personnel. In the application of heart observation, the probability of error in this mode will be magnified to a certain extent due to a large amount of manual intervention. A typical scenario of the above problem is a Java server, which is a kind of container, and the application needs to run on the Java server to complete the business. For example, Java servers include JAVA application servers, weblogic and open source tomcat and jboss servers. A large number of low-level functions are encapsulated in the Java server, and applications complete services by calling the low-level functions in the Java server.
本发明实施例提出了一种解决数据库连接泄漏的方法,在发生数据库连接泄露时,自动回收数据库连接,该方法可通过解决模型具体实现。其中,解决模型为一个代码模块,这个代码模块中定义了具体场景下各种异常事件处理的函数。举例来说,对应用于任何使用Java技术的数据库连接池,使用Java语言编写解决模型。具体地,解决模型可概述为:首先需要自动解决数据库连接泄漏的中间件开启连接泄漏,然后,应用需要数据库连接的时候,会从容器中的数据库连接池中获取,容器会与数据库去建立连接,放入容器中的数据库连接池中,每次返回给应用的连接,都记录拿取得时间,然后如果应用超过一定的时间仍然没有归还,就去查看连接是否有大量的数据交互,若无,则表明显示连接,主动把连接归还给容器中数据库连接池,则解决数据库泄漏问题。The embodiment of the present invention proposes a method for solving database connection leakage. When a database connection leakage occurs, the database connection is automatically recovered. The method can be specifically realized by a solution model. Among them, the solution model is a code module that defines functions for handling various abnormal events in specific scenarios. For example, corresponding to any database connection pool that uses Java technology, the solution model is written in Java language. Specifically, the solution model can be summarized as follows: First, the middleware that automatically solves the database connection leakage needs to open the connection leakage, and then, when the application needs a database connection, it will be obtained from the database connection pool in the container, and the container will establish a connection with the database. , Put it into the database connection pool in the container, and record the acquisition time every time the connection returned to the application, and then if the application has not returned after a certain period of time, check whether the connection has a large amount of data interaction, if not, It indicates that the connection is displayed, and the connection is actively returned to the database connection pool in the container to solve the database leakage problem.
如图1所示,为本发明实施例提出的一种数据库连接管理方法对应的步骤流程图。As shown in FIG. 1, it is a flowchart of steps corresponding to a method for database connection management proposed by an embodiment of the present invention.
步骤101:当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长。Step 101: When a database connection is occupied by an application, determine the duration of time that the database connection is occupied by the application.
步骤102:若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。Step 102: If it is determined that the duration is greater than or equal to the first preset duration, and the database connection is not detected to have transmission content, release the application's occupation of the database connection.
步骤101之前,需要开启解决模型,开启解决模型的方式为热开启,即时生效,不需要再重启机器。举例来说,通过在命令行输入命令以开启该解决模型。如图2所示,为本发明实施例提出的一种数据库连接管理方法对应的模块交互示意图。需要说明的是,图2所示的容器仅以JAVA应用服务器为例说明,应用运行在容器JAVA应用服务器上,数据库先与JAVA应用服务器中运行的数据库连接池建立连接,应用需要与数据库连接时,直接从数据库连接池获取数据库连接。Before step 101, the solution model needs to be opened. The method of opening the solution model is hot opening, which takes effect immediately and does not need to restart the machine. For example, by entering a command on the command line to open the solution model. As shown in FIG. 2, it is a schematic diagram of module interaction corresponding to a database connection management method proposed by an embodiment of the present invention. It should be noted that the container shown in Figure 2 only takes the JAVA application server as an example. The application runs on the container JAVA application server. The database first establishes a connection with the database connection pool running in the JAVA application server. When the application needs to connect to the database , Get the database connection directly from the database connection pool.
步骤101中,如图3所示,为本发明实施例提出的一种数据库连接管理方法对应的应用获取数据库连接的示意图。应用从数据库连接池获取数据库连接,也就是数据库连接被占用时,解决模型记录了获取数据库连接的时间戳,也就是数据库连接被应用占用的时间戳,被占用的起始时刻,从这个起始时刻开始计时,计算持续时长。In step 101, as shown in FIG. 3, is a schematic diagram of obtaining a database connection by an application corresponding to a database connection management method proposed in an embodiment of the present invention. The application obtains the database connection from the database connection pool, that is, when the database connection is occupied, the solution model records the timestamp of obtaining the database connection, which is the timestamp of the database connection being occupied by the application, and the starting time of the occupation, starting from this The time starts to count and the duration is calculated.
确定持续时长的方式有多种,一种可选的实施方式为,在数据库连接被应用占用时,记录下被占用的起始时刻,按照第一预设周期获取当前时刻,并将当前时刻减去起始时刻的时长,作为持续时长;所述第一预设周期小于所述第一预设时长。举例来说,在数据库连接被应用占用的起始时刻,设定一个定时器来对第一预设周期进行计时,定时器的时长可根据具体场景设定,举例来说,定时器时长为1秒。当定时器到达对应时长后,将当前时刻减去起始时刻,作为持续时长。There are many ways to determine the duration. An optional implementation is to record the start time of the database connection when the application is occupied, obtain the current time according to the first preset period, and subtract the current time The duration of the de-start time is used as the duration; the first preset period is less than the first preset duration. For example, at the initial moment when the database connection is occupied by the application, a timer is set to count the first preset period. The duration of the timer can be set according to the specific scenario. For example, the timer duration is 1. second. When the timer reaches the corresponding duration, the current time minus the start time is used as the duration.
步骤102中,如图4所示,为本发明实施例提出的一种数据库连接管理方法对应的应用归还数据库连接的示意图。由于步骤101中,应用在获取数据库连接池中的数据库连接时,已经记录了获取数据库连接的时间戳并开始计时,当数据库连接被占用的持续时长超过第一预设时长时,检验数据库连 接是否已经归还至数据库连接池,也就是说应用是否解除了对数据库连接的占用,如果没有归还数据库连接,则检测模块会检测数据库连接上是否有数据传输内容,如果也没有传输内容,则强制解除应用对数据库连接的占用。In step 102, as shown in FIG. 4, it is a schematic diagram of an application returning a database connection corresponding to a database connection management method proposed in an embodiment of the present invention. Since in step 101, when the application obtains the database connection in the database connection pool, it has recorded the timestamp of obtaining the database connection and started timing. When the duration of the database connection occupied exceeds the first preset period of time, check whether the database connection is Has been returned to the database connection pool, that is to say whether the application has released the occupation of the database connection, if the database connection is not returned, the detection module will detect whether there is data transmission content on the database connection, and if there is no transmission content, the application is forcibly released Occupation of database connection.
需要说明的是,计算持续时长以及检验数据库连接是否有传输内容即可同时进行,也可以异步进行。一种可选的实施方式为,在步骤101中计时的持续时长大于或等于第一预设时长,检验数据库连接是否有传输内容,在第二预设时长内,检验数据库连接是否有传输内容,所述第二预设时长的开始时刻在所述第一预设时长的开始时刻之后。It should be noted that calculating the duration and checking whether the database connection has transmission content can be performed simultaneously or asynchronously. An optional implementation manner is that the duration timed in step 101 is greater than or equal to the first preset duration, checking whether the database connection has transmission content, and within the second preset duration, checking whether the database connection has transmission content, The start time of the second preset duration is after the start time of the first preset duration.
另外,举例来说,根据持续时长以及第一预设时长的开始时刻或结束时刻确定启动检验数据库连接的时长,设定一个启动检验数据库连接传输内容的触发检验时长。需要说明的是,以下出现的时刻从数据库连接被占用的开始计时的时刻。举例来说,第一预设时长为10秒,持续时长大于8秒,触发检验时长为8秒,则在持续时长的第8秒末开启对数据库连接是否有传输内容的检验。In addition, for example, the time length for starting to check the database connection is determined according to the duration and the start time or end time of the first preset time length, and a trigger check time period for starting to check the transmission content of the database connection is set. It should be noted that the following time appears from the time when the database connection is occupied. For example, if the first preset duration is 10 seconds, the duration is greater than 8 seconds, and the trigger check duration is 8 seconds, then at the end of the 8th second of the duration, the database connection will be checked for transmission content.
按照以下方式检验所述数据库连接是否有传输内容:Check whether the database connection has transmission content in the following way:
(1)对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空。其中,切面拦截为,对变量、数据库连接中传输数据进行获取的一种方法,通过该方法可对变量值、数据库连接中传输内容进行追踪,以便运维人员对数据变化进行分析,进而对故障原因进行排查定位,具体可通过编译环境中的数据拦截器实现。举例来说,通过Java拦截器对传输内容进行拦截。(2)从检验数据库连接开始计时,到第二预设时长为止,再次检验第一变量的值,如果第一变量的值仍为空,则确定数据库连接无传输内容;否则,确定数据库连接有传输内容。(1) Perform aspect interception on the database connection, and store the intercepted content of the aspect in a first variable; the default value of the first variable is empty. Among them, aspect interception is a method of obtaining data transmitted in variables and database connections. Through this method, variable values and transmission content in database connections can be tracked, so that operation and maintenance personnel can analyze data changes and then troubleshoot The reason is investigated and located, which can be implemented by the data interceptor in the compilation environment. For example, the transmission content is intercepted through a Java interceptor. (2) From the time when the database connection is checked, until the second preset duration, check the value of the first variable again. If the value of the first variable is still empty, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has Transfer content.
当持续时长大于第一预设时长时,若检验到所述数据库连接有传输内容,若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻,以重新确定所述持续时长。由于数据库连接有传输内容,代表这个应用仍然在正常运行正常传输数据,因此需要重新对被占用的时长计时,在持续时长大 于或等于第一预设时长时,仍然要再行检验数据库连接是否有传输内容。When the duration is greater than the first preset duration, if it is verified that the database is connected to the transmission content, if it is verified that the database is connected to the transmission content, the current time is used to replace the start time to re-determine the duration duration. Since the database connection has transmission content, it means that the application is still running normally and transmitting data normally. Therefore, the occupied duration needs to be re-timed. When the duration is greater than or equal to the first preset duration, it is still necessary to check whether the database connection exists Transfer content.
步骤102中,需要说明的是,数据库连接状态包括已被占用或者未被占用。数据库连接在数据库连接池中的默认状态为未被占用。当一个数据库连接从数据库连接池中被获取并被应用占用后,这个数据库连接状态会由未被占用修改为已被占用,而且占用该数据库连接的应用也会被记录,被一个应用占用的数据库连接不能被其它应用获取并使用。当应用归还了被占用的数据库连接时,该数据库连接的状态又会由已被占用状态修改为未被占用状态,从而可再被应用占用,之前占用该数据库连接是应用都会被存储在该数据库连接对应的一个历史记录库中。In step 102, it should be noted that the database connection status includes occupied or unoccupied. The default status of the database connection in the database connection pool is not occupied. When a database connection is obtained from the database connection pool and occupied by the application, the database connection status will be changed from unoccupied to occupied, and the application occupying the database connection will also be recorded, the database occupied by an application The connection cannot be acquired and used by other applications. When the application returns the occupied database connection, the status of the database connection will be changed from the occupied state to the unoccupied state, so that it can be occupied by the application again. If the database connection was occupied before, the application will be stored in the database Connect to a corresponding historical record library.
上述数据库连接状态是否为被占用,以及修改数据库连接的状态,一种可行的实施为,在配置文件中配置数据库连接状态变量,以标注数据库连接是否被占用。举例来说,用变量T的值表示数据库连接状态,T取值包括0和1,T为0表示数据库连接未被占用,T为1表示数据库连接已被占用。数据库连接C1从数据库连接池中被获取并被应用APP1占用后,T的值由0修改为1,并且此时会记录C1。当T为1时,如果另一个应用APP2试图获取C1,会首先读取T的值,当T的值为1时,则返回获取C1失败。另外一方面,当APP1归还了C1时,该T的值又由1被修改为0,APP1被存储在C1对应的操作日志库,从而如果应用APP3再试图占用C1时,由于此时T为0,APP3发送数据库连接请求时,成功返回数据库连接C1。One possible implementation of whether the database connection status is occupied and the status of the database connection is modified is to configure a database connection status variable in the configuration file to mark whether the database connection is occupied. For example, the value of the variable T is used to indicate the database connection status. The value of T includes 0 and 1. A value of T of 0 indicates that the database connection is not occupied, and a value of T of 1 indicates that the database connection is occupied. After the database connection C1 is obtained from the database connection pool and occupied by the application APP1, the value of T is changed from 0 to 1, and C1 is recorded at this time. When T is 1, if another application APP2 tries to obtain C1, it will first read the value of T. When the value of T is 1, it will return to fail to obtain C1. On the other hand, when APP1 returns C1, the value of T is changed from 1 to 0, and APP1 is stored in the operation log library corresponding to C1, so if the application APP3 tries to occupy C1 again, because T is 0 at this time , When APP3 sends a database connection request, it successfully returns to database connection C1.
另外,一种可选的实施方式为,在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。In addition, an optional implementation manner is to keep the database connection unchanged within a time period when it is determined that the duration is less than the first preset duration, or if it is verified that the database is connected with transmission content.
该模型的优势在于:第一、对应用使用透明,逻辑处理在中间件数据库连接池中完成。第二、可热开启,热关闭,无需重启服务器。第三、对于数据库连接池泄漏的应用可以使应用无需中断服务,继续正常服务。第四、该模式误杀概率低。该模型核心在于每一次连接拿取都加上时间属性,然后侦测是否超时,再次检测数据流量。The advantages of this model are: First, it is transparent to the application and the logic processing is completed in the middleware database connection pool. Second, it can be hot-opened and hot-closed without restarting the server. Third, for applications with database connection pool leakage, applications can continue normal services without interrupting services. Fourth, this model has a low probability of manslaughter. The core of this model is to add the time attribute to each connection retrieval, and then detect whether it has timed out, and then detect the data traffic again.
本发明实施例具有较强的通用性和可扩展性。在数据库连接池的场景下,应用获取连接后,根据设定的归还时间和连接检测技术,使应用可以透明的使用,当出现数据库连接泄漏后,应用也可以透明无感知,自动归还到了数据库连接池。本发明实施例提出的方法适用于任何数据库连接池,举例来说,适用于java技术的数据库连接池。The embodiments of the present invention have strong versatility and scalability. In the database connection pool scenario, after the application gets the connection, it can be used transparently according to the set return time and connection detection technology. When the database connection leaks, the application can also be transparent and unconscious, and automatically return the database connection Pool. The method proposed in the embodiment of the present invention is applicable to any database connection pool, for example, it is applicable to a database connection pool of java technology.
本发明实施例中,数据库连接被应用占用时记录了被占用的持续时长,当持续时长大于或等于第一预设时长时,且未检验到数据库连接有传输内容,则解除应用对数据库连接的占用,将该数据块连接归还至数据库连接池,避免应用已无传输内容却仍然占用数据库连接,导致其他应用不能使用该连接。In the embodiment of the present invention, when the database connection is occupied by the application, the duration of the occupied duration is recorded. When the duration is greater than or equal to the first preset duration and the transmission content of the database connection is not verified, the application to the database connection is released Occupy, return the data block connection to the database connection pool to avoid the application has no transmission content but still occupy the database connection, causing other applications to be unable to use the connection.
如图5所示,为本发明实施例提出的一种数据库连接管理装置对应的结构示意图。As shown in FIG. 5, it is a schematic diagram of a corresponding structure of a database connection management apparatus proposed by an embodiment of the present invention.
本发明实施例提供一种数据库连接管理装置,该装置包括:The embodiment of the present invention provides a database connection management device, which includes:
确定模块501,用于当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;The determining module 501 is configured to determine the duration of the database connection occupied by the application when the database connection is occupied by the application;
处理模块502,用于若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。The processing module 502 is configured to release the application's occupation of the database connection if it is determined that the duration is greater than or equal to the first preset duration, and the database connection has no transmission content detected.
可选的,所述确定模块501,具体用于:Optionally, the determining module 501 is specifically configured to:
记录所述数据库连接被所述应用占用时的起始时刻;Record the starting time when the database connection is occupied by the application;
按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
可选的,所述处理模块502,还用于:Optionally, the processing module 502 is further configured to:
若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
可选的,所述处理模块502,具体用于:Optionally, the processing module 502 is specifically configured to:
对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接 无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
可选的,所述处理模块502,还用于:Optionally, the processing module 502 is further configured to:
在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。When it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
可选的,所述处理模块502,具体用于:Optionally, the processing module 502 is specifically configured to:
若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。If the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
基于相同的技术构思,本发明实施例提供一种数据库连接管理设备。至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述实施例中的数据库连接管理方法。Based on the same technical concept, the embodiment of the present invention provides a database connection management device. At least one processor; and, a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable The at least one processor can execute the database connection management method in the foregoing embodiment.
以一个处理器为例,图6为本发明实施例提供的数据库连接管理设备的结构,该数据库连接管理设备600包括:收发器601、处理器602、存储器603和总线系统604;Taking a processor as an example, FIG. 6 is a structure of a database connection management device provided by an embodiment of the present invention. The database connection management device 600 includes a transceiver 601, a processor 602, a memory 603, and a bus system 604;
其中,存储器603,用于存放程序。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器603可能为随机存取存储器(random access memory,简称RAM),也可能为非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。图中仅示出了一个存储器,当然,存储器也可以根据需要,设置为多个。存储器603也可以是处理器602中的存储器。Among them, the memory 603 is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 603 may be a random access memory (random access memory, RAM for short), or a non-volatile memory (non-volatile memory), such as at least one disk memory. Only one memory is shown in the figure. Of course, the memory can also be set to multiple as required. The memory 603 may also be a memory in the processor 602.
存储器603存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:The memory 603 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
操作指令:包括各种操作指令,用于实现各种操作。Operating instructions: including various operating instructions, used to implement various operations.
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。Operating system: including various system programs, used to implement various basic services and process hardware-based tasks.
上述本发明实施例数据库连接管理方法可以应用于处理器602中,或者说由处理器602实现。处理器602可能是一种集成电路芯片,具有信号的处 理能力。在实现过程中,上述数据库连接管理方法的各步骤可以通过处理器602中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器602可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器603,处理器602读取存储器603中的信息,结合其硬件执行以下步骤:The foregoing database connection management method in the embodiment of the present invention may be applied to the processor 602, or implemented by the processor 602. The processor 602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the database connection management method described above can be completed by hardware integrated logic circuits in the processor 602 or instructions in the form of software. The aforementioned processor 602 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware Components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory 603, and the processor 602 reads the information in the memory 603, and performs the following steps in combination with its hardware:
所述处理器602,用于当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。The processor 602 is configured to determine the duration of the database connection being occupied by the application when the database connection is occupied by the application; if it is determined that the duration of the database connection is greater than or equal to the first preset duration, and it is not checked If the database connection has transmission content, the application's occupation of the database connection is released.
优选地,所述处理器602具体用于:Preferably, the processor 602 is specifically configured to:
记录所述数据库连接被所述应用占用时的起始时刻;Record the starting time when the database connection is occupied by the application;
按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
优选地,所述处理器602还用于:Preferably, the processor 602 is further configured to:
若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
优选地,所述处理器602具体用于:Preferably, the processor 602 is specifically configured to:
对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
优选地,所述处理器602还用于:Preferably, the processor 602 is further configured to:
在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。When it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
优选地,所述处理器602具体用于:Preferably, the processor 602 is specifically configured to:
若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。If the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
本发明实施例的数据库连接管理设备以多种形式存在,包括但不限于:The database connection management device of the embodiment of the present invention exists in various forms, including but not limited to:
(1)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(1) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has calculation and processing functions, and generally also has mobile Internet features. Such terminals include: PDA, MID and UMPC devices, such as iPad.
(2)其他具有数据库连接管理功能的电子装置。(2) Other electronic devices with database connection management functions.
本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be implemented by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer). , A chip, etc.) or a processor (processor) executes all or part of the steps of the method in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
另外,本发明还提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行上述任一项所述的数据库连接管理方法。In addition, the present invention also provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the database described in any one of the above Connection management method.
另外,本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任一项所述的数据库连接管理方法。In addition, the present invention also provides a computer program product, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer , Enabling the computer to execute any one of the database connection management methods described above.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个 其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt 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 codes.
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。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, and 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (15)

  1. 一种数据库连接管理方法,其特征在于,包括:A method for database connection management, characterized in that it comprises:
    当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;When a database connection is occupied by an application, determine the duration of time that the database connection is occupied by the application;
    若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。If it is determined that the duration is greater than or equal to the first preset duration, and the database connection is not detected to have transmission content, then the application's occupation of the database connection is released.
  2. 如权利要求1所述的方法,其特征在于,所述确定所述数据库连接被所述应用占用的持续时长,包括:The method of claim 1, wherein the determining the duration of the database connection being occupied by the application comprises:
    所述数据库连接被所述应用占用时,被记录了占用的起始时刻;When the database connection is occupied by the application, the start time of the occupation is recorded;
    按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  3. 如权利要求2所述的方法,其特征在于,所述未检验到所述数据库连接有传输内容,还包括:3. The method according to claim 2, wherein said unchecking that said database is connected with transmission content, further comprising:
    若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
  4. 如权利要求1-3任一所述的方法,其特征在于,按照以下方式检验所述数据库连接是否有传输内容:The method according to any one of claims 1-3, characterized in that, whether the database connection has transmission content is checked in the following manner:
    对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
    若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
  5. 如权利要求1-3任一所述的方法,其特征在于,还包括:The method according to any one of claims 1-3, further comprising:
    在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。When it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
  6. 如权利要求1-3任一所述的方法,其特征在于,还包括:The method according to any one of claims 1-3, further comprising:
    若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。If the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
  7. 一种数据库连接管理装置,其特征在于,包括:A database connection management device, characterized in that it comprises:
    确定模块,用于当数据库连接被应用占用时,确定所述数据库连接被所述应用占用的持续时长;The determining module is used to determine the duration of the database connection being occupied by the application when the database connection is occupied by the application;
    处理模块,用于若确定所述持续时长大于或等于第一预设时长,且未检验到所述数据库连接有传输内容,则解除所述应用对所述数据库连接的占用。The processing module is configured to release the application's occupation of the database connection if it is determined that the duration is greater than or equal to the first preset duration, and the database connection has no transmission content detected.
  8. 如权利要求7所述的装置,其特征在于,所述确定模块,具体用于:The device according to claim 7, wherein the determining module is specifically configured to:
    记录所述数据库连接被所述应用占用时的起始时刻;Record the starting time when the database connection is occupied by the application;
    按照第一预设周期获取当前时刻,并将当前时刻减去所述起始时刻的时长,作为所述持续时长;所述第一预设周期小于所述第一预设时长。The current time is acquired according to the first preset period, and the duration of the current time minus the start time is used as the duration; the first preset period is less than the first preset duration.
  9. 如权利要求8所述的装置,其特征在于,所述处理模块,还用于:The device according to claim 8, wherein the processing module is further configured to:
    若检验到所述数据库连接有传输内容,则用当前时刻替换所述起始时刻。If it is verified that there is transmission content connected to the database, the current time is used to replace the start time.
  10. 如权利要求7-9任一所述的装置,其特征在于,所述处理模块,具体用于:The device according to any one of claims 7-9, wherein the processing module is specifically configured to:
    对所述数据库连接进行切面拦截,并将切面拦截的内容存储至第一变量;所述第一变量的默认值为空;Intercepting the database connection in an aspect, and storing the intercepted content of the aspect in a first variable; the default value of the first variable is empty;
    若在第二预设时长内,所述第一变量的值为空,则确定所述数据库连接无传输内容;否则,确定所述数据库连接有传输内容。If the value of the first variable is empty within the second preset time period, it is determined that the database connection has no transmission content; otherwise, it is determined that the database connection has transmission content.
  11. 如权利要求7-9任一所述的装置,其特征在于,所述处理模块,还用于:9. The device according to any one of claims 7-9, wherein the processing module is further configured to:
    在确定所述持续时长小于所述第一预设时长的时间段内,或者检验到所述数据库连接有传输内容,则保持所述数据库连接不变。When it is determined that the duration is less than the first preset time period, or it is verified that the database connection has transmission content, the database connection is kept unchanged.
  12. 如权利要求7-9任一所述的装置,其特征在于,所述处理模块,具体用于:The device according to any one of claims 7-9, wherein the processing module is specifically configured to:
    若所述持续时长大于或等于所述第一预设时长,检验所述数据库连接是否有传输内容。If the duration is greater than or equal to the first preset duration, check whether the database connection has transmission content.
  13. 一种数据库连接管理设备,其特征在于,包括:A database connection management device, characterized in that it comprises:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6任一所述数据库连接管理方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the database connection of any one of claims 1 to 6 Management methods.
  14. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-6任一所述数据库连接管理方法。A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the database according to any one of claims 1 to 6 Connection management method.
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-6任一所述数据库连接管理方法。A computer program product, characterized in that, the computer program product includes a calculation program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, The computer executes the database connection management method of any one of claims 1-6.
PCT/CN2020/073053 2019-03-05 2020-01-19 Database connection management method and apparatus, and device WO2020177495A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910163071.6 2019-03-05
CN201910163071.6A CN109977096A (en) 2019-03-05 2019-03-05 A kind of database connection management method and device

Publications (1)

Publication Number Publication Date
WO2020177495A1 true WO2020177495A1 (en) 2020-09-10

Family

ID=67077879

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/073053 WO2020177495A1 (en) 2019-03-05 2020-01-19 Database connection management method and apparatus, and device

Country Status (2)

Country Link
CN (1) CN109977096A (en)
WO (1) WO2020177495A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977096A (en) * 2019-03-05 2019-07-05 中国银联股份有限公司 A kind of database connection management method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808556A (en) * 2014-12-29 2016-07-27 深圳云之家网络有限公司 Operating method for database and database engine
CN106095878A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 The database manipulation device and method of table is divided based on point storehouse
CN106250500A (en) * 2016-07-29 2016-12-21 广州唯品会信息科技有限公司 The dynamic management approach of database connection pool and system
CN109977096A (en) * 2019-03-05 2019-07-05 中国银联股份有限公司 A kind of database connection management method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281587B (en) * 2013-07-03 2018-05-11 阿里巴巴集团控股有限公司 A kind of method and device for establishing connection
CN105373420B (en) * 2014-08-28 2019-12-06 北京奇虎科技有限公司 Data transmission method and device
CN105956138B (en) * 2016-05-11 2019-07-12 北京百度网讯科技有限公司 The control method and device of database connection
US10706027B2 (en) * 2017-01-09 2020-07-07 Sap Se Database management system with dynamic allocation of database requests
CN108549592A (en) * 2018-03-19 2018-09-18 联动优势电子商务有限公司 A kind of monitoring method and monitoring device, application server of database connection pool

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808556A (en) * 2014-12-29 2016-07-27 深圳云之家网络有限公司 Operating method for database and database engine
CN106095878A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 The database manipulation device and method of table is divided based on point storehouse
CN106250500A (en) * 2016-07-29 2016-12-21 广州唯品会信息科技有限公司 The dynamic management approach of database connection pool and system
CN109977096A (en) * 2019-03-05 2019-07-05 中国银联股份有限公司 A kind of database connection management method and device

Also Published As

Publication number Publication date
CN109977096A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN110941528B (en) Log buried point setting method, device and system based on fault
US9355002B2 (en) Capturing trace information using annotated trace output
CN108255620B (en) Service logic processing method, device, service server and system
CN110489310B (en) Method and device for recording user operation, storage medium and computer equipment
CN111835790B (en) Risk identification method, device and system
CN104503912A (en) Monitoring method and device for service responding process
CN110659256A (en) Multi-computer room synchronization method, computing device and computer storage medium
US20180101307A1 (en) Scenario based logging
WO2019140738A1 (en) Method for avoiding excess return visits, and electronic apparatus and computer-readable storage medium
CN110599305A (en) Service processing method, device and storage medium
CN111813635A (en) Monitoring method, system and device for intelligent contracts of block chains
US20120304026A1 (en) Separation of error information from error propagation information
WO2020177495A1 (en) Database connection management method and apparatus, and device
WO2020253045A1 (en) Configured supplementary processing method and device for data of which forwarding has abnormality, and readable storage medium
US20150378799A1 (en) Automatic memory leak detection
CN110647463B (en) Method and device for restoring test breakpoint and electronic equipment
CN111078418B (en) Operation synchronization method, device, electronic equipment and computer readable storage medium
CN105760283B (en) A kind of log-output method and device
CN107958414B (en) Method and system for eliminating long transactions of CICS (common integrated circuit chip) system
EP2960798B1 (en) Automatic memory leak detection
CN114090514A (en) Log retrieval method and device for distributed system
CA3048699C (en) Join pattern agnostic aggregate computation in database query operations
US10102052B2 (en) Dumping resources
CN112699129A (en) Data processing system, method and device
CN113076122A (en) Resource file management method, device, equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20765690

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20765690

Country of ref document: EP

Kind code of ref document: A1