CN105550065A - Database server communication management method and device - Google Patents

Database server communication management method and device Download PDF

Info

Publication number
CN105550065A
CN105550065A CN 201510916191 CN201510916191A CN105550065A CN 105550065 A CN105550065 A CN 105550065A CN 201510916191 CN201510916191 CN 201510916191 CN 201510916191 A CN201510916191 A CN 201510916191A CN 105550065 A CN105550065 A CN 105550065A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
server
database server
database
application
communication
Prior art date
Application number
CN 201510916191
Other languages
Chinese (zh)
Inventor
陈帅
莫孝舟
Original Assignee
广州华多网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/142Reconfiguring to eliminate the error
    • G06F11/1428Reconfiguring to eliminate the error with loss of hardware functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1443Transmit or communication errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30286Information retrieval; Database structures therefor ; File system structures therefor in structured data stores
    • G06F17/30575Replication, distribution or synchronisation of data between databases or within a distributed database; Distributed database system architectures therefor

Abstract

The invention discloses a database server communication management method, and belongs to the technical field of computers. The database server communication management method is applied to a database system, the database system comprises at least one application server and multiple database servers, and each application server respectively creates data connection with each database server and respectively stores self switching conditions for switching the database servers. The database server communication management method comprises the steps: a first application server counts communication failure events in a process of performing data communication with a first database server when the first database server is recorded as an execution database server; when the communication failure times meets a first switching condition stored in the first application server, the first application server switches the execution database server from the first database server to a second database server. By adopting the database server communication management method and device, the timeliness of obtaining network business data by the user can be guaranteed.

Description

一种进行数据库服务器通信管理的方法和装置 A method and apparatus is communication management server database

技术领域 FIELD

[0001]本发明涉及计算机技术领域,特别涉及一种进行数据库服务器通信管理的方法和 [0001] The present invention relates to computer technology, and particularly relates to a method for traffic management and database server

目.0 Head .0

背景技术 Background technique

[0002]随着网络技术的飞速发展,网络已遍及社会的各个角落,越来越多的网络应用程序得到了开发和使用。 [0002] With the rapid development of network technology, network throughout every corner of society, more and more network applications have been developed and used.

[0003]在网络侧,数据库服务器中存储有大量的网络业务数据,如网络视频数据、网络音频数据等。 [0003] On the network side, the database server stores a large amount of network traffic data, such as network video data, audio data, etc. network. 当用户需要获取某网络业务数据时,可以通过网络应用程序访问对应的应用服务器,进而从连接的数据库服务器中调取相关的网络业务数据。 When the user needs to obtain a network traffic data, the corresponding application can be accessed via a network application server, in turn related to the transfer of network traffic data from the database server connection.

[0004]在实现本发明的过程中,发明人发现现有技术至少存在以下问题: [0004] During the implementation of the present invention, the inventors found that the prior art has at least the following problems:

[0005]当用户需要获取某网络业务数据时,如果应用服务器连接的数据库服务器出现故障,则无法及时向用户发送相应的网络业务数据,用户需要等待数据库服务器恢复正常才能获取到网络业务数据,从而降低了用户获取网络业务数据的及时性。 [0005] When the user needs to obtain a certain network traffic data, if the database server application server connection fails, you can not timely send the corresponding network traffic data to the user, the user needs to wait for the database server to return to normal in order to get into the network business data reducing the user access to network traffic data timeliness.

发明内容 SUMMARY

[0006]为了解决现有技术的问题,本发明实施例提供了一种进行数据库服务器通信管理的方法和装置。 [0006] In order to solve the problems of the prior art, embodiments of the present invention provides a method and apparatus for performing traffic management database server. 所述技术方案如下: The technical solutions are as follows:

[0007]根据本公开实施例的第一方面,提供了一种进行数据库服务器通信管理的方法,所述方法应用于数据库系统,所述数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件,所述方法包括: [0007] According to a first aspect of the disclosed embodiment of the present embodiment, there is provided a method of communication management server database, the method is applied to a database system, said database system comprising at least a plurality of application servers and database servers, each application servers are established a data connection with the server to each database, each application server separately stores the respective switching condition for switching the database server, the method comprising:

[0008]第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计; [0008] The first application server in the first state is recorded as the database server performs the database server, the process of data communication with the first database server, the communication failure event statistics;

[0009]当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0009] When the number of times the first communication fails to meet a first switching condition stored in the application server, the first application server will perform a database server over from the first to the second database server database server.

[0010]可选的,所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0010] Alternatively, when the number of times when the communication failure of the first handover condition is satisfied stored first application server, the first application server will perform a database server is switched to the second server from the first database database server, including:

[0011]当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0011] When the number of communication failures reaches a first threshold value of the number stored when the first server application, the first application server will perform a database server database is switched from a first server to a second database server.

[0012]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0012] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0013]当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0013] When the number of consecutive communication failures reaches the first application server stores a first threshold number, the first application server will perform a database server database is switched from a first server to a second database server.

[0014]这样,当通信连续失败则可以认为当前数据库服务器出现了故障,需要切换。 [0014] Thus, when the communication failure may be considered continuous current database server fails, the need to switch.

[0015]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0015] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0016]当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0016] When the preset number of times within the length of a first communication failure times reaches the threshold value stored when the first server application, the first application server will perform a database server to switch from the first database to a second database server server .

[0017]这样,当一段时间内出现多次通信失败则可以认为当前数据库服务器出现了故障,需要切换。 [0017] Thus, many communication failures occur when a period of time that the current may be a database server failure, the need to switch.

[0018]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0018] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0019]当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0019] When a first threshold number of times within a predetermined period in a communication failure reaches the first server application stored, the first application server will perform a database server to switch from the first database to a second database server server .

[0020]这样,当一个周期内出现多次失败则可以认为当前数据库服务器出现了故障,需要切换。 [0020] In this way, many failures occur within a period when it is considered that the current database server fails, the need to switch.

[0021 ]可选的,所述第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计之前,所述方法还包括:第一应用服务器将第一数据库服务器记录为执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为备用数据库服务器; Before [0021] Optionally, the first application server in a record state of the first database server to perform the database server, data communication process with the first database server, the communication failure event statistics, the said method further comprising: a first server application to perform a first database server records database server, database server other than the first record of the database server standby database server;

[0022]所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器在备用数据库服务器中选取第二数据库服务器,将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0022] The number of times when the communication failed to meet the first switching condition of the first server application stored, the first application server will perform a database server to switch from a first to a second database server database server, comprising : when the number of times the first communication fails to meet a first switching condition stored in the application server, the first application server database server selecting a second standby database server, the database server performs the switch from the first database server a second database server.

