CN111708802B - Network request anti-reprocessing method and device - Google Patents

Network request anti-reprocessing method and device Download PDF

Info

Publication number
CN111708802B
CN111708802B CN202010488604.0A CN202010488604A CN111708802B CN 111708802 B CN111708802 B CN 111708802B CN 202010488604 A CN202010488604 A CN 202010488604A CN 111708802 B CN111708802 B CN 111708802B
Authority
CN
China
Prior art keywords
record
repeated
temporary
records
information
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
CN202010488604.0A
Other languages
Chinese (zh)
Other versions
CN111708802A (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.)
Lakala Payment Co ltd
Original Assignee
Lakala Payment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lakala Payment Co ltd filed Critical Lakala Payment Co ltd
Priority to CN202010488604.0A priority Critical patent/CN111708802B/en
Publication of CN111708802A publication Critical patent/CN111708802A/en
Application granted granted Critical
Publication of CN111708802B publication Critical patent/CN111708802B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/243Natural language query formulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses a network request anti-reprocessing method and device. Wherein the method comprises the following steps: monitoring operation result information returned by an upstream system, acquiring failure record information in the operation result information, and writing the failure record information into a temporary record table; monitoring all operation information sent to a downstream system, identifying and intercepting failure record information in all operation information, and carrying out corresponding processing on the intercepted failure record information according to the temporary record table; and monitoring a repeated operation request initiated by a downstream system, inquiring the matching condition of the repeated operation request in the temporary record table, and processing the repeated operation request according to the matching condition.

Description

