CN101192228B - Database interactive processing method and system - Google Patents

Database interactive processing method and system Download PDF

Info

Publication number
CN101192228B
CN101192228B CN2006101610058A CN200610161005A CN101192228B CN 101192228 B CN101192228 B CN 101192228B CN 2006101610058 A CN2006101610058 A CN 2006101610058A CN 200610161005 A CN200610161005 A CN 200610161005A CN 101192228 B CN101192228 B CN 101192228B
Authority
CN
China
Prior art keywords
concurrent
database
time
request
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2006101610058A
Other languages
Chinese (zh)
Other versions
CN101192228A (en
Inventor
沈少峰
吕开利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN2006101610058A priority Critical patent/CN101192228B/en
Publication of CN101192228A publication Critical patent/CN101192228A/en
Priority to HK08111051.5A priority patent/HK1118357A1/en
Application granted granted Critical
Publication of CN101192228B publication Critical patent/CN101192228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a database interactive processing method and a system thereof and solves the problems that the prior art has more concurrent programmes and causes that a database is suspended and can no longer respond requests. The method of the invention is as follows: a request of accessing the database is accepted; the concurrent number is acquired and is a maximum quantity which allows processing the concurrent programmes simultaneously; whether the quantity of the current processing concurrent programmes is less than the concurrent number is judged; if yes, the request is processed, otherwise, the request is refused. The system comprises an application interface, a processing module and an execution module.

Description

A kind of database interactive processing method and system
Technical field
The present invention relates to computing machine and database application field, particularly database interactive processing method and system.
Background technology
Generally all can be in based on the large scale system of database along with the growth of time, data volume constantly increases, the processing power of database will constantly reduce, and the reduction of this performance is the process of a gradual change, can't well predict, the consequence that causes be exactly certain the time begin, the response speed of system is more and more slower, also more and more unstable, the response that can produce some application once in a while becomes slow especially, if there are this time a lot of concurrent systems that will cause to hang up no longer response request again.
Solution commonly used at present mainly concentrates on monitoring, and manual analysis then improves back promote query performance more one by one.Monitoring is added on the application program often, rather than on database access layer, the general main performance issue of application based on database all is in the inquiry of database now, and the time of doing renewal and newly-increased deletion is very short comparatively speaking.Monitoring mainly is to note application program to begin time of carrying out and finishing to carry out, and outputs to then in the daily record, again statistical study is carried out in daily record, finds the place of performance bottleneck, calls together the related personnel that improvement project is discussed again.
Existing scheme mainly is that response is not prompt enough, has no idea to the fast automatic isolation of the application implementation that goes wrong.Because general log collection and analysis have a process, personnel also need to discuss targetedly after receiving statistic analysis result then, and when data volume acquired a certain degree, the application that often relates to all can have performance issue, and the place that modification just will be discussed can be many; And this time, problem was more and more serious, and system is bearing very big risk, may cause collapse because there is the place of performance issue to occur concurrent in a large number at any time.
Summary of the invention
The invention provides a kind of database interactive processing method and system, exist the more database that causes of concurrent program to hang up the no longer problem of response request in order to solve in the prior art.
The invention provides following technical scheme:
A kind of database interactive processing method may further comprise the steps:
Receive the request of accessing database from application layer;
Obtain concurrent number, described concurrent number is meant the maximum quantity that allows to handle simultaneously concurrent program;
Whether the quantity of judging the concurrent program of working as pre-treatment is less than described concurrent number, if, processes said request then, otherwise, the result who returns the refusal execution is to application layer, wherein processes said request may further comprise the steps: inquire about the corresponding relation of predetermined process time and concurrent number and obtain concurrent number again according to the mutual maximum duration of database in the concurrent program of pre-treatment, judge that further whether the quantity of the concurrent program of working as pre-treatment is less than the concurrent number that obtains again, if, then accept this request and carry out the corresponding database operation, otherwise rejecting said request.
Processes said request is meant to be accepted this request and carries out the corresponding database operation.
Also comprise step when accepting described request:
The start time and the concluding time of record concurrent program database interaction process, determine the time that the concurrent program database is mutual according to described start time and concluding time, and upgrade described averaging time.
Quantity according to mutual time of the database of each concurrent program of having carried out and the concurrent program carried out is upgraded described average handling time; Perhaps
According to the quantity and the described averaging time of mutual time of concurrent program database of this acquisition, the concurrent program before this, carried out, upgrade described averaging time.
Further also obtain concurrent number again according to the corresponding relation of inquiring about predetermined process time and concurrent number averaging time after upgrading.
Inquire about the corresponding relation of predetermined process time and concurrent number and determine described concurrent number according to the mutual maximum duration of database in the concurrent program of pre-treatment.
Acquiescence is accepted the request of first accessing database and is carried out the corresponding database operation.
A kind of database interaction process system comprises:
Application interface is used for receiving from application layer the request of accessing database;
Processing module is used to obtain concurrent number, and whether judges quantity when the concurrent program of pre-treatment less than described concurrent number, and described concurrent number is meant the maximum quantity that allows to handle simultaneously concurrent program;
Execution module, be used for when judged result processes said request when being, when judged result is not returned the result that refusal is carried out to application layer for the time, wherein when judged result when being, execution module is inquired about the corresponding relation of predetermined process time and concurrent number and is obtained concurrent number again according to the mutual maximum duration of database in the concurrent program of pre-treatment, judge that further whether the quantity of the concurrent program of working as pre-treatment is less than the concurrent number that obtains again, if, then accept this request and carry out the corresponding database operation, otherwise rejecting said request.
Beneficial effect of the present invention is as follows:
Whether 1, the present invention judges when each database access request comes, allow to carry out, and in real time database access is monitored; And when going wrong isolated data storehouse request of access automatically, avoided a large amount of request of access to cause system to hang up, needn't wait for analysis result.
2, the present invention can export various data at any time and monitors and analyze, and needn't wait for and just can analyze after outputing to the monitoring daily record.
3, the present invention monitored the mutual time of the database of concurrent program, and the concurrent number of further control permission, so the present invention is applicable to various Database Systems, and adopt the present invention to increase, also can be well controlled during the database performance variation in data volume.
Description of drawings
Fig. 1 is the structural drawing of database interaction process system in the embodiment of the invention;
Fig. 2 is the basic flow sheet of database interactive processing method in the embodiment of the invention;
Fig. 3 is the detail flowchart of a kind of database interactive processing method in the embodiment of the invention;
Fig. 4 is the detail flowchart of another kind of database interactive processing method in the embodiment of the invention.
Embodiment
Exist the more database that causes of concurrent program to hang up the no longer problem of response request in the prior art in order to solve, the present invention controls the quantity of concurrent processor in averaging time that the database key-course is handled according to concurrent program and the maximum duration carried out.
Referring to Fig. 1, database interaction process system comprises application interface 101, processing module 102, statistical module 103 and execution module 104 in the present embodiment.
Application interface 101 receives the request of accessing database from application layer.
Processing module 102 generates unique identification for each request, obtains the quantity of the concurrent program of concurrent number and current execution from statistical module 103, and whether the quantity of concurrent program of judging current execution is less than concurrent number.
Statistical module 103 is determined concurrent number according to the mutual maximum duration of database in the concurrent program of executed concurrent program average handling time or current execution, and adds up the quantity of the concurrent program of current execution.
Execution module 104 when judged result be less than the time processes said request, the execution concurrence program; When judged result is to return the information that refusal is handled to application layer when being not less than.
Referring to Fig. 2, the basic procedure of database interactive processing method is as follows in the present embodiment:
Step 201: receive request from the accessing database of application layer.
Step 202: obtain concurrent number, described concurrent number is meant the maximum quantity that allows to handle simultaneously concurrent program.
Step 203: whether judge quantity when the concurrent program of pre-treatment less than described concurrent number, if, processes said request then, otherwise, rejecting said request.
Referring to Fig. 3, the detailed process of database interactive processing method is as follows in the present embodiment:
Step 301: receive the request of accessing database, and for it generates unique identification, described request is generally a Structured Query Language (SQL) (SQL), comprises increase, deletes, revises and searches.
Sign is generally sequential encoding, can be numeral or letter or their combination, also can be SQL statement itself.This sign can be expressed the kind of request, can obtain the quantity of the concurrent program that executed finishes and the quantity of the concurrent program carried out by sign.Also can be for request like the category is provided with a sign, the described similar type that is meant request and required execution time are basic identical.
Can increase a gauge tap, select whether use this programme, select application scheme when needed, the flow process below continuing.
Step 302: obtain the average handling time (to call averaging time in the following text) of the concurrent program carried out, and determine current concurrent number according to the corresponding relation of averaging time and processing time and concurrent number.
Concurrent number is meant and allows the quantity of the concurrent program of execution at most simultaneously.Processing time is meant carries out in the execution concurrence program process the mutual time of database.
If so just there is not averaging time in first request, then giving tacit consent to averaging time is 0, perhaps directly allows to handle first request.
Step 303: whether the quantity of judging the current concurrent program of carrying out is less than current concurrent number, if then continue step 304, otherwise continue step 307.
Step 304: obtain the mutual maximum duration of database in each concurrent program of carrying out.
Step 305: whether the quantity of judging the current concurrent program of carrying out is less than the concurrent number that described maximum duration allowed, if then allow to handle this request, execution concurrence program, continuation step 306; Otherwise continue step 307.
General database manipulation is to finish in 1 second, and the maximum data storehouse linking number that general application server is provided with is about 25.The corresponding relation of averaging time and maximum duration and concurrent number is as follows in the present embodiment:
Time is 0 to 2s, and the concurrent number of permission is 5;
Time is 2 to 5s, and the concurrent number of permission is 3;
Time is 5 to 8s, and the concurrent number of permission is 2;
Time is more than the 8s, and the concurrent number of permission is 1.
Can adjust above-mentioned corresponding relation according to factors such as the type of database and data volumes.
Step 306: allow to handle this request, the time that begins to carry out that database of record is mutual, end of record (EOR) time when database finishes alternately, and the averaging time of upgrading the concurrent program of having carried out.Can also further upgrade concurrent number, then in step 302, can directly obtain concurrent number.
Also can be from the start and end time that monitoring be obtained concurrent program the daily record, but monitoring daily record at present read that to be limited to performance requirement generally be independent and non real-time, present embodiment is direct record in accessing database, this is a kind of preferable mode.Can also at any time various data (execution time of each concurrent program and current averaging time etc.) be outputed to monitoring analysis system, carry out instant analysis.
The various data of the concurrent program carried out are kept in the internal memory, only need be according to the current averaging time of Time Calculation of the sign of each request of writing down in the internal memory and averaging time that obtained last time and the execution of this concurrent program, so calculated amount is very little, and can obtain to be used for the averaging time that concurrent program quantity controls.
The aforementioned calculation method is a kind of preferable scheme, also can calculate current averaging time according to the processing time and the quantity of each concurrent program of having carried out.
Step 307: the result who returns the refusal execution is to application layer.
Referring to Fig. 4, the detailed process of another kind of database interactive processing method is as follows in the present embodiment:
Step 401: receive the request of accessing database, and for it generates unique identification, described request is generally a Structured Query Language (SQL), comprises increase, deletes, revises and searches.
Step 402: obtain the mutual maximum duration of database in each concurrent program of carrying out.
If the current program of not carrying out, then giving tacit consent to the execution time is 0, perhaps directly allows to handle first request of access.
Step 403: whether the quantity of judging the current concurrent program of carrying out is less than the concurrent number that described maximum duration allowed, if then continue step 404; Otherwise continue step 405.
General database manipulation is to finish in 1 second, and the maximum data storehouse linking number that general application server is provided with is about 25.The corresponding relation of maximum duration and concurrent number is as follows in the present embodiment:
Time is 0 to 2s, and the concurrent number of permission is 5;
Time is 2 to 5s, and the concurrent number of permission is 3;
Time is 5 to 8s, and the concurrent number of permission is 2;
Time is more than the 8s, and the concurrent number of permission is 1.
Can adjust above-mentioned corresponding relation according to factors such as the type of database and data volumes.
Step 404: accept this request, carry out associative operation to database.
Step 405: the result who returns the refusal execution is to application layer.
Whether the present invention judges when each database access request comes allow to carry out, in real time database access is monitored; And when going wrong isolated data storehouse request of access automatically, avoided a large amount of request of access to cause system to hang up, needn't wait for analysis result.The present invention can export various data at any time and monitor and analyze, and needn't wait for that outputing to monitoring just can analyze after the daily record.And, the present invention monitored the mutual time of the database of concurrent program, and further controlled the concurrent number that allows, so the present invention is applicable to various Database Systems, and adopt the present invention to increase, also can be well controlled during the database performance variation in data volume.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (7)

1. a database interactive processing method is characterized in that, may further comprise the steps:
Receive the request of accessing database from application layer;
Obtain concurrent number, described concurrent number is meant the maximum quantity that allows to handle simultaneously concurrent program;
Whether judge quantity when the concurrent program of pre-treatment less than described concurrent number, if, processes said request then, otherwise, return result that refusal carries out to application layer, wherein processes said request may further comprise the steps:
Inquire about the corresponding relation of predetermined process time and concurrent number and obtain concurrent number again according to the mutual maximum duration of database in the concurrent program of pre-treatment, judge that further whether the quantity of the concurrent program of working as pre-treatment is less than the concurrent number that obtains again, if, then accept this request and carry out the corresponding database operation, otherwise rejecting said request.
2. database interactive processing method as claimed in claim 1, it is characterized in that, describedly obtain concurrent number and specifically comprise: carry out database according to the concurrent program of having carried out and inquire about the corresponding relation of predetermined process time and concurrent number mutual averaging time and determine described concurrent number.
3. database interactive processing method as claimed in claim 2 is characterized in that, also comprises step when accepting described request:
The start time and the concluding time of record concurrent program database interaction process, determine the time that the concurrent program database is mutual according to described start time and concluding time, and upgrade described averaging time.
4. database interactive processing method as claimed in claim 3 is characterized in that, upgrades described averaging time according to the quantity of mutual time of the database of each concurrent program of having carried out and the concurrent program carried out; Perhaps
According to the quantity of mutual time of concurrent program database of this acquisition, the concurrent program before this, carried out, upgrade described averaging time.
5. database interactive processing method as claimed in claim 4 is characterized in that, further also obtains concurrent number again according to the corresponding relation of inquiring about predetermined process time and concurrent number averaging time after upgrading.
6. database interactive processing method as claimed in claim 1 is characterized in that, acquiescence is accepted the request of first accessing database and carried out the corresponding database operation.
7. a database interaction process system is characterized in that, comprising:
AIM is used for receiving from application layer the request of accessing database;
Processing module is used to obtain concurrent number, and whether judges quantity when the concurrent program of pre-treatment less than described concurrent number, and described concurrent number is meant the maximum quantity that allows to handle simultaneously concurrent program;
Execution module, be used for when judged result processes said request when being, when judged result is not returned the result that refusal is carried out to application layer for the time, wherein when judged result when being, execution module is inquired about the corresponding relation of predetermined process time and concurrent number and is obtained concurrent number again according to the mutual maximum duration of database in the concurrent program of pre-treatment, judge that further whether the quantity of the concurrent program of working as pre-treatment is less than the concurrent number that obtains again, if, then accept this request and carry out the corresponding database operation, otherwise rejecting said request.
CN2006101610058A 2006-12-01 2006-12-01 Database interactive processing method and system Active CN101192228B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN2006101610058A CN101192228B (en) 2006-12-01 2006-12-01 Database interactive processing method and system
HK08111051.5A HK1118357A1 (en) 2006-12-01 2008-10-03 Method and system for database interactive processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2006101610058A CN101192228B (en) 2006-12-01 2006-12-01 Database interactive processing method and system

Publications (2)

Publication Number Publication Date
CN101192228A CN101192228A (en) 2008-06-04
CN101192228B true CN101192228B (en) 2011-11-09

Family

ID=39487223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2006101610058A Active CN101192228B (en) 2006-12-01 2006-12-01 Database interactive processing method and system

Country Status (2)

Country Link
CN (1) CN101192228B (en)
HK (1) HK1118357A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673275B (en) * 2009-08-11 2012-07-25 东软集团股份有限公司 Method and device for ensuring consistent affairs inside database
CN102346891B (en) * 2010-07-30 2016-05-11 阿里巴巴集团控股有限公司 A kind of network trading method and server
CN102033784B (en) * 2010-11-18 2013-08-07 山东中创软件工程股份有限公司 Method and device for optimizing application server
CN102270235A (en) * 2011-08-01 2011-12-07 中国民生银行股份有限公司 Query processing method and device for data warehouse
CN102346767B (en) * 2011-09-19 2013-04-17 北京金和软件股份有限公司 Database connection method based on double connection pools
GB2507484A (en) 2012-10-30 2014-05-07 Ibm Limiting the number of concurrent requests in a database system
CN107346308B (en) * 2016-05-04 2020-07-28 阿里巴巴集团控股有限公司 Method and device for calling data in cluster system
CN107786614B (en) * 2016-08-30 2022-02-22 航天信息股份有限公司 TMS application downloading self-adaptive strategy method
CN107786615B (en) * 2016-08-30 2021-07-06 航天信息股份有限公司 TMS application downloading self-adaptive strategy method
CN107544849A (en) * 2017-09-30 2018-01-05 北京天元创新科技有限公司 A kind of WEB server concurrency management method and system
CN108804035A (en) * 2018-05-22 2018-11-13 深圳忆联信息系统有限公司 Reduce method, apparatus, computer equipment and the storage medium of IO delays
CN112667726A (en) * 2021-01-04 2021-04-16 拉卡拉支付股份有限公司 Data extraction method, data extraction device, electronic equipment, storage medium and program product

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
朱长生.自适应数据库连接池的研究.计算机工程与应用 36.2003,(36),187-189.
朱长生.自适应数据库连接池的研究.计算机工程与应用 36.2003,(36),187-189. *
李运莉.基于负荷预测的数据库连接池设计与实现.计算机与数字工程34 9.2006,34(9),144-146.
李运莉.基于负荷预测的数据库连接池设计与实现.计算机与数字工程34 9.2006,34(9),144-146. *
魏常辉.基于XML的自优化数据库连接池的设计与实现.计算机应用研究.2005,206-209. *

Also Published As

Publication number Publication date
HK1118357A1 (en) 2009-02-06
CN101192228A (en) 2008-06-04

Similar Documents

Publication Publication Date Title
CN101192228B (en) Database interactive processing method and system
CN100478898C (en) Apparatus, system, and method for resolving computing resource deadlocks
CN101727466A (en) Method and device for verifying service data object
CN103959275B (en) The method and system of the memory access in optimization multiple processor computation system
US20150026342A1 (en) Virtual resource management tool for cloud computing service
CN110134738B (en) Distributed storage system resource estimation method and device
CN103020149A (en) Shared data updating device and shared data updating method
US9697009B2 (en) Method for improving the performance of computers
CN110661863B (en) Request processing method and device, electronic equipment and storage medium
CN105763595A (en) Method of improving data processing efficiency and server
ATE258696T1 (en) METHOD FOR ACCESS CONTROL TO COMPUTER-CONTROLLED PROGRAMS THAT CAN BE USED BY SEVERAL USER UNITS SIMULTANEOUSLY
US7590630B2 (en) Managing electronic information
US20050149562A1 (en) Method and system for managing data access requests utilizing storage meta data processing
US20080294594A1 (en) Audit trail management method, system and processing program
US7908268B2 (en) Predictive database pool preparation
CN104750806A (en) Large data query method and system
US20120296936A1 (en) Terminal device for executing a query to a database
CN105302909B (en) Network security log system big data search method based on subregion calculations of offset
JP5055059B2 (en) Database processing method, implementation system and program
US20090168092A1 (en) Job management and scheduling method for network system
CN113868630A (en) Method, system, device and medium for automatic authority management based on user attribute
CN111290855B (en) GPU card management method, system and storage medium for multiple GPU servers in distributed environment
CN111196534A (en) Elevator stopping layer optimization method and system
CN116842299B (en) Dynamic data access risk control system and method
US20060048154A1 (en) Organizing transmission of repository data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1118357

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1118357

Country of ref document: HK

TR01 Transfer of patent right

Effective date of registration: 20191209

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: Georgetown, Grand Cayman, British Cayman Islands

Patentee before: Alibaba Group Holding Co., Ltd.

TR01 Transfer of patent right