[0023]这样,对数据库服务器进行记录,便于应用服务器进行数据库服务器切换。 [0023] Thus, the recording to the database server, application server database server to facilitate handover.

[0024]可选的,在所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器之后,所述方法还包括: [0024] Alternatively, after the first application server will perform a database server to switch from a first to a second database server database server, the method further comprising:

[0025]第一应用服务器将所述第一数据库服务器记录为故障数据库服务器。 [0025] the application server, the first server records the first database for the failed database server.

[0026]这样,可以避免应用服务器再次切换至出现故障的数据库服务器。 [0026] Thus, to avoid the application server again switched to the database server fails.

[0027]可选的,所述方法还包括: [0027] Optionally, the method further comprising:

[0028]第一应用服务器在接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为备用数据库服务器。 [0028] In the first application server after receiving the first failure of the repair message database server, database server records the first standby database server.

[0029]这样,当故障数据库服务器恢复正常后,可以及时投入使用。 [0029] Thus, when the database server failure back to normal, can be put to use in a timely manner.

[0030]根据本公开实施例的第二方面,提供了一种进行数据库服务器通信管理的装置,所述装置应用于数据库系统,所述数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件,所述装置包括: [0030] According to a second aspect of the disclosed embodiment of the present embodiment, there is provided an apparatus for performing communication management server database, the apparatus is applied to a database system, said database system comprising at least a plurality of application servers and database servers, each application servers are established a data connection with the server to each database, each application server separately stores the respective switching condition for switching the database server, the apparatus comprising:

[0031 ]统计模块,用于在第一应用服务器将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计; [0031] Statistics module configured to perform a database server in a state where the first database server to record a first application server, process data communication with the first database server, the communication failure event statistics;

[0032]切换模块,用于当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0032] The switching module for the communication when the number of failures to meet the first switching condition of the first server application stored, the execution of the first application server database server is switched to the second server from the first database the database server.

[0033]可选的,所述切换模块,用于: [0033] Alternatively, the switching module, configured to:

[0034]当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0034] When the number of communication failures reaches a first threshold value of the number stored when the first server application, the first application server database server performs handover from a first to a second database server database server.

[0035]可选的,所述切换模块,用于: [0035] Alternatively, the switching module, configured to:

[0036]当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0036] When the number of consecutive communication failures reaches a first threshold value of the number stored when the first server application, the first application server database server performs handover from a first to a second database server database server .

[0037]可选的,所述切换模块,用于: [0037] Alternatively, the switching module, configured to:

[0038]当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0038] When the preset number of times within the length of a first communication failure times reaches the threshold value stored when the first server application, the first application server database server performs handover from the first database to a second database server server.

[0039]可选的,所述切换模块,用于: [0039] Alternatively, the switching module, configured to:

[0040]当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0040] When a first threshold number of times within a predetermined period in a communication failure reaches the first server application stored, the execution of the first application server database server is switched from the first database to a second database server server.

[0041 ]可选的,所述装置还包括:第一记录模块,用于将第一数据库服务器记录为第一应用服务器的执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为第一应用服务器的备用数据库服务器; [0041] Optionally, the apparatus further comprising: a first recording module configured to record a first database server to execute a first application server database server, database server other than the first record in the database server for the first a standby application server database server;

[0042]所述切换模块,用于:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,在所述第一应用服务器的备用数据库服务器中选取第二数据库服务器,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0042] The switching module, configured to: when the number of the communication failure to meet the first switching condition stored in a first application server, database server selecting a second standby database server of the first server application , the first application server database server performs handover from a first to a second database server database server.

[0043] 可选的,所述装置还包括: [0043] Optionally, the apparatus further comprising:

[0044]第二记录模块,用于将所述第一数据库服务器记录为第一应用服务器的故障数据库服务器。 [0044] The second recording module, the first database server is configured to record the failed database server is a first server application.

[0045] 可选的,所述装置还包括: [0045] Optionally, the apparatus further comprising:

[0046]第三记录模块,用于在第一应用服务器接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为第一应用服务器的备用数据库服务器。 After the [0046] third recording means for receiving the first database server failure repair in a first message application server, database server records the first standby database server of the first server application.

[0047]本发明实施例提供的技术方案带来的有益效果是: [0047] Embodiments of the invention provide a technical solution is beneficial effects:

[0048]本发明实施例中,第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计,当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 Embodiment [0048] of the present invention, the first application server in the first database server to perform the database server records the status of the data communication process with the first database server, the communication failure event statistics, when the communication when the number of failures to meet a first switching condition of the first server application stored, first application server will perform a database server over from the first to the second database server database server. 这样,当第一应用服务器与第一数据库服务器的数据通信出现失败时,可以及时切换数据库服务器进行数据通信,不会产生因为数据库服务器出现故障而导致用户需要等待数据库服务器恢复才能获取网络业务数据的情况,从而保证了用户获取网络业务数据的及时性。 Thus, when a failure occurs first application server data communication with the first database server, the database server can be switched timely data communication, no because the database server fails and causes the user to wait for the database server in order to restore access to network traffic data situation, thus ensuring user access to network traffic data timeliness.

附图说明 BRIEF DESCRIPTION

