CN104572974A - Service request processing method and device - Google Patents
Service request processing method and device Download PDFInfo
- Publication number
- CN104572974A CN104572974A CN201410854779.3A CN201410854779A CN104572974A CN 104572974 A CN104572974 A CN 104572974A CN 201410854779 A CN201410854779 A CN 201410854779A CN 104572974 A CN104572974 A CN 104572974A
- Authority
- CN
- China
- Prior art keywords
- connection
- database
- service request
- idle
- application
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明提供了一种业务请求处理方法和装置,其中,所述方法包括:拦截应用向数据库发送的业务请求;判断连接池中是否存在与所述数据库的空闲连接;若不存在,则保存所述业务请求,并按照设定规则持续判断所述连接池中是否存在所述与所述数据库的空闲连接,直至所述连接池中出现所述空闲连接;选择出现的所述空闲连接,并使用选择的所述空闲连接将所述业务请求发送至数据库。通过本发明,应用只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。
The present invention provides a service request processing method and device, wherein the method includes: intercepting the service request sent by the application to the database; judging whether there is an idle connection with the database in the connection pool; if not, saving the The service request, and continue to judge whether there is an idle connection with the database in the connection pool according to the set rules until the idle connection appears in the connection pool; select the idle connection that occurs, and use The selected idle connection sends the service request to the database. Through the present invention, the application only needs to send a service request once to ensure that the service request is processed by the database, which can not only prevent the user from receiving a message that the service request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending the service request. Therefore, both Reducing the operating burden of the terminal where the application is located and the network can improve the user experience.
Description
技术领域technical field
本发明涉及数据处理技术领域,特别是涉及一种业务请求处理方法和装置。The present invention relates to the technical field of data processing, in particular to a service request processing method and device.
背景技术Background technique
目前,在关系型数据库系统以及非分布式数据库系统中主要采用应用与数据库直连的架构。这种架构的数据库系统在处理业务请求时,应用直接向数据库发送业务请求,数据库返回相应的响应结果至应用。At present, in the relational database system and the non-distributed database system, the architecture of direct connection between the application and the database is mainly adopted. When a database system with this architecture processes a business request, the application directly sends the business request to the database, and the database returns the corresponding response result to the application.
采用现有的这种业务请求处理方案,当数据库当前处理的业务请求数量达到数据库可支持的上限(数据库的连接数达到上限),在有新的应用向数据库发送业务请求时,数据库接收到业务请求后由于没有空闲的连接可提供给该应用,因此,会返回业务请求失败的消息至该应用。而该应用在接收到请求失败的消息后,会再次向数据库发送业务请求,而如果数据库仍没有空闲的连接则会再次返回业务请求失败的消息至该应用。该应用以及数据库会重复上述操作,直至数据库中出现空闲的连接提供给该应用进行业务请求处理。With this existing business request processing scheme, when the number of business requests currently processed by the database reaches the upper limit that the database can support (the number of connections to the database reaches the upper limit), and when a new application sends a business request to the database, the database receives the business request After the request, since there is no idle connection available to the application, a message of service request failure will be returned to the application. After the application receives the request failure message, it will send the service request to the database again, and if the database still has no idle connection, it will return the service request failure message to the application again. The application and the database will repeat the above operations until an idle connection in the database is provided for the application to process the service request.
可见,现有的这种业务请求处理方案,当数据库当前处理的业务请求数量达到数据库可支持的上限,在有新的应用向数据库发送业务请求时,一方面,由于数据库直接向该应用返回业务请求失败的消息,因此,会影响用户的使用体验。同时,使用该应用需要重复发送业务请求直至请求成功,在影响用户的使用体验的同时也会增加应用所在终端以及网络的操作负担。另一方面,由于数据库要重复多次判断是否存在空闲连接以及向应用返回业务请求失败的消息,同样也会增加数据库的操作负担。It can be seen that in the existing business request processing scheme, when the number of business requests currently processed by the database reaches the upper limit that the database can support, when a new application sends a business request to the database, on the one hand, since the database directly returns business requests to the application Request failure messages, therefore, affect the user experience. At the same time, using the application requires repeated service requests until the request succeeds, which will not only affect the user experience, but also increase the operational burden of the terminal where the application is located and the network. On the other hand, since the database has to repeatedly determine whether there is an idle connection and return a message of service request failure to the application, the operational burden of the database will also be increased.
发明内容Contents of the invention
鉴于上述现有的问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的业务请求处理方法和装置。In view of the above existing problems, the present invention is proposed to provide a service request processing method and device for overcoming the above problems or at least partially solving the above problems.
依据本发明的一个方面,提供了一种业务请求处理方法,包括:拦截应用向数据库发送的业务请求;判断连接池中是否存在与所述数据库的空闲连接;若不存在,则保存所述业务请求,并按照设定规则持续判断所述连接池中是否存在所述与所述数据库的空闲连接,直至所述连接池中出现所述空闲连接;选择出现的所述空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库。According to one aspect of the present invention, a service request processing method is provided, including: intercepting the service request sent by the application to the database; judging whether there is an idle connection with the database in the connection pool; if not, saving the service request Request, and continue to judge whether there is an idle connection with the database in the connection pool according to the set rules until the idle connection appears in the connection pool; select the idle connection that occurs, and use the selected The idle connection sends the service request to the database.
根据本发明的另一方面,提供了一种业务请求处理装置,所述业务请求处理装置包括:第一拦截模块,用于拦截应用装置向数据库装置发送的业务请求;判断模块,用于判断连接池中是否存在与数据库装置之间的空闲连接;第一执行模块,用于若所述判断模块的判断结果为不存在空闲连接时,则保存所述业务请求,并按照设定规则持续判断所述连接池中是否存在所述与所述数据库装置之间的空闲连接,直至所述连接池中出现所述空闲连接;发送模块,用于选择出现的所述空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库装置。According to another aspect of the present invention, a service request processing device is provided, the service request processing device includes: a first interception module, used to intercept the service request sent by the application device to the database device; a judging module, used to judge the connection Whether there is an idle connection with the database device in the pool; the first execution module is used to save the service request if the judging result of the judgment module is that there is no idle connection, and continue to judge the service request according to the set rules Whether there is an idle connection with the database device in the connection pool, until the idle connection appears in the connection pool; the sending module is used to select the idle connection that appears, and use the selected An idle connection sends the service request to the database device.
通过本发明,在数据库系统尤其是非分布式数据库系统如关系型数据库系统中,拦截应用向数据库发送的业务请求,从连接池中选择与数据库之间的空闲连接来发送给业务请求,当连接池中存在空闲连接时,则可直接将业务请求通过空闲连接发送至数据库,当连接池中不存在空闲连接时,仍然正常接受应用的业务请求,待出现空闲连接时即将该业务请求发送至数据库进行处理,而不会向应用返回错误或失败消息。可见,应用只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。此外,本发明中公开的业务信息处理方案中,仅是在数据库存在空闲连接时将业务请求发送至数据库处理,数据库无需重复判断自身是否存在空闲连接更不需要向应用返回业务请求失败的消息,因此,能够有效降低数据库的操作负担。Through the present invention, in a database system, especially a non-distributed database system such as a relational database system, the service request sent by the application to the database is intercepted, and an idle connection with the database is selected from the connection pool to send to the service request. When the connection pool When there is an idle connection in the pool, the business request can be directly sent to the database through the idle connection. When there is no idle connection in the connection pool, the business request of the application is still accepted normally. When an idle connection appears, the business request will be sent to the database for processing. Process without returning an error or failure message to the application. It can be seen that the application only needs to send a business request once to ensure that the business request is processed by the database, which can not only prevent the user from receiving the message that the business request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending business requests. The operating burden of the terminal and the network can improve the user experience. In addition, in the business information processing solution disclosed in the present invention, the business request is only sent to the database for processing when there is an idle connection in the database, and the database does not need to repeatedly judge whether there is an idle connection and does not need to return a message of business request failure to the application. Therefore, the operational burden on the database can be effectively reduced.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:
图1是根据本发明实施例一的一种业务请求处理方法的步骤流程示意图;FIG. 1 is a schematic flow chart of steps of a service request processing method according to Embodiment 1 of the present invention;
图2是根据本发明实施例二的一种业务请求处理方法的步骤流程示意图;FIG. 2 is a schematic flowchart of steps of a service request processing method according to Embodiment 2 of the present invention;
图3是根据本发明实施例三的一种业务请求处理方法的步骤流程示意图;FIG. 3 is a schematic flowchart of steps of a service request processing method according to Embodiment 3 of the present invention;
图4是根据本发明实施例四的一种业务请求处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a service request processing device according to Embodiment 4 of the present invention;
图5是根据本发明实施例五的一种业务请求处理装置的结构示意图。Fig. 5 is a schematic structural diagram of a service request processing device according to Embodiment 5 of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
实施例一Embodiment one
参照图1,示出了本发明实施例一的一种业务请求处理方法的步骤流程示意图。Referring to FIG. 1 , it shows a schematic flowchart of steps of a service request processing method according to Embodiment 1 of the present invention.
本实施例的业务请求处理方法包括以下步骤:The service request processing method in this embodiment includes the following steps:
步骤S102:拦截应用向数据库发送的业务请求。Step S102: Intercept the service request sent by the application to the database.
其中,业务请求为应用可以向数据库发送的任意业务请求,例如:请求获取某用户号码的请求、获取套餐剩余流量值的请求等。Among them, the service request is any service request that the application can send to the database, for example: a request to obtain a user number, a request to obtain the remaining traffic value of a package, etc.
需要说明的是,本实施例中可以由设置在应用和数据库之间的中间件来拦截应用向数据库发送的业务请求,也可以由其他任意适当的装置来拦截。It should be noted that in this embodiment, the service request sent by the application to the database may be intercepted by the middleware set between the application and the database, or may be intercepted by any other appropriate device.
步骤S104:判断连接池中是否存在与数据库的空闲连接。Step S104: Determine whether there is an idle connection to the database in the connection pool.
在连接池中依据数据库的可支持的连接的信息,为数据库建立相应地连接。当连接池中与数据库的连接被业务请求占用时,则连接的当前状态为忙碌,当连接池中与数据库的连接未被业务请求占用时,则连接的当前状态为空闲。在拦截到业务请求后,从连接池中选择一个与数据库的空闲连接来向数据库发送该业务请求。In the connection pool, according to the supportable connection information of the database, a corresponding connection is established for the database. When the connection to the database in the connection pool is occupied by a business request, the current state of the connection is busy; when the connection to the database in the connection pool is not occupied by a business request, the current state of the connection is idle. After intercepting the service request, select an idle connection with the database from the connection pool to send the service request to the database.
步骤S106:若连接池中不存在与数据库的空闲连接,则保存业务请求,并按照设定规则持续判断连接池中是否存在与数据库的空闲连接,直至连接池中出现空闲连接。Step S106: If there is no idle connection to the database in the connection pool, save the service request, and continue to judge whether there is an idle connection to the database in the connection pool according to the set rules until an idle connection appears in the connection pool.
需要说明的是,业务请求可以存放入处理队列中,也可以存放入预设的缓存中,或者采用其它任意适当的存放形式。It should be noted that the service request may be stored in a processing queue, or in a preset cache, or in any other appropriate storage form.
在实际实现过程中,本领域技术人员可以根据实际需求设置持续判断连接池中是否存在与数据库之间的空闲连接的具体规则。例如:每隔设定的时间间隔轮询连接池中的与数据库之间的各连接的状态,以判断是否存在空闲连接。In the actual implementation process, those skilled in the art can set specific rules for continuously judging whether there is an idle connection with the database in the connection pool according to actual needs. For example: poll the status of each connection between the connection pool and the database every set time interval to determine whether there is an idle connection.
步骤S108:选择出现的空闲连接,并使用选择的空闲连接将业务请求发送至数据库。Step S108: Select an idle connection that appears, and use the selected idle connection to send the service request to the database.
选择空闲连接将业务请求发送至数据库,数据库中由于存在空闲连接因此能够保证该业务请求被处理。Select an idle connection to send the service request to the database, and the service request can be guaranteed to be processed due to the existence of an idle connection in the database.
通过本实施例提供的业务请求处理方法,在数据库系统尤其是非分布式数据库系统如关系型数据库系统中,拦截应用向数据库发送的业务请求,从连接池中选择与数据库之间的空闲连接来发送给业务请求,当连接池中存在空闲连接时,则可直接将业务请求通过空闲连接发送至数据库,当不存在空闲连接时,仍正常接受应用的业务请求,待出现空闲连接时即将该业务请求发送至数据库进行处理,而不会向应用返回错误或者失败消息。可见,应用只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。此外,仅是在数据库存在空闲连接时将业务请求发送至数据库处理,数据库无需重复判断自身是否存在空闲连接更不需要向应用返回业务请求失败的消息,因此,能够有效降低数据库的操作负担。Through the service request processing method provided in this embodiment, in a database system, especially a non-distributed database system such as a relational database system, the service request sent by the application to the database is intercepted, and an idle connection with the database is selected from the connection pool to send For business requests, when there is an idle connection in the connection pool, the business request can be directly sent to the database through the idle connection. When there is no idle connection, the business request of the application is still accepted normally, and the business request will be processed when an idle connection appears. Sent to the database for processing without returning an error or failure message to the application. It can be seen that the application only needs to send a business request once to ensure that the business request is processed by the database, which can not only prevent the user from receiving the message that the business request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending business requests. The operating burden of the terminal and the network can improve the user experience. In addition, only when the database has an idle connection, the business request is sent to the database for processing, and the database does not need to repeatedly judge whether there is an idle connection or not to return a message of failure of the business request to the application. Therefore, the operational burden of the database can be effectively reduced.
实施例二Embodiment two
参照图2,示出了本发明实施例二的一种业务请求处理方法的步骤流程示意图。Referring to FIG. 2 , it shows a schematic flowchart of steps of a service request processing method according to Embodiment 2 of the present invention.
本实施例的业务请求处理方法包括以下步骤:The service request processing method in this embodiment includes the following steps:
步骤S202:中间件拦截应用向数据库发送的业务请求。Step S202: the middleware intercepts the service request sent by the application to the database.
其中,本实施例中由中间件来拦截应用向数据库发送的业务请求,中间件设置于应用和数据库之间。所谓的之间并非是物理意义上的之间,而是由于中间件拦截应用与数据库之间发送的数据,因此,才称其为设置于应用和数据库之间中间件。Wherein, in this embodiment, the middleware is used to intercept the service request sent by the application to the database, and the middleware is set between the application and the database. The so-called gap is not a gap in the physical sense, but because the middleware intercepts the data sent between the application and the database, so it is called the middleware set between the application and the database.
需要说明的是,应用、中间件以及数据库可以设置在同一台设备上,也可以各自设置在一台设备上,或者两两组合设置在不同的设备上。一个中间件可以设置于多个应用和一个数据库之间即为每个数据库设置一个中间件,一个中间件可以设置于多个应用和多个数据库之间即为多个数据库设置一个中间件。It should be noted that the application, middleware, and database can be set on the same device, or each can be set on one device, or a combination of two can be set on different devices. One middleware can be set between multiple applications and one database, that is, one middleware is set for each database, and one middleware can be set between multiple applications and multiple databases, that is, one middleware is set for multiple databases.
其中,业务请求为应用可以向数据库发送的任意业务请求,例如:请求获取某用户号码的请求、获取套餐剩余流量值的请求等。Among them, the service request is any service request that the application can send to the database, for example: a request to obtain a user number, a request to obtain the remaining traffic value of a package, etc.
步骤S204:中间件判断自身的连接池中是否存在中间件与数据库之间的空闲连接,若存在,则执行步骤S206,若不存在,则执行步骤S208。Step S204: the middleware judges whether there is an idle connection between the middleware and the database in its own connection pool, if yes, execute step S206, if not, execute step S208.
其中,中间件自身的连接池中设置有中间件与数据库之间的连接,其数量与数据库可支持的连接的数量相同。另外,当存在多个数据库时,各个数据库中存储的数据也相同。Wherein, the connection pool between the middleware and the database is set in the connection pool of the middleware itself, the number of which is the same as the number of connections supported by the database. In addition, when there are a plurality of databases, the data stored in each database is also the same.
步骤S206:若中间件判断自身的连接池中存在中间件与数据库之间的空闲连接时,则选择一个空闲连接,然后,执行步骤S210。Step S206: If the middleware determines that there is an idle connection between the middleware and the database in its own connection pool, select an idle connection, and then execute step S210.
对于选择一个空闲连接的具体选择方式本实施例不作具体限制,当存在多个空闲连接时,中间件可以随机从中选择一个空闲连接,也可以按照连接空闲时间的长短选择一个空闲时间最长的连接,当然还可以按照其他的选择方式进行选择。This embodiment does not make specific restrictions on the specific selection method for selecting an idle connection. When there are multiple idle connections, the middleware can randomly select an idle connection, or select a connection with the longest idle time according to the idle time of the connection. , of course, can also be selected according to other selection methods.
步骤S208:若中间件判断自身的连接池中不存在中间件与数据库之间的空闲连接时,则保存业务请求,并按照设定规则持续判断连接池中是否存在中间件与数据库之间的空闲连接,直至连接池中出现空闲连接,选择出现的空闲连接,然后,执行步骤S210。Step S208: If the middleware judges that there is no idle connection between the middleware and the database in its own connection pool, save the business request, and continue to judge whether there is an idle connection between the middleware and the database in the connection pool according to the set rules Connect until an idle connection appears in the connection pool, select the idle connection that appears, and then execute step S210.
需要说明的是,业务请求可以存放入处理队列中,也可以存放入预设的缓存中,或者采用其它任意适当的存放形式。It should be noted that the service request may be stored in a processing queue, or in a preset cache, or in any other appropriate storage form.
在实际实现过程中,本领域技术人员可以根据实际需求设置持续判断连接池中是否存在中间件与数据库之间的空闲连接的具体规则。例如:每隔设定的时间间隔轮询连接池中的与数据库之间的各连接的状态,以判断是否存在空闲连接。In the actual implementation process, those skilled in the art can set specific rules for continuously judging whether there is an idle connection between the middleware and the database in the connection pool according to actual needs. For example: poll the status of each connection between the connection pool and the database every set time interval to determine whether there is an idle connection.
步骤S210:中间件使用选择的空闲连接将业务请求发送至数据库。Step S210: the middleware uses the selected idle connection to send the service request to the database.
中间件选择空闲连接将业务请求发送至数据库,数据库中由于存在空闲连接因此能够保证该业务请求被处理。The middleware selects an idle connection to send the service request to the database, and since there is an idle connection in the database, the service request can be guaranteed to be processed.
步骤S212:中间件拦截数据库通过选择的空闲连接向应用返回的、对业务请求的响应结果,并将拦截到的响应结果发送至发送业务请求的应用。Step S212: The middleware intercepts the response result to the service request returned by the database to the application through the selected idle connection, and sends the intercepted response result to the application sending the service request.
数据库处理完业务请求后,通过发送业务请求的连接将响应结果返回至应用,此时,中间件拦截所述数据库返回的、对业务请求的响应结果。After the database finishes processing the service request, it returns the response result to the application through the connection sending the service request. At this time, the middleware intercepts the response result to the service request returned by the database.
对于中间件如何确定响应结果对应的应用,可以由本领域技术人员根据实际情况进行设置,例如:可以在中间件发送至数据库的业务请求中携带发送该业务请求的应用的标识信息,数据库在返回响应结果时,在响应结果中也携带有应用的标识信息,当中间件拦截到响应结果时,则可根据响应结果中的应用的标识信息来确定对应的应用。How the middleware determines the application corresponding to the response result can be set by those skilled in the art according to the actual situation, for example: the business request sent by the middleware to the database can carry the identification information of the application that sent the business request, and the database returns the response In the result, the response result also carries application identification information, and when the middleware intercepts the response result, the corresponding application can be determined according to the application identification information in the response result.
相关技术中,在非分布式数据库系统如关系型数据库系统中主要采用应用与数据库直连的架构,导致数据库无法响应超过其连接数量上限的业务请求。而通过本实施例提供的业务请求处理方法,在数据库系统尤其是非分布式数据库系统如关系型数据库系统中,设置位于应用和数据库之间的中间件,中间件拦截应用向数据库发送的业务请求,从中间件自身的连接池中选择中间件与数据库之间的空闲连接来发送给业务请求,当中间件中存在空闲连接时,则可直接将业务请求通过空闲连接发送至数据库,当中间件中不存在空闲连接时,仍正常接受应用的业务请求,待出现空闲连接时即将该业务请求发送至数据库进行处理,而不会向应用返回错误或者失败消息。可见,应用只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。此外,中间件仅是在数据库存在空闲连接时将业务请求发送至数据库处理,数据库无需重复判断自身是否存在空闲连接更不需要向应用返回业务请求失败的消息,因此,能够有效降低数据库的操作负担。In related technologies, a non-distributed database system such as a relational database system mainly adopts an architecture of direct connection between an application and a database, which causes the database to be unable to respond to service requests exceeding the upper limit of its number of connections. And through the service request processing method provided in this embodiment, in the database system, especially in the non-distributed database system such as the relational database system, the middleware between the application and the database is set, and the middleware intercepts the service request sent by the application to the database. Select an idle connection between the middleware and the database from the middleware's own connection pool to send to the business request. When there is an idle connection in the middleware, the business request can be directly sent to the database through the idle connection. When the middleware When there is no idle connection, the business request of the application is still accepted normally, and when an idle connection occurs, the business request will be sent to the database for processing without returning an error or failure message to the application. It can be seen that the application only needs to send a business request once to ensure that the business request is processed by the database, which can not only prevent the user from receiving the message that the business request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending business requests. The operating burden of the terminal and the network can improve the user experience. In addition, the middleware only sends business requests to the database for processing when there is an idle connection in the database. The database does not need to repeatedly judge whether there is an idle connection and does not need to return a message of business request failure to the application. Therefore, the operational burden of the database can be effectively reduced .
实施例三Embodiment three
参照图3,示出了本发明实施例三的一种业务处理方法的步骤流程示意图。Referring to FIG. 3 , it shows a schematic flowchart of steps of a service processing method according to Embodiment 3 of the present invention.
本实施例的业务处理方法具体包括以下步骤:The business processing method of this embodiment specifically includes the following steps:
步骤S302:中间件根据数据库可支持的连接的信息,生成连接池。Step S302: The middleware generates a connection pool according to the connection information supported by the database.
其中,中间件设置于应用和数据库之间。连接池用于管理数据库可支持的连接。Wherein, the middleware is arranged between the application and the database. A connection pool is used to manage the connections that a database can support.
中间件根据数据库可支持的连接的信息,生成连接池的一种可选的生成方式如下:中间件根据数据库可支持的连接的信息确定数据库可支持的连接上限;在连接池中设置相同的数量的连接。例如:数据库可支持的连接上限为50个连接,那么,中间件在连接池中建立50个连接。An optional generation method for the middleware to generate a connection pool based on the connection information that the database can support is as follows: the middleware determines the upper limit of the connection that the database can support according to the connection information that the database can support; set the same number in the connection pool Connection. For example: the upper limit of connections supported by the database is 50 connections, then the middleware establishes 50 connections in the connection pool.
本实施例中的业务处理方法可以应用于多种数据库系统,优选地,将本实施例中的业务请求处理方法应用于非分布式数据库系统,更优选地,应用于关系型数据库系统。由于目前非分布式数据库系统如关系型数据库系统在处理业务请求时,均是应用直接向数据库发送业务请求,数据库直接响应或者拒绝应用发送的业务请求,而这样业务请求处理方法,当数据库当前处理的业务请求数量达到数据库可支持的上限时,数据库会直接向应用返回业务请求失败的消息,影响用户的使用体验。所以,将本实施例中的业务请求处理方法应用于关系型数据库,在应用和数据库之间设置中间件,由中间件来缓存数据库无法马上处理的业务请求,待数据库存在空闲连接能够处理该业务请求时再将业务请求发送至数据库,而不会向应用返回错误或失败消息,能够有效解决影响用户体验的问题。The service processing method in this embodiment can be applied to various database systems. Preferably, the service request processing method in this embodiment is applied to a non-distributed database system, more preferably, to a relational database system. Since the current non-distributed database systems such as relational database systems process business requests, the application directly sends business requests to the database, and the database directly responds or rejects the business requests sent by the application. When the number of business requests reaches the upper limit that the database can support, the database will directly return a message of business request failure to the application, affecting the user experience. Therefore, apply the business request processing method in this embodiment to a relational database, set middleware between the application and the database, and use the middleware to cache business requests that the database cannot process immediately, and wait for the database to have an idle connection to process the business When the request is made, the business request is sent to the database without returning an error or failure message to the application, which can effectively solve the problems affecting the user experience.
步骤S304:中间件拦截应用向数据库发送的业务请求,并向应用返回业务请求被接受的消息。Step S304: the middleware intercepts the service request sent by the application to the database, and returns a message that the service request is accepted to the application.
需要说明的是,中间件向应用返回业务请求被接受的消息为可选操作,在实际实现过程中,还可以设置成中间件拦截应用向数据库发送的业务请求,但不向应用返回业务请求被接受的消息。通过向应用返回业务请求被接受的消息,使得应用能够确认本次的业务请求已被成功受理,避免应用不断向数据库或中间件发送询问消息,减少应用的操作负担以及网络的信息交互负担。It should be noted that it is optional for the middleware to return the message that the business request is accepted to the application. Accepted message. By returning the message that the business request is accepted to the application, the application can confirm that the business request has been successfully accepted, avoiding the application to continuously send inquiry messages to the database or middleware, and reducing the operation burden of the application and the information interaction burden of the network.
步骤S306:中间件判断自身的连接池中是否存在中间件与数据库之间的空闲连接,若存在,则执行步骤S308,若不存在,则执行步骤S310。Step S306: the middleware judges whether there is an idle connection between the middleware and the database in its own connection pool, if yes, execute step S308, if not, execute step S310.
一种优选的中间件判断连接池中是否存与数据库之间的空闲连接的方式如下:A preferred way for the middleware to determine whether there is an idle connection with the database in the connection pool is as follows:
中间件根据连接池中各连接的连接状态,判断连接池中是否存在与数据库之间的空闲连接;当存在连接状态为空闲的连接时,确定连接池中存在与数据库之间的空闲连接;当所有连接的状态均为忙碌时,确定连接池中不存在与数据库之间的空闲连接。The middleware judges whether there is an idle connection with the database in the connection pool according to the connection status of each connection in the connection pool; when there is a connection whose connection status is idle, it is determined that there is an idle connection with the database in the connection pool; When the status of all connections is busy, it is determined that there is no idle connection with the database in the connection pool.
另一种中间件判断连接池中是否存在与数据库之间的空闲连接的方式如下:中间件可以在判断拦截到数据库返回的响应结果时,则确定连接池中存在与数据库之间的空闲连接。Another way for the middleware to judge whether there is an idle connection with the database in the connection pool is as follows: the middleware can determine that there is an idle connection with the database in the connection pool when it judges that the response result returned by the database is intercepted.
步骤S308:若中间件判断连接池中存在空闲连接,则选择一个空闲连接,然后,执行步骤S312。Step S308: If the middleware determines that there is an idle connection in the connection pool, select an idle connection, and then execute step S312.
步骤S310:若中间件判断自身的连接池中不存在空闲连接,中间件保存业务请求,并则返回步骤S306。Step S310: If the middleware determines that there is no idle connection in its own connection pool, the middleware saves the service request, and returns to step S306.
例如,中间件将业务请求存放入待处理队列,或者,将业务请求存放入预设的缓存。For example, the middleware stores the service request in a pending queue, or stores the service request in a preset cache.
也即,若中间件判断连接池中不存在空闲连接,则会返回步骤S306按照设定规则持续判断连接池中是否存在与数据库之间的空闲连接,直至连接池中出现空闲连接,选择出现的空闲连接。That is, if the middleware judges that there is no idle connection in the connection pool, it will return to step S306 and continue to judge whether there is an idle connection with the database in the connection pool according to the set rules until there is an idle connection in the connection pool, and select the one that appears. idle connection.
优选地,设定规则可以设置成包括但不限于以下规则:Preferably, the setting rules can be set to include but not limited to the following rules:
第一种规则,中间件按照设定时间间隔判断连接池中是否存在与数据库之间的空闲连接。其中,时间间隔的设定可以由本领域技术人员根据实际需求进行设置,例如:设置成在轮询连接池中的所有与数据库之间的连接后隔1秒再次对连接池中的连接进行轮询。In the first rule, the middleware judges whether there is an idle connection with the database in the connection pool according to the set time interval. Wherein, the setting of the time interval can be set by those skilled in the art according to actual needs, for example: set to poll the connection in the connection pool again every 1 second after polling all the connections between the connection pool and the database .
第二种规则,中间件实时判断连接池中是否存在与数据库之间的空闲连接。In the second rule, the middleware judges in real time whether there is an idle connection to the database in the connection pool.
需要说明的是,该步骤中判断连接池中是否存在与数据库之间的空闲连接,直至连接池中出现空闲连接时,可以选择采用步骤S306中说明的任一种优选的方式。It should be noted that, in this step, it is judged whether there is an idle connection with the database in the connection pool, until an idle connection appears in the connection pool, any preferred method described in step S306 can be selected.
步骤S312:中间件将选择的空闲连接的连接状态从空闲更改为忙碌,并使用选择的空闲连接向数据库发送业务请求。Step S312: the middleware changes the connection state of the selected idle connection from idle to busy, and uses the selected idle connection to send a service request to the database.
中间件通过将所选择的空闲连接的连接状态更改为忙碌,可以高效快速地判断出连接池中各个连接的当前状态,从而更为有效地为业务请求选择空闲连接。The middleware can efficiently and quickly determine the current state of each connection in the connection pool by changing the connection state of the selected idle connection to busy, so that the idle connection can be selected for the service request more effectively.
中间件使用选择的空闲连接向数据库发送业务请求时,会根据业务请求在队列中所处的位置或者业务请求的优先级来发送业务请求,具体地:When the middleware uses the selected idle connection to send a business request to the database, it will send the business request according to the position of the business request in the queue or the priority of the business request, specifically:
当业务请求存放于待处理队列时,从待处理队列中依次取出业务请求,并为取出的业务请求分配空闲连接,使用分配的空闲连接将业务请求发送至数据库。When the business request is stored in the queue to be processed, the business request is sequentially taken out from the queue to be processed, and an idle connection is allocated for the taken out business request, and the business request is sent to the database using the allocated idle connection.
当业务请求存放于预设的缓存时,根据业务请求的优先级依次取出业务请求,并为取出的业务请求分配空闲连接,使用分配的空闲连接将业务请求发送至数据库。When the service request is stored in the preset cache, the service request is taken out in sequence according to the priority of the service request, and an idle connection is allocated for the taken out service request, and the service request is sent to the database using the allocated idle connection.
也就是说,如果步骤S310中保存的业务请求如果位于待处理队列的第一位或者在预设的缓存中的优先级最高,那么,当选择出空闲连接时,则可直接将业务请求发送至数据库。而如果该业务请求并不位于待处理队列的第一位或者不是优先级最高的业务请求,则需要等待,直至将待处理队列中位于该业务请求前的业务请求、或者是优先级高于该优先级的业务请求发送至数据库后,才能够选择空闲连接将该业务请求发送至数据库。That is to say, if the service request saved in step S310 is located at the first place in the queue to be processed or has the highest priority in the preset cache, then when an idle connection is selected, the service request can be directly sent to database. And if the service request is not at the top of the queue to be processed or is not the service request with the highest priority, you need to wait until the service request before the service request in the queue to be processed, or with a priority higher than the service request Only after the priority business request is sent to the database can an idle connection be selected to send the service request to the database.
步骤S314:中间件拦截数据库通过选择的空闲连接向应用返回的、对业务请求的响应结果。Step S314: The middleware intercepts the response result to the service request returned by the database to the application through the selected idle connection.
数据库接收业务请求,在处理完该业务请求后,会通过之前中间件选择的空闲连接向应用返回对业务请求的响应结果。此时,中间件拦截该响应结果。The database receives the business request, and after processing the business request, it returns the response to the business request to the application through the idle connection selected by the previous middleware. At this time, the middleware intercepts the response result.
步骤S316:中间件根据拦截到的响应结果,将返回响应结果的连接的连接状态从忙碌更改为空闲,同时,中间件将拦截到的响应结果发送至发送业务请求的应用。Step S316: According to the intercepted response result, the middleware changes the connection state of the connection returning the response result from busy to idle, and at the same time, the middleware sends the intercepted response result to the application sending the service request.
本步骤中,中间件在拦截到通过某连接返回的响应结果时,将该连接的连接状态由忙碌修改为空闲,便于中间件为尚未得到处理的业务请求分配连接,提高连接的使用率。In this step, when the middleware intercepts the response result returned by a certain connection, it changes the connection status of the connection from busy to idle, so that the middleware can allocate connections for unprocessed service requests and improve connection utilization.
同时,中间件会将拦截到的响应结果发送至发送业务请求的应用。At the same time, the middleware will send the intercepted response result to the application that sends the business request.
需要说明的是,连接状态的修改与向应用发送响应结果可以同时并行执行,也可以以任意先后顺序执行。It should be noted that the modification of the connection state and the sending of the response result to the application can be executed in parallel or in any order.
通过本实施例提供的业务请求处理方法,在数据库系统尤其是非分布式数据库系统如关系型数据库系统中,设置位于应用和数据库之间的中间件,中间件拦截应用向数据库发送的业务请求,从连接池中选择与数据库之间的空闲连接来发送给业务请求,当连接池中存在空闲连接时,则可直接将业务请求通过空闲连接发送至数据库,当连接池中不存在空闲连接时,仍然正常接受应用的业务请求,待出现空闲连接时即将该业务请求发送至数据库进行处理,而不会向应用返回错误或失败消息。可见,应用只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。此外,中间件仅是在数据库存在空闲连接时将业务请求发送至数据库处理,数据库无需重复判断连接池中是否存在空闲连接更不需要向应用返回业务请求失败的消息,因此,能够有效降低数据库的工作负荷。Through the service request processing method provided in this embodiment, in a database system, especially a non-distributed database system such as a relational database system, middleware between the application and the database is set, and the middleware intercepts the service request sent by the application to the database, from Select an idle connection with the database in the connection pool to send the business request. When there is an idle connection in the connection pool, the business request can be directly sent to the database through the idle connection. When there is no idle connection in the connection pool, it will still Accept the business request of the application normally, and send the business request to the database for processing when an idle connection occurs, without returning an error or failure message to the application. It can be seen that the application only needs to send a business request once to ensure that the business request is processed by the database, which can not only prevent the user from receiving the message that the business request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending business requests. The operating burden of the terminal and the network can improve the user experience. In addition, the middleware only sends business requests to the database for processing when there are idle connections in the database. The database does not need to repeatedly judge whether there are idle connections in the connection pool, nor does it need to return a message of business request failure to the application. Therefore, it can effectively reduce the workload of the database. Workload.
实施例四Embodiment four
参照图4,示出了本发明实施例四的一种业务请求处理装置的结构示意图。Referring to FIG. 4 , it shows a schematic structural diagram of a service request processing apparatus according to Embodiment 4 of the present invention.
本实施的业务请求处理装置可以设置于应用装置和数据库装置之间,业务请求处理装置包括:第一拦截模块402,用于拦截应用装置向数据库装置发送的业务请求;判断模块404,用于判断连接池中是否存在与数据库装置之间的空闲连接;第一执行模块406,用于若判断模块的判断结果为不存在空闲连接时,则保存业务请求,并按照设定规则持续判断连接池中是否存在与数据库装置之间的空闲连接,直至连接池中出现空闲连接;发送模块408,用于选择出现的空闲连接,并使用选择的空闲连接将业务请求发送至数据库装置。需要说明的是,业务请求处理装置、应用装置和数据库装置可以设置在同一设备中,也可以分别设置在不同的设备中。本实施例中对此不作具体限制。The service request processing device in this embodiment can be set between the application device and the database device. The service request processing device includes: a first interception module 402, which is used to intercept the service request sent by the application device to the database device; a judging module 404, which is used to judge Whether there is an idle connection with the database device in the connection pool; the first execution module 406 is used to save the service request if the judging result of the judging module is that there is no idle connection, and continue to judge the connection pool according to the set rules. Whether there is an idle connection with the database device, until an idle connection appears in the connection pool; the sending module 408 is used to select the idle connection that appears, and use the selected idle connection to send the service request to the database device. It should be noted that the service request processing device, the application device and the database device may be set in the same device, or may be respectively set in different devices. This is not specifically limited in this embodiment.
通过本实施例提供的业务请求处理装置,在数据库系统尤其是非分布式数据库系统如关系型数据库系统中,能够拦截应用装置向数据库装置发送的业务请求,从连接池中选择与数据库装置之间的空闲连接来发送给业务请求,当存在空闲连接时,则可直接将业务请求通过空闲连接发送至数据库装置,当不存在空闲连接时,仍然正常接受应用的业务请求,待出现空闲连接时即将该业务请求发送至数据库装进行处理,而不会向应用返回错误或失败消息。可见,应用装置只需发送一次业务请求,即可保证业务请求被数据库处理,既能够避免用户接收到业务请求失败的消息导致使用体验降低,又能够避免应用重复发送业务请求,因此,既能够降低应用所在终端以及网络的操作负担又能够提升用户的使用体验。此外,本实施例的业务请求处理装置仅是在数据库装置存在空闲连接时将业务请求发送至数据库装置处理,数据库装置无需重复判断自身是否存在空闲连接更不需要向应用返回业务请求失败的消息,因此,能够有效降低数据库装置的操作负担。Through the service request processing device provided in this embodiment, in a database system, especially a non-distributed database system such as a relational database system, it is possible to intercept the service request sent by the application device to the database device, and select a connection with the database device from the connection pool. When there is an idle connection, the service request can be directly sent to the database device through the idle connection. When there is no idle connection, the service request of the application is still accepted normally. When an idle connection occurs, the service request will be sent Business requests are sent to the database for processing without returning an error or failure message to the application. It can be seen that the application device only needs to send a service request once to ensure that the service request is processed by the database, which can not only prevent the user from receiving a message that the service request fails, resulting in a decrease in user experience, but also prevent the application from repeatedly sending service requests. The operating burden of the terminal where the application is located and the network can also improve the user experience. In addition, the service request processing device of this embodiment only sends the service request to the database device for processing when there is an idle connection in the database device, and the database device does not need to repeatedly judge whether it has an idle connection, nor does it need to return a message of service request failure to the application. Therefore, the operational burden on the database device can be effectively reduced.
实施例五Embodiment five
参照图5,示出了本发明实施例五的一种业务请求处理装置的结构示意图。Referring to FIG. 5 , it shows a schematic structural diagram of a service request processing apparatus according to Embodiment 5 of the present invention.
本实施例对实施例四中的业务请求处理装置进行了进一步优化,优化后的业务请求处理装置包括:第一拦截模块502,用于拦截应用装置向数据库装置发送的业务请求;判断模块504,用于判断连接池中是否存在与数据库装置之间的空闲连接;第一执行模块506,用于若判断模块的判断结果为不存在空闲连接时,则保存业务请,并按照设定规则持续判断连接池中是否存在与数据库装置之间的空闲连接,直至连接池中出现空闲连接,选择出现的空闲连接;发送模块508,用于选择出现的空闲连接,并使用选择的空闲连接将业务请求发送至数据库装置。This embodiment further optimizes the service request processing device in the fourth embodiment. The optimized service request processing device includes: a first interception module 502, which is used to intercept the service request sent by the application device to the database device; a judgment module 504, It is used to judge whether there is an idle connection with the database device in the connection pool; the first execution module 506 is used to save the business request if the judgment result of the judgment module is that there is no idle connection, and continue to judge according to the set rules Whether there is an idle connection with the database device in the connection pool, until an idle connection appears in the connection pool, select the idle connection that occurs; the sending module 508 is used to select the idle connection that occurs, and use the selected idle connection to send the service request to the database device.
优选地,本实施例的业务请求处理装置还包括:第二执行模块510,用于若判断模块504的判断结果为连接池中存在与数据库的空闲连接时,则选择一个空闲连接,并使用选择的空闲连接将业务请求发送至数据库。Preferably, the service request processing device in this embodiment further includes: a second execution module 510, configured to select an idle connection if the judging result of the judging module 504 is that there is an idle connection with the database in the connection pool, and use the selected The idle connection sends the service request to the database.
优选地,本实施例的业务请求处理装置还包括:第二拦截模块512,用于拦截数据库装置通过选择的空闲连接向应用装置返回的、对业务请求的响应结果,并将拦截到的响应结果发送至发送业务请求的应用装置。Preferably, the service request processing device in this embodiment further includes: a second interception module 512, configured to intercept the response result to the service request returned by the database device to the application device through the selected idle connection, and convert the intercepted response result Sent to the application sending the service request.
优选地,本实施例的业务请求处理装置还包括:连接池生成模块514,用于在第一拦截模块502拦截应用装置向数据库装置发送的业务请求之前,根据数据库装置可支持的连接的信息,生成连接池,其中,连接池用于管理数据库装置可支持的连接。Preferably, the service request processing device in this embodiment further includes: a connection pool generation module 514, configured to, according to the connection information supported by the database device, before the first interception module 502 intercepts the service request sent by the application device to the database device, A connection pool is generated, wherein the connection pool is used to manage connections that the database device can support.
优选地,第一拦截模块502,用于拦截应用装置向数据库装置发送的业务请求,并向应用装置返回业务请求被接受的消息。Preferably, the first interception module 502 is configured to intercept the service request sent by the application device to the database device, and return a message that the service request is accepted to the application device.
优选地,判断模块504包括:状态判断模块5042,用于根据中间件装置自身的连接池中各连接的连接状态,判断中间件装置自身的连接池中是否存在中间件装置与数据库装置之间的空闲连接;确定模块5044,用于当状态判断模块5042的判断结果为存在连接状态为空闲的连接时,确定连接池中存在与数据库装置之间的空闲连接;当状态判断模块5042的判断结果为所有连接的状态均为忙碌时,确定连接池中不存在与数据库装置之间的空闲连接。Preferably, the judging module 504 includes: a state judging module 5042, which is used to judge whether there is a connection between the middleware device and the database device in the connection pool of the middleware device itself according to the connection status of each connection in the connection pool of the middleware device itself. Idle connection; Determining module 5044 is used to determine that there is an idle connection between the database device in the connection pool when the judgment result of the state judgment module 5042 is that there is a connection whose connection state is idle; when the judgment result of the state judgment module 5042 is When the states of all connections are busy, it is determined that there is no idle connection with the database device in the connection pool.
优选地,发送模块508,用于将选择的空闲连接的连接状态从空闲更改为忙碌,并使用选择的空闲连接向数据库装置发送业务请求;本实施例的业务请求息处理装置还包括:连接状态更改模块516,用于在第二拦截模块512拦截数据库装置通过选择的空闲连接向应用装置返回的、对业务请求的响应结果之后,根据拦截到的响应结果,将返回响应结果的连接的连接状态从忙碌更改为空闲。Preferably, the sending module 508 is configured to change the connection status of the selected idle connection from idle to busy, and use the selected idle connection to send a service request to the database device; the service request information processing device of this embodiment also includes: connection status The modification module 516 is configured to, after the second interception module 512 intercepts the response result to the service request returned by the database device to the application device through the selected idle connection, according to the intercepted response result, the connection status of the connection that will return the response result Change from busy to free.
优选地,第一执行模块506按照设定规则持续判断连接池中是否存在与数据库装置之间的空闲连接时:当判断拦截到数据库装置返回的响应结果时,则确定连接池中存在与数据库装置之间的空闲连接。Preferably, when the first execution module 506 continues to judge whether there is an idle connection with the database device in the connection pool according to the set rules: when it is judged that the response result returned by the database device is intercepted, then it is determined that there is between idle connections.
优选地,第一执行模块506按照设定规则持续判断连接池中是否存在与数据库装置之间的空闲连接时:按照设定时间间隔判断连接池中是否存在与数据库装置之间的空闲连接;或者,实时判断连接池中是否存在与数据库装置之间的空闲连接。Preferably, when the first execution module 506 continues to judge whether there is an idle connection with the database device in the connection pool according to the set rules: judge whether there is an idle connection with the database device in the connection pool at a set time interval; or , judging in real time whether there is an idle connection with the database device in the connection pool.
优选地,第一执行模块506保存业务请求时,将业务请求存放入待处理队列;或者,将业务请求存放入预设的缓存。Preferably, when storing the service request, the first execution module 506 stores the service request in a queue to be processed; or stores the service request in a preset cache.
优选地,发送模块508使用选择的空闲连接将业务请求发送至数据库装置时:当业务请求存放于待处理队列时,从待处理队列中依次取出业务请求,并为取出的业务请求分配空闲连接,使用分配的空闲连接将业务请求发送至数据库装置;当业务请求存放于预设的缓存时,根据业务请求的优先级依次取出业务请求,并为取出的业务请求分配空闲连接,使用分配的空闲连接将业务请求发送至数据库装置。Preferably, when the sending module 508 uses the selected idle connection to send the service request to the database device: when the service request is stored in the queue to be processed, the service request is sequentially taken out from the queue to be processed, and an idle connection is allocated for the taken out service request, Use the allocated idle connection to send the service request to the database device; when the service request is stored in the preset cache, take out the service request in sequence according to the priority of the service request, and allocate an idle connection for the taken out service request, and use the allocated idle connection Send the service request to the database device.
优选地,本实施例的业务请求处理装置应用于非分布式数据库系统。Preferably, the service request processing apparatus of this embodiment is applied to a non-distributed database system.
优选地,本实施例的业务请求处理装置应用于关系型数据库系统。Preferably, the service request processing apparatus of this embodiment is applied to a relational database system.
优选地,本实施例的业务请求处理装置为中间件装置,该中间件装置设置于应用装置和数据库之间,中间件装置中设置有自身的连接池,中间件在拦截到应用装置向数据库装置发送的业务请求时,判断中间件装置自身的连接池中是否存在中间件与数据库装置之间的空闲连接;当判断出存在中间件与数据库装置之间的空闲连接时,选择一个空闲连接,并使用选择的空闲连接将业务请求发送至所述数据库。当判断出不存在中间件与数据库装置之间的空闲连接时,则保存拦截到的业务请求,并按照设定规则持续判断自身的连接池中是否存在中间件与数据库装置之间的空闲连接,直至连接池中出现空闲连接,选择出现的空闲连接,并使用选择的空闲连接将业务请求发送至数据库装置。Preferably, the service request processing device of this embodiment is a middleware device, which is arranged between the application device and the database, and the middleware device is provided with its own connection pool, and the middleware intercepts the application device to the database device When sending a service request, judge whether there is an idle connection between the middleware and the database device in the connection pool of the middleware device itself; when judging that there is an idle connection between the middleware and the database device, select an idle connection, and A service request is sent to the database using the selected idle connection. When it is judged that there is no idle connection between the middleware and the database device, then save the intercepted service request, and continue to judge whether there is an idle connection between the middleware and the database device in its own connection pool according to the set rules, Until an idle connection appears in the connection pool, select the idle connection that appears, and use the selected idle connection to send the service request to the database device.
本实施例的业务请求处理装置用于实现前述实施例一、实施例二以及实施例三中相应的业务请求处理的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The service request processing apparatus in this embodiment is used to implement the corresponding service request processing methods in the first embodiment, the second embodiment and the third embodiment, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
在此提供的业务请求处理方案不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造具有本发明方案的系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The service request processing solution provided here is not inherently related to any specific computer, virtual system or other equipment. Various generic systems can also be used with the teachings based on this. The structure required to construct a system having the solution of the present invention is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的业务请求处理方案中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the service request processing solution according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”或“包括”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" or "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
本发明实施例公开了A1、一种业务请求处理方法,包括:The embodiment of the present invention discloses A1, a service request processing method, including:
拦截应用向数据库发送的业务请求;Intercept the business request sent by the application to the database;
判断连接池中是否存在与所述数据库的空闲连接;Judging whether there is an idle connection with the database in the connection pool;
若不存在,则保存所述业务请求,并按照设定规则持续判断所述连接池中是否存在所述与所述数据库的空闲连接,直至所述连接池中出现所述空闲连接;If it does not exist, then save the service request, and continue to judge whether there is the idle connection with the database in the connection pool according to the set rules until the idle connection appears in the connection pool;
选择出现的所述空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库。Select the idle connection that appears, and use the selected idle connection to send the service request to the database.
A2、根据A1所述的方法,其中,所述方法还包括:A2. The method according to A1, wherein the method also includes:
若连接池中存在与所述数据库的空闲连接,则选择一个空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库。If there is an idle connection to the database in the connection pool, select an idle connection, and use the selected idle connection to send the service request to the database.
A3、根据A1所述的方法,其中,所述方法还包括:A3. The method according to A1, wherein the method also includes:
拦截所述数据库通过选择的所述空闲连接向所述应用返回的、对所述业务请求的响应结果,并将拦截到的所述响应结果发送至所述发送业务请求的应用。Intercepting the response result to the service request returned by the database to the application through the selected idle connection, and sending the intercepted response result to the application sending the service request.
A4、根据A1所述的方法,其中,在所述拦截应用向数据库发送的业务请求的步骤之前,所述方法还包括:A4. The method according to A1, wherein, before the step of intercepting the service request sent by the application to the database, the method further includes:
根据所述数据库可支持的连接的信息,生成所述连接池,其中,所述连接池用于管理所述数据库可支持的连接。The connection pool is generated according to the information of the connections supported by the database, wherein the connection pool is used to manage the connections supported by the database.
A5、根据A1所述的方法,其中,所述拦截应用向数据库发送的业务请求包括:A5. The method according to A1, wherein the interception of the service request sent by the application to the database includes:
拦截所述应用向所述数据库发送的业务请求,并向所述应用返回所述业务请求被接受的消息。Intercepting the service request sent by the application to the database, and returning a message that the service request is accepted to the application.
A6、根据A1所述的方法,其中,所述判断连接池中是否存在与所述数据库之间的空闲连接的步骤包括:A6. The method according to A1, wherein the step of judging whether there is an idle connection with the database in the connection pool includes:
根据连接池中各连接的连接状态,判断连接池中是否存在与所述数据库之间的空闲连接;According to the connection state of each connection in the connection pool, it is judged whether there is an idle connection with the database in the connection pool;
当存在连接状态为空闲的连接时,确定连接池中存在与所述数据库之间的空闲连接;当所有连接的状态均为忙碌时,确定连接池中不存在与所述数据库之间的空闲连接。When there is a connection whose connection state is idle, it is determined that there is an idle connection with the database in the connection pool; when all the connections are busy, it is determined that there is no idle connection with the database in the connection pool .
A7、根据A6所述的方法,其中,所述使用选择的所述空闲连接将所述业务请求发送至所述数据库的步骤包括:A7. The method according to A6, wherein the step of sending the service request to the database using the selected idle connection includes:
将选择的所述空闲连接的连接状态从空闲更改为忙碌,并使用选择的所述空闲连接向所述数据库发送所述业务请求。changing the connection state of the selected idle connection from idle to busy, and using the selected idle connection to send the service request to the database.
A8、根据A3所述的方法,其中,在所述拦截所述数据库通过选择的所述空闲连接向所述应用返回的、对所述业务请求的响应结果步骤之后,所述方法还包括:A8. The method according to A3, wherein, after the step of intercepting the response result of the service request returned by the database to the application through the selected idle connection, the method further includes:
根据拦截到的所述响应结果,将返回所述响应结果的连接的连接状态从忙碌更改为空闲。According to the intercepted response result, change the connection state of the connection returning the response result from busy to idle.
A9、根据A8所述的方法,其中,所述按照设定规则持续判断所述连接池中是否存在与所述数据库之间的空闲连接的步骤包括:A9. The method according to A8, wherein the step of continuously judging whether there is an idle connection with the database in the connection pool according to the set rules includes:
当判断拦截到所述数据库返回的响应结果时,则确定所述连接池中存在与所述数据库之间的空闲连接。When it is judged that the response result returned by the database is intercepted, it is determined that there is an idle connection with the database in the connection pool.
A10、根据A8所述的方法,其中,所述按照设定规则持续判断所述连接池中是否存在与所述数据库之间的空闲连接的步骤包括:A10. The method according to A8, wherein the step of continuously judging whether there is an idle connection with the database in the connection pool according to the set rules includes:
按照设定时间间隔判断所述连接池中是否存在与所述数据库之间的空闲连接;judging whether there is an idle connection with the database in the connection pool according to a set time interval;
或者,or,
实时判断所述连接池中是否存在与所述数据库之间的空闲连接。It is judged in real time whether there is an idle connection with the database in the connection pool.
A11、根据A2所述的方法,其中,所述保存所述业务请求的步骤包括:A11. The method according to A2, wherein the step of saving the service request includes:
将所述业务请求存放入待处理队列;或者,将所述业务请求存放入预设的缓存。storing the service request in a waiting queue; or storing the service request in a preset cache.
A12、根据A11所述的方法,其中,所述使用选择的所述空闲连接将所述业务请求发送至所述数据库的步骤,包括:A12. The method according to A11, wherein the step of using the selected idle connection to send the service request to the database includes:
当所述业务请求存放于待处理队列时,从所述待处理队列中依次取出业务请求,并为取出的所述业务请求分配空闲连接,使用分配的所述空闲连接将所述业务请求发送至所述数据库;When the business request is stored in the queue to be processed, the business request is sequentially taken out from the queue to be processed, and an idle connection is allocated for the taken out business request, and the service request is sent to said database;
当所述业务请求存放于预设的缓存时,根据所述业务请求的优先级依次取出所述业务请求,并为取出的所述业务请求分配空闲连接,使用分配的所述空闲连接将所述业务请求发送至所述数据库。When the service requests are stored in the preset cache, the service requests are sequentially taken out according to the priority of the service requests, and idle connections are allocated for the taken out service requests, and the allocated idle connections are used to connect the Service requests are sent to the database.
A13、根据A1所述的方法,其中,所述业务请求处理方法应用于非分布式数据库系统。A13. The method according to A1, wherein the service request processing method is applied to a non-distributed database system.
A14、根据A1或A13所述的方法,其中,所述业务请求处理方法应用于关系型数据库系统。A14. The method according to A1 or A13, wherein the service request processing method is applied to a relational database system.
本发明实施例还公开了B15、一种业务请求处理装置,所述业务请求处理装置包括:The embodiment of the present invention also discloses B15, a service request processing device, the service request processing device includes:
第一拦截模块,用于拦截应用装置向数据库装置发送的业务请求;The first interception module is used to intercept the service request sent by the application device to the database device;
判断模块,用于判断连接池中是否存在与数据库装置之间的空闲连接;A judging module, configured to judge whether there is an idle connection with the database device in the connection pool;
第一执行模块,用于若所述判断模块的判断结果为不存在空闲连接时,则保存所述业务请求,并按照设定规则持续判断所述连接池中是否存在所述与所述数据库装置之间的空闲连接,直至所述连接池中出现所述空闲连接;The first execution module is configured to save the service request if the judging result of the judging module is that there is no idle connection, and continue judging whether the connection pool with the database device exists in the connection pool according to the set rules between idle connections until the idle connection appears in the connection pool;
发送模块,用于选择出现的所述空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库装置。A sending module, configured to select the idle connection that appears, and use the selected idle connection to send the service request to the database device.
B16、根据B15所述的业务请求处理装置,其中,所述装置还包括:B16. The service request processing device according to B15, wherein the device also includes:
第二执行模块,用于若所述判断模块的判断结果为连接池中存在与所述数据库的空闲连接时,则选择一个空闲连接,并使用选择的所述空闲连接将所述业务请求发送至所述数据库。The second execution module is configured to select an idle connection if the judging result of the judging module is that there is an idle connection with the database in the connection pool, and send the service request to the database.
B17、根据B15所述的业务请求处理装置,其中,所述装置还包括:B17. The service request processing device according to B15, wherein the device also includes:
第二拦截模块,用于拦截所述数据库装置通过选择的所述空闲连接向所述应用装置返回的、对所述业务请求的响应结果,并将拦截到的所述响应结果发送至所述发送业务请求的应用装置。The second interception module is configured to intercept the response result to the service request returned by the database device to the application device through the selected idle connection, and send the intercepted response result to the sending The application device of the service request.
B18、根据B15所述的业务请求处理装置,其中,所述装置还包括:B18. The service request processing device according to B15, wherein the device also includes:
连接池生成模块,用于在所述第一拦截模块拦截应用装置向数据库装置发送的业务请求之前,根据所述数据库装置可支持的连接的信息,生成所述连接池,其中,所述连接池用于管理所述数据库装置可支持的连接。A connection pool generation module, configured to generate the connection pool according to the information of the connections supported by the database device before the first interception module intercepts the service request sent by the application device to the database device, wherein the connection pool Used to manage the connections supported by the database appliance.
B19、根据B15所述的业务请求息处理装置,其中,所述第一拦截模块,用于拦截所述应用装置向所述数据库装置发送的业务请求,并向所述应用装置返回所述业务请求被接受的消息。B19. The service request information processing device according to B15, wherein the first interception module is configured to intercept the service request sent by the application device to the database device, and return the service request to the application device accepted message.
B20、根据B15所述的业务请求处理装置,其中,所述判断模块包括:B20. The service request processing device according to B15, wherein the judging module includes:
状态判断模块,用于根据所述连接池中各连接的连接状态,判断连接池中是否存在与所述数据库装置之间的空闲连接;A status judging module, configured to judge whether there is an idle connection with the database device in the connection pool according to the connection status of each connection in the connection pool;
确定模块,用于当所述状态判断模块的判断结果为存在连接状态为空闲的连接时,确定所述连接池中存在与所述数据库装置之间的空闲连接;当所述状态判断模块的判断结果为所有连接的状态均为忙碌时,确定连接池中不存在与所述数据库装置之间的空闲连接。A determination module, configured to determine that there is an idle connection with the database device in the connection pool when the judgment result of the state judgment module is that there is a connection whose connection state is idle; when the judgment of the state judgment module As a result, when the status of all connections is busy, it is determined that there is no idle connection with the database device in the connection pool.
B21、根据B20所述的业务请求处理装置,其中,所述发送模块,用于将选择的所述空闲连接的连接状态从空闲更改为忙碌,并使用选择的所述空闲连接向所述数据库装置发送所述业务请求;B21. The service request processing device according to B20, wherein the sending module is configured to change the connection status of the selected idle connection from idle to busy, and send the selected idle connection to the database device Send the service request;
B22、根据B18所述的业务请求处理装置,所述业务信息处理装置还包括:B22. According to the service request processing device described in B18, the service information processing device also includes:
连接状态更改模块,用于在所述第二拦截模块拦截所述数据库装置通过选择的所述空闲连接向所述应用装置返回的、对所述业务请求的响应结果之后,根据拦截到的所述响应结果,将返回所述响应结果的连接的连接状态从忙碌更改为空闲。The connection state changing module is configured to, after the second intercepting module intercepts the response result to the service request returned by the database device to the application device through the selected idle connection, according to the intercepted A response result that changes the connection status of the connection that returned the response result from busy to idle.
B23、根据B22所述的业务请求处理装置,其中,所述执行模块按照设定规则持续判断所述连接池中是否存在与所述数据库装置之间的空闲连接时:B23. The service request processing device according to B22, wherein, when the execution module continues to judge whether there is an idle connection with the database device in the connection pool according to the set rules:
当判断拦截到所述数据库装置返回的响应结果时,则确定所述连接池中存在与所述数据库装置之间的空闲连接。When it is judged that the response result returned by the database device is intercepted, it is determined that there is an idle connection with the database device in the connection pool.
B24、根据B22所述的业务请求处理装置,其中,所述执行模块按照设定规则持续判断所述连接池中是否存在与所述数据库装置之间的空闲连接时:B24. The service request processing device according to B22, wherein, when the execution module continues to judge whether there is an idle connection with the database device in the connection pool according to the set rules:
按照设定时间间隔判断所述连接池中是否存在与所述数据库装置之间的空闲连接;judging whether there is an idle connection with the database device in the connection pool according to a set time interval;
或者,or,
实时判断所述连接池中是否存在与所述数据库装置之间的空闲连接。It is judged in real time whether there is an idle connection with the database device in the connection pool.
B25、根据B16所述的业务请求处理装置,其中,所述第一执行模块保存所述业务请求时,将所述业务请求存放入待处理队列;或者,将所述业务请求存放入预设的缓存。B25. The service request processing device according to B16, wherein, when the first execution module saves the service request, it stores the service request in a queue to be processed; or, stores the service request in a preset cache.
B26、根据B25所述的业务请求处理装置,其中,所述发送模块使用选择的所述空闲连接将所述业务请求发送至所述数据库装置时:B26. The service request processing device according to B25, wherein when the sending module uses the selected idle connection to send the service request to the database device:
当所述业务请求存放于待处理队列时,从所述待处理队列中依次取出业务请求,并为取出的所述业务请求分配空闲连接,使用分配的所述空闲连接将所述业务请求发送至所述数据库装置;When the business request is stored in the queue to be processed, the business request is sequentially taken out from the queue to be processed, and an idle connection is allocated for the taken out business request, and the service request is sent to said database means;
当所述业务请求存放于预设的缓存时,根据所述业务请求的优先级依次取出所述业务请求,并为取出的所述业务请求分配空闲连接,使用分配的所述空闲连接将所述业务请求发送至所述数据库装置。When the service requests are stored in the preset cache, the service requests are sequentially taken out according to the priority of the service requests, and idle connections are allocated for the taken out service requests, and the allocated idle connections are used to connect the A service request is sent to the database device.
B27、根据B15所述的业务请求处理装置,其中,所述业务信息处理装置应用于非分布式数据库系统。B27. The service request processing device according to B15, wherein the service information processing device is applied to a non-distributed database system.
B28、根据B15或B27所述的业务请求处理装置,其中,所述业务信息处理装置应用于关系型数据库系统。B28. The service request processing device according to B15 or B27, wherein the service information processing device is applied to a relational database system.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410854779.3A CN104572974B (en) | 2014-12-31 | 2014-12-31 | service request processing method and device |
PCT/CN2015/095545 WO2016107340A1 (en) | 2014-12-31 | 2015-11-25 | Service request processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410854779.3A CN104572974B (en) | 2014-12-31 | 2014-12-31 | service request processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104572974A true CN104572974A (en) | 2015-04-29 |
CN104572974B CN104572974B (en) | 2018-10-12 |
Family
ID=53089036
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410854779.3A Expired - Fee Related CN104572974B (en) | 2014-12-31 | 2014-12-31 | service request processing method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104572974B (en) |
WO (1) | WO2016107340A1 (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016107340A1 (en) * | 2014-12-31 | 2016-07-07 | 北京奇虎科技有限公司 | Service request processing method and device |
CN106021313A (en) * | 2016-05-05 | 2016-10-12 | 北京元心科技有限公司 | Method and system for preventing repeated issue of command |
CN106257456A (en) * | 2016-07-08 | 2016-12-28 | 北京京东尚科信息技术有限公司 | The method of data base's stability, Apparatus and system is improved under high concurrent request |
CN106302421A (en) * | 2016-08-08 | 2017-01-04 | 腾讯科技(深圳)有限公司 | A kind of information intercepting processing method and device |
CN106341447A (en) * | 2016-08-12 | 2017-01-18 | 中国南方电网有限责任公司 | Database service intelligent exchange method based on mobile terminal |
CN108259559A (en) * | 2017-12-06 | 2018-07-06 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of more session data transmission realizing methods based on udp protocol |
CN109800067A (en) * | 2018-12-15 | 2019-05-24 | 中国平安人寿保险股份有限公司 | Database connection optimization method, device and relevant device based on cloud monitoring |
CN106021313B (en) * | 2016-05-05 | 2019-07-16 | 北京元心科技有限公司 | A kind of method and system for preventing instruction from repeating to issue |
CN112732441A (en) * | 2021-01-07 | 2021-04-30 | 山东众阳健康科技集团有限公司 | Connection method, device and system of multi-element dynamic connection pool |
CN113126882A (en) * | 2019-12-30 | 2021-07-16 | 深圳市中兴微电子技术有限公司 | Data processing method and device, storage medium and electronic device |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112532403B (en) * | 2019-09-17 | 2023-08-08 | 中盈优创资讯科技有限公司 | Network element adaptation driving service device, network element adaptation method and system |
CN111078372B (en) * | 2019-12-20 | 2023-08-08 | 北京思特奇信息技术股份有限公司 | Automatic process management method and system |
CN112612834B (en) * | 2020-12-23 | 2022-08-02 | 瀚高基础软件股份有限公司 | Database middleware and method for realizing connection between client and server |
CN112954076B (en) * | 2021-03-31 | 2023-04-07 | 沃科合众科技(北京)股份有限公司 | Data acquisition method |
CN113434479A (en) * | 2021-06-07 | 2021-09-24 | 北京许继电气有限公司 | Method and system for realizing autonomous controllable database connection pool |
CN114500628A (en) * | 2021-12-30 | 2022-05-13 | 天翼云科技有限公司 | Connection selection method and device |
CN115801886B (en) * | 2022-11-16 | 2024-09-10 | 浪潮通用软件有限公司 | Middleware connection system and method for shielding middleware differences |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070136311A1 (en) * | 2005-11-29 | 2007-06-14 | Ebay Inc. | Method and system for reducing connections to a database |
CN103605571A (en) * | 2013-11-20 | 2014-02-26 | 国家电网公司 | Control method of database connection pool |
CN103729373A (en) * | 2012-10-15 | 2014-04-16 | 北京新媒传信科技有限公司 | Database agency method and device |
CN104063451A (en) * | 2014-06-23 | 2014-09-24 | 北京京东尚科信息技术有限公司 | Database connection management method and system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9268798B2 (en) * | 2013-04-26 | 2016-02-23 | Oracle International Corporation | Support for cloud-based multi-tenant environments using connection labeling |
CN104239365B (en) * | 2013-06-24 | 2018-09-04 | 北京新媒传信科技有限公司 | A kind of method and database connection pool connected in acquisition database connection pool |
CN104572974B (en) * | 2014-12-31 | 2018-10-12 | 北京奇虎科技有限公司 | service request processing method and device |
-
2014
- 2014-12-31 CN CN201410854779.3A patent/CN104572974B/en not_active Expired - Fee Related
-
2015
- 2015-11-25 WO PCT/CN2015/095545 patent/WO2016107340A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070136311A1 (en) * | 2005-11-29 | 2007-06-14 | Ebay Inc. | Method and system for reducing connections to a database |
CN103729373A (en) * | 2012-10-15 | 2014-04-16 | 北京新媒传信科技有限公司 | Database agency method and device |
CN103605571A (en) * | 2013-11-20 | 2014-02-26 | 国家电网公司 | Control method of database connection pool |
CN104063451A (en) * | 2014-06-23 | 2014-09-24 | 北京京东尚科信息技术有限公司 | Database connection management method and system |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016107340A1 (en) * | 2014-12-31 | 2016-07-07 | 北京奇虎科技有限公司 | Service request processing method and device |
CN106021313A (en) * | 2016-05-05 | 2016-10-12 | 北京元心科技有限公司 | Method and system for preventing repeated issue of command |
CN106021313B (en) * | 2016-05-05 | 2019-07-16 | 北京元心科技有限公司 | A kind of method and system for preventing instruction from repeating to issue |
CN106257456A (en) * | 2016-07-08 | 2016-12-28 | 北京京东尚科信息技术有限公司 | The method of data base's stability, Apparatus and system is improved under high concurrent request |
CN106302421A (en) * | 2016-08-08 | 2017-01-04 | 腾讯科技(深圳)有限公司 | A kind of information intercepting processing method and device |
CN106302421B (en) * | 2016-08-08 | 2019-07-16 | 腾讯科技(深圳)有限公司 | A kind of information intercepting processing method and device |
CN106341447A (en) * | 2016-08-12 | 2017-01-18 | 中国南方电网有限责任公司 | Database service intelligent exchange method based on mobile terminal |
CN108259559A (en) * | 2017-12-06 | 2018-07-06 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of more session data transmission realizing methods based on udp protocol |
CN109800067A (en) * | 2018-12-15 | 2019-05-24 | 中国平安人寿保险股份有限公司 | Database connection optimization method, device and relevant device based on cloud monitoring |
CN113126882A (en) * | 2019-12-30 | 2021-07-16 | 深圳市中兴微电子技术有限公司 | Data processing method and device, storage medium and electronic device |
CN112732441A (en) * | 2021-01-07 | 2021-04-30 | 山东众阳健康科技集团有限公司 | Connection method, device and system of multi-element dynamic connection pool |
Also Published As
Publication number | Publication date |
---|---|
WO2016107340A1 (en) | 2016-07-07 |
CN104572974B (en) | 2018-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104572974B (en) | service request processing method and device | |
US9336168B2 (en) | Enhanced I/O performance in a multi-processor system via interrupt affinity schemes | |
CN104539713B (en) | service request processing method and device | |
US7953915B2 (en) | Interrupt dispatching method in multi-core environment and multi-core processor | |
WO2019128535A1 (en) | Message management method and device, and storage medium | |
CN108959549A (en) | Method for writing data, calculates equipment and computer storage medium at device | |
US9021138B2 (en) | Performance of multi-processor computer systems | |
CN103207785B (en) | The processing method of data download request, Apparatus and system | |
CN109729106A (en) | Handle the method, system and computer program product of calculating task | |
CN109408243B (en) | A kind of data processing method, device and medium based on RDMA | |
KR102086019B1 (en) | System and method for providing low latency to applications using heterogeneous processors | |
CN105447092A (en) | Caching method and apparatus | |
CN114579285B (en) | Task running system and method and computing device | |
CN106325996A (en) | GPU resource distribution method and system | |
CN110908797B (en) | Call request data processing method, device, equipment, storage medium and system | |
CN106649640A (en) | Instant search method and device | |
CN106325995B (en) | A method and system for allocating GPU resources | |
CN111385255B (en) | Asynchronous call implementation method, device, server and server cluster | |
CN109002364A (en) | Optimization method, electronic device and the readable storage medium storing program for executing of interprocess communication | |
CN107294911B (en) | A data packet monitoring method and device, a remote procedure call system, and a device | |
CN105373563B (en) | Database switching method and device | |
CN103634298A (en) | A database connection processing method and device | |
CN111352710B (en) | Process management method and device, computing device, storage medium | |
CN104504331A (en) | Virtualization security detection method and system | |
CN103942103A (en) | Method and device for generating processor scheduling policy in multi-core system and scheduling system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20181012 Termination date: 20181231 |