Network request anti-reprocessing method and device
Technical Field
The disclosure relates to the technical field of computer networks, and in particular relates to a network request anti-reprocessing method, a device, electronic equipment and a storage medium.
Background
The current internet is an exceptionally large integrated system, and by means of a series of strict network protocols and request response mechanisms, interconnection and interworking between billions of users and billions of devices are realized, so that the system is a very complex and fine set of systems. Under normal conditions, each internet request is responded in extremely short time, so that a transaction is completed quickly; however, in some cases, not every internet request is responded in time under the influence of various internal and external factors. For example, in a typical internet platform service system, a complete business process may involve multiple interactions of users, service parties, platform parties, intermediary institutions (third party payments), and settlement institutions, where any one of the steps may not be completed in time, possibly resulting in a response delay for the business.
For the scene that the real-time performance of the service is not too high, the unresponsive service can be suspended, polling is repeated in a subsequent period of time, the service is marked as failed only after the specified time and polling times are exceeded, and then the service is terminated to wait for the user to resubmit the request for re-execution. But this approach is clearly problematic for scenarios where traffic real-time requirements are very high and there is a great demand for user experience. Such as in internet taxi taking, ordering, takeaway, etc., it is not possible for the user to wait a long time to determine that the task failed, but instead to choose to terminate the previous task immediately and initiate a retry.
This may be a single task for the user, but in view of the platform side and the intermediary, the intermediary is more faced with access to multiple platform systems due to the high concurrency of the platform services themselves, and in case of handling tens of millions of instantaneous traffic, fast and frequently initiated repetitive operations are difficult to distinguish from prior operations, which is very prone to system traffic errors (such as recurring payments, etc.). In order to avoid errors caused by unnecessary repeated operations, the prior art generally realizes the uniqueness constraint (unique constraint) through anti-duplication judgment of a specific field, for example, a whole-course unique order number field is newly added to service records of each system, the order number is used when a platform access system initiates a re-exchange, and a third party pay-for-sale system judges whether the re-exchange occurs according to the order number. Furthermore, in the prior art, the unique constraint may be performed by a joint/combination constraint manner, that is, a service is uniquely determined by using a joint/combination of a plurality of fields (which may also be referred to as key fields) in an existing record, instead of the unified modification of a specific field.
However, the inventor finds that in the process of implementing the technical scheme related to the embodiment of the present disclosure, the existing anti-reprocessing technology still has obvious defects: the method of the specific field needs to uniformly reform all access systems, corresponding fields are added in the database of each system and uniformly distributed, and the reform cost is high. Because of the huge number of services, the uniqueness of the services in reality is difficult to be ensured by the multi-field combination/combination constraint, taking a common internet service order as an example, 5 key fields of channels, service types, payment accounts, collection accounts and money are usually used for the combination/combination constraint, but in actual situations, a plurality of different normal services with the same 5 key fields also often occur, and the weight prevention cannot be really and effectively realized.
Disclosure of Invention
Aiming at the technical problems in the prior art, the embodiment of the disclosure provides a network request anti-reprocessing method, a device, electronic equipment and a computer readable storage medium, so as to solve the problems of high anti-reprocessing cost or poor effectiveness in the prior art.
A first aspect of an embodiment of the present disclosure provides a network request anti-reprocessing method, including:
monitoring operation result information returned by an upstream system, acquiring failure record information in the operation result information, and writing the failure record information into a temporary record table;
Monitoring all operation information sent to a downstream system, identifying and intercepting failure record information in all operation information, and carrying out corresponding processing on the intercepted failure record information according to the temporary record table;
And monitoring a repeated operation request initiated by a downstream system, inquiring the matching condition of the repeated operation request in the temporary record table, and processing the repeated operation request according to the matching condition.
In some embodiments, the writing the failure record information into the temporary record table includes:
And searching the temporary record table, and when a plurality of repeated records with the same key field content are found, processing the content of at least one key field in each repeated record so that the repeated records become different records.
In some embodiments, the processing the content of at least one key field in each duplicate record includes:
When the state of more than 2 repeated records in the repeated records is not transmitted, modifying the sum field of each repeated record which is not transmitted, so that the sum of each repeated record which is not transmitted is different but the total sum of all the repeated records which are not transmitted is unchanged;
when the state of only one repeated record in the repeated records is not transmitted, dividing the repeated record which is not transmitted into 2 records, wherein the divided 2 records have different amounts but unchanged total amounts, and the contents of other key fields are unchanged;
When the plurality of repeated records are all in the transmitted state, no processing is performed at all.
In some embodiments, the processing of the intercepted failure record information according to the temporary record table includes:
inquiring intercepted failure record information in a temporary record table, when mainID fields of the intercepted failure record information only have one matching record in the temporary record table, releasing the intercepted failure record information, and changing the state of the matching record in the temporary record table into 'sent';
When the mainID field of the intercepted failed record information has a plurality of matching records in the temporary record table, the plurality of matching records in the temporary record table are transmitted, and the state of the plurality of matching records in the temporary record table is changed to 'transmitted'.
In some embodiments, said processing said repeat operation request according to said match condition comprises:
Inquiring the repeated operation request in the temporary record table, if the key field content is the same and the state is the sent matching record, immediately deleting the matching record from the temporary record table, and releasing the repeated operation request;
If the deletion fails or there is no matching record with the same key field content and the sent state, rejecting the repeat operation request.
A second aspect of an embodiment of the present disclosure provides a network request anti-reprocessing apparatus, including:
the temporary table writing module is used for monitoring operation result information returned by the upstream system, acquiring failure record information in the operation result information and writing the failure record information into a temporary record table;
The record processing module is used for monitoring all operation information sent to a downstream system, identifying and intercepting failure record information in all operation information, and correspondingly processing the intercepted failure record information according to the temporary record table;
And the anti-re-processing module is used for monitoring a repeated operation request initiated by a downstream system, inquiring the matching condition of the repeated operation request in the temporary record table, and processing the repeated operation request according to the matching condition.
In some embodiments, the temporary table writing module includes:
And the field processing module is used for searching the temporary record table, and when a plurality of repeated records with the same key field content are found, processing the content of at least one key field in each repeated record so that the repeated records become different records.
In some embodiments, the field processing module comprises:
The amount modifying module is used for modifying the amount field of each unsent repeated record when the state of more than 2 repeated records in the repeated records is unsent, so that the amount of each unsent repeated record is different but the total unsent amount is unchanged;
And the record splitting module is used for splitting the repeated record which is not transmitted into 2 records when the state of only one repeated record in the repeated records is not transmitted, the sum of the split 2 records is different but the total sum is unchanged, and the contents of other key fields are unchanged.
In some embodiments, the record processing module comprises:
The record release module is used for inquiring intercepted failure record information in the temporary record table, releasing the intercepted failure record information when the mainID field of the intercepted failure record information has only one matching record in the temporary record table, and changing the state of the matching record in the temporary record table into 'sent';
And the record replacement module is used for sending the plurality of matching records of the temporary record table when the mainID field of the intercepted failure record information has the plurality of matching records in the temporary record table, and changing the state of the plurality of matching records in the temporary record table into sent.
In some embodiments, the anti-reprocessing module comprises:
the deletion release module is used for inquiring the repeated operation request in the temporary record table, and if the key field content is the same and the state is the sent matching record, deleting the matching record from the temporary record table immediately and releasing the repeated operation request;
And the rejecting module is used for rejecting the repeated operation request when deleting fails or no matching records with the same key field content and sent state are available.
A third aspect of the disclosed embodiments provides an electronic device, comprising:
a memory and one or more processors;
wherein the memory is communicatively coupled to the one or more processors, and instructions executable by the one or more processors are stored in the memory, which when executed by the one or more processors, are operable to implement the methods as described in the previous embodiments.
A fourth aspect of the disclosed embodiments provides a computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a computing device, are operable to implement the methods of the previous embodiments.
A fifth aspect of the disclosed embodiments provides a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are operable to implement a method as described in the previous embodiments.
According to the technical scheme provided by the embodiment of the disclosure, the check and the retry verification are performed through the temporary record table, so that the normal request is found by utilizing the prior failure record information, the subsequent normal request can be correctly performed, the unique constraint on each record can be realized through the joint constraint mode, the reasonable retry request can be correctly and efficiently identified with extremely low cost, and the system performance is ensured while the system reliability is ensured.
Drawings
The features and advantages of the present disclosure will be more clearly understood by reference to the accompanying drawings, which are schematic and should not be construed as limiting the disclosure in any way, in which:
FIG. 1 is a flow diagram of a network request anti-replay processing method according to some embodiments of the present disclosure;
FIG. 2 is a block diagram of a network request anti-reprocessing apparatus according to some embodiments of the present disclosure;
fig. 3 is a schematic structural view of an electronic device according to some embodiments of the present disclosure.
Detailed Description
In the following detailed description, numerous specific details are set forth by way of examples in order to provide a thorough understanding of the relevant disclosure. However, it will be apparent to one of ordinary skill in the art that the present disclosure may be practiced without these specific details. It should be appreciated that the use of "system," "apparatus," "unit," and/or "module" terms in this disclosure is one method for distinguishing between different parts, elements, portions, or components at different levels in a sequential arrangement. However, these terms may be replaced with other expressions if the other expressions can achieve the same purpose.
It will be understood that when a device, unit, or module is referred to as being "on," "connected to," or "coupled to" another device, unit, or module, it can be directly on, connected to, or coupled to, or in communication with the other device, unit, or module, or intervening devices, units, or modules may be present unless the context clearly indicates an exception. For example, the term "and/or" as used in this disclosure includes any and all combinations of one or more of the associated listed items.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to limit the scope of the present disclosure. As used in the specification and the claims, the terms "a," "an," "the," and/or "the" are not specific to a singular, but may include a plurality, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" are intended to cover only those features, integers, steps, operations, elements, and/or components that are explicitly identified, but do not constitute an exclusive list, as other features, integers, steps, operations, elements, and/or components may be included.
These and other features and characteristics of the present disclosure, as well as the methods of operation, functions of the related elements of structure, combinations of parts and economies of manufacture, may be better understood with reference to the following description and the accompanying drawings, all of which form a part of this specification. It is to be expressly understood, however, that the drawings are for the purpose of illustration and description only and are not intended as a definition of the limits of the disclosure. It will be understood that the figures are not drawn to scale.
Various block diagrams are used in the present disclosure to illustrate various modifications of the embodiments according to the present disclosure. It should be understood that the foregoing or following structures are not intended to limit the present disclosure. The protection scope of the present disclosure is subject to the claims.
In internet services, re-initiating a request for a task that does not respond or fails in time is a common operation, but too frequent repeated operations may cause system errors, so that judgment and processing of service anti-heavy are sometimes very important. On the one hand, when the prior service is still effective, the anti-duplication can avoid unnecessary repeated operation; on the other hand, when the prior service fails, the anti-duplication can efficiently determine the normal service and the abnormal service, thereby releasing and processing the normal service as soon as possible. However, the weight prevention mechanism in the prior art has certain defects that neither global field constraint nor joint constraint can effectively prevent weight within reasonable cost.
In view of this, the embodiments of the present disclosure provide a network request anti-retry processing method, which performs a comparison experiment by adding a reference request, so that a failure cause can be determined in a very small number of retry processes, thereby performing more targeted error correction operation, and greatly improving system efficiency. In one embodiment of the present disclosure, as shown in fig. 1, the network request anti-reprocessing method includes:
s101, monitoring operation result information returned by an upstream system through an independent monitoring process, acquiring failure record information in the operation result information, and writing the failure record information into a temporary record table.
Wherein, in the embodiment of the disclosure, the network request anti-reprocessing method preferably runs in a platform system of a middle layer of network interaction and an intermediary mechanism (such as a third party payment mechanism). On one hand, the intermediary platform system is used as a unified entrance to interact with a plurality of downstream systems, receives operation requests of the plurality of downstream systems, and provides summarizing and unified supervision services for all the operation requests; on the other hand, the system is used as a unified initiator to interact with a plurality of upstream systems, the operation requests aiming at each upstream system are summarized and then sent to the upstream system in batches for processing, and the processing results (operation result information) are received and fed back to the corresponding downstream system. Optionally, creating an independent monitoring process and a temporary record table at the same time of starting the intermediate platform system; or only the monitoring process can be firstly established, and the temporary record table is established when the failure record information is monitored for the first time. Further, the independent monitoring process refers to that the monitoring process and the main table writing process of the intermediate platform system are independent, and the operation of the monitoring process does not affect the main table.
S102, monitoring all operation information sent to a downstream system through the monitoring process, identifying and intercepting failure record information in all operation information, and carrying out corresponding processing on the intercepted failure record information according to the temporary record table.
In the embodiment of the disclosure, it is recorded in the temporary record table that the upstream system explicitly indicates the failed operation, and in theory, after the failed information is fed back to the downstream system, the downstream system tries to solve the problem by retrying the operation, that is, the downstream system will reinitiate the repeated operation request with the same content with high probability. In general, a request re-initiated after failure belongs to a normal operation request, and some repeated operation requests initiated after failure of an unequally-scheduled task are easy to cause system errors, and are generally regarded as abnormal requests. Since the normal request for repeating operation does not indicate whether it is initiated after failure, in order to correctly distinguish between normal and abnormal requests therefrom, embodiments of the present disclosure first ensure that all the failed record information is uniquely recorded in the temporary record table, and further ensure that the failed record information sent to the downstream system is uniquely determinable, avoiding that similar records with the same key fields affect subsequent operations.
S103, monitoring a repeated operation request initiated by a downstream system through the monitoring process, inquiring the matching condition of the repeated operation request in the temporary record table, and processing the repeated operation request according to the matching condition.
In the embodiment of the disclosure, the check and re-verification is performed through the temporary record table, so that the normal request is found by using the prior failure record information, and the subsequent normal request is ensured to be correctly performed. Preferably, all operation requests initiated by a downstream system are monitored, a repeated operation request is identified according to specific information in request information, the key field of the repeated operation request is further searched in a temporary record table, and if the repeated operation request has matched failure record information in the temporary record table, the repeated operation request is a normal request and should be executed; if an abnormal request is determined, execution is denied. In this way, the embodiment of the disclosure can effectively identify the correct retry operation, avoid the influence of the incorrect retry on the system performance and reliability, and realize a better anti-weight effect.
In some embodiments of the present disclosure, the temporary record table is managed by a joint constraint of multiple key field combinations. Preferably, the failure record information recorded in the temporary record table may further include, in addition to a plurality of key fields (such as a channel, a business category, a payment account number, a collection account number, and an amount, etc.), the failure record information further includes: a field (e.g., mainID field indicating an order number) describing the service number of the broker platform system and a status field (e.g., status field) describing the status of information transmission. In a preferred embodiment, the reliability of the system in high concurrency can be further improved through the system cache; specifically, the acquired failure record information is firstly stored in a pre-created cache, and when the cache is full or the cache is timed (delay is avoided to be too long), the failure record information is removed from the cache and written into a temporary record table.
However, due to the problems described in the background section, in the prior art, a record cannot be uniquely determined by the joint constraint mode of combining multiple key fields, and the same record of multiple key fields can be obtained simply by means of the temporary record table, so that a specific corresponding mode of some records cannot be effectively screened, and further modification of the temporary record table is required. In one embodiment of the present disclosure, the failed record information in the temporary record table requires further processing to avoid duplicate records as much as possible. Specifically, when writing into the temporary record table, firstly, searching the temporary record table for duplicate records with the same key field content (only the key field content is repeated, the whole content is not repeated, and a plurality of different records are needed), and when finding out the duplicate records with the same key field content, processing the content of at least one key field in each duplicate record so that the duplicate records become different records (namely, the duplicate records can be uniquely constrained by the combination of the key fields).
In some embodiments, considering that modifications of other key fields may cause systematic errors, it is preferable to process the amount fields in the key fields such that the amount fields of the multiple duplicate records are no longer the same but the total amount is still the same as the original total amount; on the one hand, the multiple repeated records can be distinguished, and on the other hand, the actual balance of the two parties is not influenced. Further, considering that each record may have a different state, the processing of the key fields includes:
When the state of more than 2 repeated records in the repeated records is not transmitted, modifying the sum field of each repeated record which is not transmitted, so that the sum of each repeated record which is not transmitted is different but the total sum of all the repeated records which are not transmitted is unchanged;
When the state of only one repeated record in the repeated records is not transmitted, dividing the repeated record which is not transmitted into 2 records, wherein the amount of the divided 2 records is different but the total amount is unchanged (the same as the amount of the record before the division), and the contents of other key fields are unchanged (especially mainID fields are unchanged);
When the plurality of repeated records are all in the transmitted state, no processing is performed at all.
Optionally, the above-mentioned check and repeat processing may be performed when the failure record information is written into the temporary record table, or may be performed during any idle time when the temporary record table is not operated, so as to fully utilize system resources and relieve system pressure.
In the embodiment of the disclosure, all operation information sent to a downstream system is monitored through the monitoring process, and failure record information is identified and intercepted;
Wherein, the failure record information is inquired in the temporary record table, when the mainID field of the intercepted failure record information has only one matching record in the temporary record table, the intercepted failure record information is released, and the status (status field) of the matching record in the temporary record table is changed into 'sent';
When the mainID field of the intercepted failed record information has a plurality of matching records in the temporary record table, the plurality of matching records of the temporary record table (i.e., the original record information is replaced) are transmitted, and the status (status field) of the plurality of matching records in the temporary record table is changed to "transmitted".
In this way, it is ensured that the failure record information (or the corresponding matching record) sent to the downstream system satisfies the uniqueness constraint, so that the downstream system also satisfies the uniqueness constraint according to the re-initiated retry operation thereof, and can be effectively identified. Wherein the status (status field) of each record in the temporary record table defaults to "unsent".
Further, in the embodiment of the present disclosure, the listening process listens to the repeated operation requests initiated by the downstream systems, where by default, each downstream system initiates a corresponding repeated operation request according to the received failure record information (i.e. initiates a retry operation according to the record after the amount is modified), and at the same time, explicitly notes that the request is repeatedly initiated in the request (such as by marking a remark field, or initiating the request in a unified retry/retry list).
Inquiring the repeated operation request in the temporary record table, if the key field content is the same and the state is the sent matching record, releasing the repeated operation request, and immediately deleting the matching record from the temporary record table;
If no key field is identical in content and the status is a sent matching record, rejecting the repeat operation request.
Further, in order to be effectively anti-replay even at high concurrency, the deletion operation should be performed immediately after the matching record is found (the deletion operation is equivalent to a logic "lock" to lock the matching record), and if the deletion is successful, it is indicated that this is the first/only request for repeating operation, and it can be released; if the delete fails (typically the record is already in the delete or deleted but not present), it is indicated that there are other concurrent repeat operation requests executing at the same time, and the repeat operation request should be denied.
The released repeat operation request is submitted to the upstream system, and in order to update the master table reasonably, the master table should be notified after success for all modification amounts and split record information.
The above method steps are described from the perspective of a third party payment mechanism, and it should be understood by those skilled in the art that the embodiments of the present disclosure are obviously applicable to other interactive terminals, such as a user side device, a merchant side device, or an clearing settlement facility device, and the above method steps should not be construed as limiting the specific implementation device of the embodiments of the present disclosure.
According to the network request anti-retry processing method provided by the embodiment of the disclosure, the unique constraint on each record can be completed through the temporary record table, so that a reasonable retry request can be correctly and efficiently identified at extremely low cost, and the reliability of the system is ensured while the performance of the system is ensured.
Fig. 2 is a schematic diagram of a network request anti-reprocessing apparatus according to some embodiments of the present disclosure. As shown in fig. 2, the network request anti-reprocessing apparatus 200 includes a temporary table writing module 201, a recording processing module 202, and an anti-reprocessing module 203; wherein,
A temporary table writing module 201, configured to monitor operation result information returned by an upstream system, obtain failure record information in the operation result information, and write the failure record information into a temporary record table;
The record processing module 202 is configured to monitor all operation information sent to a downstream system, identify and intercept failure record information in all operation information, and perform corresponding processing on the intercepted failure record information according to the temporary record table;
And the anti-re processing module 203 is configured to monitor a repeated operation request initiated by a downstream system, query a temporary record table for a matching condition of the repeated operation request, and process the repeated operation request according to the matching condition.
In some embodiments, the temporary table writing module includes:
And the field processing module is used for searching the temporary record table, and when a plurality of repeated records with the same key field content are found, processing the content of at least one key field in each repeated record so that the repeated records become different records.
In some embodiments, the field processing module comprises:
The amount modifying module is used for modifying the amount field of each unsent repeated record when the state of more than 2 repeated records in the repeated records is unsent, so that the amount of each unsent repeated record is different but the total unsent amount is unchanged;
And the record splitting module is used for splitting the repeated record which is not transmitted into 2 records when the state of only one repeated record in the repeated records is not transmitted, the sum of the split 2 records is different but the total sum is unchanged, and the contents of other key fields are unchanged.
In some embodiments, the record processing module comprises:
The record release module is used for inquiring intercepted failure record information in the temporary record table, releasing the intercepted failure record information when the mainID field of the intercepted failure record information has only one matching record in the temporary record table, and changing the state of the matching record in the temporary record table into 'sent';
And the record replacement module is used for sending the plurality of matching records of the temporary record table when the mainID field of the intercepted failure record information has the plurality of matching records in the temporary record table, and changing the state of the plurality of matching records in the temporary record table into sent.
In some embodiments, the anti-reprocessing module comprises:
the deletion release module is used for inquiring the repeated operation request in the temporary record table, and if the key field content is the same and the state is the sent matching record, deleting the matching record from the temporary record table immediately and releasing the repeated operation request;
And the rejecting module is used for rejecting the repeated operation request when deleting fails or no matching records with the same key field content and sent state are available.
Referring to fig. 3, a schematic diagram of an electronic device according to an embodiment of the present disclosure is provided. As shown in fig. 3, the electronic device 300 includes:
memory 330 and one or more processors 310;
Wherein the memory 330 is communicatively coupled to the one or more processors 310, and instructions 332 executable by the one or more processors are stored in the memory 330, the instructions 332 being executable by the one or more processors 310 to cause the one or more processors 310 to perform the methods of the foregoing embodiments of the disclosure.
In particular, processor 310 and memory 330 may be connected by a bus or otherwise, as illustrated in FIG. 3 by bus 340. The processor 310 may be a central processing unit (Central Processing Unit, CPU). The Processor 310 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field-Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.
Memory 330, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as a cascading progressive network in embodiments of the disclosure, and the like. The processor 310 executes various functional applications of the processor and data processing by running non-transitory software programs, instructions, and functional modules 332 stored in memory 330.
Memory 330 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created by the processor 310, etc. In addition, memory 330 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 330 may optionally include memory located remotely from processor 310, which may be connected to processor 310 via a network, such as via communication interface 320. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
An embodiment of the present disclosure also provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed, perform the method of the foregoing embodiments of the present disclosure.
The foregoing computer-readable storage media includes both physical volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer-readable storage media includes, but is not limited to, U disk, removable hard disk, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), erasable programmable Read-Only Memory (EPROM), electrically erasable programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, digital Versatile Disk (DVD), HD-DVD, blu-Ray (Blue-Ray) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer.
While the subject matter described herein is provided in the general context of operating systems and application programs that execute in conjunction with the execution of a computer system, those skilled in the art will recognize that other implementations may also be performed in combination with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform particular tasks or implement particular abstract data types. Those skilled in the art will appreciate that the subject matter described herein may be practiced with other computer system configurations, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like, as well as distributed computing environments that have tasks 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 memory storage devices.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure.
In summary, the disclosure provides a network request reprocessing prevention method, a device, an electronic device and a computer readable storage medium thereof. According to the embodiment of the disclosure, the check and the retry verification are performed through the temporary record table, so that the normal request is found by utilizing the prior failure record information, the subsequent normal request can be guaranteed to be correctly performed, and the unique constraint on each record can be realized through the joint constraint mode, so that the reasonable retry request is correctly and efficiently identified with extremely low cost, and the system performance is guaranteed while the system reliability is guaranteed.
It is to be understood that the above-described embodiments of the present disclosure are merely illustrative or explanatory of the principles of the disclosure and are not restrictive of the disclosure. Accordingly, any modifications, equivalent substitutions, improvements, or the like, which do not depart from the spirit and scope of the present disclosure, are intended to be included within the scope of the present disclosure. Furthermore, the appended claims of this disclosure are intended to cover all such changes and modifications that fall within the scope and boundary of the appended claims, or the equivalents of such scope and boundary.