[0049]为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。 [0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, as briefly described in the introduction to the accompanying drawings required for use in describing the embodiments. Apparently, the drawings in the following description are only some of the present invention. embodiments, those of ordinary skill in the art is concerned, without creative efforts, can derive from these drawings other drawings.

[0050]图1是本发明实施例提供的一种进行数据库服务器通信管理的方法流程图; [0050] FIG. 1 is a method of communication management database server according to an embodiment of the present invention, a flow chart;

[0051 ]图2是本发明实施例提供的一种数据库系统的框架图; [0051] FIG. 2 is a diagram of a frame according to the present invention, a database system according to an embodiment;

[0052]图3是本发明实施例提供的一种切换数据库服务器的示意图; [0052] FIG. 3 is a schematic diagram of a switching database server according to an embodiment of the present invention;

[0053]图4是本发明实施例提供的一种记录数据库服务器状态的示意图; [0053] FIG. 4 is a schematic diagram of a database server state record according to an embodiment of the present invention;

[0054]图5是本发明实施例提供的一种记录数据库服务器状态的示意图; [0054] FIG. 5 is a schematic diagram of a database server state record according to an embodiment of the present invention;

[0055]图6是本发明实施例提供的一种记录数据库服务器状态的示意图; [0055] FIG. 6 is a schematic diagram of a database server state record according to an embodiment of the present invention;

[0056]图7是本发明实施例提供的一种进行数据库服务器通信管理的装置结构图; [0056] FIG. 7 is a embodiment of the present invention provides an apparatus for performing the database configuration diagram of a communication management server;

[0057]图8是本发明实施例提供的一种进行数据库服务器通信管理的装置结构图; [0057] FIG. 8 is an embodiment of the present invention provides an apparatus for performing the database configuration diagram of a communication management server;

[0058]图9是本发明实施例提供的一种进行数据库服务器通信管理的装置结构图; [0058] FIG. 9 is an embodiment of the present invention provides an apparatus for performing the database configuration diagram of a communication management server;

[0059]图10是本发明实施例提供的一种进行数据库服务器通信管理的装置结构图; [0059] FIG. 10 is an embodiment of the present invention provides an apparatus for performing the database configuration diagram of a communication management server;

[0060]图11是本发明实施例提供的一种应用服务器的装置结构图。 [0060] FIG. 11 shows the structure of an application server according to an embodiment of the present invention.

具体实施方式 detailed description

[0061]为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。 [0061] To make the objectives, technical solutions, and advantages of the present invention will become apparent in conjunction with the accompanying drawings of the following embodiments of the present invention will be described in further detail.

[0062] 实施例一 [0062] Example a

[0063]本发明实施例提供了一种进行数据库服务器通信管理的方法,该方法可以应用于数据库系统中,如图2所示,数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件。 [0063] The embodiments of the present invention provides a method of communication management server database, the method may be applied to the database system, the database system comprising at least a plurality of application servers and database servers in FIG. 2, each application establishing a data connection with the server, respectively, each database server, application server, respectively, each stores a switching condition for switching each database server. 其中,应用服务器可以是终端上安装的网络应用程序对应的后台服务器,数据库服务器可以是用来存储网络应用程序产生的网络业务数据的服务器。 Wherein the application server may be installed on the terminal corresponding to the backend web application server, database server may be a server for storing network traffic data generated by web application. 应用服务器可以包括处理器、存储器、传输部件,处理器可以用于进行下述流程中的切换数据库服务器的处理,存储器可以用于存储下述处理过程中需要的数据以及产生的数据,传输部件可以用于进行数据库服务器通信管理过程中数据的接收与发送。 The application server may include a processor, memory, a transmission component, the processor may be used for the following processing flow switching database servers, data storage memory may be used for the following processing and generating data required, the transmission member may process for receiving and sending data in the database management server communication. 数据库服务器可以包括处理器、存储器、传输部件,处理器可以用于进行下述流程中的切换数据库服务器的处理,存储器可以用于存储下述处理过程中需要的数据以及产生的数据,传输部件可以用于进行数据库服务器通信管理过程中数据的接收与发送。 The database server may include a data processor, a memory, a transmission member, the processor may be used for the following processing flow switching database servers, data storage memory may be used in the following processing and generation of the required transmission member may process for receiving and sending data in the database management server communication.

[0064]下面将结合具体实施方式,对图1所示的处理流程进行详细的说明,内容可以如下: [0064] conjunction with the following specific embodiments, the flow of the processing shown in FIG 1 is described in detail, the content may be as follows:

[0065]步骤101,第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计。 [0065] Step 101, the first application server in the first state is recorded as a database server performs the database server, the process of data communication with the first database server, the communication failure event statistics.

[0066]在实施中,当用户在通过安装在终端上的网络应用程序进行网络业务时,会产生大量的网络业务数据,这些网络业务数据会通过网络发送到对应的应用服务器,即第一应用服务器,进而存储至相连的数据库服务器中,即第一数据库服务器。 [0066] In the embodiment, when the user through the network service application installed on a network terminal, a large amount of network traffic data, the network traffic data is sent to the corresponding application server through the network, i.e., a first application server, database server and further coupled to the memory, i.e., the first database server. 而第一应用服务器与多个数据库服务器建立数据连接,但同一时间只与一个数据库服务器进行数据通信,并记录该数据库服务器为执行数据库服务器。 And the first application server with a plurality of database servers to establish a data connection, but at the same time only in data communication with a database server, and recording the database server to perform the database server. 其中,每个数据库服务器内存储的数据是共享同步的,即可以认为第一数据库服务器在接收到应用服务器传输的数据后,会将数据传输给其它数据库服务器进行数据同步,这样,无论应用服务器与那个数据库服务器进行数据通信,都可以保证数据全面完整。 Wherein the data stored in each database server is shared synchronized, i.e., the first database server may be considered in the application server after receiving the data transmission, data is transmitted to the other database server for data sync, so that, regardless of the application server and the database server for data communications, data can be guaranteed full and complete. 此外,多个应用服务器可以共用同一个数据库服务器,即每个数据库服务器中可以存储多个应用服务器传输的数据,当某个应用服务器在对数据库服务器中的数据进行读写时,不会影响其它应用服务器与该数据库服务器的数据通信。 Further, the plurality of application servers can access the same database server, i.e. each database server may store a plurality of data transmitted by the server application, when an application server when the database server in the data read and write, without affecting the other data communications application server and the database server.

[0067]服务器侧的技术人员可以在应用服务器中输入数据库服务器的网络地址和接入端口,应用服务器则可以根据上述内容与每个数据库服务器创建数据连接,并可以默认与第一个可用的数据库服务器进行数据通信。 [0067] server side in the art can be entered in the database server and the network address of the application server access port, the server application may create a data connection with each of the above-described content database server, and the default may be the first available database server data communication. 第一应用服务器在与第一数据库服务器进行数据通信的过程中,可能会出现数据读写失败、数据库服务器无响应、数据格式错误等通信失败的事件,第一应用服务器则可以实时记录通信失败事件,对该类事件进行统计。 The first application server process data communication with the first database server may appear to read and write data fails, the database server does not respond, the data format errors communication failure event, the first application server can record events in real-time communication failure , the type of event statistics.

[0068]步骤102,当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0068] Step 102, when the number of communication failure to satisfy a first switching condition stored in the first application server, application server, a first database server will perform handover from a first to a second database server database server.

