CN114328726A - Hotspot account service method and device, storage medium and electronic equipment - Google Patents

Hotspot account service method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114328726A
CN114328726A CN202111615005.1A CN202111615005A CN114328726A CN 114328726 A CN114328726 A CN 114328726A CN 202111615005 A CN202111615005 A CN 202111615005A CN 114328726 A CN114328726 A CN 114328726A
Authority
CN
China
Prior art keywords
database
account
account service
master
state
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.)
Pending
Application number
CN202111615005.1A
Other languages
Chinese (zh)
Inventor
鲁海龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin Yillion Bank Co ltd
Original Assignee
Jilin Yillion Bank Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin Yillion Bank Co ltd filed Critical Jilin Yillion Bank Co ltd
Priority to CN202111615005.1A priority Critical patent/CN114328726A/en
Publication of CN114328726A publication Critical patent/CN114328726A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a hotspot account service method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when determining that a first memory database in the master-slave database set is abnormal, switching the first memory database from the current master state to the standby state, and switching a second memory database from the current standby state to the master state; switching the master-slave database set from the current account service state to a non-account service state, and switching the disk database to the account service state so that the service system provides hot spot account service based on the disk database; and after the second memory database is determined to be synchronized with the latest account data, switching the master database set and the slave database set to an account service state, and switching the disk database to a non-account service state, so that the service system provides hot spot account service based on the second memory database. By applying the method, account service abnormity caused by data asynchronism can be avoided, and account fund safety is guaranteed.

Description

