CN112860804B - Fuse quota data synchronization method and device - Google Patents

Fuse quota data synchronization method and device Download PDF

Info

Publication number
CN112860804B
CN112860804B CN202110350495.0A CN202110350495A CN112860804B CN 112860804 B CN112860804 B CN 112860804B CN 202110350495 A CN202110350495 A CN 202110350495A CN 112860804 B CN112860804 B CN 112860804B
Authority
CN
China
Prior art keywords
quota
data
state
switch
updating
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
Application number
CN202110350495.0A
Other languages
Chinese (zh)
Other versions
CN112860804A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110350495.0A priority Critical patent/CN112860804B/en
Publication of CN112860804A publication Critical patent/CN112860804A/en
Application granted granted Critical
Publication of CN112860804B publication Critical patent/CN112860804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/403Solvency checks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems

Abstract

The application relates to the technical field of Internet finance, and provides a fusing quota data synchronization method and device, wherein the method comprises the following steps: determining whether the double write switch is in an on state if the cumulative limit increases; when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota; and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library. The problems of large resource consumption, incomplete transformation, low synchronization aging and system stability existing in the existing method for synchronizing data by adopting a queue are solved by the scheme, and the technical effects of improving synchronization efficiency, reducing time delay and reducing resource occupation are achieved.

Description