[0069]在实施中,为了保证应用程序的数据库系统的高可用性能,应用服务器与多个数据库服务器保持连接,并随时可以切换当前进行数据通信的数据库服务器至其它的数据库服务器。 [0069] In the embodiment, the performance of the database system in order to ensure availability of the application, application server and a plurality of databases connected to the server, and database server can always switch to the current data communication other database servers. 而每个应用服务器都存储有各自的用于切换数据库服务器的切换条件,如第一应用服务器的切换条件为只要出现I次通信失败事件就进行数据库服务器切换,第二应用服务器的切换条件为短时间内连续出现10次通信失败事件则进行数据库服务器切换。 And each application server stores a switching condition for switching each database server, such as the switching condition of the first application server is I secondary communication failure event as long as there will be a database server switching, the switching condition to the short second application server 10th consecutive time the communication failure event database server switching. 当第一应用服务器统计到的通信失败事件的次数满足存储的第一切换条件时,则可以将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,即停止与第一数据库服务器进行数据通信,开始与第二数据库服务器进行数据通信,如图3所示。 When the first frequency and a first switching condition to the application server statistics satisfy a communication failure event stored, the database server can perform handover from a first to a second database server database server, i.e. stops data communication with the first database server starts data communication with the second database server, as shown in FIG.

[0070]可选的,上述切换条件可以具体为通信失败次数达到预设次数阈值,相应的,步骤102的处理可以如下:当通信失败的次数达到第一应用服务器存储的第一次数阈值时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0070] Alternatively, the switching condition may be embodied reaches a preset threshold number of times a communication failure corresponding process step 102 may be as follows: when the number of communication failure times reaches a first threshold value stored in the first application server , a first application server database server performs handover from a first to a second database server database server.

[0071]在实施中,当第一应用服务器统计到的通信失败事件的次数达到第一应用服务器存储的第一次数阈值时,则可以将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,即停止与第一数据库服务器进行数据通信,开始与第二数据库服务器进行数据通信。 [0071] In the embodiment, when the number of the first application server to a communication failure statistics events reaches a first application server stores a first threshold number of times, the database server may be performed over from the first database to a second database server server stops data communication with the first database server starts data communication with the second database server.

[0072]可选的,对通信失败的次数的统计方式多种多样,如下给出了两种可行的方式: [0072] Alternatively, a variety of communication failure times of statistical methods, the following gives two possible ways:

[0073]方式一,当通信失败连续出现的次数达到第一应用服务器存储的第一次数阈值时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0073] one embodiment, when the number of consecutive communication failures reaches a first threshold number of times stored in the first server application, the first application server database server performs handover from a first to a second database server database server.

[0074]在实施中,第一应用服务器可以实时记录与第一数据库服务器进行数据通信的过程中,通信失败出现的具体情况。 Process [0074] In the embodiment, the first application server can be recorded in real time with the first database server in data communication, the specific situation of communication failure. 当出现一次通信失败后,第一应用服务器开始监测与第一数据库服务器的后续每一次通信,如果在之后的连续预设次数的数据通信均失败,即通信失败连续出现的次数已满足第一应用服务器存储的第一切换条件,进而第一应用服务器可以将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 When a communication failure occurs, a first application server starts monitoring communication with the subsequent first database server each time, if the data communication after a preset number of consecutive failures are, i.e., the number of consecutive communication failures have been met first application a first switching condition storage server, a first application server may in turn perform the database server database is switched from a first server to a second database server.

[0075]方式二,当在预设时长内通信失败的次数达到第一应用服务器存储的第一次数阈值时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0075] The second approach, when the number of times within a preset length of communication failures reaches a first application server stores a first threshold number, the first application server database server performs handover from a first to a second database server database server.

[0076]在实施中,在实施中,第一应用服务器可以实时记录与第一数据库服务器进行数据通信的过程中,通信失败出现的具体情况。 Process [0076] In the embodiment, in the embodiment, the first application server can be recorded in real time with the first database server in data communication, the specific situation of communication failure. 当出现一次通信失败时,第一应用服务器记录此次通信失败的时间,并在预设时长内监测与第一数据库服务器的通信发生通信失败的次数,如果在预设时长内通信失败的次数达到第一应用服务器存储的第一次数阈值,即通信失败连续出现的次数已满足第一应用服务器存储的第一切换条件,进而第一应用服务器可以将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 When a communication failure occurs, the first time the application server records this communication failures, communication failures and the number of communications monitoring and long in the first database server occurs when a preset number of times if the communication failure within a preset length reached a first threshold number stored in the first server application, i.e. the number of consecutive communication failures has met a first switching condition stored in the first application server, a first application server may be further performed by the database server is switched to the first database server two database servers.

[0077]方式三,当在预设周期内通信失败的次数达到第一应用服务器存储的第一次数阈值时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0077] The third approach, when the number reaches a first threshold value stored in the first application server within a predetermined number of cycles of the communication failure, the database server executes the first application server by a first database server switching to a second database server.

[0078]在实施中,第一应用服务器可以实时记录与第一数据库服务器进行数据通信的过程中,并周期性统计通信失败出现的次数。 [0078] In the embodiment, the first application server in real time for recording process of the first database server in data communication, and periodically count the number of occurrences of communication failures. 如果在预设周期内,统计次数达到预设阈值,可认为已满足第一应用服务器存储的第一切换条件,进而第一应用服务器可以将执行数据库服务器由第一数据库服务器切换为第二数据库服务器;如果在预设周期内,统计次数没有达到预设阈值,则通信失败出现的次数统计清O。 If within a predetermined period, count the number reaches a preset threshold, the switching condition is met that the first server stores a first application, the first application server may in turn perform the database server database is switched from a first server to a second server database ; if the number of times within a preset period, count the number does not reach a preset threshold, the communication failure occurred statistics clear O.

[0079]可选的,应用服务器可以对已创建连接的数据库进行标记,相应的处理可以如下:第一应用服务器将第一数据库服务器记录为执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为备用数据库服务器; [0079] Alternatively, the application server may be labeled already created a database connection, the corresponding process may be as follows: a first server application to perform a first database server records database server, database server, in addition to a first database standby server records to the database server;

[0080]相应的,步骤102的处理可以如下:当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器在备用数据库服务器中选取第二数据库服务器,将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0080] Accordingly, the process of step 102 may be as follows: when the first switching condition is stored in a first application server failed to meet the number of communications, a first application server, database server selecting a second standby database server, the server performs the database switching from a first to a second database server database server.

[0081]在实施中,在第一应用服务器与第一数据库服务器进行数据通信后,可以将第一数据库服务器记录为执行数据库服务器,表示第一数据库服务器为当前正在使用的数据库服务器,同时可以将除第一数据库服务器之外的其它已建立通信连接的数据库服务器记录为备用数据库服务器,表示这些数据库服务器为可切换的服务器。 [0081] In the embodiment, the data communication in a first application server and the first server database, the first database server to perform the database server records, showing a first database server for the database server currently in use, and can be other have established a communication connection database server other than the first record of the database server to the standby database server, database server represents the server can be switched.

