Summary of the invention
The invention provides a kind of method and system of database update to solve the problem.
The invention provides a kind of method of database update, comprise the following steps.After the communication server receives the renewal instruction of controller transmission, the User Status list of the described communication server enters blocking model, and the User Status in User Status list is updated to the spare fields in database server by the described communication server.If described User Status is not updated to described spare fields by the described communication server in the first Preset Time, the described communication server is to controller request first strategy.User Status after process according to the pending User Status in the pending User Status list of the first strategy process received, and is updated to the true field of database server by the described communication server.If the described User Status in described User Status list is successfully updated to described spare fields by the described communication server in the second Preset Time, the described communication server notifies described controller, described controller sends synchronic command to database server, after described spare fields is synchronized to true field according to described synchronic command by described database server, described controller sends unlock command to the communication server, the described communication server according to described unlock command by described User Status list unblocking pattern.
The invention provides a kind of system of database update, comprise controller, at least one communication server and database server, described controller connects the described communication server and database server respectively, and the described communication server connects described database server.Described controller, instruction is upgraded for sending to the communication server, and according to the notice of the described communication server, synchronic command is sent to database server, also for providing the first strategy to the described communication server, and after described spare fields is synchronized to true field by described database server, send unlock command to the communication server.The described communication server, for receive controller send renewal instruction after make user's status list enter blocking model, and the spare fields User Status in User Status list is updated in database server, if and in the first Preset Time, described User Status is not updated to described spare fields, to controller request first strategy, also for processing the pending User Status in pending User Status list according to the first strategy received, and the User Status after process is updated to the true field of database server, if and in the second Preset Time, the described User Status in described User Status list is successfully updated to described spare fields, notify described controller, and according to controller send unlock command by described User Status list unblocking pattern.Described database server, for the notice according to described controller, is synchronized to true field by described spare fields.
Compared to prior art, according to the method and system of database update provided by the invention, after the communication server receives the renewal instruction of controller transmission, its User Status list enters blocking model, and the User Status in User Status list is updated to the spare fields in database server by the communication server.If User Status is not updated to spare fields by the communication server in the first Preset Time, the communication server is to controller request first strategy.User Status after process according to the pending User Status in the pending User Status list of the first strategy process received, and is updated to the true field of database server by the communication server.By arranging the first strategy, avoid waiting as long for of pending user.If the User Status in User Status list is successfully updated to spare fields by the communication server in the second Preset Time, communication server notification controller, controller sends synchronic command to database server, after spare fields is synchronized to true field according to synchronic command by database server, controller sends unlock command to the communication server, the communication server according to unlock command by User Status list unblocking pattern.So, ensure that the communication server is consistent with the User Status in database server, improve the quality of video conference.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Figure 1 shows that the flow chart of the method for the database update that preferred embodiment according to the present invention provides.As shown in Figure 1, the method for database update that preferred embodiment of the present invention provides comprises step 101 ~ 104.
Step 101: after the communication server receives the renewal instruction of controller transmission, the User Status list of the described communication server enters blocking model, and the User Status in User Status list is updated to the spare fields in database server by the described communication server.
Specifically, controller sends to the communication server and upgrades the mode of instruction, can be periodically send or not timing transmission, according to demand can sets itself in practical application, but is not construed as limiting this present invention.Before described controller sends renewal instruction to the described communication server, first send clear command to described database server, described spare fields resets according to described clear command by described database server.In this, after the User Status list of the described communication server enters blocking model, the not newly arrived pending User Status of reprocessing.
Step 102: if described User Status is not updated to described spare fields by the described communication server in the first Preset Time, the described communication server is to controller request first strategy.
Specifically, described controller stores the first strategy, and the mode that the described communication server obtains the first strategy is, after the communication server sends request to controller, the first strategy is sent to the communication server by described controller.
If described User Status is successfully updated to described spare fields by the described communication server in the first Preset Time, described communication server notification controller, described controller sends synchronic command to database server, after described spare fields is synchronized to true field according to described synchronic command by described database server, described controller sends unlock command to the communication server, the described communication server according to described unlock command by described User Status list unblocking pattern.In this, if there is multiple communication server, when described User Status is successfully updated to described spare fields by all communication servers, and after notification controller, described controller just sends synchronic command to database server.
Step 103: the User Status after process according to the pending User Status in the pending User Status list of the first strategy process received, and is updated to the true field of database server by the described communication server.
Specifically, described first strategy is, the mode of each pending user in the list of described communication server process pending User Status is concurrent processing, and the time of each pending User Status of described communication server process is the second Preset Time.User Status in User Status list is updated to the spare fields in database server process the pending User Status in pending User Status list in the second Preset Time while by the communication server.In this, described second Preset Time is greater than the first Preset Time.
Step 104: if the described User Status in described User Status list is successfully updated to described spare fields by the described communication server in the second Preset Time, the described communication server notifies described controller, described controller sends synchronic command to database server, after described spare fields is synchronized to true field according to described synchronic command by described database server, described controller sends unlock command to the communication server, the described communication server according to described unlock command by described User Status list unblocking pattern.
Specifically, in described second Preset Time, described User Status is successfully updated to described spare fields by the communication server, and database server is when being synchronized to true field according to the synchronic command of controller by described spare fields, the pending User Status of the communication server still in the pending User Status list of process.Until at the end of the second Preset Time, the pending User Status after process is just updated to the true field of database server by the communication server.So, the User Status that the true field of database server is corresponding up-to-date can be guaranteed.
If described User Status is not successfully updated to described spare fields by the described communication server in the second Preset Time, the described communication server no longer sends notice to described controller, and the blocking model of described User Status list removed voluntarily by the described communication server.Now, the communication server can the newly arrived pending User Status of normal process.In this, this database update failure, controller is waited for sending to the communication server next time and is upgraded instruction.
For example, if the communication server on December 26th, 2012 10:00:00 receive the renewal instruction of controller, the User Status list of the described communication server enters blocking model, and the User Status (user 1,2 and 3 is down status) in own user status list is updated to the spare fields in database server.If the first Preset Time is 10 seconds, during to 10:00:10, if the down status of described user 1,2 and 3 is not also updated to spare fields by the communication server, then the communication server is to controller request first strategy.If the pending user in the list of the communication server pending User Status comprises user 3 and 4(is line states), and the second Preset Time is 20 seconds.Between 10:00:10 to 10:00:30, the down status of user 1,2 and 3 is updated to the spare fields in database server by the described communication server, the upper line states (processing time of distribution is the second Preset Time that is 20 seconds) of the user of concurrent processing simultaneously 3 and 4, and at 10:00:30, result is updated to the true field of database server.
If when 10:00:25, the down status of user 1,2 and 3 is successfully updated to spare fields in database server and notification controller by the communication server, controller sends synchronic command to database server, spare fields is synchronized to true field according to described synchronic command by database server, and the unlock command that the communication server sends according to controller is by described User Status list unblocking pattern.If when 10:00:30, the communication server is by the true field of state updating to database server of reaching the standard grade of user 3 and 4, now the corresponding each User Status of the true field of database server is respectively: user 1 and 2 is down status, and user 3 and 4 is upper line states.
Otherwise, if until during 10:00:30, the down status of user 1,2 and 3 is not also updated to the spare fields in database server by the communication server, then this database update failure, when controller sends renewal instruction to the communication server next time, restart synchronous.The communication server is asynchronous in the reach the standard grade state updating true field to database server of 10:00:30 by user 3 and 4.In the true field of then database server, the User Status before user 1 and 2 state keeps this to upgrade is constant, and the state of user 3 and 4 is upper line states.
Figure 2 shows that the schematic diagram of the system of the database update that preferred embodiment according to the present invention provides.As shown in Figure 2, the system of the database update that present pre-ferred embodiments provides comprises controller 201, the communication server 202 and 203, database server 204, controller 201 connects the communication server 202,203 and database server 204 respectively, and the communication server 202 and 203 connects and database server 204 respectively.Described controller 201, instruction is upgraded for sending to the communication server 202 and 203, and according to the notice of the described communication server 202 and 203, synchronic command is sent to database server 204, also for providing the first strategy to the described communication server 202 and 203, and after described spare fields is synchronized to true field by described database server 204, send unlock command to the communication server 202 and 203.The described communication server 202 and 203, for receive controller 201 send renewal instruction after make user's status list enter blocking model, and the User Status in User Status list is updated to the spare fields in database server 204, if and in the first Preset Time, described User Status is not updated to described spare fields, the first strategy is asked to controller 201, also for processing the pending User Status in pending User Status list according to the first strategy received, and the User Status after process is updated to the true field of database server 204, if and in the second Preset Time, the described User Status in described User Status list is successfully updated to described spare fields, notify described controller 201, and according to controller 201 send unlock command by described User Status list unblocking pattern.Described database server 204, for the notice according to described controller 201, is synchronized to true field by described spare fields.About the operating process of said system with described in said method, therefore repeat no more in this.
In sum, according to the method and system of the database update that present pre-ferred embodiments provides, after the communication server receives the renewal instruction of controller transmission, its User Status list enters blocking model, and the User Status in User Status list is updated to the spare fields in database server by the communication server.If User Status is not updated to spare fields by the communication server in the first Preset Time, the communication server is to controller request first strategy.User Status after process according to the pending User Status in the pending User Status list of the first strategy process received, and is updated to the true field of database server by the communication server.By arranging the first strategy, avoid waiting as long for of pending user.If the User Status in User Status list is successfully updated to spare fields by the communication server in the second Preset Time, communication server notification controller, controller sends synchronic command to database server, after spare fields is synchronized to true field according to synchronic command by database server, controller sends unlock command to the communication server, the communication server according to unlock command by User Status list unblocking pattern.So, ensure that the communication server is consistent with the User Status in database server, improve the quality of video conference.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.