Hotspot account service method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of data processing, in particular to a hotspot account service method and device, a storage medium and electronic equipment.
Background
In the business processing process of financial institutions such as banks, a service processing scene of a hot account often appears, wherein the hot account refers to an account which conducts transactions at a high frequency, and is also a single account with high concurrent database operation.
At present, a service system usually responds to database operation of a hot spot account based on a redundant memory database, a main memory database provides hot spot account service under normal conditions, and when the main memory database is abnormal, the main memory database is switched to a standby memory database to provide hot spot account service.
In an actual application scenario, data between the two memory databases is not synchronized in real time, and when the main memory database is switched to the standby memory database, the standby memory database may not store the latest account data. In this case, if the hot spot account service is provided using the backup memory database, there is a possibility that service abnormalities such as failure of balance control of the hot spot account or overdraft of the account may occur, which may adversely affect the client and the financial institution.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a hot spot account service method, so as to solve the problem that adverse effects are caused by abnormal conditions of services such as failure of balance control of a hot spot account or overdraft of an account, which are easily caused by providing a hot spot account service based on a redundant memory database in the prior art.
The embodiment of the invention also provides a hot spot account service device which is used for ensuring the actual realization and application of the method.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a hotspot account service method comprises the following steps:
when determining that a first memory database in a master-slave database set is abnormal, switching the first memory database from a current master state to a standby state, and switching a second memory database in the master-slave database set from the current standby state to the master state;
switching the master-slave database set from the current account service state to a non-account service state so that the business system stops providing hot account service based on the master-slave database set;
switching a disk database of the business system from a current non-account service state to an account service state so that the business system provides hot spot account service based on the disk database;
determining whether the second memory database is synchronized with the latest account data;
if the second memory database synchronizes the latest account data, switching the master-slave database set from the current non-account service state to the account service state, and switching the disk database from the current account service state to the non-account service state, so that the service system provides hot spot account service based on the second memory database.
Optionally, the method for determining that the first internal memory database in the master-slave database set is abnormal includes:
detecting whether the running state of the first memory database is abnormal or not through a preset sentinel node;
and if the sentinel node detects that the running state of the first memory database is abnormal, determining that the first memory database is abnormal.
Optionally, the aforementioned method, where switching the master-slave database set from the current account service state to the non-account service state includes:
determining a hotspot account service mark corresponding to the master-slave database set;
setting a mark parameter corresponding to the hotspot account service mark as a preset service forbidding parameter so as to switch the master-slave database set from the current account service state to a non-account service state.
Optionally, the aforementioned method, where switching the master-slave database set from the current non-account service state to the account service state includes:
setting a mark parameter corresponding to the hotspot account service mark as a preset service enabling parameter so as to switch the master-slave database set from a current non-account service state to an account service state.
Optionally, the determining whether the second memory database is synchronized with the latest account data includes:
determining first account data corresponding to the disk database;
determining second account data corresponding to the second memory database;
judging whether the first account data is the same as the second account data;
and if the first account data is the same as the second account data, determining that the second memory database is synchronized with the latest account data.
The above method, optionally, further includes:
and if the second memory database does not synchronize the latest account data, acquiring the synchronous account data from the disk database, and storing the synchronous account data to the second memory database.
A hotspot account service device, comprising:
the first switching unit is used for switching the first memory database from the current main state to the standby state and switching the second memory database in the master-slave database set from the current standby state to the main state when the first memory database in the master-slave database set is determined to be abnormal;
the second switching unit is used for switching the master-slave database set from the current account service state to the non-account service state so as to enable the business system to stop providing the hot account service based on the master-slave database set;
the third switching unit is used for switching the disk database of the business system from the current non-account service state to the account service state so that the business system provides hot spot account service based on the disk database;
the determining unit is used for determining whether the second memory database is synchronized with the latest account data;
and the fourth switching unit is used for switching the master-slave database set from the current non-account service state to the account service state and switching the disk database from the current account service state to the non-account service state if the second memory database synchronizes the latest account data, so that the service system provides hot spot account service based on the second memory database.
The above apparatus, optionally, further comprises:
and the synchronization unit is used for acquiring the synchronous account data from the disk database and storing the synchronous account data into the second memory database if the second memory database does not synchronize the latest account data.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium is located to perform the hotspot account service method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the hotspot account service method as described above.
Based on the hot spot account service method provided by the embodiment of the invention, the method comprises the following steps: when determining that a first memory database in the master-slave database set is abnormal, switching the first memory database from the current master state to the standby state, and switching a second memory database in the master-slave database set from the current standby state to the master state; switching the master-slave database set from the current account service state to a non-account service state so that the business system stops providing hot account service based on the master-slave database set; switching the disk database from a current non-account service state to an account service state so that the service system provides hot spot account service based on the disk database; determining whether the second memory database is synchronized with the latest account data; if the second memory database synchronizes the latest account data, the master-slave database set is switched from the current non-account service state to the account service state, and the disk database is switched from the current account service state to the non-account service state, so that the service system provides hot spot account service based on the second memory database. By applying the method provided by the embodiment of the invention, when the current state of providing the hot spot account service based on the first memory database is required to be switched to the state of providing the hot spot account service based on the second memory database, the disk database can be adopted to respond to the hot spot account service, and the hot spot account service is provided by the second memory database after the second memory database is determined to be synchronized with the latest account data. Under the condition of ensuring the service continuity of the hotspot account service, the service abnormity caused by the asynchronous data of the second memory database can be avoided.
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, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of a hotspot account service method according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of a hotspot account service method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a hotspot account service device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a hotspot account service device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
As known from the background art, a hot account is a single account with high concurrent database operations, and if the operation of responding to the hot account is performed in a serial queuing manner, a performance bottleneck is caused. Because the operation speed of the memory is far faster than that of the traditional database, the operation of the memory database responding to the hot spot account is usually adopted at present, and the hot spot account service is responded in the memory, such as cache balance for overdraft control. In an actual application process, when master-slave switching occurs, the situation that data of a master library is not synchronized to a standby library exists, the data of the master library is used for providing hot spot account service by the database with unsynchronized data, abnormal service conditions such as balance control failure or overdraft and the like can be caused, a large risk exists, and adverse effects are easily brought to customers and institutions.
Therefore, the embodiment of the invention provides a hot spot account service method, when a master memory database and a slave memory database are switched, the traditional disk database provides service, and after data synchronization is determined, the memory database is started again to provide service, so that abnormal conditions caused by data asynchronization are avoided.
The embodiment of the invention provides a hot spot account service method, which can be applied to various business systems, wherein an execution main body can be a server of the system, and a method flow chart of the method is shown in figure 1 and comprises the following steps:
s101: when determining that a first memory database in a master-slave database set is abnormal, switching the first memory database from a current master state to a standby state, and switching a second memory database in the master-slave database set from the current standby state to the master state;
in the method provided by the embodiment of the invention, a master-slave database set comprising a first memory database and a second memory database is preset, the first memory database is used as a master database, namely the database in the master state at present, and the second memory database is used as a slave database, namely the database in the standby state at present. In normal conditions, in the process of providing hot account service by a business system, a master database in a master-slave database set responds to database operation of hot accounts, such as account balance modification and the like,
when the current master database (namely the first memory database) in the master-slave database set is abnormal, master-slave switching can be triggered, and the current slave database (namely the second memory database) is upgraded into a new master database.
The memory database in the method provided by the embodiment of the invention can adopt a Redis memory database, and can also adopt other types of memory databases, so that the realization function of the method provided by the embodiment of the invention is not influenced.
S102: switching the master-slave database set from the current account service state to a non-account service state so that the business system stops providing hot account service based on the master-slave database set;
in the method provided by the embodiment of the invention, when the master database and the slave database are switched in the master database and the slave database, the master database and the slave database are switched from the current account service state to the non-account service state, namely, the master database in the master database and the slave database is not adopted to respond to the database operation of the hot account.
S103: switching a disk database of the business system from a current non-account service state to an account service state so that the business system provides hot spot account service based on the disk database;
in the method provided by the embodiment of the invention, a traditional database, namely a disk database, is preset, when a main database in a main database and a slave database set responds to database operation of a hotspot account, an operation result can be asynchronously registered in the disk database, for example, the balance of an account is cached in the main database to perform overdraft control, and the balance registration of a corresponding account is asynchronously performed in the disk database, namely, account data in the disk database is synchronous with account data in the main database.
When the master database and the slave database are switched in the master database and the slave database, the disk database is switched to an account service state, namely the disk database is adopted to respond to database operation of a hot account, such as account balance control.
S104: determining whether the second memory database is synchronized with the latest account data;
in the method provided by the embodiment of the invention, after the master database and the slave database are switched, whether the account data stored in the second memory database which needs to be upgraded into the master database is the latest account data or not can be determined.
S105: if the second memory database synchronizes the latest account data, switching the master-slave database set from the current non-account service state to the account service state, and switching the disk database from the current account service state to the non-account service state, so that the service system provides hot spot account service based on the second memory database.
In the method provided by the embodiment of the invention, if the second memory database completes the update of the account data, the master-slave database set is restored to the original service state, and the master database in the master-slave database set is continuously used for responding the database operation of the hotspot account, so that the hotspot account service is provided. And at the moment, the master database in the master-slave database set is the second memory database. And the disk database does not respond to the database operation of the hot spot account any more, and still records the current account data in the master database in the master-slave database set.
Based on the method provided by the embodiment of the invention, if the first memory database in the main state is abnormal, the second memory database in the standby state is switched to the main state, the service system suspends the use of the memory database to provide the hot spot account service, and the disk database is used to provide the hot spot account service. And when the second memory database is determined to be synchronized with the latest account data, the service system resumes using the memory database to provide the hot spot account service. By applying the method provided by the embodiment of the invention, the performance bottleneck caused by high concurrent operation of the hot account can be solved based on the quick reading and writing of the memory database. And a redundant memory database is adopted to provide a hot spot account service, so that the high availability of a service system can be guaranteed. And further when the memory database is switched between master and slave, the disk database provides service, and the new master memory database provides service after the new master memory database is confirmed to synchronize the latest data, so that the continuity of service can be guaranteed, the service exception caused by data asynchronism can be avoided, the account fund safety can be guaranteed, and the adverse effect can be avoided.
Further, on the basis of the method provided in the foregoing embodiment, in the method provided in the embodiment of the present invention, the step of determining that the first memory database in the master-slave database set is abnormal in step S101 includes:
detecting whether the running state of the first memory database is abnormal or not through a preset sentinel node;
and if the sentinel node detects that the running state of the first memory database is abnormal, determining that the first memory database is abnormal.
In the method provided by the embodiment of the invention, the memory database is a Redis database, and the Redis database has a sentinel model. The running state of the main-use memory database can be detected in real time through the sentinel node to determine whether the abnormality exists. And if the sentinel node detects that the running state of the first memory database is abnormal, determining that the first memory database is abnormal.
In the method provided by the embodiment of the invention, when the sentinel node detects that the memory database in the main state is abnormal, the switching of the master database and the slave database can be triggered, and whether the master database and the slave database are switched is monitored.
On the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process of switching the master-slave database set from the current account service state to the non-account service state in step S102 includes:
determining a hotspot account service mark corresponding to the master-slave database set;
setting a mark parameter corresponding to the hotspot account service mark as a preset service forbidding parameter so as to switch the master-slave database set from the current account service state to a non-account service state.
In the method provided by the embodiment of the invention, a database system corresponding to the master-slave database set is provided with a hot spot account service mark for representing whether a master memory database in the master-slave database set, namely a memory database in a master state, is used, so as to provide hot spot account service.
And configuring a hotspot account service mark corresponding to the master-slave database set as a preset forbidden service parameter through a parameter modification instruction, wherein the preset forbidden service parameter represents that the hot-spot account service is provided without using a master memory database in the master-slave database set.
On the basis of the method provided by the foregoing embodiment, in the method provided by the embodiment of the present invention, the process of switching the master-slave database set from the current non-account service state to the account service state, which is mentioned in step S105, includes:
setting a mark parameter corresponding to the hotspot account service mark as a preset service enabling parameter so as to switch the master-slave database set from a current non-account service state to an account service state.
In the method provided by the embodiment of the invention, the hotspot account service mark can be configured as a preset service enabling parameter through a parameter modification instruction, and the preset service enabling parameter represents that the hotspot account service is provided by using a main memory database in a main database set and a slave database set.
On the basis of the method shown in fig. 1, in the method provided in the embodiment of the present invention, the step of determining whether the second in-memory database has synchronized the latest account data in step S104 includes:
determining first account data corresponding to the disk database;
determining second account data corresponding to the second memory database;
judging whether the first account data is the same as the second account data;
and if the first account data is the same as the second account data, determining that the second memory database is synchronized with the latest account data.
In the method provided by the embodiment of the invention, the account data stored in the disk database, such as each account number and the balance of the account, can be read. And reading account data stored in the second memory database, comparing the account data stored in the disk database with the account data stored in the second memory database, and if the account data stored in the two databases are the same, determining that the second memory database is synchronized with the latest account data.
In the method provided by the embodiment of the invention, after the master-slave database set is switched between the master and the slave, the data stored in the second memory database can be updated into the latest data stored in the disk database, and then the confirmation process is carried out.
In order to better describe the method provided by the embodiment of the present invention, the embodiment of the present invention provides another hot spot account service method, a flowchart of the method is shown in fig. 2, and on the basis of the method shown in fig. 1, the method provided by the embodiment of the present invention further includes:
s106: and if the second memory database does not synchronize the latest account data, acquiring the synchronous account data from the disk database, and storing the synchronous account data to the second memory database.
In the method provided by the embodiment of the present invention, if the second memory database does not synchronously update the latest account data, the synchronous account data, that is, the real-time latest account data, is obtained from the disk database, and the obtained synchronous account data is stored in the second memory database, so that the second memory database synchronizes the latest account data. After the synchronous account data is stored in the second memory database, whether the synchronous account data is synchronized with the latest account data can be confirmed again, so that the subsequent process can be carried out.
In order to better explain the method provided by the embodiment of the invention, the embodiment of the invention provides another hot spot account service method, and the hot spot account service process provided by the embodiment of the invention is further and integrally explained by combining a specific application scene.
In the method provided by the embodiment of the invention, the memory database is a Redis memory database, a sentinel model is adopted to ensure that the Redis memory database is highly available, and a 'whether to start a hot account flag' is set in the Redis memory database: HOT _ ACC _ FLAG, and the value dictionary is YES and NO.
Under normal conditions, data are read and written from the Redis master library, and because the Redis is a memory database, the reading and writing speed is obviously higher than that of the traditional disk database.
When the Redis master library has problems, the sentinel nodes can be automatically switched to the slave libraries, and the slave libraries are upgraded to provide services for the master library.
Due to the fact that data are not synchronized theoretically in the switching process, incomplete data of a new main database exist, and risks such as fund overdraft exist. At the moment, according to the event subscription service provided by the sentinel node, master-slave switching of the Redis memory database is monitored by independently establishing the service. If master-slave switching is monitored, HOT _ ACC _ FLAG is set to be NO, at the moment, the service is degraded to be balance which is not suitable for controlling the Redis memory database, and is reduced to be balance which is controlled by using a disk database, and at the moment, the performance is obviously reduced.
And after the Redis memory database suspends the account service, acquiring the latest accurate balance from the disk database, storing the latest accurate balance into a Redis new main library (new main library), changing HOT _ ACC _ FLAG into YES, and recovering the Redis memory database to provide the high-performance hotspot account service.
In the method provided by the embodiment of the invention, through the sensing of the switching of the master library and the slave library, when the slave library is switched, the transaction is temporarily blocked, and the external service is performed again after the disk database is synchronized to the latest account balance, so that the service continuity can be ensured to the maximum extent, and the account fund security is ensured.
Corresponding to the hot spot account service method shown in fig. 1, an embodiment of the present invention further provides a hot spot account service apparatus, which is used for implementing the method shown in fig. 1 specifically, and a schematic structural diagram of the hot spot account service apparatus is shown in fig. 3, where the hot spot account service apparatus includes:
a first switching unit 201, configured to switch a current primary state of a first memory database in a master-slave database set to a standby state when it is determined that a first memory database in the master-slave database set is abnormal, and switch a current standby state of a second memory database in the master-slave database set to the primary state;
a second switching unit 202, configured to switch the master-slave database set from a current account service state to a non-account service state, so that the service system stops providing the hot-spot account service based on the master-slave database set;
a third switching unit 203, configured to switch a disk database of the business system from a current non-account service state to an account service state, so that the business system provides a hot spot account service based on the disk database;
a determining unit 204, configured to determine whether the second memory database synchronizes with the latest account data;
a fourth switching unit 205, configured to switch the master-slave database set from the current non-account service state to the account service state and switch the disk database from the current account service state to the non-account service state if the second memory database synchronizes the latest account data, so that the service system provides a hot spot account service based on the second memory database.
Based on the device provided by the embodiment of the invention, if the first memory database in the main state is abnormal, the second memory database in the standby state is switched to the main state, the service system suspends the use of the memory database to provide the hot spot account service, and the disk database is used to provide the hot spot account service. And when the second memory database is determined to be synchronized with the latest account data, the service system resumes using the memory database to provide the hot spot account service. By applying the device provided by the embodiment of the invention, the performance bottleneck caused by high concurrent operation of the hot account can be solved based on the quick reading and writing of the memory database. And a redundant memory database is adopted to provide a hot spot account service, so that the high availability of a service system can be guaranteed. And further when the memory database is switched between master and slave, the disk database provides service, and the new master memory database provides service after the new master memory database is confirmed to synchronize the latest data, so that the continuity of service can be guaranteed, the service exception caused by data asynchronism can be avoided, the account fund safety can be guaranteed, and the adverse effect can be avoided.
Further, as shown in the schematic structural diagram of fig. 4, an embodiment of the present invention provides another hot spot account service apparatus, and on the basis of the apparatus shown in fig. 3, the apparatus provided in the embodiment of the present invention further includes:
a synchronizing unit 206, configured to, if the second memory database does not synchronize the latest account data, obtain the synchronized account data from the disk database, and store the synchronized account data in the second memory database.
On the basis of the device provided by the above embodiment, the device provided by the embodiment of the present invention further includes:
the detection unit is used for detecting whether the running state of the first memory database is abnormal or not through a preset sentinel node; and if the sentinel node detects that the running state of the first memory database is abnormal, determining that the first memory database is abnormal.
On the basis of the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the second switching unit 202 includes:
the first determining subunit is used for determining a hotspot account service sign corresponding to the master-slave database set;
and the first setting subunit is used for setting the mark parameter corresponding to the hotspot account service mark as a preset service forbidding parameter so as to switch the master-slave database set from the current account service state to a non-account service state.
In addition to the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the fourth switching unit 205 includes:
and the second setting subunit is used for setting the mark parameter corresponding to the hotspot account service mark as a preset service enabling parameter so as to switch the master-slave database set from the current non-account service state to the account service state.
On the basis of the apparatus provided in the foregoing embodiment, in the apparatus provided in the embodiment of the present invention, the determining unit 204 includes:
the second determining subunit is used for determining first account data corresponding to the disk database; determining second account data corresponding to the second memory database;
the judging subunit is configured to judge whether the first account data is the same as the second account data;
and a third determining subunit, configured to determine that the second memory database is synchronized with the latest account data if the first account data is the same as the second account data.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the hot spot account service method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 301 and one or more instructions 302, where the one or more instructions 302 are stored in the memory 301 and configured to be executed by one or more processors 303 to perform the following operations for the one or more instructions 302:
when determining that a first memory database in a master-slave database set is abnormal, switching the first memory database from a current master state to a standby state, and switching a second memory database in the master-slave database set from the current standby state to the master state;
switching the master-slave database set from the current account service state to a non-account service state so that the business system stops providing hot account service based on the master-slave database set;
switching a disk database of the business system from a current non-account service state to an account service state so that the business system provides hot spot account service based on the disk database;
determining whether the second memory database is synchronized with the latest account data;
if the second memory database synchronizes the latest account data, switching the master-slave database set from the current non-account service state to the account service state, and switching the disk database from the current account service state to the non-account service state, so that the service system provides hot spot account service based on the second memory database.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A hotspot account service method is characterized by comprising the following steps:
when determining that a first memory database in a master-slave database set is abnormal, switching the first memory database from a current master state to a standby state, and switching a second memory database in the master-slave database set from the current standby state to the master state;
switching the master-slave database set from the current account service state to a non-account service state so that the business system stops providing hot account service based on the master-slave database set;
switching a disk database of the business system from a current non-account service state to an account service state so that the business system provides hot spot account service based on the disk database;
determining whether the second memory database is synchronized with the latest account data;
if the second memory database synchronizes the latest account data, switching the master-slave database set from the current non-account service state to the account service state, and switching the disk database from the current account service state to the non-account service state, so that the service system provides hot spot account service based on the second memory database.
2. The method of claim 1, wherein determining that the first in-memory database in the master-slave database set is abnormal comprises:
detecting whether the running state of the first memory database is abnormal or not through a preset sentinel node;
and if the sentinel node detects that the running state of the first memory database is abnormal, determining that the first memory database is abnormal.
3. The method of claim 1, wherein switching the master-slave database set from a current account service state to a non-account service state comprises:
determining a hotspot account service mark corresponding to the master-slave database set;
setting a mark parameter corresponding to the hotspot account service mark as a preset service forbidding parameter so as to switch the master-slave database set from the current account service state to a non-account service state.
4. The method of claim 3, wherein switching the master-slave database set from a current non-account service state to an account service state comprises:
setting a mark parameter corresponding to the hotspot account service mark as a preset service enabling parameter so as to switch the master-slave database set from a current non-account service state to an account service state.
5. The method of claim 1, wherein determining whether the second in-memory database has synchronized up-to-date account data comprises:
determining first account data corresponding to the disk database;
determining second account data corresponding to the second memory database;
judging whether the first account data is the same as the second account data;
and if the first account data is the same as the second account data, determining that the second memory database is synchronized with the latest account data.
6. The method of claim 1, further comprising:
and if the second memory database does not synchronize the latest account data, acquiring the synchronous account data from the disk database, and storing the synchronous account data to the second memory database.
7. A hotspot account service device, comprising:
the first switching unit is used for switching the first memory database from the current main state to the standby state and switching the second memory database in the master-slave database set from the current standby state to the main state when the first memory database in the master-slave database set is determined to be abnormal;
the second switching unit is used for switching the master-slave database set from the current account service state to the non-account service state so as to enable the business system to stop providing the hot account service based on the master-slave database set;
the third switching unit is used for switching the disk database of the business system from the current non-account service state to the account service state so that the business system provides hot spot account service based on the disk database;
the determining unit is used for determining whether the second memory database is synchronized with the latest account data;
and the fourth switching unit is used for switching the master-slave database set from the current non-account service state to the account service state and switching the disk database from the current account service state to the non-account service state if the second memory database synchronizes the latest account data, so that the service system provides hot spot account service based on the second memory database.
8. The apparatus of claim 7, further comprising:
and the synchronization unit is used for acquiring the synchronous account data from the disk database and storing the synchronous account data into the second memory database if the second memory database does not synchronize the latest account data.
9. A storage medium, comprising stored instructions, wherein when executed, the instructions control a device on which the storage medium is located to execute the hotspot account service method according to any one of claims 1 to 6.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the hotspot account service method of any one of claims 1-6.
CN202111615005.1A 2021-12-27 2021-12-27 Hotspot account service method and device, storage medium and electronic equipment Pending CN114328726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111615005.1A CN114328726A (en) 2021-12-27 2021-12-27 Hotspot account service method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111615005.1A CN114328726A (en) 2021-12-27 2021-12-27 Hotspot account service method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114328726A true CN114328726A (en) 2022-04-12