[0082]当第一应用服务器统计到的通信失败事件的次数满足存储的第一切换条件时,则可以停止与第一数据库服务器进行数据通信,并在备用数据库服务器中选取第二数据库服务器,进而可以开始与第二数据库服务器进行数据通信,即将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,如图4所示。 [0082] When the first switching condition of the first frequency and the application server statistics to satisfy a communication failure event stored in data communication may be stopped with the first database server, database server and selecting a second standby database server, and further can start data communication with the second database server, database server is about to perform handover from a first to a second database server database server, as shown in FIG.

[0083]可选的,第一应用服务器将第一数据库服务器记录为故障数据库服务器。 [0083] Alternatively, the first application server recorded for the first database server failed database server.

[0084]在实施中,当第一应用服务器统计到的通信失败事件的次数满足存储的第一切换条件时,则可以停止与第一数据库服务器进行数据通信,并在备用数据库服务器中选取第二数据库服务器,进而可以开始与第二数据库服务器进行数据通信,即将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,同时将第一数据库服务器记录为故障数据库服务器,则避免了在后续切换过程中重新切换至该数据库服务器,如图5所示。 [0084] In the embodiment, when a first frequency and a first switching condition to the application server statistics satisfy a communication failure event stored in data communication may be stopped with the first database server, and select a second standby database server the database server, and further can start the second data communication with the database server, the database server is about to perform handover from a first to a second database server database server, the first database server to record the failed database server, switching is avoided in a subsequent process re-switching to the database server, as shown in FIG.

[0085]可选的,在故障数据库服务器被修复成功后,可以重新被投入使用,相应的处理可以如下:第一应用服务器在接收到第一数据库服务器的故障修复消息后,将第一数据库服务器记录为备用数据库服务器。 [0085] Alternatively, after the failed database server is successfully repaired, can be put to use again, appropriate treatment may be as follows: the first application server after receiving the first failure repair message database server, the first database server recording standby database server.

[0086]在实施中,当第一应用服务器统将执行数据库服务器由第一数据库服务器切换为第二数据库服务器时,可以发出提示消息以表明与第一数据库服务器的通信连接出现问题。 [0086] In the embodiment, when the first application server will perform a database server system switches from a first to a second database server when the database server, can alert message to indicate a communication connection with a first database server problem. 此处的提示消息可以是程序代码,由第一应用服务器发送给第一数据库服务器,以使第一数据库服务器根据运行该段程序代码进行自检和修复;或者提示消息可以是故障提示灯光,铃声等,用于通知技术人员第一应用程序与第一数据库服务器的通信连接出现问题,需要进行修复。 Prompt message here may be a program code, a first application server sent by the server to the first database, the first database server so that the self-test and repair a section of the running program code; or reminder message prompt may be a fault light, tone etc., for technical problems to inform staff first application communication connection with the first database server needs to be fixed. 当第一数据库服务器被修复成功后,第一数据库服务器可以向第一应用服务器发送故障修复消息,进而第一应用服务器将第一数据库服务器记录为备用数据库服务器,如图6所示。 When the first database server successfully been repaired, the first database server may send a first message application server failover, whereby the first application server database server records the first standby database server, as shown in FIG.

[0087]本发明实施例中,第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计,当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 Embodiment [0087] of the present invention, the first application server in the first database server to perform the database server records the status of the data communication process with the first database server, the communication failure event statistics, when the communication when the number of failures to meet a first switching condition stored in the first application server, the application server will perform a first database server database server switch from a first to a second database server. 这样,当第一应用服务器与第一数据库服务器的数据通信出现失败时,可以及时切换数据库服务器进行数据通信,不会产生因为数据库服务器出现故障而导致用户需要等待数据库服务器恢复才能获取网络业务数据的情况,从而保证了用户获取网络业务数据的及时性。 Thus, when a failure occurs first application server data communication with the first database server, the database server can be switched timely data communication, no because the database server fails and causes the user to wait for the database server in order to restore access to network traffic data situation, thus ensuring user access to network traffic data timeliness.

[0088] 实施例二 [0088] Second Embodiment

[0089]基于相同的技术构思,本发明实施例还提供了一种进行数据库服务器通信管理的装置,所述装置应用于数据库系统,所述数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件,如图7所示,所述装置包括: [0089] Based on the same technical concept, embodiments of the present invention further provides an apparatus for performing communication management server database, the apparatus is applied to a database system, said database system comprising at least a plurality of application servers and database servers, each application servers are established a data connection with the server to each database, each application server separately stores the respective switching condition for switching the database server, as shown in FIG. 7, the apparatus comprising:

[0090]统计模块701,用于在第一应用服务器将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计;[0091 ]切换模块702,用于当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0090] The statistics module 701, a process for a first application server in a state where the first record database server to perform the database server, the first data communication with the database server, the communication failure event statistics; [0091 ] the switching module 702, the number of times when the communication failed to meet the first switching condition stored in the first application server, the application server the first database server performs handover from the first database to a second database server server.

[0092]可选的,所述切换模块702,用于: [0092] Alternatively, the switching module 702, configured to:

[0093]当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0093] When the number of communication failures reaches a first threshold value of the number stored when the first server application, the first application server database server performs handover from a first to a second database server database server.

[0094]可选的,所述切换模块702,用于: [0094] Alternatively, the switching module 702, configured to:

[0095]当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0095] When the number of consecutive communication failures reaches a first threshold value of the number stored when the first server application, the first application server database server performs handover from a first to a second database server database server .

[0096]可选的,所述切换模块702,用于: [0096] Alternatively, the switching module 702, configured to:

[0097]当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0097] When the preset number of times within the length of a first communication failure times reaches the threshold value stored when the first server application, the first application server database server performs handover from the first database to a second database server server.

[0098]可选的,所述切换模块702,用于: [0098] Alternatively, the switching module 702, configured to:

[0099]当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0099] When a first threshold number of times within a predetermined period in a communication failure reaches the first server application stored, the execution of the first application server database server is switched from the first database to a second database server server.

[0100]可选的,如图8所示,所述装置还包括第一记录模块703,用于将第一数据库服务器记录为第一应用服务器的执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为第一应用服务器的备用数据库服务器; [0100] Optionally, as shown in FIG. 8, the apparatus further comprising means for recording a first database server to execute a first application server database server, the recording module 703 to the first except the first database server database server record standby database server of the first application server;