Claims (6)

1. A network request anti-reprocessing method, comprising:
monitoring operation result information returned by an upstream system, acquiring failure record information in the operation result information, and writing the failure record information into a temporary record table;
Monitoring all operation information sent to a downstream system, identifying and intercepting failure record information in all operation information, and carrying out corresponding processing on the intercepted failure record information according to the temporary record table;
monitoring a repeated operation request initiated by a downstream system, inquiring the matching condition of the repeated operation request in the temporary record table, processing the repeated operation request according to the matching condition,
The writing the failure record information into the temporary record table comprises the following steps:
Checking the temporary record table, when a plurality of repeated records with the same key field content are found, processing the content of at least one key field in each repeated record to enable the repeated records to be different records,
The processing the content of at least one key field in each repeated record comprises the following steps:
When the state of more than 2 repeated records in the repeated records is not transmitted, modifying the sum field of each repeated record which is not transmitted, so that the sum of each repeated record which is not transmitted is different but the total sum of all the repeated records which are not transmitted is unchanged;
when the state of only one repeated record in the repeated records is not transmitted, dividing the repeated record which is not transmitted into 2 records, wherein the divided 2 records have different amounts but unchanged total amounts, and the contents of other key fields are unchanged;
when the plurality of repeated records are all in the transmitted state, no processing is performed at all,
The above-described check-up process is performed when the failure record information is written into the temporary record table or during any idle time when the temporary record table is not operated,
And submitting the released repeated operation request to the upstream system, and reporting a main table of the upstream system after success of all the modification amounts and the split record information so as to update the main table.
2. The method according to claim 1, wherein the corresponding processing of the intercepted failure record information according to the temporary record table includes:
inquiring intercepted failure record information in a temporary record table, when mainID fields of the intercepted failure record information only have one matching record in the temporary record table, releasing the intercepted failure record information, and changing the state of the matching record in the temporary record table into 'sent';
When the mainID field of the intercepted failed record information has a plurality of matching records in the temporary record table, the plurality of matching records in the temporary record table are transmitted, and the state of the plurality of matching records in the temporary record table is changed to 'transmitted'.
3. The method of claim 1, wherein said processing said repeat request according to said match condition comprises:
Inquiring the repeated operation request in the temporary record table, if the key field content is the same and the state is the sent matching record, immediately deleting the matching record from the temporary record table, and releasing the repeated operation request;
If the deletion fails or there is no matching record with the same key field content and the sent state, rejecting the repeat operation request.
4. A network request anti-reprocessing apparatus, comprising:
the temporary table writing module is used for monitoring operation result information returned by the upstream system, acquiring failure record information in the operation result information and writing the failure record information into a temporary record table;
The record processing module is used for monitoring all operation information sent to a downstream system, identifying and intercepting failure record information in all operation information, and correspondingly processing the intercepted failure record information according to the temporary record table;
the anti-re-processing module is used for monitoring the repeated operation request initiated by the downstream system, inquiring the matching condition of the repeated operation request in the temporary record table, processing the repeated operation request according to the matching condition,
The temporary table writing module includes:
A field processing module, configured to check the temporary record table for duplication, and when multiple duplicate records with the same key field content are found, process the content of at least one key field in each duplicate record, so that the multiple duplicate records become different records,
The field processing module includes:
The amount modifying module is used for modifying the amount field of each unsent repeated record when the state of more than 2 repeated records in the repeated records is unsent, so that the amount of each unsent repeated record is different but the total unsent amount is unchanged;
A record splitting module for splitting the non-transmitted repeated record into 2 records when the status of only one repeated record is non-transmitted, the split 2 records have different amounts but unchanged total amount, other key field contents are unchanged,
The above-described check-up process is performed when the failure record information is written into the temporary record table or during any idle time when the temporary record table is not operated,
And submitting the released repeated operation request to the upstream system, and reporting a main table of the upstream system after success of all the modification amounts and the split record information so as to update the main table.
5. The apparatus of claim 4, wherein the record processing module comprises:
The record release module is used for inquiring intercepted failure record information in the temporary record table, releasing the intercepted failure record information when the mainID field of the intercepted failure record information has only one matching record in the temporary record table, and changing the state of the matching record in the temporary record table into 'sent';
And the record replacement module is used for sending the plurality of matching records of the temporary record table when the mainID field of the intercepted failure record information has the plurality of matching records in the temporary record table, and changing the state of the plurality of matching records in the temporary record table into sent.
6. The apparatus of claim 4, wherein the anti-replay processing module comprises:
the deletion release module is used for inquiring the repeated operation request in the temporary record table, and if the key field content is the same and the state is the sent matching record, deleting the matching record from the temporary record table immediately and releasing the repeated operation request;
And the rejecting module is used for rejecting the repeated operation request when deleting fails or no matching records with the same key field content and sent state are available.
CN202010488604.0A 2020-06-02 2020-06-02 Network request anti-reprocessing method and device Active CN111708802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010488604.0A CN111708802B (en) 2020-06-02 2020-06-02 Network request anti-reprocessing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010488604.0A CN111708802B (en) 2020-06-02 2020-06-02 Network request anti-reprocessing method and device