Family

ID=81013072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111615005.1A Pending CN114328726A (en) 2021-12-27 2021-12-27 Hotspot account service method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114328726A (en)

Similar Documents

Publication Publication Date Title
JP3822381B2 (en) Distributed database system failure recovery method
US9798792B2 (en) Replication for on-line hot-standby database
US10565071B2 (en) Smart data replication recoverer
EP2790112B1 (en) Method and system for data synchronization and data access apparatus
US5802267A (en) Method for checkpointing in computer system under distributed processing environment
US20200019543A1 (en) Method, apparatus and device for updating data, and medium
KR20010052972A (en) Synchronization of processor in a fault toferant multi-processor system
CN112486740B (en) Master-slave relationship confirmation method and system among multiple controllers and related device
CN112181723A (en) Financial disaster recovery method and device, storage medium and electronic equipment
CN111984474B (en) Method, system and equipment for recovering double-control cluster fault
US11307944B2 (en) Automated failover for asynchronous remote copy
CN113297173A (en) Distributed database cluster management method and device and electronic equipment
CN114328726A (en) Hotspot account service method and device, storage medium and electronic equipment
JP5154843B2 (en) Cluster system, computer, and failure recovery method
CN107404511B (en) Method and device for replacing servers in cluster
CN115934742A (en) Fault processing method, device, equipment and storage medium
JPH08278909A (en) System and method for high reliability
CN113297134B (en) Data processing system, data processing method and device, and electronic device
CN105574020B (en) Database operation method and device
CN109005059A (en) A kind of system and method for realizing Redis automated back-up
CN112732493B (en) Method and device for newly adding node, node of distributed system and storage medium
CN110442770B (en) Data grabbing and storing method and device, computer equipment and storage medium
CN117520050A (en) Disaster recovery method, system, equipment and medium for crossing IDC data lakes
CN116795820A (en) Online service cluster migration method, device, equipment and storage medium
KR20010010293A (en) Fault management system and Method for recovering fault of the Configuration Management System in the fault tolerant switching control 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