Fuse quota data synchronization method and device
Technical Field
The application belongs to the technical field of internet finance, and particularly relates to a fusing quota data synchronization method and device.
Background
At present, operations such as transferring money, replacing wages and the like are all dependent background instruction libraries through enterprise network banking. However, as the amount of data increases, anomalies in the instruction library may result, which may affect the business associated with the enterprise network bank.
The purpose of enterprise bank fusing decoupling is to realize the decoupling of the ebbc exclusive product group and the instruction library, thereby ensuring that the ebbc exclusive product group can still normally provide services to the outside during the abnormal period of the instruction library so as to improve the disaster tolerance capability of the exclusive product group. The table data of the enterprise client transaction limit information is typically stored in an instruction library of the F-EBANKC (enterprise online banking), and the enterprise online banking transaction logic reads the limit information of the database. In order to realize fusing and decoupling, the aim that limit information cannot be read once an enterprise network instruction library is abnormal, but part of transactions can be normally carried out is fulfilled, and before a fusing mechanism is formally started, limit accumulated data of client transactions are required to be synchronized from an enterprise network (F-EBANKC) instruction oracle database to a mysql fragmentation database of F-EBBCBASE (enterprise electronic banking). When abnormal conditions occur, transactions such as enterprise network bank transfer remittance, replacement wages and the like can be ensured to be normally carried out by reading and recording data in a malsql fragmentation database of the F-EBBCBASE.
Currently, the synchronization mechanism for fusing the forehead data is: firstly, deploying a CDC (Change Data Capture, variable data capture) synchronization tool on an original enterprise bank (F-EBANKC) instruction library; then, a new container is applied for, and a KAFKA data synchronization service environment is built on the container. On the F-EBANKC side, the original limit data record code is modified, a data pushing thread is newly added, and meanwhile, the processing code of the original code for recording the limit data in the instruction library is reserved. On the F-EBBCBASE side, the original quota data record mode codes are modified, the quota data pulling thread is newly added, and meanwhile, the codes for judging the group data partition routes are added. Then, the CDC synchronous switch is started, and the newly added limit data of the previous transaction is sent to a message queue of KAFKA. Meanwhile, the F-EBBCBASE pulling thread starts the thread to pull the latest quota information from KAFKA according to the table dimension, and updates the corresponding fragments to complete synchronization.
However, the current enterprise network silver faces numerous transformation of distributed architecture, group splitting and other transformation, and the transformation requirement for data synchronization is gradually increased. However, the current quota synchronization mechanism only considers the synchronization of the instruction library and the F-EBBCBASE slicing library, does not consider and deploy other undetached groups of the enterprise network bank, has no reusability and more sequelae, and once a new group is detached, risks of redesign scheme or a large number of modification schemes are faced. Furthermore, the synchronization mode needs to apply CDC and KAFKA related resources, apply related synchronization thread containers, and newly add push threads and pull threads. If other groups are newly added in the later enterprise network to perform data synchronization, the data synchronization scheme may be disabled, resulting in resource waste. Meanwhile, newly added CDC and KAFKA environments are required to be monitored and maintained during production operation, so that the maintenance cost of production operation is increased. The amount of quota data to be synchronized in the synchronization mode is very large, and the working mechanism of KAFKA has performance bottleneck, so that data synchronization is delayed, and the real-time accurate effect cannot be achieved.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The invention aims to provide a fusing limit data synchronization method and device, which can solve the problems of large resource consumption, incomplete transformation, low synchronization aging and insufficient system stability of the existing fusing limit data synchronization mechanism.
The application provides a fusing quota data synchronization method and device, which are realized as follows:
a fuse quota data synchronization method, the method comprising:
determining whether the double write switch is in an on state if the cumulative limit increases;
when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota;
and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library.
In one embodiment, updating data in the instruction library according to the increment of the quota comprises:
determining whether the fuse switch is in an on state;
when the fuse switch is in an on state, registering a playback task through the target database, wherein the registration playback task is used for representing that the increase of the quota needs to be played back to the instruction library;
Determining whether the limit switch is in an on state;
and under the condition that the quota switch is in an on state, calling an instruction library quota service to update the increment of the quota into the instruction library by reading a playback task table in the target database.
In one embodiment, after determining whether the limit switch is in the on state, further comprising:
and under the condition that the limit switch is in an off state, directly updating the increment of the limit into the instruction library.
In one embodiment, after determining whether the fuse switch is in the on state, further comprising:
and under the condition that the fuse switch is in an off state, directly updating the increment of the quota into the instruction library.
In one embodiment, registering playback tasks with the target database includes:
registering at least one of the following as the playback task: group number, amount, accumulated time, playback time, accumulated success flag.
In one embodiment, invoking a quota service of a target database, updating data in a shareholder of the target database according to an increment of a quota, comprising:
acquiring a group main body with increased accumulated quota;
Invoking quota service in a target database, and inquiring whether data corresponding to a group main body exist in the target database according to the group number corresponding to the group main body;
inserting a piece of data as the data corresponding to the group main body under the condition that no data corresponding to the group main body is determined;
and under the condition that the data corresponding to the group main body is determined, determining a fragment library corresponding to the group main body, and updating the data in the fragment library according to the increment of the quota.
In one embodiment, the target database is a fragmented database of electronic banking business of an enterprise, and the instruction library is an internet banking instruction library of the enterprise.
A fuse limit data synchronization device, comprising:
the determining module is used for determining whether the double-write switch is in an on state or not under the condition that the accumulated quota is increased;
the calling module is used for calling the quota service of the target database under the condition that the double-write switch is in an on state, updating the data in the fragment library of the target database according to the increment of the quota, and updating the data in the instruction library according to the increment of the quota;
and the updating module is used for updating the accumulated quota of the quota into the instruction library under the condition that the double-write switch is in an off state.
In one embodiment, the calling module includes:
a first determining unit configured to determine whether the fuse switch is in an on state;
a registration unit, configured to register a playback task through the target database in a case where the fuse switch is in an on state, where the registration playback task is used to characterize an increase in the quota to be played back to the instruction library;
a second determining unit configured to determine whether the limit switch is in an on state;
and the first calling unit is used for calling the instruction library quota service to update the quota increment into the instruction library by reading the playback task table in the target database under the condition that the quota switch is in an on state.
In one embodiment, the calling module includes:
an acquisition unit configured to acquire a group principal in which an accumulated quota is increased;
the second calling unit is used for calling quota service in a target database and inquiring whether data corresponding to the group main body exist in the target database according to the group number corresponding to the group main body;
an inserting unit, configured to insert a piece of data as data corresponding to the group main body, if it is determined that there is no data corresponding to the group main body;
And the updating unit is used for determining a fragment library corresponding to the group main body under the condition that the data corresponding to the group main body is determined, and updating the data in the fragment library according to the increment of the quota.
An electronic device comprising a processor and a memory for storing processor-executable instructions, which when executed by the processor implement the steps of the above-described method.
A computer readable storage medium having stored thereon computer instructions which when executed perform the steps of the above method.
According to the fusing limit data synchronization method and device, whether the double-write switch is in an on state is determined under the condition that the accumulated limit is increased; when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota; and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library. That is, whether to synchronize the fuse limit data to the target database is controlled by setting the double-write switch, so that the problems of large resource consumption, incomplete transformation, low synchronization aging and system stability existing in the existing data synchronization by adopting a queue mode can be solved, and the technical effects of improving the synchronization efficiency, reducing the time delay and reducing the resource occupation are achieved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a method flow diagram of one embodiment of a fuse limit data synchronization method provided herein;
FIG. 2 is an interactive schematic diagram of a fuse quota data synchronization method provided herein;
FIG. 3 is a block diagram of the hardware architecture of an electronic device of a fuse limit data synchronization method provided in the present application;
fig. 4 is a block diagram of a fuse limit data synchronizer provided in the present application.
Detailed Description
In order to better understand the technical solutions in the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
FIG. 1 is a flow chart of one embodiment of a fuse limit data synchronization method provided herein. Although the present application provides a method operation step or apparatus structure as shown in the following examples or figures, more or fewer operation steps or module units may be included in the method or apparatus based on routine or non-inventive labor. In the steps or structures where there is no necessary causal relationship logically, the execution order of the steps or the module structure of the apparatus is not limited to the execution order or the module structure shown in the drawings and described in the embodiments of the present application. The described methods or module structures may be implemented sequentially or in parallel (e.g., in a parallel processor or multithreaded environment, or even in a distributed processing environment) in accordance with the embodiments or the method or module structure connection illustrated in the figures when implemented in a practical device or end product application.
Specifically, as shown in fig. 1, the above-mentioned fuse limit data synchronization method may include the following steps:
step 101: determining whether the double write switch is in an on state if the cumulative limit increases;
that is, a double write switch is provided, and the synchronous update flow of the quota data is determined by the open/close state of the double write switch.
Step 102: when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota;
specifically, a fuse switch and a limit switch can be further arranged, and under the condition that the double-write switch is in an on state, the fuse switch and the limit switch are combined to perform finer and more accurate data synchronization.
For example, when the double-write switch is in an on state, invoking a quota service of a target database, and updating data in a fragment library of the target database according to an increment of a quota, it may be determined whether the fuse switch is in an on state; when the fuse switch is in an on state, registering a playback task through the target database, wherein the registration playback task is used for representing that the increase of the quota needs to be played back to the instruction library; determining whether the limit switch is in an on state; and under the condition that the quota switch is in an on state, calling an instruction library quota service to update the increment of the quota into the instruction library by reading a playback task table in the target database.
If the limit switch is in an off state, directly updating the increment of the limit into the instruction library; if the fuse switch is in the off state, the increment of the quota is also updated directly into the instruction library.
The above registration of the playback task by the target database may be, but is not limited to, registration of at least one of the following as the playback task: group number, amount, accumulated time, playback time, accumulated success flag.
Step 103: and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library.
The target database may be an F-EBBCBASE (enterprise electronic banking) database, that is, a new database, in the form of a sliced database, where data of different groups are stored in own slices, and where data of all groups are stored together in an instruction library, and the concept of slicing storage does not exist. When the quota service of the target database is called and the data in the fragment library of the target database is updated according to the increment of the quota, the method can be realized according to the following steps:
s1: acquiring a group main body with increased accumulated quota;
S2: invoking quota service in a target database, and inquiring whether data corresponding to a group main body exist in the target database according to the group number corresponding to the group main body;
s3: inserting a piece of data as the data corresponding to the group main body under the condition that no data corresponding to the group main body is determined;
s4: and under the condition that the data corresponding to the group main body is determined, determining a fragment library corresponding to the group main body, and updating the data in the fragment library according to the increment of the quota.
That is, it is first determined whether there is data for the quota increased group in the new database, if not, a piece of data is added for characterizing the specific data, and if so, updating of the quota data is performed.
In the above example, in the case where the cumulative limit increases, it is determined whether the double write switch is in the on state; when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota; and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library. That is, whether to synchronize the fuse limit data to the target database is controlled by setting the double-write switch, so that the problems of large resource consumption, incomplete transformation, low synchronization aging and system stability existing in the existing data synchronization by adopting a queue mode can be solved, and the technical effects of improving the synchronization efficiency, reducing the time delay and reducing the resource occupation are achieved.
The above method is described below in connection with a specific embodiment, however, it should be noted that this specific embodiment is only for better illustrating the present application and is not meant to be a undue limitation on the present application.
For example, assuming a client, after submitting a command, it is necessary to add 1 element of his daily cumulative limit data to the background database, and the daily cumulative limit data is known to be 100 elements before submitting a transaction. Then the daily cumulative limit data in the instruction library and EBBCBASE library (target database) limit table should be updated to 101 yuan after the customer commit transaction is successful as expected. According to the existing data synchronization scheme, the data update flow is as follows:
step1, judging that the quota is added by 1 element in the instruction library, and accumulating in the quota table of the instruction library, wherein the daily accumulated quota data in the quota table is updated to be 101 elements, and the daily accumulated quota data of the group in the EBBCBASE fragment library is still 100 elements.
Step2, starting cdc synchronization, and pushing the daily cumulative quota 101 element of the group in the instruction library to the KAFKA message queue.
Step3, the data pull thread of EBBCBASE pulls the daily cumulative limit for the group from the KAFKA message queue to 101 yuan.
Step4, the EBBCBASE judges the fragment where the group is located, and updates the daily cumulative limit 101 element into the fragment library. At this time, the instruction library is consistent with the EBBCBASE database, and synchronization is completed.
Because CDC and KAFKA related resources need to be applied in the process of data synchronization, and because data synchronization is performed in a queue manner, a great time delay exists. Aiming at the problems of large resource consumption, incomplete transformation, low synchronous aging, insufficient system stability and the like of the existing fusing limit data synchronization mechanism, in the example, an enterprise network silver fusing limit data synchronization scheme is provided, which can comprise the following steps:
s1: the transaction code of the F-EBANKC related quota is modified, the public operation is called, as shown in figure 2, the logic code for judging the double-write switch is added, and meanwhile, the processing code recorded in the instruction library for the quota data in the original code is reserved. When the double-on switch is turned off, the quota data is updated and transferred to the original judgment storage process, and is updated into the F-EBANKC instruction library, and data synchronization is not performed; and when the double-on switch is on, calling the EBBCBASE quota service to perform quota accumulation and judgment.
S2: modifying the EBBCBASE quota accumulation judging service, firstly inquiring whether data exists according to the group number, inserting one piece if the data does not exist, and writing the latest quota data of the instruction library into the corresponding F-EBBCBASE slicing database according to the rule of (the time stamp in the uploading time stamp > table) or (the time stamp in the uploading time stamp = the time stamp in the table and the amount of money in the uploading time stamp > table) if the data exists.
S3: functional code is added to register the playback quota task to record whether the transaction has a record of invoking a new flow (EBBCBASE quota service) for registering the post-fuse EBBCBASE quota data, including but not limited to: the group number, the amount, the accumulated time, the playback time, the accumulated success mark and the like are added, meanwhile, a logic code for judging the fuse switch is added, and if the fuse switch is on, a newly added registration playback task is called for reversely synchronizing limit data back to the instruction library; and if the fusing switch is off, returning a judging result to the next step.
S4: F-EBANKC newly increases and judges the function code of the current quota change-over switch, newly increases and plays back and reads the function code, and meanwhile increases and makes compatible judgment to the fusing switch return result in S3. And under the condition that the return result of the fusing switch is on, judging a limit change-over switch, if the limit change-over switch is on, switching to EBBCBASE for limit control, and at the moment, reading a playback task table recorded by the EBBCBASE in S2 by the instruction library, performing anti-synchronization on limit data accumulated in the F-EBBCBASE slicing database, synchronizing the limit data to the instruction library, and ensuring the consistency of the instruction library and the F-EBBCBASE database. If the limit switch is off, the limit accumulation and judgment are carried out in the instruction library, the original data updating flow is carried out to record limit data in the instruction library, and the judgment result (and abnormal condition) returned by the EBBCBASE limit service is ignored.
S5: and under the condition that the fusing switch returns to off, skipping judgment of the quota service switching switch, directly calling a quota accumulating flow of the instruction library, and recording quota data in the instruction library.
For example, the synchronization of the 1-member group day accumulation limit is added, and by way of example, the data update process may include the following cases:
(1) The double write switch is on, the fuse switch is on, and the limit change-over switch is on:
step1, judging the quota to be added by 1 element in the instruction library, and then judging the double-write switch. At this time, if the switch is on, the F-EBBCBASE quota service is called, 1 element is accumulated in the EBBCBASE fragment library, and at this time, the daily accumulated quota data in the EBBCBASE quota table is updated to be 101 elements.
Step2, after the data updating is completed, judging that the fuse switch is turned on at the moment, and registering a playback task by the EBBCBASE database, namely, the group daily cumulative limit needs to be played back to the instruction library, and updating and recording the updated record as a newly added 1-element.
Step3, after the registration playback task is completed, the instruction library judges that the limit change-over switch is turned on, and at the moment, the instruction library limit service adds 1 element to the group daily accumulated limit by reading the EBBCBASE playback task table, and updates the data to 101 elements. The instruction library is consistent with the EBBCBASE database.
(2) The double write switch is on, the fuse switch is on, and the limit switch is off:
step1, judging the quota to be added by 1 element in the instruction library, and then judging the double-write switch. At this time, if the switch is on, the F-EBBCBASE quota service is called, 1 element is accumulated in the EBBCBASE fragment library, and at this time, the daily accumulated quota data in the EBBCBASE quota table is updated to be 101 elements.
Step2, after the data updating is completed, judging that the fuse switch is turned on at the moment, and registering a playback task by the EBBCBASE database, namely, the group daily cumulative limit needs to be played back to the instruction library, and updating and recording the updated record as a newly added 1-element.
Step3, after the registration and playback task is completed, the instruction library judges that the limit change-over switch is closed, at the moment, the data is subjected to limit accumulation and judgment in the instruction library, the judgment result returned by the EBBCBASE fusing switch is ignored, and the update date accumulation is directly 101 yuan in the limit table of the instruction library. The instruction library is consistent with the EBBCBASE database.
(3) The double-write switch is on, the fusing switch is off, and the result of fusing off at the moment does not judge the limit switch:
step1, judging the quota to be added by 1 element in the instruction library, and then judging the double-write switch. At this time, if the switch is on, the F-EBBCBASE quota service is called, 1 element is accumulated in the EBBCBASE fragment library, and at this time, the daily accumulated quota data in the EBBCBASE quota table is updated to be 101 elements.
Step2, after the data updating is completed, judging that the fusing switch is off at the moment, and directly accumulating the updating date into 101 yuan in the instruction library quota table without judging the quota switch at the moment. The instruction library is consistent with the EBBCBASE database.
(4) The double write switch is off:
step1, directly recording the quota data in an instruction library, and accumulating the updated date in the quota table of the instruction library to be 101 yuan. Instruction library data is not synchronized to the EBBCBASE database.
In the above example, the real-time synchronization of the fuse forehead data is realized through the judgment of the logic switch, and compared with the existing data synchronization schemes of CDC and KAFKA, the method has the following advantages:
1) The method only relates to the new addition and modification of the logic codes, the group which is not split can be used for multiplexing, the switch is automatically maintained, and the stability is good. After all product groups related to quota information are changed to call the EBBCBASE service in the later period, the transaction can be decoupled from the instruction library, the transformation is more thorough, and the reusability is high.
2) The method has the advantages that any container or equipment is not required to be applied, only the service logic codes are required to be modified, if maintenance is required in the later period, each product can be self-carried out by modifying and calling the service logic in the background, production monitoring personnel are not required to specially monitor the logic, the estimated stability is improved by 80%, the production maintenance cost is reduced by 90%, and therefore the system operation maintenance cost is low.
3) All limit data updates are registered online along with the transaction, are synchronous in real time, have no delay, avoid the condition of delaying for 1-3 hours existing in the existing scheme, ensure that the information of the accumulated limit of the foreground transaction is accurate, and cannot influence the foreground transaction, so that the timeliness is high, and the information accuracy is high.
4) If the data synchronization logic needs to be modified in the next newly increased demand, only the data synchronization logic code needs to be modified, and the modification or the revocation scheme does not need to be performed again, so that the maintainability is high.
The method embodiments provided in the above embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the example of running on an electronic device, fig. 3 is a block diagram of a hardware structure of the electronic device of a fuse limit data synchronization method provided in the present application. As shown in fig. 3, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (the processors 02 may include, but are not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 04 for storing data, and a transmission module 06 for communication functions. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 3 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device 10 may also include more or fewer components than shown in FIG. 3, or have a different configuration than shown in FIG. 3.
The memory 04 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the fuse data synchronization method in the embodiment of the present application, and the processor 02 executes the software programs and modules stored in the memory 04, thereby executing various functional applications and data processing, that is, implementing the fuse data synchronization method of the application program described above. Memory 04 may include high-speed random access memory, but may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 04 may further include memory located remotely from processor 02, which may be connected to electronic device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission module 06 is used for receiving or transmitting data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 06 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission module 06 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
At the software level, the fuse limit data synchronization device may, as shown in fig. 4, include:
a determining module 401, configured to determine whether the double write switch is in an on state in the case of an increase in the cumulative limit;
a calling module 402, configured to call a quota service of a target database when the double-write switch is in an on state, update data in a fragment library of the target database according to an increment of a quota, and update data in an instruction library according to the increment of the quota;
and the updating module 403 is configured to update the accumulated quota of the quota to the instruction library when the double write switch is in an off state.
In one embodiment, the calling module 402 may include: a first determining unit configured to determine whether the fuse switch is in an on state; a registration unit, configured to register a playback task through the target database in a case where the fuse switch is in an on state, where the registration playback task is used to characterize an increase in the quota to be played back to the instruction library; a second determining unit configured to determine whether the limit switch is in an on state; and the first calling unit is used for calling the instruction library quota service to update the quota increment into the instruction library by reading the playback task table in the target database under the condition that the quota switch is in an on state.
In one embodiment, the calling module 402 may include: an acquisition unit configured to acquire a group principal in which an accumulated quota is increased; the second calling unit is used for calling quota service in a target database and inquiring whether data corresponding to the group main body exist in the target database according to the group number corresponding to the group main body; an inserting unit, configured to insert a piece of data as data corresponding to the group main body, if it is determined that there is no data corresponding to the group main body; and the updating unit is used for determining a fragment library corresponding to the group main body under the condition that the data corresponding to the group main body is determined, and updating the data in the fragment library according to the increment of the quota.
In one embodiment, after determining whether the limit switch is in the on state, it may further include: and under the condition that the limit switch is in an off state, directly updating the increment of the limit into the instruction library.
In one embodiment, after determining whether the fuse switch is in the on state, it may further include: and under the condition that the fuse switch is in an off state, directly updating the increment of the quota into the instruction library.
In one embodiment, registering playback tasks through the target database may include: registering at least one of the following as the playback task: group number, amount, accumulated time, playback time, accumulated success flag.
In one embodiment, the target database may be a sharded database of electronic banking of an enterprise, and the instruction library may be an online banking instruction library of an enterprise.
The embodiment of the application also provides a specific implementation mode of the electronic device capable of realizing all the steps in the fusing quota data synchronization method in the embodiment, and the electronic device specifically comprises the following contents: a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the processor is configured to invoke the computer program in the memory, where the processor executes the computer program to implement all the steps in the fuse limit data synchronization method in the foregoing embodiment, for example, the processor executes the computer program to implement the following steps:
Step 1: determining whether the double write switch is in an on state if the cumulative limit increases;
step 2: when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota;
step 3: and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library.
As can be seen from the above description, in the embodiment of the present application, in the case where the cumulative limit increases, it is determined whether the double write switch is in the on state; when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota; and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library. That is, whether to synchronize the fuse limit data to the target database is controlled by setting the double-write switch, so that the problems of large resource consumption, incomplete transformation, low synchronization aging and system stability existing in the existing data synchronization by adopting a queue mode can be solved, and the technical effects of improving the synchronization efficiency, reducing the time delay and reducing the resource occupation are achieved.
The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the fuse data synchronization method in the above embodiments, the computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the fuse data synchronization method in the above embodiments, for example, the processor implementing the following steps when executing the computer program:
step 1: determining whether the double write switch is in an on state if the cumulative limit increases;
step 2: when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota;
step 3: and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library.
As can be seen from the above description, in the embodiment of the present application, in the case where the cumulative limit increases, it is determined whether the double write switch is in the on state; when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota; and under the condition that the double-write switch is in an off state, updating the accumulated quota of the quota into the instruction library. That is, whether to synchronize the fuse limit data to the target database is controlled by setting the double-write switch, so that the problems of large resource consumption, incomplete transformation, low synchronization aging and system stability existing in the existing data synchronization by adopting a queue mode can be solved, and the technical effects of improving the synchronization efficiency, reducing the time delay and reducing the resource occupation are achieved.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a hardware+program class embodiment, the description is relatively simple, as it is substantially similar to the method embodiment, as relevant see the partial description of the method embodiment.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Although the present application provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an actual device or client product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a car-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although the present description provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. 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, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when implementing the embodiments of the present disclosure, the functions of each module may be implemented in the same or multiple pieces of software and/or hardware, or a module that implements the same function may be implemented by multiple sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller can be regarded as a hardware component, and means for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description embodiments may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present embodiments may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of an embodiment of the present disclosure and is not intended to limit the embodiment of the present disclosure. Various modifications and variations of the illustrative embodiments will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the embodiments of the present specification, should be included in the scope of the claims of the embodiments of the present specification.

Claims (7)

1. A fuse limit data synchronization method, the method comprising:
determining whether the double write switch is in an on state if the cumulative limit increases;
when the double-write switch is in an on state, invoking quota service of a target database, updating data in a fragment library of the target database according to the increase of the quota, and updating data in an instruction library according to the increase of the quota;
updating the increment of the quota into the instruction library under the condition that the double-write switch is in an off state;
the method for updating the data in the instruction library according to the increment of the quota comprises the following steps: determining whether the fuse switch is in an on state; when the fuse switch is in an on state, registering a playback task through the target database, wherein the registration playback task is used for representing that the increase of the quota needs to be played back to the instruction library; determining whether the limit switch is in an on state; under the condition that a quota switch is in an on state, calling an instruction library quota service to update an increment of a quota into the instruction library by reading a playback task table in the target database;
Wherein after determining whether the limit switch is in the on state, further comprising: under the condition that the limit switch is in an off state, directly updating the increment of the limit into the instruction library; after determining whether the fuse switch is in the on state, further comprising: and under the condition that the fuse switch is in an off state, directly updating the increment of the quota into the instruction library.
2. The method of claim 1, wherein registering playback tasks through the target database comprises:
registering at least one of the following as the playback task: group number, amount, accumulated time, playback time, accumulated success flag.
3. The method of claim 1, wherein invoking the quota service of the target database updates data in the sharded library of the target database according to the increased quota, comprising:
acquiring a group main body with increased accumulated quota;
invoking quota service in a target database, and inquiring whether data corresponding to a group main body exist in the target database according to the group number corresponding to the group main body;
inserting a piece of data as the data corresponding to the group main body under the condition that no data corresponding to the group main body is determined;
And under the condition that the data corresponding to the group main body is determined, determining a fragment library corresponding to the group main body, and updating the data in the fragment library according to the increment of the quota.
4. A method according to any one of claims 1 to 3, wherein the target database is a sharded database of an electronic banking business of an enterprise and the instruction library is an internet banking instruction library of an enterprise.
5. A fuse limit data synchronizing device, comprising:
the determining module is used for determining whether the double-write switch is in an on state or not under the condition that the accumulated quota is increased;
the calling module is used for calling the quota service of the target database under the condition that the double-write switch is in an on state, updating the data in the fragment library of the target database according to the increment of the quota, and updating the data in the instruction library according to the increment of the quota;
the updating module is used for updating the increment of the quota into the instruction library under the condition that the double-write switch is in an off state;
the method for updating the data in the instruction library according to the increment of the quota comprises the following steps: determining whether the fuse switch is in an on state; when the fuse switch is in an on state, registering a playback task through the target database, wherein the registration playback task is used for representing that the increase of the quota needs to be played back to the instruction library; determining whether the limit switch is in an on state; under the condition that a quota switch is in an on state, calling an instruction library quota service to update an increment of a quota into the instruction library by reading a playback task table in the target database;
Wherein after determining whether the limit switch is in the on state, further comprising: under the condition that the limit switch is in an off state, directly updating the increment of the limit into the instruction library; after determining whether the fuse switch is in the on state, further comprising: and under the condition that the fuse switch is in an off state, directly updating the increment of the quota into the instruction library.
6. An electronic device comprising a processor and a memory for storing processor-executable instructions which when executed by the processor implement the steps of the method of any one of claims 1 to 4.
7. A computer readable storage medium having stored thereon computer instructions which when executed implement the steps of the method of any of claims 1 to 4.
CN202110350495.0A 2021-03-31 2021-03-31 Fuse quota data synchronization method and device Active CN112860804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110350495.0A CN112860804B (en) 2021-03-31 2021-03-31 Fuse quota data synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110350495.0A CN112860804B (en) 2021-03-31 2021-03-31 Fuse quota data synchronization method and device

Publications (2)

Publication Number Publication Date
CN112860804A CN112860804A (en) 2021-05-28
CN112860804B true CN112860804B (en) 2024-03-08

Family

ID=75991948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110350495.0A Active CN112860804B (en) 2021-03-31 2021-03-31 Fuse quota data synchronization method and device

Country Status (1)

Country Link
CN (1) CN112860804B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101627A (en) * 2018-08-14 2018-12-28 交通银行股份有限公司 heterogeneous database synchronization method and device
CN110335033A (en) * 2019-07-09 2019-10-15 中国工商银行股份有限公司 Limit processing method and system
CN111641214A (en) * 2020-07-11 2020-09-08 李瑶 Stable quota monitoring and checking system
CN111798301A (en) * 2020-06-28 2020-10-20 中国建设银行股份有限公司 Resource transfer quota determining method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101627A (en) * 2018-08-14 2018-12-28 交通银行股份有限公司 heterogeneous database synchronization method and device
CN110335033A (en) * 2019-07-09 2019-10-15 中国工商银行股份有限公司 Limit processing method and system
CN111798301A (en) * 2020-06-28 2020-10-20 中国建设银行股份有限公司 Resource transfer quota determining method, device and system
CN111641214A (en) * 2020-07-11 2020-09-08 李瑶 Stable quota monitoring and checking system

Also Published As

Publication number Publication date
CN112860804A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CA3087309C (en) Blockchain-based data processing method and device
CN108280080B (en) Data synchronization method and device and electronic equipment
CN104809202B (en) A kind of method and apparatus of database synchronization
US7827299B2 (en) Transitioning between historical and real time data streams in the processing of data change messages
CN109493076A (en) A kind of unique consuming method of Kafka message, system, server and storage medium
CN109376197B (en) Data synchronization method, server and computer storage medium
CN110765165B (en) Method, device and system for synchronously processing cross-system data
CN105530272A (en) Method and device for application data synchronization
CN106375360B (en) Graph data updating method, device and system
CN111881116A (en) Data migration method, data migration system, computer system, and storage medium
CN111597197B (en) Data reconciliation method and device between databases, storage medium and electronic equipment
CN106339387B (en) Increase the method for data synchronization and device of server in a kind of data-base cluster newly
CN112925614A (en) Distributed transaction processing method, device, medium and equipment
CN111163172B (en) Message processing system, method, electronic device and storage medium
CN112069195A (en) Database-based message transmission method and device, electronic equipment and storage medium
CN110427426A (en) A kind of data synchronizing processing method and device
CN112860804B (en) Fuse quota data synchronization method and device
CN111414356A (en) Data storage method and device, non-relational database system and storage medium
CN109635020A (en) A kind of processing method of business, device, equipment and system
CN110019131A (en) A kind of method and apparatus of discs business
CN105488047B (en) Metadata reading/writing method and device
CN116186082A (en) Data summarizing method based on distribution, first server and electronic equipment
CN115658357A (en) Method and apparatus for replaying blockchain transactions
CN116701387A (en) Data segmentation writing method, data reading method and device
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium

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