[0101]所述切换模块702,用于:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,在所述第一应用服务器的备用数据库服务器中选取第二数据库服务器,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0101] The switching module 702, configured to: when the number of the communication failure to meet the first switching condition stored in a first application server, select the second database on the standby server of the first server application server, the first application server database server performs handover from a first to a second database server database server.

[0102] 可选的,如图9所示,所述装置还包括: [0102] Optionally, as shown in FIG. 9, said apparatus further comprising:

[0103]第二记录模块704,用于将所述第一数据库服务器记录为第一应用服务器的故障数据库服务器。 [0103] The second recording module 704, for the first database server to record the failed database server of the first server application.

[0104] 可选的,如图10所示,所述装置还包括: [0104] Optionally, as shown in FIG. 10, the apparatus further comprising:

[0105]第三记录模块705,用于在第一应用服务器接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为第一应用服务器的备用数据库服务器。 After the [0105] third recording module 705, for receiving the first database server failure repair in a first message application server, database server records the first standby database server of the first server application.

[0106]本发明实施例中,第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计,当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 Embodiment [0106] of the present invention, the first application server in the first database server to perform the database server records the status of the data communication process with the first database server, the communication failure event statistics, when the communication when the number of failures to meet a first switching condition of the first server application stored, first application server will perform a database server over from the first to the second database server database server. 这样,当第一应用服务器与第一数据库服务器的数据通信出现失败时,可以及时切换数据库服务器进行数据通信,不会产生因为数据库服务器出现故障而导致用户需要等待数据库服务器恢复才能获取网络业务数据的情况,从而保证了用户获取网络业务数据的及时性。 Thus, when a failure occurs first application server data communication with the first database server, the database server can be switched timely data communication, no because the database server fails and causes the user to wait for the database server in order to restore access to network traffic data situation, thus ensuring user access to network traffic data timeliness.

[0107]需要说明的是:上述实施例提供的进行数据库服务器通信管理的装置在进行数据库服务器通信管理时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。 [0107] Note that: a database server communication managing apparatus of the above-described embodiment provides the database server during the communication management, division of the foregoing functional modules illustrated practical application, the above may be necessary function assigned to different functional modules, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above. 另外,上述实施例提供的进行数据库服务器通信管理的装置与进行数据库服务器通信管理的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。 Further, the above embodiments provide a method of managing a communication device database server with a database server communication managing embodiment the same conception, the specific embodiments of the method implementation process will not be repeated here.

[0108] 实施例三 [0108] Example three

[0109]图11是本发明实施例提供的应用服务器的结构示意图。 [0109] FIG. 11 is a schematic structural diagram of an application server according to an embodiment of the present invention. 该应用服务器1100可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(centralprocessing units,CPU) 1122(例如,一个或一个以上处理器)和存储器1132,一个或一个以上存储应用程序1142或数据1144的存储介质1130(例如一个或一个以上海量存储设备)。 The application server 1100 may generate relatively large differences due to different properties or configuration, may include one or more central processors (centralprocessing units, CPU) 1122 (e.g., one or more processors) and a memory 1132, one or more storage application data storage medium 1144 or 11,301,142 (e.g., one or more mass storage devices). 其中,存储器1132和存储介质1130可以是短暂存储或持久存储。 Wherein the memory storage medium 1132 and 1130 may be short-lived or persistent storage memory. 存储在存储介质1130的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对服务器中的一系列指令操作。 1130 stored in the storage medium of the program may include one or more modules (not shown shown), each of the server module may include a series of instructions. 更进一步地,中央处理器1122可以设置为与存储介质1130通信,在应用服务器1100上执行存储介质1130中的一系列指令操作。 Still further, the central processor 1122 may be provided, the storage medium 1130 performs a series of instructions stored in the communication medium 1130 and 1100 operate on the application server.

[0110] 应用服务器1100还可以包括一个或一个以上电源1126,一个或一个以上有线或无线网络接口1150,一个或一个以上输入输出接口1158,一个或一个以上键盘1156,和/或,一个或一个以上操作系统1141,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM 等等。 [0110] The application server 1100 may also include one or supply 1126 more, one or more wired or wireless network interface 1150, one or more input and output interface 1158, one or more keyboard 1156, and / or one or more than 1141 operating system, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and so on.

[0111]应用服务器1100可以包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令: [0111] The application server 1100 may include a memory, and one or more than one program, wherein the one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for the following operations:

[0112]第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计; [0112] the first application server in the first state is recorded as a database server performs the database server, the process of data communication with the first database server, the communication failure event statistics;

[0113]当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0113] When the number of times the first communication fails to meet a first switching condition stored in the application server, the first application server will perform a database server over from the first to the second database server database server.

[0114]可选的,所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0114] Alternatively, when the number of times when the communication failure of the first handover condition is satisfied stored first application server, the first application server will perform a database server is switched to the second server from the first database database server, including:

[0115]当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0115] When the number of communication failures reaches a first threshold value of the number stored when the first server application, the first application server will perform a database server database is switched from a first server to a second database server.

[0116]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0116] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0117]当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0117] When the number of consecutive communication failures reaches the first application server stores a first threshold number, the first application server will perform a database server database is switched from a first server to a second database server.

[0118]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0118] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0119]当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0119] When the preset number of times within the length of a first communication failure times reaches the threshold value stored when the first server application, the first application server will perform a database server to switch from the first database to a second database server server .

[0120]可选的,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: [0120] Alternatively, when the number of times when the number of communication failures reaches a first threshold value stored in the first application server, the first application server will perform a database server by the switching of the first database server two database servers, including:

[0121]当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0121] When a first threshold number of times within a predetermined period in a communication failure reaches the first server application stored, the first application server will perform a database server to switch from the first database to a second database server server .

[0122]可选的,所述第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计之前,所述方法还包括:第一应用服务器将第一数据库服务器记录为执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为备用数据库服务器; Before [0122] Optionally, the first application server in a record state of the first database server to perform the database server, data communication process with the first database server, the communication failure event statistics, the said method further comprising: a first server application to perform a first database server records database server, database server other than the first record of the database server standby database server;

[0123]所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器在备用数据库服务器中选取第二数据库服务器,将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 [0123] The number of times when the communication failed to meet the first switching condition of the first server application stored, the first application server will perform a database server to switch from a first to a second database server database server, comprising : when the number of times the first communication fails to meet a first switching condition stored in the application server, the first application server database server selecting a second standby database server, the database server performs the switch from the first database server a second database server.

