CN110019520B - Service execution method, system and device - Google Patents
Service execution method, system and device Download PDFInfo
- Publication number
- CN110019520B CN110019520B CN201711229270.XA CN201711229270A CN110019520B CN 110019520 B CN110019520 B CN 110019520B CN 201711229270 A CN201711229270 A CN 201711229270A CN 110019520 B CN110019520 B CN 110019520B
- Authority
- CN
- China
- Prior art keywords
- service
- server
- main
- standby
- service server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3006—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/02—Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Accounting & Taxation (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Hardware Redundancy (AREA)
Abstract
The invention discloses a service execution method, which comprises the following steps: the method comprises the steps that a main monitoring server judges whether service data in a main service server is synchronously copied in a standby service server or not, if not, services and users corresponding to the service data which are not completely copied are recorded, when the services of the main service server are switched to the standby service server, the standby service server is informed of limiting to execute recorded services, services of other users except recorded users in the main service server are informed of being switched to the standby service server to carry out normal services, the services of other users cannot be influenced by switching, and after the recorded services are limited to be executed, the services of the users recorded in the main service server are switched to the standby service server to continue executing the limited services. The invention also discloses a service execution system and a device, which can reduce the degree of limitation of users and services when the services are switched to the service server.
Description
Technical Field
The invention belongs to the technical field of mobile terminals, and particularly relates to a service execution method, system and device.
Background
On a mainstream third-party payment platform, a distributed storage system is used, a multi-machine room multi-activity strategy is generally adopted, and when one machine room fails, the flow can be switched to a backup data machine room to continuously provide service for a user. But this places high demands on data consistency and data delay between rooms.
In the prior art, when a problem occurs in an Internet Data Center (IDC), an operation and maintenance worker switches the flow of a user from an abnormal machine room to a normal machine room through a front-end load balancing system, and then performs active/standby switching of a database, that is, upgrades a standby load to an active load. The data is set to be unwritable in the switching process, so that fund safety is guaranteed, and the data is recovered after the data synchronization is completed, but the user data can only be read and cannot be modified in the time period from the time when the flow is switched to the standby machine to the time before the data is recovered, so that the user cannot trade, the fund operation of the user is comprehensively limited, the trade operation cannot be carried out, the data circulation of a system is influenced, and the user experience is not good.
Disclosure of Invention
Embodiments of the present invention provide a method, a system, and a device for executing a service, which can solve the problems that all services are prohibited from being operated when a service is switched, and user experience is not good.
A first aspect of an embodiment of the present invention provides a method for executing a service, including:
the main monitoring server monitors the service data of the main service server and whether the service data is completely copied in the standby service server or not;
if not, recording the service and the user corresponding to the service data which is not completely copied;
when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent before the recorded service is limited to be executed, wherein the first switching notice comprises the recorded user so as to switch the recorded services of other users except the recorded user from the main service server to the standby service server to execute unlimited services;
and sending a second switching notice after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server to the standby service server and continue to execute the limited service.
A second aspect of the embodiments of the present invention provides a service execution system, including:
the system comprises a main monitoring server, a main service server and a standby service server;
the main monitoring server is used for monitoring the service data of the main service server and whether the service data is completely copied in the standby service server; if not, recording the service and the user corresponding to the service data which is not completely copied; when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent before the recorded service is limited to be executed, wherein the first switching notice comprises the recorded user so as to switch the recorded services of other users except the recorded user from the main service server to the standby service server to execute unlimited services; and sending a second switching notice after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server to the standby service server and continue to execute the limited service.
A third aspect of the present invention provides a service execution apparatus, including:
the monitoring module is used for monitoring the service data of the main service server and whether the service data is completely copied in the standby service server;
the recording module is used for recording the service and the user corresponding to the service data which is not completely copied if the copying is not completely performed;
the notification module is used for notifying the standby service server to limit the recorded service within a preset execution range when the service of the main service server is confirmed to be switched to the standby service server;
the notification module is further configured to send a first switching notification before the recorded service is restricted from being executed, where the first switching notification includes the recorded user, so as to switch the service of another user than the recorded user from the main service server to the standby service server to execute an unrestricted service;
the notification module is further configured to send a second switching notification after the recorded service is restricted from being executed, so as to switch the recorded service of the user from the main service server to the standby service server, and continue to execute the restricted service.
It can be known from the foregoing embodiments of the present invention that, the service execution method, system and apparatus provided by the present invention determine, by the main monitoring server, whether the service data in the main service server is synchronously copied in the standby service server, if not, record the service and user corresponding to the service data that is not completely copied, when the service of the main service server is switched to the standby service server, notify the standby service server to limit execution of the recorded service, notify the main service server that the services of other users except the recorded user are switched to the standby service server to perform normal service, the services of other users are not affected by the switching, after the recorded service is limited to be executed, switch the service of the user recorded in the main service server to the standby service server to continue to execute the limited service, and limit the service of the user whose copied service data is abnormal to a certain extent, the method and the system can protect the service safety, reduce the service influence of abnormal users to the minimum and improve the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a system hardware structure diagram to which a service execution method according to an embodiment of the present invention is applied;
fig. 2 is a flowchart illustrating a service execution method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a service execution method according to a second embodiment of the present invention;
fig. 4 is an interaction flow diagram of a service execution method in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service execution system according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a service execution system according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a service execution apparatus according to a fifth embodiment of the present invention;
fig. 8 is a schematic structural diagram of a service execution apparatus according to a sixth embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The following typical application scenario of each embodiment of the present invention is that on a large third-party payment platform, in a scenario of crossing a main/standby service server (or a main/standby service room), a monitoring program deployed in the main monitoring server (or the main/standby service room) is started to determine whether service data is completely copied between the main/standby service servers (or the main/standby service rooms), if not, a user and a service fund amount corresponding to the service data that is not completely copied are recorded, when a service is switched between the main/standby service servers (or the main/standby service rooms), the standby service server (or the standby service room) is notified according to the record to perform restricted execution on the service that is not completely copied, for example, the service fund can be frozen, when the service is switched, service switching is not performed on the user who restricts execution of the service, that is, that the service of the user who is restricted to execute the service is temporarily left on the main service server (or the main service room), the method comprises the steps that no service is executed, when the standby service server finishes execution limiting operation, namely the service fund is frozen, the service of a user limited to execute the service is switched into the standby service server, at the moment, the user limited to execute the service can carry out limited operation within a limited range, specifically, only the service fund is frozen, the service execution corresponding to the service fund is influenced, not all services of the user limited to execute the service are limited, the limited behaviors of the users limited to execute the service are greatly reduced, the condition that the user fund and the platform fund are not lost is ensured, and the service flow switching between the main service server and the standby service server (a main service room and a standby service room) is not influenced. The specific system structure is shown in fig. 1.
In fig. 1, taking a main service server, a standby service server, a main monitoring server and a standby monitoring server as an example, it can be understood that the servers may respectively correspond to a main service room, a standby service room, a main monitoring room and a standby monitoring room, the room includes multiple servers, and the execution principle is the same as that of a single server, and is within the protection scope of the embodiment of the present invention.
The system structure includes: it should be noted that, the main service server 20, the standby service server 30, the main monitoring server 40, the standby monitoring server 50, the database proxy module 60, the main database 70, and the standby database 80 are opposite concepts in the embodiment of the present invention, and the main service server 20 may be a standby server of the standby service server 30.
The service distribution module 10 is configured to distribute a service to the main service server 20 or the standby service server 30 according to a service processing rule, taking the case that the service is distributed to the main service server 20, the service system 21 in the main service server 20 writes information of the service into the main monitoring server 40 to generate a remote log, the service system 21 executes the service logic after writing is successful, and simultaneously writes the executed service information into the main database 70 in the main service server 20 through the database proxy module 60, where the main database 70 may include a plurality of user libraries and service libraries, and fig. 1 takes one user library 1 and one service library 1 as an example. For example, on the third party payment platform, a transaction is executed, the service system 21 writes user information such as the user name and the user contact information of the transaction into the user base 1 through the database proxy module 60, and writes specific contents such as the transaction target, the transaction amount, the transaction contact information, and the transaction method of the transaction into the service base 1 through the database proxy module 60. Further, database proxy module 60 synchronizes the service data written into primary database 70 to backup database 80 in backup service server 30, which is in a primary-backup relationship with primary service server 20.
The main monitoring server 40 is provided with a monitoring program, the monitoring program is operated to read a local remote log of the main monitoring server 40, obtain service information in the remote log, and query the main database 70 and the standby database 80 by accessing the database proxy module 60, so as to determine whether service data are not copied in the main database 70 and the standby database 80 synchronously, if service data are not copied in synchronization, the main monitoring server 40 records the service data which are not copied completely, and the amount of user and service fund corresponding to the service data, and notifies the service distribution module 10 that the service data are not copied completely, after the service distribution module receives the notification, the service distribution module can forward the notification to a management module (not shown in the figure), the management module integrates the notification and the obtained notification from other modules of the system, and determines whether a condition that the service server needs to be switched, this situation may include a failure of the main service server 20, etc. Or, after the service distribution module receives the notification, the service distribution module can automatically integrate the notification and the acquired notifications from other modules of the system to judge whether the condition that the service server needs to be switched occurs.
When it is determined that the service on the main service server 20 needs to be switched to the standby service server 30, a notification is sent to the main monitoring server 40, the main monitoring server 40 notifies the standby service server 30 of the amount of the user and the service fund corresponding to the recorded incompletely copied service data, the standby service server 30 is instructed to freeze the service fund of the user, meanwhile, the main monitoring server 40 notifies the service distribution module 10 to switch, and notifies the service distribution module 10 not to switch the service of the user corresponding to the incompletely copied service data to the standby service server 30, and at this time, the service of the users cannot be performed. When the standby service server 30 finishes freezing, the main monitoring server 40 is notified, the main monitoring server 40 notifies the service distribution module 10, and the service of the user corresponding to the incompletely copied service data is switched to the standby service server 30, and at this time, the users can perform the service unrelated to the frozen fund, and the limited range is very small.
Finally, the operation and maintenance personnel can perform the operation of recovering the service data, and after the service data is recovered, the service data of the main database 70 and the standby database 80 are completely synchronized, the capital unfreezing operation is performed on the users, and the normal service operation authority can be recovered.
It should be noted that, the backup monitoring server 50 is also provided with a monitoring program, and has a remote log written by the backup service server 30, and the monitoring process is the same as that of the main monitoring server 40 described above, and is not described herein again.
Further, if the main service server 20 and the standby service server 30 are closer to each other, the main monitoring server 40 and the standby monitoring server 50 may be merged to be the same monitoring server, a monitoring program is built in, and both the main service server 20 and the standby service server 30 write the service data into the monitoring server to generate a remote log. The function of the monitoring program is the same as described above.
The description of the specific technical solution of the service execution method in this embodiment refers to the following embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of a service execution method according to a first embodiment of the present invention, where the method includes:
s101, a main monitoring server monitors service data of a main service server and whether the service data is completely copied in a standby service server or not;
the main monitoring server is internally provided with a monitoring program, and the monitoring program is started to monitor the service data generated by the completed service and determine whether the copying is completed between the service server and the standby service server.
S102, if the copying is not complete, recording the service and the user corresponding to the service data which is not completely copied;
if the corresponding service data in the remote log is not completely copied between the main service server and the standby service server, recording the service corresponding to the incompletely copied service data as a copy abnormal service, and simultaneously recording the service corresponding to the incompletely copied service data and the user.
Further, the related module is notified that the situation that the service data is not completely copied occurs to provide a basis for switching the service server, the related module can integrate the notification and the notifications sent by other modules to determine whether the service needs to be switched from the main service server to the standby service server, and the related module can be the management module or the service distribution module.
S103, when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent out before the recorded service is limited to be executed, wherein the switching notice comprises the recorded user, so that the recorded services of other users except the recorded user are switched from the main service server to the standby service server to execute unlimited services;
if the fact that the existing service data reported by the main monitoring server are not completely copied and other information such as data exchange obstacles and hardware structure faults reported by other modules is judged, if the main service server has a fault such as hardware, software or network, the service needs to be switched to the standby service server. The primary monitoring server is notified prior to the handoff.
And the main monitoring server informs the standby service server to limit the recorded service within a preset execution range, and specifically, the capital corresponding to the recorded service is frozen. The standby service server also needs a little time to execute the limiting operation, before the recorded service is limited to be executed, the main monitoring server sends a first switching notice to the service distribution module, wherein the first switching notice comprises the recorded user and is used for informing the service distribution module to switch the recorded service of other users except the recorded user from the main service server to the standby service server to execute the unlimited service. The user which is not switched to the standby service server can not execute the service operation temporarily, thereby protecting the safety of the account. The user switched to the standby service server can normally execute the service operation, the user cannot perceive the influence caused by the switching, and the user experience is improved.
And S104, sending a second switching notice after the recorded service is limited to be executed, so as to switch the recorded service of the user from the main service server to the standby service server, and continuously executing the limited service.
After the standby service server completes the operation of limiting the recorded service, the recorded service is limited to be executed on the standby service server, and the standby service server informs the main monitoring server.
Further, the main monitoring server sends a second switching notification to the service allocation module, so as to notify the service allocation module to switch the recorded service of the user from the main service server to the standby service server, where the recorded service of the user continues to execute a limited service on the standby service server, where the limited service has a slight influence on the user, and specifically, if the fund corresponding to the recorded service is frozen, only the service corresponding to the part of the fund cannot be executed, and other services of the user can still be normally executed.
In the embodiment of the invention, the main monitoring server judges whether the service data in the main service server is synchronously copied in the standby service server or not, if not, the service and the user corresponding to the service data which is not completely copied are recorded, when the service of the main service server is switched to the standby service server, the standby service server is informed to limit the execution of the recorded service, the services of other users except the recorded user in the main service server are informed to be switched to the standby service server to carry out normal service, the services of other users are not influenced by switching, after the recorded service is limited to be executed, the service of the user recorded in the main service server is switched to the standby service server to continue to execute the limited service, the service of the user with abnormal copied service data is limited to a certain extent, and the service safety can be protected, meanwhile, the service influence of the abnormal user is reduced to the minimum, and the user experience is improved.
Referring to fig. 3, fig. 3 is a service execution method according to a second embodiment of the present invention, where the method includes:
s201, before the main service server executes the service, the main service server writes the service data of the service to be executed into the main monitoring server as a remote log, and if the writing is successful, the main service server executes the service to be executed;
the external service request enters the service distribution module first, and the service distribution module distributes the transaction system to the corresponding service server according to the service server to which the user belongs, in this embodiment, the business server is distributed to the main service server as an example.
Before executing the service, the main service server writes the service data of the service to be executed into the main monitoring server as a remote log through the service system, and if the writing is successful, the main service server executes the service to be executed. The remote log includes all information related to the service, such as the subject, content, amount, user, etc. of the service. The service system starts to execute the service after writing successfully.
If the writing is unsuccessful, the service data of the service to be executed is tried to be written into the main monitoring server as a remote log again, and if the writing is still unsuccessful after the preset times of the trial, an error prompt is returned to the service distribution module or the management module.
S202, the main service server stores the service data into a local main database through a database proxy module, and the database proxy module copies the service data in the main database into a standby database of a standby service server;
the main service server sends the service data to the database proxy module, and the database proxy module stores the service data to a main database in the main service server. Further, the database agent module automatically copies the service data in the main database to the standby database of the standby service server.
The database agent module can inquire the service data of the main database and the standby database.
S203, the main monitoring server reads a local remote log, and inquires service data corresponding to the remote log in the main database and the standby database through the database proxy module;
the main monitoring server is internally provided with a monitoring program, the monitoring program is started to read a local remote log written by the main service server, and whether the service data of each service in the remote log is copied between the service server and the standby service server or not can be judged according to the identification information, the name and the like of the service read in the remote log, namely whether the service data of each service in the remote log is copied between the service server and the standby service server or not is judged, namely, whether the service server and the standby service server are synchronously copied or not aiming at the service in the remote log.
S204, comparing whether the service data inquired in the main database is consistent with the service data inquired in the standby database or not, if not, confirming the service data corresponding to the remote log in the main service server, and not completely copying the service data in the standby service server;
if the two are consistent, no recording is performed.
S205, recording services and users corresponding to the service data which are not completely copied;
incomplete replication includes no replication, or only partial replication of the traffic data.
And recording abnormal business and users of the copied business data, for example, data of a transaction B completed by a user A in the main business server, and recording the transaction B and the user A if the data is not completely copied in the standby business server.
S206, when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent before the recorded service is limited to be executed, wherein the first switching notice comprises the recorded user so as to switch the services of other users except the recorded user from the main service server to the standby service server to execute unlimited services;
and the main monitoring server informs the standby service server to limit the recorded service within a preset execution range, and specifically, the capital corresponding to the recorded service is frozen. The standby service server also needs a little time to execute the limiting operation, before the recorded service is limited to be executed, the main monitoring server sends a first switching notice to the service distribution module, wherein the first switching notice comprises the recorded user and is used for informing the service distribution module to switch the recorded service of other users except the recorded user from the main service server to the standby service server to execute the unlimited service. The user which is not switched to the standby service server can not execute the service operation temporarily, thereby protecting the safety of the account. The user switched to the standby service server can normally execute service operation, the user cannot perceive the influence caused by switching, and the user experience is improved.
S207, sending a second switching notice after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server to the standby service server and continue to execute the limited service;
after the standby service server completes the operation of limiting the recorded service, the recorded service is limited to be executed on the standby service server, and the standby service server informs the main monitoring server.
Further, the main monitoring server sends a second switching notification to the service allocation module, so as to notify the service allocation module to switch the recorded service of the user from the main service server to the standby service server, where the recorded service of the user continues to execute a limited service on the standby service server, where the limited service has a slight influence on the user, and specifically, if the fund corresponding to the recorded service is frozen, only the service corresponding to the part of the fund cannot be executed, and other services of the user can still be normally executed.
S208, the standby monitoring server monitors whether the service data of the main service server is identical to the service data of the standby service server or not, and if the service data of the main service server is identical to the service data of the standby service server, the standby service server is informed to remove the limitation execution of the recorded service.
And after the service is switched from the main service server to the standby service server, the standby monitoring server is responsible for monitoring the synchronization of the service data. And after the operation and maintenance personnel restore the synchronization of the service data of the main service server and the standby service server, the standby monitoring server monitors whether the service data of the standby service server is completely synchronized into the main service server.
If the service data of the main service server is completely the same as the service data of the standby service server, the standby service server is informed to remove the execution limitation of the recorded service, so that the user of the limited service can normally perform the service.
In one example, when a third-party payment platform carries out transaction, a service distribution module distributes the transaction to a main service server, a service system in the main service server writes data of each transaction as a remote log into a main monitoring server, the main monitoring server starts a monitoring program to read the remote log to obtain a plurality of transaction information of a user A, a user B, a user C, a user D, a user E and a user F, and inquires about one transaction of the user A and one transaction of the user B in a standby server through a database proxy module, and if the transactions are not completely copied, the fund amount of the two transactions carried out by the user A, the user B and the user A is recorded. When the service distribution module confirms that the service of the main service server is switched to the standby service server, the main service server informs the standby service server to freeze funds of two transactions of a user A and a user B, and sends a first switching notification to the service distribution module before the freezing is finished, wherein the first switching notification comprises name information of the user A and the user B, the service distribution module switches the services of other users except the user A and the user B from the main service server to the standby service server, and the other users execute unlimited transactions on the standby service server. And sending a second switching notification to the service distribution module after the fund is frozen, switching the services of the user A and the user B from the main service server to the standby service server by the service distribution module, and continuously executing the limited services on the standby service server by the user A and the user B.
Referring to fig. 4, an interaction flow in the embodiment of the present invention is shown in fig. 4. The abnormal service refers to a service corresponding to the service data which is not completely copied, and the abnormal user refers to a user corresponding to the abnormal service. The shielding of the abnormal user means that the service of the abnormal user is not switched when the service is switched. The step of shielding the abnormal user is to switch the service of the abnormal user to the service server. For further details of the interaction process, reference is made to the description of the foregoing embodiments.
In the embodiment of the invention, the main monitoring server judges whether the service data in the main service server is synchronously copied in the standby service server or not, if not, the service and the user corresponding to the service data which is not completely copied are recorded, when the service of the main service server is switched to the standby service server, the standby service server is informed to limit the execution of the recorded service, the services of other users except the recorded user in the main service server are informed to be switched to the standby service server to carry out normal service, the services of other users are not influenced by switching, after the recorded service is limited to be executed, the service of the user recorded in the main service server is switched to the standby service server to continue to execute the limited service, the service of the user with abnormal copied service data is limited to a certain extent, and the service safety can be protected, meanwhile, the service influence of the abnormal user is reduced to the minimum, and the user experience is improved.
Referring to fig. 5, fig. 5 is a service execution system according to a third embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. The system mainly comprises:
a main monitoring server 301, a main service server 302 and a standby service server 303.
The main monitoring server 301 is configured to monitor whether the service data of the main service server 302 is completely copied in the standby service server 303; if not, recording the service and the user corresponding to the service data which is not completely copied; when the service of the main service server 302 is confirmed to be switched to the standby service server 303, the standby service server 303 is notified to limit the recorded service within a preset execution range, and a first switching notification is sent before the recorded service is limited to be executed, wherein the first switching notification comprises the recorded user, so that the services of other users except the recorded user are switched from the main service server 302 to the standby service server 303 to execute unlimited services; and sending a second switching notification after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server 302 to the standby service server 303 and continue to execute the limited service.
Referring to fig. 6, fig. 6 is a service execution system according to a fourth embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. The system comprises:
further, the main service server 302 is further configured to, before executing the service, write the service data of the service to be executed as a remote log into the main monitoring server 301;
the main service server 302 is further configured to execute the service to be executed if the writing is successful.
Further, the system further comprises: a database proxy module 304;
a main service server 302, further configured to store service data in a local main database through a database proxy module 304;
the database proxy module 304 is configured to copy the service data in the primary database to the standby database of the standby service server 303.
Further, the main monitoring server 301 is further configured to read a local remote log, and query, through the database proxy module 304, service data corresponding to the remote log in the main database and the backup database;
the main monitoring server 301 is further configured to compare whether the service data queried in the main database is consistent with the service data queried in the standby database, and if not, determine that the service data corresponding to the remote log in the main service server 302 is not completely copied in the standby service server 303.
Further, the system further comprises: a standby monitoring server 305;
a standby monitoring server 305, configured to monitor whether the service data of the main service server 302 is identical to the service data of the standby service server 303;
if the recorded services are identical, the standby service server 303 is notified to release the restriction on the recorded services.
The system in the embodiment of the present invention is configured to perform the method in the embodiment shown in fig. 2 to 3, and details of the technology that are not described are the same as those in the embodiment shown in fig. 2 to 3, and are not described again here.
In the embodiment of the invention, the main monitoring server judges whether the service data in the main service server is synchronously copied in the standby service server or not, if not, the service and the user corresponding to the service data which is not completely copied are recorded, when the service of the main service server is switched to the standby service server, the standby service server is informed to limit the execution of the recorded service, the services of other users except the recorded user in the main service server are informed to be switched to the standby service server to carry out normal service, the services of other users are not influenced by switching, after the recorded service is limited to be executed, the service of the user recorded in the main service server is switched to the standby service server to continue to execute the limited service, the service of the user with abnormal copied service data is limited to a certain extent, and the service safety can be protected, meanwhile, the service influence of the abnormal user is reduced to the minimum, and the user experience is improved.
Referring to fig. 7, fig. 7 is a service execution apparatus according to a fifth embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown. The device may be the main monitoring server in the foregoing embodiments, and the device includes:
a monitoring module 401, configured to monitor whether the service data of the main service server is completely copied in the standby service server;
a recording module 402, configured to record, if the copy is not complete, a service and a user corresponding to service data that is not completely copied;
a notification module 403, configured to notify the standby service server to limit the recorded service within a preset execution range when it is determined that the service of the main service server is switched to the standby service server;
the notification module 403 is further configured to send a first switching notification before the recorded service is restricted from being executed, where the first switching notification includes the recorded user, so as to switch the service of another user than the recorded user from the main service server to the standby service server to execute the unrestricted service;
the notification module 403 is further configured to send a second switching notification after the recorded service is restricted from being executed, so as to switch the recorded service of the user from the main service server to the standby service server, and continue to execute the restricted service.
Details of technologies not described in the embodiments of the present invention are the same as those in the embodiments shown in fig. 2 to fig. 6, and are not described herein again.
In the embodiment of the invention, a monitoring module judges whether the service data in a main service server is synchronously copied in a standby service server or not, if not, a recording module records the service and the user corresponding to the service data which is not completely copied, when the service of the main service server is switched to the standby service server, a notification module notifies the standby service server to limit the execution of the recorded service, notifies the main service server of the services of other users except the recorded user to switch to the standby service server to carry out normal service, the services of the other users are not influenced by switching, after the recorded service is limited to be executed, the service of the user recorded in the main service server is switched to the standby service server to continue to execute the limited service, and the service of the user with abnormal copied service data is limited to a certain extent, the method and the system can protect the service safety, reduce the service influence of abnormal users to the minimum and improve the user experience.
Referring to fig. 8, fig. 8 is a service execution device according to a sixth embodiment of the present invention, which may be a main monitoring server in the foregoing embodiments, and is different from the device shown in fig. 7 in that:
further, the monitoring module 401 includes:
the reading submodule 4011 is configured to read a local remote log;
the query submodule 4012 is configured to query, through the database proxy module, service data corresponding to remote logs in the primary database and the backup database;
the comparison sub-module 4013 is configured to compare whether the service data queried in the primary database is consistent with the service data queried in the secondary database;
the confirming submodule 4014 is configured to confirm, if the service data is inconsistent with the service data in the master service server, that the service data is not completely copied in the backup service server.
The undescribed technical details in the embodiments of the present invention are the same as those in the embodiments shown in fig. 2 to fig. 7, and are not described again here.
In the embodiment of the invention, a monitoring module judges whether the service data in a main service server is synchronously copied in a standby service server, if not, a recording module records the service and the user corresponding to the service data which is not completely copied, when the service of the main service server is switched to the standby service server, a notification module notifies the standby service server to limit the execution of the recorded service, notifies other users except the recorded user in the main service server to switch to the standby service server to carry out normal service, the services of other users are not influenced by switching, after the recorded service is limited to be executed, the service of the user recorded in the main service server is switched to the standby service server to continue to execute the limited service, and the service of the user with abnormal copied service data is limited to a certain extent, the method and the system can protect the service safety, reduce the service influence of abnormal users to the minimum and improve the user experience.
In the embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is only one logical division, and the actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication link may be an indirect coupling or communication link of some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the above description, for the service execution method, the service execution system and the service execution device provided by the present invention, for those skilled in the art, according to the idea of the embodiment of the present invention, there may be a change in the specific implementation and application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (12)
1. A method for performing a service, comprising:
the main monitoring server monitors the service data of the main service server and whether the service data is completely copied in the standby service server or not;
if not, recording the service and the user corresponding to the service data which is not completely copied;
when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent before the recorded service is limited to be executed, wherein the first switching notice comprises the recorded user so as to switch the recorded services of other users except the recorded user from the main service server to the standby service server to execute unlimited services;
and sending a second switching notice after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server to the standby service server and continue to execute the limited service.
2. The method of claim 1, wherein the primary monitoring server monitors the service data of the primary service server, and whether the service data is completely copied in the standby service server, and the method comprises the following steps:
before the main service server executes the service, the service data of the service to be executed is written into the main monitoring server as a remote log;
and if the writing is successful, the main service server executes the service to be executed.
3. The method of claim 2, wherein the master business server stores the business data to a local master database through a database proxy module;
and the database agent module copies the service data in the main database to a standby database of the standby service server.
4. The method of claim 3, wherein the monitoring of the service data of the primary service server by the primary monitoring server whether the service data is completely copied in the backup service server comprises:
the main monitoring server reads a local remote log, and inquires service data corresponding to the remote log in the main database and the standby database through the database proxy module;
comparing whether the service data inquired in the main database is consistent with the service data inquired in the standby database;
and if the remote logs are inconsistent, confirming that the service data corresponding to the remote logs in the main service server are not completely copied in the standby service server.
5. The method of claim 1, wherein issuing a second handover notification to handover the recorded user's service from the primary service server to the standby service server after the recorded service is restricted from being executed comprises, after the restricted service is continued:
monitoring whether the service data of the main service server is identical to the service data of the standby service server by the standby monitoring server;
and if the recorded services are identical, informing the standby service server to remove the restriction on the recorded services.
6. A business execution system, comprising:
the system comprises a main monitoring server, a main service server and a standby service server;
the main monitoring server is used for monitoring the service data of the main service server and whether the service data is completely copied in the standby service server; if not, recording the service and the user corresponding to the service data which is not completely copied; when the service of the main service server is confirmed to be switched to the standby service server, the standby service server is informed to limit the recorded service within a preset execution range, and a first switching notice is sent before the recorded service is limited to be executed, wherein the first switching notice comprises the recorded user so as to switch the recorded services of other users except the recorded user from the main service server to the standby service server to execute unlimited services; and sending a second switching notice after the recorded service is limited to be executed so as to switch the recorded service of the user from the main service server to the standby service server and continue to execute the limited service.
7. The system of claim 6, wherein the main service server is further configured to, before executing a service, write service data of the service to be executed as a remote log into the main monitoring server;
the main service server is further configured to execute the service to be executed if the writing is successful.
8. The system of claim 7, further comprising: a database agent module;
the main service server is also used for storing service data to a local main database through the database agent module;
and the database agent module is used for copying the service data in the main database to a standby database of the standby service server.
9. The system of claim 8,
the main monitoring server is also used for reading a local remote log and inquiring service data corresponding to the remote log in the main database and the standby database through the database agent module;
the main monitoring server is also used for comparing whether the service data inquired in the main database is consistent with the service data inquired in the standby database, if not, the service data corresponding to the remote log in the main service server is confirmed, and the service data is not completely copied in the standby service server.
10. The system of claim 6, further comprising: preparing a monitoring server;
the standby monitoring server is used for monitoring whether the service data of the main service server is identical to the service data of the standby service server;
and if the recorded services are identical, informing the service standby server to remove the limited execution of the recorded services.
11. A service execution apparatus, comprising:
the monitoring module is used for monitoring the service data of the main service server and whether the service data is completely copied in the standby service server;
the recording module is used for recording the service and the user corresponding to the service data which is not completely copied if the copying is not completely performed;
the notification module is used for notifying the standby service server to limit the recorded service within a preset execution range when the service of the main service server is confirmed to be switched to the standby service server;
the notification module is further configured to send a first switching notification before the recorded service is restricted from being executed, where the first switching notification includes the recorded user, so as to switch the service of another user than the recorded user from the main service server to the standby service server to execute an unrestricted service;
the notification module is further configured to send a second switching notification after the recorded service is restricted from being executed, so as to switch the recorded service of the user from the main service server to the standby service server, and continue to execute the restricted service.
12. The apparatus of claim 11, wherein the monitoring module comprises:
the reading submodule is used for reading a local remote log;
the query submodule is used for querying the service data corresponding to the remote logs in the main database and the standby database through the database agent module;
the comparison sub-module is used for comparing whether the business data inquired in the main database is consistent with the business data inquired in the standby database;
and the confirming submodule is used for confirming that the service data corresponding to the remote log in the main service server is not completely copied in the standby service server if the service data are not consistent.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711229270.XA CN110019520B (en) | 2017-11-29 | 2017-11-29 | Service execution method, system and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711229270.XA CN110019520B (en) | 2017-11-29 | 2017-11-29 | Service execution method, system and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110019520A CN110019520A (en) | 2019-07-16 |
| CN110019520B true CN110019520B (en) | 2022-09-23 |
Family
ID=67185913
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711229270.XA Active CN110019520B (en) | 2017-11-29 | 2017-11-29 | Service execution method, system and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110019520B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113472469B (en) * | 2021-07-27 | 2023-12-05 | 厦门亿联网络技术股份有限公司 | Data synchronization method, device, equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AU2002340403A1 (en) * | 2001-11-16 | 2003-06-10 | Paralleldb, Incorporated | Data replication system and method |
| JP2003337717A (en) * | 2002-05-22 | 2003-11-28 | Nec Corp | Fault recovery synchronizing system of online transaction process |
| CN105207809A (en) * | 2015-08-25 | 2015-12-30 | 广州华多网络科技有限公司 | Data processing method, server, client side and system |
| CN105677675A (en) * | 2014-11-20 | 2016-06-15 | 阿里巴巴集团控股有限公司 | Business processing method and device |
| CN107391758A (en) * | 2017-08-24 | 2017-11-24 | 阿里巴巴集团控股有限公司 | Database switching method, device and equipment |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102891849B (en) * | 2012-09-25 | 2015-07-22 | 北京星网锐捷网络技术有限公司 | Service data synchronization method, data recovery method, data recovery device and network device |
| KR101740327B1 (en) * | 2012-11-22 | 2017-06-08 | 한국전자통신연구원 | Apparatus and system for providing software service using software virtualization and method thereof |
| US9268860B2 (en) * | 2012-12-02 | 2016-02-23 | At&T Intellectual Property I, L.P. | Methods, systems, and products for personalized monitoring of data |
| CN104158693B (en) * | 2014-08-27 | 2018-04-13 | 乐视网信息技术(北京)股份有限公司 | The disaster-tolerant backup method and system of data service |
| CN106411659A (en) * | 2016-11-29 | 2017-02-15 | 福建中金在线信息科技有限公司 | Business data monitoring method and apparatus |
-
2017
- 2017-11-29 CN CN201711229270.XA patent/CN110019520B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AU2002340403A1 (en) * | 2001-11-16 | 2003-06-10 | Paralleldb, Incorporated | Data replication system and method |
| JP2003337717A (en) * | 2002-05-22 | 2003-11-28 | Nec Corp | Fault recovery synchronizing system of online transaction process |
| CN105677675A (en) * | 2014-11-20 | 2016-06-15 | 阿里巴巴集团控股有限公司 | Business processing method and device |
| CN105207809A (en) * | 2015-08-25 | 2015-12-30 | 广州华多网络科技有限公司 | Data processing method, server, client side and system |
| CN107391758A (en) * | 2017-08-24 | 2017-11-24 | 阿里巴巴集团控股有限公司 | Database switching method, device and equipment |
Non-Patent Citations (2)
| Title |
|---|
| Exploring the benefit of rerouting multi-period traffic to multi-site data centers;Ting Wang等;《IEEE/OSA Journal of Optical Communications and Networking》;20170430;第C25-34页 * |
| IT云服务能力平台业务连续性策略研究;王海霞等;《移动通信》;20171030(第20期);第27-32、38页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110019520A (en) | 2019-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3617886B1 (en) | Hot backup system, hot backup method, and computer device | |
| US8464101B1 (en) | CAS command network replication | |
| US9563684B1 (en) | Replication cookie | |
| CN103226502B (en) | A kind of data calamity is for control system and data reconstruction method | |
| CN102891849B (en) | Service data synchronization method, data recovery method, data recovery device and network device | |
| CN106933843B (en) | Database heartbeat detection method and device | |
| CN102411639B (en) | Multi-copy storage management method and system of metadata | |
| CN102467508A (en) | Method for providing database service and database system | |
| CN100547558C (en) | Method and system for redundancy protection in a parallel computing system | |
| CN108319618B (en) | Data distribution control method, system and device of distributed storage system | |
| CN114003439B (en) | Data backup method, device, equipment and storage medium | |
| CN114328033B (en) | Method and device for maintaining service configuration consistency of high-availability equipment group | |
| WO2025246814A1 (en) | High availability data management | |
| CN110019520B (en) | Service execution method, system and device | |
| CN109104314B (en) | Method and device for modifying log configuration file | |
| CN113760608B (en) | Data recovery method and device, electronic equipment and storage medium | |
| CN111124757A (en) | Data node heartbeat detection algorithm of distributed transaction database | |
| US11599428B2 (en) | Protecting databases in a distributed availability group | |
| CN107291575B (en) | Processing method and equipment for data center fault | |
| CN111404737B (en) | Disaster recovery processing method and related device | |
| CN110928945B (en) | Data processing method and device for database and data processing system | |
| CN116389233A (en) | Container cloud management platform active-standby switching system, method and device and computer equipment | |
| JP2011253400A (en) | Distributed mirrored disk system, computer device, mirroring method and its program | |
| CN115470041A (en) | Data disaster recovery management method and device | |
| CN116185703A (en) | a data management system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |