CN113505110A - Double-log-surface anti-duplication method and device during cross-day cutting - Google Patents

Double-log-surface anti-duplication method and device during cross-day cutting Download PDF

Info

Publication number
CN113505110A
CN113505110A CN202110773741.3A CN202110773741A CN113505110A CN 113505110 A CN113505110 A CN 113505110A CN 202110773741 A CN202110773741 A CN 202110773741A CN 113505110 A CN113505110 A CN 113505110A
Authority
CN
China
Prior art keywords
transaction
host
date
record
log table
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.)
Granted
Application number
CN202110773741.3A
Other languages
Chinese (zh)
Other versions
CN113505110B (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 CN202110773741.3A priority Critical patent/CN113505110B/en
Publication of CN113505110A publication Critical patent/CN113505110A/en
Application granted granted Critical
Publication of CN113505110B publication Critical patent/CN113505110B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a double-log-surface anti-duplication method and a device during cross-day cutting, which can be used in the financial field or other technical fields, and the method comprises the following steps: when a platform calls a host to process a transaction, if the host processes the transaction abnormally, judging whether the current system date of the host is the same as the transaction date of the transaction; if the current system date of the host is different from the transaction date of the transaction, respectively registering a null rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, wherein the null rollback record comprises an event number field, and the field value of the event number field is equal to the field value of the forward host event number field. The invention realizes the functions of idle rollback and suspension prevention of the transaction of the host accessed to the distributed platform during the cross-day switching.

Description

Double-log-surface anti-duplication method and device during cross-day cutting
Technical Field
The invention relates to the technical field of distributed transaction processing, in particular to a double-log-surface anti-duplication method and device during cross-day cutting.
Background
As more and more applications fall on the floor of the distributed system, the logic complexity of the system increases, and the handling capability for the emergency is more demanding. However, different applications and service calling relations in production are complicated, and once a certain link has network delay and logic problems are suspicious, the program can rely on the channel log to realize null rollback and suspension prevention. If the channel is repeatedly initiated, the service provider is not controlled, and the transaction can be repeatedly initiated; if the service provider only controls the repetition without returning the last processing result, the client cannot sense the transaction result, and the client experience is influenced.
According to the specification requirements of 'distributed transaction development technical specification', the branch transaction incorporated in the distributed transaction management should meet idempotent, idle rollback and anti-hanging design. For the application of which the branch transaction is platform distributed, the application takes the event number as a transaction uniqueness judgment condition and a main key, establishes a relevant transaction log/register book, and records and stores the results of idempotent, null rollback and anti-suspension processing. The one-to-one relation between the channel logs of the host and the events is fully utilized as the design characteristic of a main event table, and the idempotent, idle rollback and anti-hanging functions of the host application are realized. Most applications can meet the host service transaction management requirements. However, in a few cases, due to the double-sided design of channel logs, the power, idle rollback and anti-hanging mechanisms in the cross-day switching period fail. For example, for idle rollback and suspension prevention, for example, an idle rollback record is registered for a transaction instruction on a T day, but due to a T day DSR network or a system environment, the instruction is re-sent on a T +1 day, so that two different transaction states exist in one instruction at the same time, and thus an idle rollback and suspension prevention mechanism fails.
In order to solve the problems of idle rollback and failure of a suspension prevention mechanism caused by specific conditions, the scheme provides a double-log-surface anti-duplication method in a cross-sun switching period.
Disclosure of Invention
The invention provides a method and a device for preventing duplicate logs in a cross-day cutting period, aiming at solving the technical problems in the background art.
In order to achieve the above object, according to one aspect of the present invention, there is provided a duplicate prevention method for a dual journaling face cross-sun cut period, the method comprising:
when a platform calls a host to process a transaction, if the host processes the transaction abnormally, judging whether the current system date of the host is the same as the transaction date of the transaction, wherein before the platform calls the host to process the transaction, a transaction record corresponding to the transaction is generated in a calling host event log table, and the transaction record comprises a forward host event number field;
if the current system date of the host is different from the transaction date of the transaction, respectively registering a null rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, wherein the null rollback record comprises an event number field, and the field value of the event number field is equal to the field value of the forward host event number field.
Optionally, when the host processes the transaction, a transaction record corresponding to the transaction is generated in a host channel log table, where the transaction record of the transaction in the host channel log table includes an event number field and a transaction state field, and a field value of the event number field is the same as a field value of the host event number field in the forward direction; and when the host computer is successful in processing the transaction, setting a transaction state field as a first field value, and when the host computer is failed in processing the transaction, setting the transaction state field as a second field value.
Optionally, the method for preventing duplicate logs during the cross-day cutting further includes:
and if the current system date of the host is the same as the transaction date of the transaction, registering a null-rollback record corresponding to the transaction in a host channel log table corresponding to the current system date.
Optionally, the method for preventing duplicate logs during the cross-day cutting further includes:
if the registration of the empty rollback record in the host channel log table corresponding to the current system date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of a transaction state field exists in the host channel log table corresponding to the current system date;
and if so, calling the host computer to perform compensation processing on the transaction through the platform.
Optionally, the method for preventing duplicate logs during the cross-day cutting further includes:
if the registration of the empty rollback record in the host channel log table corresponding to the transaction date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of a transaction state field exists in the host channel log table corresponding to the transaction date;
and if so, calling the host computer to perform compensation processing on the transaction through the platform.
Optionally, when the host is called to perform the compensation processing of the transaction, the platform generates a compensated host event number, and adds the generated compensated host event number to a compensated host event number field in a transaction record corresponding to the transaction in the call host event log table;
and when the host carries out the compensation processing of the transaction, generating a transaction record corresponding to the compensation processing of the transaction in a host channel log table, wherein the transaction record corresponding to the compensation processing of the transaction comprises an event number field, and the field value of the event number field is the host event number on the compensation.
Optionally, the abnormality specifically includes: the host processes the transaction timeout.
In order to achieve the above object, according to another aspect of the present invention, there is provided a duplicate prevention apparatus for a dual journaling face cross-sun cut period, the apparatus including:
the system comprises an exception judging module, a transaction processing module and a transaction processing module, wherein the exception judging module is used for judging whether the current system date of a host is the same as the transaction date of the transaction if the host processes the transaction abnormally when a platform calls the host to process the transaction, the platform generates a transaction record corresponding to the transaction in a calling host event log table before calling the host to process the transaction, and the transaction record comprises a forward host event number field;
a first empty rollback record registering module, configured to register an empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, if the current system date of the host is different from the transaction date of the transaction, respectively, where the empty rollback record includes an event number field, and a field value of the event number field is equal to a field value of the host event number field located immediately above.
Optionally, the double-log-surface anti-duplication device used during the inter-daily cutting period further includes:
and the second empty rollback record registering module is used for registering the empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date if the current system date of the host is the same as the transaction date of the transaction.
Optionally, the double-log-surface anti-duplication device used during the inter-daily cutting period further includes:
the first registration failure processing module is used for determining whether a transaction record which corresponds to the transaction and has a first field value as a field value of a transaction state field exists in a host channel log table corresponding to the current system date when the empty rollback record is not registered in the host channel log table corresponding to the current system date, and calling the host to perform compensation processing on the transaction through the platform when the transaction record exists;
and the second registration failure processing module is used for determining whether a transaction record which corresponds to the transaction and has a transaction state field value as a first field value exists in the host channel log table corresponding to the transaction date when the empty rollback record is not registered in the host channel log table corresponding to the transaction date, and calling the host to perform compensation processing on the transaction through the platform when the transaction record exists.
To achieve the above object, according to another aspect of the present invention, there is also provided a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the above duplicate log-plane anti-duplication method across a daily cutting period when executing the computer program.
To achieve the above object, according to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the above-described duplicate prevention method for a dual-log-plane cross-sun cut period.
The invention has the beneficial effects that:
when a platform calls a host to process a transaction, if the host processes the transaction abnormally, judging whether the current system date of the host is the same as the transaction date of the transaction or not; if the current system date of the host is different from the transaction date of the transaction, the empty rollback record corresponding to the transaction is respectively registered in the host channel log table corresponding to the current system date and the host channel log table corresponding to the transaction date.
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 introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts. In the drawings:
FIG. 1 is a flow chart of a method for preventing duplicate logs during a cross-sun cut in an embodiment of the invention;
FIG. 2 is a first flowchart of a registration failure process according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a registration failure process according to an embodiment of the present invention;
FIG. 4 is a diagram of an application scenario of an embodiment of the present invention;
FIG. 5 is a first block diagram of a duplicate prevention apparatus during a double-log-plane cross-sun cut according to an embodiment of the present invention;
FIG. 6 is a second block diagram of the duplicate prevention apparatus during the double-log-plane cross-sun switch according to the embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
It should be noted that the duplicate prevention method and device for the double-log-surface cross-day cutting period can be used in the financial field and can also be applied in other technical fields, and the technical field of application is not limited by the invention.
Fig. 4 is an application scenario diagram of the present invention, as shown in fig. 4, the event log table of the calling host is maintained by a platform (also called platform service or distributed platform), the platform calls the host to perform transaction processing, and the host is responsible for maintaining the channel log table of the host and returning a transaction result to the platform.
In an alternative embodiment of the present invention, as shown in Table 1 below, each note in the call host event Log table contains: a forward host event number, a forward transaction status, and a compensated host event number. In an alternative embodiment of the present invention, as shown in Table 2 below, each note in the host channel log table contains: event number, transaction status, and empty rollback flag. The forward upper host event number and the compensation upper host event number of the calling host event log table respectively and uniquely correspond to a record of a host channel log table, and the 'event number' recorded in the host channel log table is unique.
Table 1 calling host event log table (part)
Figure BDA0003153449390000051
Figure BDA0003153449390000061
Table 2 host channel log table (part)
Field(s) Field value Description of field
Event numbering
Status of transaction 1-transaction success; 2-transaction failure
Empty rollback mark Log for marking whether to rollback a registration
Fig. 1 is a flowchart of a duplicate prevention method during a dual-log-plane cross-day cut according to an embodiment of the present invention, and as shown in fig. 1, in an embodiment of the present invention, the duplicate prevention method during the dual-log-plane cross-day cut according to the present invention includes step S101 and step S102.
Step S101, when a platform calls a host to process a transaction, if the host processes the transaction abnormally, whether the current system date of the host is the same as the transaction date of the transaction is judged, wherein before the platform calls the host to process the transaction, a transaction record corresponding to the transaction is generated in a call host event log table, and the transaction record comprises a forward host event number field.
In an embodiment of the present invention, when the host processes the transaction, a transaction record corresponding to the transaction is generated in a host channel log table, the transaction record of the transaction in the host channel log table includes an event number field and a transaction status field, and a field value of the event number field is the same as a field value of the host event number field in the forward direction; and when the host computer is successful in processing the transaction, setting a transaction state field as a first field value, and when the host computer is failed in processing the transaction, setting the transaction state field as a second field value.
In one embodiment of the invention, the first field value is used to indicate that the transaction was successful, for example, the number "1" may be used. In one embodiment of the invention, the second field value is used to indicate a transaction failure, for example, the number "2" may be used.
In an embodiment of the present invention, the exception specifically includes: the host processes the transaction timeout.
In a specific embodiment of the invention, when the platform calls that the host computer has transaction processing abnormity, the step calls the empty rollback common method module of the platform. The empty rollback common method module of the platform calls a channel log processing component of the host, and whether the cross-day switching is performed or not is judged firstly. The empty rollback common method module calls a host channel log processing component to query a host system control table to obtain a host system date. And then comparing and judging the date of the host system and the transaction date of the transaction, and if the date of the host system is inconsistent with the transaction date, indicating that the date is changed from day to day. If consistent, it indicates no cross-day cut. Then different operations are performed according to whether the operation is performed across days.
Step S102, if the current system date of the host is different from the transaction date of the transaction, registering a null rollback record corresponding to the transaction in the host channel log table corresponding to the current system date and the host channel log table corresponding to the transaction date, respectively, where the null rollback record includes an event number field, and a field value of the event number field is equal to a field value of the host event number field located in the forward direction.
In the embodiment of the present invention, if the host has been cut across days, that is, the current system date of the host is different from the transaction date of the transaction, the present invention respectively registers the empty rollback records corresponding to the transaction in the host channel log table corresponding to the current system date (i.e., day T + 1) and the host channel log table corresponding to the transaction date (i.e., day T) based on the forward host event number of the transaction in the host channel log table.
In an embodiment of the present invention, the method for preventing duplicate logs during cross-day cutting further includes:
and if the current system date of the host is the same as the transaction date of the transaction, registering a null-rollback record corresponding to the transaction in a host channel log table corresponding to the current system date.
In an embodiment of the invention, if the host does not switch between days, the current system date of the host is the same as the transaction date of the transaction. According to the invention, based on the forward host event number of the transaction in the host channel log table, the empty rollback record corresponding to the transaction is registered in the host channel log table corresponding to the current system date (the current system date is the same as the transaction date and is regarded as T date).
In the embodiment of the present invention, the empty rollback record is each note record in the host channel log table, and the empty rollback record also includes: event number, transaction status, and empty rollback flag. The empty rollback flag field in the empty rollback record is not empty, i.e., the empty rollback record contains an empty rollback flag. The field value of the event number field of the empty rollback record is equal to the field value of the forward host event number field.
In the embodiment of the invention, because the registration of the empty rollback record in the host channel log table is performed by using the forward host event number as the main key, if one record with the event number as the forward host event number already exists in the host channel log table, the main key conflict occurs, and the registration fails.
If the registration of the empty rollback record is successful, it indicates that the empty rollback record is registered before the original transaction registration host log, such a record is called an empty rollback record, and in order to distinguish from the normal transaction record, it is necessary to add a flag field to mark the empty rollback record (this scheme uses the empty rollback flag of table 2 for marking, the same applies hereinafter).
Based on the empty rollback mechanism, when the original transaction is called again after the network or system environment is recovered, the event number of the host in the forward direction is the same as the event number of the empty rollback record, so that the main key of the log list of the registered host channel conflicts, the processing is refused, and the anti-hanging is realized.
Fig. 2 is a first flowchart of a registration failure process according to an embodiment of the present invention, and as shown in fig. 2, in an embodiment of the present invention, the duplicate prevention method for a dual-log-plane cross-sun cut period according to the present invention further includes step S201 and step S202.
Step S201, if the registration of the empty rollback record in the host channel log table corresponding to the current system date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of the transaction status field exists in the host channel log table corresponding to the current system date.
And step S202, if the transaction exists, calling the host computer to perform compensation processing of the transaction through the platform.
Fig. 3 is a second flowchart of the embodiment of the invention for processing the registration failure, and as shown in fig. 3, in an embodiment of the invention, the double-log-plane anti-duplication method for the cross-sun cut period further includes step S301 and step S302.
Step S301, if the registration of the empty rollback record in the host channel log table corresponding to the transaction date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of the transaction status field exists in the host channel log table corresponding to the transaction date.
Step S302, if the transaction exists, the host is called through the platform to perform compensation processing of the transaction.
In the embodiment of the invention, the invention determines whether a transaction record corresponding to the transaction and having a field value of a transaction state field as a first field value exists in the host channel log table based on the forward host event number.
In the invention, if the main key conflict occurs when the empty rollback record is registered, the invention inquires the transaction success record corresponding to the transaction in the host channel log table of the T day and the T +1 day based on the forward host event number, and the transaction success record is the transaction record of which the field value of the transaction state field is the first field value. If the record is found, calling a compensation program to perform compensation processing and registering the channel log compensation record. And if the record does not exist, directly exiting without processing.
In an embodiment of the present invention, when the host is called to perform the compensation processing of the transaction, the platform generates a compensated host event number, and adds the generated compensated host event number to a compensated host event number field in a transaction record corresponding to the transaction in the call host event log table.
In an embodiment of the present invention, when the host performs the compensation processing of the transaction, a transaction record corresponding to the compensation processing of the transaction is generated in a host channel log table, the transaction record corresponding to the compensation processing of the transaction includes an event number field and a transaction status field, and a field value of the event number field is the host event number on the compensation. The host writes a first field value in the transaction status field after successfully performing the compensation processing, and writes a second field value in the transaction status field when the compensation processing fails.
It can be seen from the above embodiments that the present invention provides a duplicate prevention method for a dual-log-plane cross-day switching period, and based on the design characteristic that each event number uniquely corresponds to one record in a host channel log table, the present invention realizes the idle rollback and hanging prevention functions of the transaction accessing the distributed platform by the host application service during the cross-day switching period. The invention can reduce the system access performance overhead as much as possible, greatly reduce the complexity and labor cost of system transformation, and help the application to access the heterogeneous system to the distributed transaction framework in the transformation process of the system architecture.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
Based on the same inventive concept, the embodiment of the present invention further provides a duplicate prevention device for a dual-log-surface cross-day cut period, which can be used to implement the duplicate prevention method for the dual-log-surface cross-day cut period described in the foregoing embodiment, as described in the following embodiment. Because the principle of the solution of the duplicate prevention device during the double-log-surface cross-day cutting period is similar to that of the duplicate prevention method during the double-log-surface cross-day cutting period, the embodiment of the duplicate prevention device during the double-log-surface cross-day cutting period can be referred to as the embodiment of the duplicate prevention method during the double-log-surface cross-day cutting period, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a first structural block diagram of a duplicate prevention apparatus during a dual-log-plane cross-day cut according to an embodiment of the present invention, and as shown in fig. 5, in an embodiment of the present invention, the duplicate prevention apparatus during the dual-log-plane cross-day cut according to the present invention includes:
the system comprises an exception judgment module 1, a transaction processing module and a transaction processing module, wherein the exception judgment module 1 is used for judging whether the current system date of a host is the same as the transaction date of the transaction if the host processes the transaction abnormally when a platform calls the host to process the transaction, the platform generates a transaction record corresponding to the transaction in a calling host event log table before the host is called to process the transaction, and the transaction record comprises a forward host event number field;
a first empty rollback record registering module 2, configured to register an empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, respectively, if the current system date of the host is different from the transaction date of the transaction, where the empty rollback record includes an event number field, and a field value of the event number field is equal to a field value of the host event number field located immediately above;
and the second empty rollback record registering module 3 is configured to register an empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date if the current system date of the host is the same as the transaction date of the transaction.
Fig. 6 is a second structural block diagram of the duplicate prevention apparatus during a dual-log-plane cross-day cut according to an embodiment of the present invention, as shown in fig. 6, in an embodiment of the present invention, the duplicate prevention apparatus during a dual-log-plane cross-day cut according to the present invention further includes:
the first registration failure processing module 4 is configured to, when a null rollback record fails to be registered in the host channel log table corresponding to the current system date, determine whether a transaction record corresponding to the transaction and having a transaction state field with a first field value exists in the host channel log table corresponding to the current system date, and call the host to perform compensation processing on the transaction through the platform when the transaction record exists;
and the second registration failure processing module 5 is configured to, when a null rollback record fails to be registered in the host channel log table corresponding to the transaction date, determine whether a transaction record corresponding to the transaction and having a transaction state field value as a first field value exists in the host channel log table corresponding to the transaction date, and call the host to perform compensation processing on the transaction through the platform when the transaction record exists.
To achieve the above object, according to another aspect of the present application, there is also provided a computer apparatus. As shown in fig. 7, the computer device comprises a memory, a processor, a communication interface and a communication bus, wherein a computer program that can be run on the processor is stored in the memory, and the steps of the method of the above embodiment are realized when the processor executes the computer program.
The processor may be a Central Processing Unit (CPU). The Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes various functional applications of the processor and the processing of the work data by executing the non-transitory software programs, instructions and modules stored in the memory, that is, the method in the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the processor 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 one or more units are stored in the memory and when executed by the processor perform the method of the above embodiments.
The specific details of the computer device may be understood by referring to the corresponding related descriptions and effects in the above embodiments, and are not described herein again.
To achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the above-described duplicate prevention method during dual-journaling cross-daily cutting. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A double-log-surface anti-duplication method for a cross-day cutting period is characterized by comprising the following steps:
when a platform calls a host to process a transaction, if the host processes the transaction abnormally, judging whether the current system date of the host is the same as the transaction date of the transaction, wherein before the platform calls the host to process the transaction, a transaction record corresponding to the transaction is generated in a calling host event log table, and the transaction record comprises a forward host event number field;
if the current system date of the host is different from the transaction date of the transaction, respectively registering a null rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, wherein the null rollback record comprises an event number field, and the field value of the event number field is equal to the field value of the forward host event number field.
2. The duplicate prevention method for the dual-log-surface cross-day cut period according to claim 1, wherein the host generates a transaction record corresponding to the transaction in a host channel log table when processing the transaction, the transaction record of the transaction in the host channel log table includes an event number field and a transaction status field, and a field value of the event number field is the same as a field value of the forward host event number field; and when the host computer is successful in processing the transaction, setting a transaction state field as a first field value, and when the host computer is failed in processing the transaction, setting the transaction state field as a second field value.
3. The method of claim 2, further comprising:
and if the current system date of the host is the same as the transaction date of the transaction, registering a null-rollback record corresponding to the transaction in a host channel log table corresponding to the current system date.
4. The method of claim 2, further comprising:
if the registration of the empty rollback record in the host channel log table corresponding to the current system date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of a transaction state field exists in the host channel log table corresponding to the current system date;
and if so, calling the host computer to perform compensation processing on the transaction through the platform.
5. The method of claim 2, further comprising:
if the registration of the empty rollback record in the host channel log table corresponding to the transaction date fails, determining whether a transaction record corresponding to the transaction and having a first field value as a field value of a transaction state field exists in the host channel log table corresponding to the transaction date;
and if so, calling the host computer to perform compensation processing on the transaction through the platform.
6. The method according to claim 4 or 5, wherein the platform generates a compensated upper host event number when the host is called to perform compensation processing on the transaction, and adds the generated compensated upper host event number to a compensated upper host event number field in a corresponding transaction record of the transaction in the calling host event log table;
and when the host carries out the compensation processing of the transaction, generating a transaction record corresponding to the compensation processing of the transaction in a host channel log table, wherein the transaction record corresponding to the compensation processing of the transaction comprises an event number field, and the field value of the event number field is the host event number on the compensation.
7. The method according to claim 1, wherein the anomaly specifically comprises: the host processes the transaction timeout.
8. A dual journaling face anti-duplication apparatus for use across a daily cut, comprising:
the system comprises an exception judging module, a transaction processing module and a transaction processing module, wherein the exception judging module is used for judging whether the current system date of a host is the same as the transaction date of the transaction if the host processes the transaction abnormally when a platform calls the host to process the transaction, the platform generates a transaction record corresponding to the transaction in a calling host event log table before calling the host to process the transaction, and the transaction record comprises a forward host event number field;
a first empty rollback record registering module, configured to register an empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date and a host channel log table corresponding to the transaction date, if the current system date of the host is different from the transaction date of the transaction, respectively, where the empty rollback record includes an event number field, and a field value of the event number field is equal to a field value of the host event number field located immediately above.
9. The dual journaling surface anti-duplication apparatus during a cross-sun cut according to claim 8, further comprising:
and the second empty rollback record registering module is used for registering the empty rollback record corresponding to the transaction in a host channel log table corresponding to the current system date if the current system date of the host is the same as the transaction date of the transaction.
10. The dual journaling surface anti-duplication apparatus during a cross-sun cut according to claim 8, further comprising:
the first registration failure processing module is used for determining whether a transaction record which corresponds to the transaction and has a first field value as a field value of a transaction state field exists in a host channel log table corresponding to the current system date when the empty rollback record is not registered in the host channel log table corresponding to the current system date, and calling the host to perform compensation processing on the transaction through the platform when the transaction record exists;
and the second registration failure processing module is used for determining whether a transaction record which corresponds to the transaction and has a transaction state field value as a first field value exists in the host channel log table corresponding to the transaction date when the empty rollback record is not registered in the host channel log table corresponding to the transaction date, and calling the host to perform compensation processing on the transaction through the platform when the transaction record exists.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 7 when executing the computer program.
12. A computer-readable storage medium, in which a computer program is stored which, when executed in a computer processor, implements the method of any one of claims 1 to 7.
CN202110773741.3A 2021-07-08 2021-07-08 Double-log-surface anti-duplicate method and device for cross-day cut period Active CN113505110B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110773741.3A CN113505110B (en) 2021-07-08 2021-07-08 Double-log-surface anti-duplicate method and device for cross-day cut period

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110773741.3A CN113505110B (en) 2021-07-08 2021-07-08 Double-log-surface anti-duplicate method and device for cross-day cut period

Publications (2)

Publication Number Publication Date
CN113505110A true CN113505110A (en) 2021-10-15
CN113505110B CN113505110B (en) 2024-03-15

Family

ID=78012227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110773741.3A Active CN113505110B (en) 2021-07-08 2021-07-08 Double-log-surface anti-duplicate method and device for cross-day cut period

Country Status (1)

Country Link
CN (1) CN113505110B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168775A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 It is a kind of to hang the method and apparatus that affairs are automatically processed
US20180091311A1 (en) * 2016-09-27 2018-03-29 International Business Machines Corporation Secure logging for host security module
CN110716793A (en) * 2019-10-10 2020-01-21 腾讯科技(深圳)有限公司 Execution method, device, equipment and storage medium of distributed transaction
CN111369333A (en) * 2020-02-28 2020-07-03 中国工商银行股份有限公司 Daily cutting cooperative processing method and system for distributed system
CN112579556A (en) * 2019-09-27 2021-03-30 中兴通讯股份有限公司 Daily cutting data unloading method, device, equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168775A (en) * 2016-03-07 2017-09-15 阿里巴巴集团控股有限公司 It is a kind of to hang the method and apparatus that affairs are automatically processed
US20180091311A1 (en) * 2016-09-27 2018-03-29 International Business Machines Corporation Secure logging for host security module
CN112579556A (en) * 2019-09-27 2021-03-30 中兴通讯股份有限公司 Daily cutting data unloading method, device, equipment and medium
CN110716793A (en) * 2019-10-10 2020-01-21 腾讯科技(深圳)有限公司 Execution method, device, equipment and storage medium of distributed transaction
CN111369333A (en) * 2020-02-28 2020-07-03 中国工商银行股份有限公司 Daily cutting cooperative processing method and system for distributed system

Also Published As

Publication number Publication date
CN113505110B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
US11010358B2 (en) Data migration method and system
US10142170B2 (en) Log processing method and client
US8782643B2 (en) Device and method for controlling communication between BIOS and BMC
CN109656742B (en) Node exception handling method and device and storage medium
CN106940699B (en) Synchronous processing method, device, server and system for memory data
US11308205B2 (en) Security tool for preventing internal data breaches
WO2012000997A1 (en) An apparatus for processing a batched unit of work
CN106331065A (en) Proxy application for host system with service container and system
CN110597918A (en) Account management method and device and computer readable storage medium
CN114189525B (en) Service request method and device and electronic equipment
WO2019019457A1 (en) Control center device, business system processing method and system, and storage medium
CN110297822B (en) Block chain-oriented key management method, device, equipment and storage medium
US7813331B2 (en) Apparatus, system, and method for implementing failover in a polling adapter without support from an application server
US8789072B2 (en) Distributed multi-system management
CN111966682B (en) White list protection matching method, system, terminal and storage medium
CN113505110A (en) Double-log-surface anti-duplication method and device during cross-day cutting
CN110851166A (en) User-unaware application program updating method and device and computer equipment
CN111475480A (en) Log processing method and system
CN110275772B (en) Data processing method and related equipment thereof
US10423505B2 (en) Agents to autonomously detect corruption or failure of network namespaces
US10127122B2 (en) System and method for supporting transaction affinity based request handling in a middleware environment
WO2019071892A1 (en) Method for transmitting masking rules for sensitive information, application server, and computer readable storage medium
CN113986941A (en) Transaction batch processing method and device
CN114036164A (en) High-concurrency transaction locking method and system combining optimistic lock and pessimistic lock
JP2001159985A (en) Duplex device

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