[0124]可选的,在所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器之后,所述方法还包括: [0124] Alternatively, after the first application server will perform a database server to switch from a first to a second database server database server, the method further comprising:

[0125]第一应用服务器将所述第一数据库服务器记录为故障数据库服务器。 [0125] the application server, the first server records the first database is a database server failure.

[0126]可选的,所述方法还包括: [0126] Optionally, the method further comprising:

[0127]第一应用服务器在接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为备用数据库服务器。 [0127] In the first application server after receiving the first failure of the repair message database server, database server records the first standby database server.

[0128]本发明实施例中,第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计,当通信失败的次数满足第一应用服务器存储的第一切换条件时,第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 Embodiment [0128] of the present invention, the first application server in the first database server to perform the database server records the status of the data communication process with the first database server, the communication failure event statistics, when the communication when the number of failures to meet a first switching condition of the first server application stored, first application server will perform a database server over from the first to the second database server database server. 这样,当第一应用服务器与第一数据库服务器的数据通信出现失败时,可以及时切换数据库服务器进行数据通信,不会产生因为数据库服务器出现故障而导致用户需要等待数据库服务器恢复才能获取网络业务数据的情况,从而保证了用户获取网络业务数据的及时性。 Thus, when a failure occurs first application server data communication with the first database server, the database server can be switched timely data communication, no because the database server fails and causes the user to wait for the database server in order to restore access to network traffic data situation, thus ensuring user access to network traffic data timeliness.

[0129]本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。 [0129] Those of ordinary skill in the art may understand that the above embodiments all or part of the steps may be implemented by hardware, by a program instruction may be relevant hardware, the program may be stored in a computer-readable storage medium in the above-mentioned storage medium may be a read-only memory, magnetic or optical disk.

[0130]以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 [0130] The foregoing is only preferred embodiments of the present invention, not intended to limit the present invention within the spirit and principle of the present invention, any modification, equivalent replacement, or improvement, it should be included in the present within the scope of the invention.

Claims (14)

  1. 1.一种进行数据库服务器通信管理的方法,其特征在于,所述方法应用于数据库系统,所述数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件,所述方法包括: 第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计; 当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 1. A method of communication management server performs the database, wherein the method is applied to a database system, said database system comprising at least a plurality of application servers and database servers, each application server to each database server are established data connections, each application server are stored with a respective switching condition for switching the database server, the method comprising: a first application server in the first database server to record the state of performing the database server, the first database server process data communication in the event of communication failure statistics; when the number of the communication failure to meet the first switching condition of the first server application stored, the first application server by the first server will perform a database The database server switched to the second database server.
  2. 2.根据权利要求1所述的方法,其特征在于,所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: 当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 2. The method according to claim 1, wherein, when said first frequency and said communication switching condition failed to meet the first server application stored, the first application server will perform a database by the server a first switched to the second database server database server, comprising: a communication failure when the number of times reaches a first threshold value of the number stored when the first server application, the first application server by a first database server will perform a database switched to the second server is a database server.
  3. 3.根据权利要求2所述的方法,其特征在于,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: 当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 3. The method according to claim 2, wherein, when the number of times said first number of communication failures reaches a threshold value stored in the first application server, the first application server will perform a database server switching from a first to a second database server database server, comprising: the communication when the number of consecutive failures reaches a first threshold value of the number stored when the first server application, the first application server will perform a database by the server The first database server is switched to the second database server.
  4. 4.根据权利要求2所述的方法,其特征在于,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: 当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 4. The method according to claim 2, wherein, when the number of times said first number of communication failures reaches a threshold value stored in the first application server, the first application server will perform a database server switching from a first to a second database server database server, comprising: when a predetermined number of times when the length of a first communication failure times reaches the threshold value stored when the first server application, the first application server will perform a database server switching from a first to a second database server database server.
  5. 5.根据权利要求2所述的方法,其特征在于,所述当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括: 当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 5. The method according to claim 2, wherein, when the number of times said first number of communication failures reaches a threshold value stored in the first application server, the first application server will perform a database server switching from a first to a second database server database server, comprising: when a first threshold number of times within a predetermined period of communication failure reaches the first server application stored, the first application server will perform a database server switching from a first to a second database server database server.
  6. 6.根据权利要求1所述的方法,其特征在于,所述第一应用服务器在将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计之前,所述方法还包括:第一应用服务器将第一数据库服务器记录为执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为备用数据库服务器; 所述当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器,包括:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,所述第一应用服务器在备用数据库服务器中选取第二数据库服务器,将执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 Process 6. The method according to claim 1, wherein the first application server in the first database server to record the state of performing the database server, the first data communication with the database server, the communication before statistical failure event, said method further comprising: a first server application to perform a first database server records database server, database server other than the first record of the database server to the standby server database; when the said when the number of communication failure to satisfy a first switching condition of the first server application stored, the first application server will perform a database server to switch from a first to a second database server database server, comprising: a number of times when the communication failure a first switching condition is satisfied when the first server application stored, the first application server database server selecting a second standby database server, the database server performs handover from a first to a second database server database server.
  7. 7.根据权利要求1所述的方法,其特征在于,在所述第一应用服务器将执行数据库服务器由第一数据库服务器切换为第二数据库服务器之后,所述方法还包括: 第一应用服务器将所述第一数据库服务器记录为故障数据库服务器; 第一应用服务器在接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为备用数据库服务器。 7. The method according to claim 1, wherein, in the first application server will perform a database server after the server is switched from the first database to a second database server, the method further comprising: a first application server the first database server failure is recorded as a database server; the first application server after receiving the first failure of the repair message database server, database server records the first standby database server.
  8. 8.—种进行数据库服务器通信管理的装置,其特征在于,所述装置应用于数据库系统,所述数据库系统包括至少一个应用服务器和多个数据库服务器,每个应用服务器分别与每个数据库服务器建立数据连接,每个应用服务器分别存储有各自的用于切换数据库服务器的切换条件,所述装置包括: 统计模块,用于在第一应用服务器将第一数据库服务器记录为执行数据库服务器的状态下,与第一数据库服务器进行数据通信的过程中,对通信失败的事件进行统计; 切换模块,用于当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 8.- kinds of database management server communication means, characterized in that said device is applied to a database system, said database system comprising at least a plurality of application servers and database servers, each application server to each database server are established data connections, each application server are stored with a respective switching condition for switching the database server, the apparatus comprising: the statistics module, the first database server for recording in a first state to execute the application server database server, process data communication with the first database server, the communication failure event statistics; when the switching module for the communication when the number of failures to meet a first switching condition of the first application server storage, the the first application server database server performs handover from a first to a second database server database server.
  9. 9.根据权利要求8所述的装置,其特征在于,所述切换模块,用于: 当所述通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 9. The apparatus according to claim 8, wherein said switching module, configured to: when the number of communication failures reaches a first threshold value of the number stored when the first application server, the first an application server database server performs handover from a first to a second database server database server.
  10. 10.根据权利要求9所述的装置,其特征在于,所述切换模块,用于: 当所述通信失败连续出现的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 10. The apparatus according to claim 9, wherein said switching module, configured to: when the number of consecutive communication failures reaches a first threshold value of the number stored when the first server application, The said first application server database server performs handover from a first to a second database server database server.
  11. 11.根据权利要求9所述的装置,其特征在于,所述切换模块,用于: 当在预设时长内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 11. The apparatus according to claim 9, wherein said switching module, configured to: when the preset number of times within the length of a first communication failure times reaches the threshold value stored in the first server application, the the first application server database server performs handover from a first to a second database server database server.
  12. 12.根据权利要求9所述的装置,其特征在于,所述切换模块,用于: 当在预设周期内通信失败的次数达到所述第一应用服务器存储的第一次数阈值时,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 12. The apparatus according to claim 9, wherein said switching module, configured to: when the number of times within a predetermined period of communication failure times reaches a first threshold value of the first server application stored, the the first application server database server performs handover from a first to a second database server database server.
  13. 13.根据权利要求8所述的装置,其特征在于,所述装置还包括: 第一记录模块,用于将第一数据库服务器记录为第一应用服务器的执行数据库服务器,将除第一数据库服务器之外的数据库服务器记录为第一应用服务器的备用数据库服务器; 所述切换模块,用于:当所述通信失败的次数满足所述第一应用服务器存储的第一切换条件时,在所述第一应用服务器的备用数据库服务器中选取第二数据库服务器,将所述第一应用服务器的执行数据库服务器由第一数据库服务器切换为第二数据库服务器。 13. The apparatus according to claim 8, characterized in that said apparatus further comprises: a first recording module configured to record a first database server to execute a first application server database server, the database server in addition to the first the database server other than the recording standby database server of the first application server; the switching module, configured to: when the number of the communication failure to meet the first switching condition of the first server application stored, the first standby database server selecting a second application server database server, the first application server database server performs handover from a first to a second database server database server.
  14. 14.根据权利要求8所述的装置,其特征在于,所述装置还包括: 第二记录模块,用于将所述第一数据库服务器记录为第一应用服务器的故障数据库服务器。 14. The apparatus according to claim 8, characterized in that said apparatus further comprises: a second recording module, the first database server is configured to record the failed database server is a first server application. 第三记录模块,用于在第一应用服务器接收到所述第一数据库服务器的故障修复消息后,将所述第一数据库服务器记录为第一应用服务器的备用数据库服务器。 After the third recording module, for receiving the first database server failure repair in a first message application server, database server records the first standby database server of the first server application.