Publications (2)

Publication Number Publication Date
CN111708802A CN111708802A (en) 2020-09-25
CN111708802B true CN111708802B (en) 2024-05-07

Family

ID=72537562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010488604.0A Active CN111708802B (en) 2020-06-02 2020-06-02 Network request anti-reprocessing method and device

Country Status (1)

Country Link
CN (1) CN111708802B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590662B (en) * 2021-08-04 2024-05-10 吉林亿联银行股份有限公司 Query method and device for business transaction result, storage medium and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493924A (en) * 2009-03-10 2009-07-29 中体彩科技发展有限公司 Transaction processing method of transaction processing system and lottery ticket transaction processing method
CN101730050A (en) * 2009-10-30 2010-06-09 中兴通讯股份有限公司 Method and system for preventing information inconsistency of network elements of MBBMS service system
CN102436485A (en) * 2010-10-20 2012-05-02 微软公司 Dynamically splitting multi-tenant databases
CN102929698A (en) * 2012-09-29 2013-02-13 北京百度网讯科技有限公司 Task re-judgment method and system
CN105573996A (en) * 2014-10-09 2016-05-11 阿里巴巴集团控股有限公司 Database processing method, database processing device and database processing system
CN105915627A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Service request processing method and service request processing device
CN106502769A (en) * 2016-09-30 2017-03-15 华为技术有限公司 Distributed transaction processing method, apparatus and system
CN107861825A (en) * 2017-10-16 2018-03-30 北京京东尚科信息技术有限公司 Request processing/conditional code querying method and device, lower/upper trip node, medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493924A (en) * 2009-03-10 2009-07-29 中体彩科技发展有限公司 Transaction processing method of transaction processing system and lottery ticket transaction processing method
CN101730050A (en) * 2009-10-30 2010-06-09 中兴通讯股份有限公司 Method and system for preventing information inconsistency of network elements of MBBMS service system
CN102436485A (en) * 2010-10-20 2012-05-02 微软公司 Dynamically splitting multi-tenant databases
CN102929698A (en) * 2012-09-29 2013-02-13 北京百度网讯科技有限公司 Task re-judgment method and system
CN105573996A (en) * 2014-10-09 2016-05-11 阿里巴巴集团控股有限公司 Database processing method, database processing device and database processing system
CN105915627A (en) * 2016-05-30 2016-08-31 北京小米移动软件有限公司 Service request processing method and service request processing device
CN106502769A (en) * 2016-09-30 2017-03-15 华为技术有限公司 Distributed transaction processing method, apparatus and system
CN107861825A (en) * 2017-10-16 2018-03-30 北京京东尚科信息技术有限公司 Request processing/conditional code querying method and device, lower/upper trip node, medium

Also Published As

Publication number Publication date
CN111708802A (en) 2020-09-25

Similar Documents

Publication Publication Date Title
EP3776208B1 (en) Runtime self-correction for blockchain ledgers
CN107818431B (en) Method and system for providing order track data
US20200013025A1 (en) Conditional deferred transactions for blockchain
US9189355B1 (en) Method and system for processing a service request
US11599431B2 (en) Database optimized disaster recovery orchestrator
CN110188103A (en) Data account checking method, device, equipment and storage medium
CN105930226B (en) A kind of data processing method and device
CN111064725A (en) Code zero intrusion interface verification method and device
RU2711348C1 (en) Method and system for processing requests in a distributed database
CN111708802B (en) Network request anti-reprocessing method and device
CN103440460A (en) Application system change validation method and system
CN111782456A (en) Anomaly detection method and device, computer equipment and storage medium
US11816163B2 (en) Systems and methods for improved transactional mainframes
CN112835885A (en) Processing method, device and system for distributed table storage
US20180225325A1 (en) Application resiliency management using a database driver
CN114218303B (en) Transaction data processing system, processing method, medium and equipment
US6865697B2 (en) Method and apparatus for reduced error checking of data received by a server from a client
CN112148762A (en) Statistical method and device for real-time data stream
CN111741080B (en) Network file distribution method and device
US11243979B1 (en) Asynchronous propagation of database events
CN114218173A (en) Batch processing system, processing method, medium and equipment for account-transfer transaction files
CN110362464B (en) Software analysis method and equipment
CN111949479A (en) Interactive system and method and equipment for determining index creation condition
CN114900531B (en) Data synchronization method, device and system
CN116737221A (en) Configuration governance method, device, computer 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