CN 201510916191 2015-12-11 2015-12-11 Database server communication management method and device CN105550065A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201510916191 CN105550065A (en) 2015-12-11 2015-12-11 Database server communication management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201510916191 CN105550065A (en) 2015-12-11 2015-12-11 Database server communication management method and device

Publications (1)

Publication Number Publication Date
CN105550065A true true CN105550065A (en) 2016-05-04

Family

ID=55829261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201510916191 CN105550065A (en) 2015-12-11 2015-12-11 Database server communication management method and device

Country Status (1)

Country Link
CN (1) CN105550065A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060391A (en) * 2007-05-16 2007-10-24 华为技术有限公司 Master and spare server switching method and system and master server and spare server
US20080126832A1 (en) * 2006-08-04 2008-05-29 Tudor Morosan Failover system and method
CN103019875A (en) * 2012-12-19 2013-04-03 北京世纪家天下科技发展有限公司 Method and device for realizing double main reconstruction of database
CN104239548A (en) * 2014-09-23 2014-12-24 中电长城网际系统应用有限公司 Database disaster recovery system and database disaster recovery method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126832A1 (en) * 2006-08-04 2008-05-29 Tudor Morosan Failover system and method
CN101060391A (en) * 2007-05-16 2007-10-24 华为技术有限公司 Master and spare server switching method and system and master server and spare server
CN103019875A (en) * 2012-12-19 2013-04-03 北京世纪家天下科技发展有限公司 Method and device for realizing double main reconstruction of database
CN104239548A (en) * 2014-09-23 2014-12-24 中电长城网际系统应用有限公司 Database disaster recovery system and database disaster recovery method

Similar Documents

Publication Publication Date Title
US20100036885A1 (en) Maintaining Data Integrity in Data Servers Across Data Centers
US20110161730A1 (en) Systems, methods, and apparatus to debug a network application
JP2004030363A (en) Logical computer system, and method and program for controlling configuration of logical computer system
CN101026494A (en) Method and system for facilitating event management and analysis within a communications environment
CN1947096A (en) Dynamic migration of virtual machine computer programs
US7069317B1 (en) System and method for providing out-of-band notification of service changes
CN102158535A (en) Cloud computing operating system
CN201682522U (en) Conversation information storage system and application server
CN102750324A (en) File storage system, file storage device and file access method
CN101562761A (en) Method and system for backup storage in optical network
CN103078927A (en) Key-value data distributed caching system and method thereof
CN101667181A (en) Method, device and system for data disaster tolerance
CN101776983A (en) Synchronization method of information of double controllers in disk array and disk array system
CN101519078A (en) Method for synchronizing multi-region data of comprehensive monitoring system
CN102916825A (en) Management equipment of dual-computer hot standby system, management method and dual-computer hot standby system
CN102411639A (en) Multi-copy storage management method and system of metadata
CN1553716A (en) Clustering system for utilizing sharing internal memory in mobile communiation system and realizing method thereof
CN103400225A (en) Method, device and system for restoring faults
CN101217353A (en) A control method on multi-point dual redundancy system of call center
CN102739799A (en) Distributed communication method in distributed application
CN101039212A (en) Fast data storage method
CN101388759A (en) Method and system for implementing from asynchronous copy to synchronous copy by data
CN102043686A (en) Disaster tolerance method, backup server and system of memory database
CN103051681A (en) Collaborative type log system facing to distribution-type file system
CN1794646A (en) Method for obtaining of daily information from network element equipment by network management server

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
CB02