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

Network request anti-reprocessing method and device Download PDF

Info

Publication number
CN111708802A
CN111708802A CN202010488604.0A CN202010488604A CN111708802A CN 111708802 A CN111708802 A CN 111708802A CN 202010488604 A CN202010488604 A CN 202010488604A CN 111708802 A CN111708802 A CN 111708802A
Authority
CN
China
Prior art keywords
record
temporary
records
information
matching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010488604.0A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN111708802A/en
Publication of CN111708802A publication Critical patent/CN111708802A/en
Pending legal-status Critical Current

Links

Images

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

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 the operation information, and performing 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, and processing the repeated operation request according to the matching condition.

Description

Network request anti-reprocessing method and device
Technical Field
The present disclosure relates to the field of computer network technologies, and in particular, to a method and an apparatus for processing a network request to prevent duplication, an electronic device, and a storage medium.
Background
The current internet is an extremely large integrated system, and realizes interconnection and intercommunication between billions of users and billions of devices by means of a series of strict network protocols and request response mechanisms, and is a set of system which is very complex and fine in fact. Under normal conditions, each internet request can be responded in a very short time, so that a transaction is completed quickly; in some cases, however, not every internet request will be responded to in a timely manner under the influence of various internal and external factors. For example, in a typical internet platform service system, a complete transaction process involves multiple interacting parties, such as the user, the service party, the platform party, the intermediary (third party payment) and the settlement institution, and any one of the steps in between may not be completed in time, which may lead to a delay in the response of the transaction.
For a scene with low service real-time performance, an 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 stopped to wait for a user to re-submit a request for execution again. But for scenarios where the real-time requirements of the service are very high and the user experience is extremely demanding, this approach is clearly problematic. For example, in internet taxi taking, ordering, taking out, etc., the user may not wait for a long time to determine that the task fails, but may choose to terminate the previous task immediately and initiate another attempt.
This may be a single task for the user, but in the view of the platform side and the intermediary, the intermediary is more faced with the access of multiple platform systems due to the high concurrency of the platform services themselves, and in the case of handling ten million levels of instantaneous traffic, the fast and frequently initiated repeat operations are difficult to distinguish from the previous operations, which is very likely to cause system service errors (such as repeat payments, etc.). In order to avoid errors caused by unnecessary repeated operations, in the prior art, unique constraint (unique constraint) is generally realized through anti-replay judgment of specific fields, for example, a full-process unique order number field is newly added to a service record of each system, the order number is used when a platform access system sends a remix, and a third-party payment system judges whether remix occurs according to the order number. In addition, in the prior art, uniqueness constraint can also be performed by means of union/combination constraint, that is, instead of uniform modification of a specific field, a service is uniquely determined by utilizing union/combination of a plurality of fields (also referred to as key fields) in an existing record.
However, the inventor finds that the prior art anti-reprocessing method still has obvious defects in the process of realizing the related technical scheme of the embodiment of the disclosure: the specific field mode needs to be modified uniformly for all access systems, corresponding fields are added and uniformly distributed in the database of each system, and the modification cost is high. However, because the number of services is huge, the multi-field association/combination constraint is difficult to ensure the uniqueness of the services in reality, taking a common internet service order as an example, the association/combination constraint is usually performed by using 5 key fields, namely, a channel, a service type, a payment account, a collection account and an amount of money, but in an actual situation, a plurality of different normal services with all the same 5 key fields are also frequently generated, and the anti-duplication cannot be really and effectively realized.
Disclosure of Invention
In view of the above technical problems in the prior art, embodiments of the present disclosure provide a method and an apparatus for processing a network request to prevent duplication, an electronic device, and a computer-readable storage medium, so as to solve the problem in the prior art that duplication prevention processing is high in cost or poor in effectiveness.
A first aspect of the embodiments of the present disclosure provides a method for preventing a network request from being reprocessed, 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 the operation information, and performing 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, and processing the repeated operation request according to the matching condition.
In some embodiments, the writing the failure record information into a temporary record table comprises:
and checking the duplicate records in the temporary record table, and when a plurality of duplicate records with the same content of the key field are found, processing the content of at least one key field in each duplicate record to enable the plurality of duplicate records to become different records.
In some embodiments, the processing the content of the at least one key field in each duplicate record comprises:
when the state of more than 2 duplicate records in the multiple duplicate records is unsent, modifying the sum field of each unsent duplicate record to ensure that the sum of each unsent duplicate record is different but the total sum of all unsent records is unchanged;
when only one of the repeated records is unsent, splitting the unsent repeated record into 2 records, wherein the sum of the 2 split records is different but the total sum is unchanged, and the contents of other key fields are unchanged;
when a plurality of duplicate records are all in a sent state, nothing is done for the moment.
In some embodiments, the performing, according to the temporary record table, corresponding processing on the intercepted failure record information includes:
inquiring intercepted failure record information in the temporary record table, when the main ID field of the intercepted failure record information only has 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 main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, the plurality of matching records of the temporary record table are sent, and the states of the plurality of matching records in the temporary record table are changed into sent.
In some embodiments, said processing said repeat operation request according to said matching condition comprises:
inquiring the repeated operation request in the temporary record table, if there is a matching record with the same key field content and the sent state, immediately deleting the matching record from the temporary record table, and releasing the repeated operation request;
and if the deletion fails or no matching record with the same key field content and the sent state is not detected, rejecting the repeat operation request.
A second aspect of the embodiments of the present disclosure provides a network request anti-replay device, including:
the temporary table writing module is used for 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;
the recording processing module is used for monitoring all operation information sent to a downstream system, identifying and intercepting failure recording information in all the operation information, and performing corresponding processing on the intercepted failure recording information according to the temporary recording table;
and the anti-replay 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 write module comprises:
and the field processing module is used for checking duplication in the temporary record table, and processing the content of at least one key field in each duplicate record when a plurality of duplicate records with the same key field content are found, so that the plurality of duplicate records become different records.
In some embodiments, the field processing module comprises:
the sum modifying module is used for modifying the sum field of each unsent duplicate record when the state of more than 2 duplicate records in the multiple duplicate records is unsent, so that the sum of each unsent duplicate record is different but the total unsent sum is unchanged;
the record splitting module is used for splitting the unsent repeated record into 2 records when only one repeated record in the plurality of repeated records is unsent, the sum of the 2 split 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:
a record releasing module, configured to query the intercepted failure record information in the temporary record table, release 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 change the state of the matching record in the temporary record table to "sent";
and the record replacing module is used for sending the plurality of matching records of the temporary record table when the main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, and changing the states of the plurality of matching records in the temporary record table into sent states.
In some embodiments, the anti-replay processing module comprises:
a deletion releasing module, configured to query the repeat operation request in the temporary record table, and if there is a matching record with the same key field content and the sent state, immediately delete the matching record from the temporary record table, and release the repeat operation request;
and the rejecting module is used for rejecting the repeated operation request when the deletion fails or no matching record with the same key field content and the sent state is detected.
A third aspect of the embodiments of the present disclosure provides an electronic device, including:
a memory and one or more processors;
wherein the memory is communicatively coupled to the one or more processors, and the memory stores instructions executable by the one or more processors, and when the instructions are executed by the one or more processors, the electronic device is configured to implement the method according to the foregoing embodiments.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium having stored thereon computer-executable instructions, which, when executed by a computing device, may be used to implement the method according to the foregoing embodiments.
A fifth aspect of embodiments of the present disclosure 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 in the preceding embodiments.
According to the technical scheme provided by the embodiment of the disclosure, the temporary record table is used for executing the duplication checking verification, so that the prior failure record information is used for discovering the normal request, and the subsequent normal request can be correctly executed.
Drawings
The features and advantages of the present disclosure will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the disclosure in any way, and in which:
FIG. 1 is a schematic flow chart diagram illustrating a network request anti-replay method according to some embodiments of the present disclosure;
FIG. 2 is a block diagram representation of a network request anti-replay device, according to some embodiments of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to some embodiments of the present disclosure.
Detailed Description
In the following detailed description, numerous specific details of the disclosure 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 understood that the use of the terms "system," "apparatus," "unit" and/or "module" in this disclosure is a method for distinguishing between different components, elements, portions or assemblies at different levels of sequence. However, these terms may be replaced by other expressions if they 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 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 dictates otherwise. For example, as used in this disclosure, the term "and/or" 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 claims of this disclosure, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are inclusive in the plural, unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" are intended to cover only the explicitly identified features, integers, steps, operations, elements, and/or components, but not to constitute an exclusive list of such features, integers, steps, operations, elements, and/or components.
These and other features and characteristics of the present disclosure, as well as the methods of operation and functions of the related elements of structure and the combination of parts and economies of manufacture, will be better understood by reference to the following description and drawings, 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 this disclosure to illustrate various variations of embodiments according to the disclosure. It should be understood that the foregoing and 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, a common operation is to reinitiate a request for a task which does not respond in time or fails, but repeated operations which are too frequent may cause system errors, so that the judgment and processing of preventing heavy services are sometimes very important. On one hand, when the prior service is still effective, the repeated operation is avoided; on the other hand, when the prior service fails, the anti-duplication can efficiently determine the normal service and the abnormal service, so that the normal service is released and processed as soon as possible. However, the anti-duplication mechanism in the prior art has certain defects, and both global field constraint and joint constraint cannot effectively prevent duplication within reasonable cost.
In view of this, the embodiment of the present disclosure provides a method for processing a network request to prevent a duplicate, which can determine a failure cause in a very small number of retries by adding a reference request to perform a comparison experiment, so that a more targeted error correction operation can be performed, and system efficiency is greatly improved. In an embodiment of the present disclosure, as shown in fig. 1, the network request anti-replay 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.
In the embodiment of the present disclosure, the network request anti-replay method preferably operates in a platform system of an intermediary mechanism (such as a third-party payment mechanism) in a network interaction. The intermediary platform system is used as a uniform entrance to interact with a plurality of downstream systems, receives operation requests of the downstream systems and provides services of summary processing and uniform supervision for all the operation requests; on the other hand, the system is used as a uniform initiator to interact with a plurality of upstream systems, collects the operation requests of each upstream system and sends the operation requests to the upstream systems in batches for processing, and receives and feeds back the processing results (operation result information) to the corresponding downstream systems. Optionally, an independent monitoring process and a temporary record table are created while the intermediary platform system is started; or, only the monitoring process is created first, and the temporary record table is created when the failure record information is monitored for the first time. Further, the independent monitor process here means that the monitor process is independent from the main table writing process of the intermediary platform system, and the operation of the monitor 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 present disclosure, what is recorded in the temporary record table is an operation that the upstream system explicitly indicates has failed, and theoretically, after the failure information is fed back to the downstream system, the downstream system attempts to solve the problem by retrying the operation, that is, the downstream system has a high probability of re-initiating the repeat operation request with the same content. Generally, a request re-initiated after a failure belongs to a normal operation request, and a repeated operation request initiated after some tasks fail is easy to cause a system error, and is generally regarded as an abnormal request. Because the normal repeated operation request does not indicate whether the repeated operation request is initiated after the repeated operation request fails or not, in order to correctly distinguish the normal request from the abnormal request, the embodiment of the disclosure firstly ensures that all the failed record information is uniquely recorded in the temporary record table, and further ensures that the failed record information sent to the downstream system is uniquely determined, thereby avoiding that the subsequent operation is influenced by similar records with the same key field.
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 present disclosure, the duplication checking is performed through the temporary record table, so that the previous failure record information is utilized to find the normal request, and it is ensured that the subsequent normal request can be correctly executed. Preferably, all operation requests initiated by the downstream system are monitored, the repeat operation request is identified according to specific information in the request information, the query is further performed in the temporary record table through a key field of the repeat operation request, and if the repeat operation request has matching failure record information in the temporary record table, the repeat operation request is a normal request and should be executed; if the determination is an abnormal request, execution is denied. In this way, the embodiment of the disclosure can effectively identify the correct retry operation, avoid the influence of the improper retry on the system performance and reliability, and realize a better anti-replay effect.
In some embodiments of the present disclosure, the temporary record table is managed by a joint constraint of a plurality of key field combinations. Preferably, the failure record information recorded in the temporary record table may include, in addition to a plurality of key fields (such as channel, business category, payment account, collection account, amount of money, etc.): a field for recording the service number of the broker platform system (e.g., a main id field indicating an order number) and a status field for recording the information transmission status (e.g., a status field). In a preferred embodiment, the reliability of the system in high concurrency can be further improved through system caching; specifically, the acquired failure record information is stored in a pre-created cache, and when the cache is full or at a certain time (avoiding too long delay), the failure record information is removed from the cache and written into the temporary record table.
However, due to the problems mentioned in the background section above, in the prior art, a record cannot be uniquely determined by a joint constraint mode of combining a plurality of key fields, and a plurality of records with the same key fields may be obtained by simply depending on a temporary record table, so that specific corresponding modes of some records cannot be effectively discriminated, and the temporary record table needs to be further modified. In one embodiment of the present disclosure, the failed record information in the temporary record table needs further processing to try to avoid duplicate records. Specifically, when writing into the temporary record table, firstly, the temporary record table is checked for duplication, and when multiple duplicate records with the same key field content (here, the content of the key field is only duplicated, and practically all the contents are not duplicated, and should be multiple different records) are found, the content of at least one key field in each duplicate record is processed, so that the multiple duplicate records become different records (i.e., can be uniquely constrained by the combination of multiple key fields).
In some embodiments, considering that modification of other key fields may cause system errors, it is preferable to process the amount field in the key field so that the amount fields of multiple duplicate records are no longer the same but the total amount remains the same as the original total amount; therefore, on one hand, a plurality of repeated records can be distinguished, and on the other hand, the actual balance of both parties is not influenced. Further, considering that there may be different states for each record, the processing of the key fields includes:
when the state of more than 2 duplicate records in the multiple duplicate records is unsent, modifying the sum field of each unsent duplicate record to ensure that the sum of each unsent duplicate record is different but the total sum of all unsent records is unchanged;
when only one of the repeated records is unsent, splitting the unsent repeated record into 2 records, wherein the sum of the 2 split records is different but the total sum is unchanged (the sum is the same as the sum of the record before splitting), and the contents of other key fields are unchanged (particularly the mainID field is unchanged);
when a plurality of duplicate records are all in a sent state, nothing is done for the moment.
Optionally, the above-mentioned duplicate checking process may be performed when the failed record information is written into the temporary record table, or may be performed in any idle time when the temporary record table is not operated, so as to fully utilize system resources and relieve system stress.
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 main ID 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 state (status field) of the matching record in the temporary record table is changed into 'sent';
when the main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, the plurality of matching records of the temporary record table are sent (namely, the original record information is replaced), and the state (status field) of the plurality of matching records in the temporary record table is changed into sent.
In this way, it can be ensured that the failure record information (or corresponding matching record) sent to the downstream system all satisfy the uniqueness constraint, so that the retry operation which is re-issued by the downstream system according to the failure record information can also satisfy the uniqueness constraint and can be effectively identified. Wherein the status (status field) of each record in the temporary record table is "unsent" by default.
Further, in the embodiment of the present disclosure, the monitoring process monitors a repeat operation request initiated by a downstream system, where by default each downstream system initiates a corresponding repeat operation request according to the received failure record information (i.e. initiates a retry operation according to the record after the amount has been modified), and at the same time, it explicitly indicates in the request that this request is initiated repeatedly (for example, by a remark field mark, or initiating the request in a unified retry/remix table).
Inquiring the repeated operation request in the temporary record table, if there is a matching record with the same key field content and the sent state, releasing the repeated operation request, and immediately deleting the matching record from the temporary record table;
and if no matching record with the same key field content and the sent state is not in the matching record, rejecting the repeated operation request.
Further, in order to effectively prevent duplication at high concurrency, a deletion operation (the deletion operation is equivalent to a logic "lock" to lock the matching records) should be performed immediately after the matching records are found, and if the deletion is successful, the deletion is the first/only repeat operation request and can be released; if the deletion fails (usually, the record is deleted or deleted but not existed), it indicates that there are other concurrent repeat requests in the process of execution, and the repeat request should be rejected.
The released repeat operation request is submitted to an upstream system, and in order to reasonably update the main table, all record information of the modification amount and the splitting should be reported to inform the main table after success.
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 also applicable to other interactive terminals, such as a user terminal device, a merchant terminal device, or a settlement mechanism device, and the above method steps should not be considered as limiting the specific implementation devices of the embodiments of the present disclosure.
According to the network request reprocessing-preventing method provided by the embodiment of the disclosure, the uniqueness constraint of each record can be completed through the temporary record table, so that a reasonable retry request can be correctly and efficiently identified at an 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-replay device according to some embodiments of the present disclosure. As shown in fig. 2, the network request anti-replay device 200 includes a temporary table writing module 201, a record processing module 202, and an anti-replay processing module 203; wherein the content of the first and second substances,
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 the operation information, and perform corresponding processing on the intercepted failure record information according to the temporary record table;
the anti-replay processing module 203 is configured to monitor a repeat operation request initiated by a downstream system, query a matching condition of the repeat operation request in the temporary record table, and process the repeat operation request according to the matching condition.
In some embodiments, the temporary table write module comprises:
and the field processing module is used for checking duplication in the temporary record table, and processing the content of at least one key field in each duplicate record when a plurality of duplicate records with the same key field content are found, so that the plurality of duplicate records become different records.
In some embodiments, the field processing module comprises:
the sum modifying module is used for modifying the sum field of each unsent duplicate record when the state of more than 2 duplicate records in the multiple duplicate records is unsent, so that the sum of each unsent duplicate record is different but the total unsent sum is unchanged;
the record splitting module is used for splitting the unsent repeated record into 2 records when only one repeated record in the plurality of repeated records is unsent, the sum of the 2 split 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:
a record releasing module, configured to query the intercepted failure record information in the temporary record table, release 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 change the state of the matching record in the temporary record table to "sent";
and the record replacing module is used for sending the plurality of matching records of the temporary record table when the main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, and changing the states of the plurality of matching records in the temporary record table into sent states.
In some embodiments, the anti-replay processing module comprises:
a deletion releasing module, configured to query the repeat operation request in the temporary record table, and if there is a matching record with the same key field content and the sent state, immediately delete the matching record from the temporary record table, and release the repeat operation request;
and the rejecting module is used for rejecting the repeated operation request when the deletion fails or no matching record with the same key field content and the sent state is detected.
Referring to fig. 3, a schematic diagram of an electronic device is provided for one embodiment of the present disclosure. As shown in fig. 3, the electronic device 300 includes:
a memory 330 and one or more processors 310;
wherein the memory 330 is communicatively coupled to the one or more processors 310, the memory 330 stores instructions 332 executable by the one or more processors, and the instructions 332 are 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 present disclosure.
In particular, the processor 310 and the memory 330 may be connected by a bus or other means, such as by a bus 340 in FIG. 3. Processor 310 may be a 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 (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or any combination thereof.
The memory 330, which is 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 the cascaded progressive network in the disclosed embodiments. The processor 310 executes various functional applications and data processing of the processor by executing non-transitory software programs, instructions, and functional modules 332 stored in the memory 330.
The memory 330 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 310, and the like. Further, 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 optionally includes memory located remotely from processor 310, which may be connected to processor 310 via a network, such as through 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, in which computer-executable instructions are stored, and the computer-executable instructions are executed to perform the method in the foregoing embodiment of the present disclosure.
The foregoing computer-readable storage media include physical volatile and nonvolatile, removable and non-removable media implemented in any manner or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. The computer-readable storage medium specifically includes, but is not limited to, a USB flash drive, a removable hard drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), an erasable programmable Read-Only Memory (EPROM), an electrically erasable programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, a CD-ROM, a Digital Versatile Disk (DVD), an HD-DVD, a Blue-Ray or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
While the subject matter described herein is provided in the general context of execution in conjunction with the execution of an operating system and application programs on 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 where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations 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 implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present 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 the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure.
In summary, the present disclosure provides a network request anti-replay method, an apparatus, an electronic device and a computer-readable storage medium thereof. The embodiment of the disclosure performs the duplication checking verification through the temporary record table, thereby discovering the normal request by using the prior failure record information and ensuring that the subsequent normal request can be correctly executed.
It is to be understood that the above-described specific embodiments of the present disclosure are merely illustrative of or illustrative of the principles of the present disclosure and are not to be construed as limiting the present disclosure. Accordingly, any modification, equivalent replacement, improvement or the like made without departing from the spirit and scope of the present disclosure should be included in the protection scope of the present disclosure. Further, it is intended that the following claims cover all such variations and modifications that fall within the scope and bounds of the appended claims, or equivalents of such scope and bounds.

Claims (10)

1. A network request anti-reprocessing method is characterized by comprising 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 the operation information, and performing 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, and processing the repeated operation request according to the matching condition.
2. The method of claim 1, wherein writing the failure record information into a temporary record table comprises:
and checking the duplicate records in the temporary record table, and when a plurality of duplicate records with the same content of the key field are found, processing the content of at least one key field in each duplicate record to enable the plurality of duplicate records to become different records.
3. The method of claim 2, wherein processing the content of at least one key field in each duplicate record comprises:
when the state of more than 2 duplicate records in the multiple duplicate records is unsent, modifying the sum field of each unsent duplicate record to ensure that the sum of each unsent duplicate record is different but the total sum of all unsent records is unchanged;
when only one of the repeated records is unsent, splitting the unsent repeated record into 2 records, wherein the sum of the 2 split records is different but the total sum is unchanged, and the contents of other key fields are unchanged;
when a plurality of duplicate records are all in a sent state, nothing is done for the moment.
4. The method according to claim 1, wherein the correspondingly processing the intercepted failure record information according to the temporary record table comprises:
inquiring intercepted failure record information in the temporary record table, when the main ID field of the intercepted failure record information only has 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 main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, the plurality of matching records of the temporary record table are sent, and the states of the plurality of matching records in the temporary record table are changed into sent.
5. The method of claim 1, wherein the processing the repeat request in accordance with the match condition comprises:
inquiring the repeated operation request in the temporary record table, if there is a matching record with the same key field content and the sent state, immediately deleting the matching record from the temporary record table, and releasing the repeated operation request;
and if the deletion fails or no matching record with the same key field content and the sent state is not detected, rejecting the repeat operation request.
6. A network request anti-replay apparatus, comprising:
the temporary table writing module is used for 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;
the recording processing module is used for monitoring all operation information sent to a downstream system, identifying and intercepting failure recording information in all the operation information, and performing corresponding processing on the intercepted failure recording information according to the temporary recording table;
and the anti-replay 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.
7. The apparatus of claim 6, wherein the temporary table writing module comprises:
and the field processing module is used for checking duplication in the temporary record table, and processing the content of at least one key field in each duplicate record when a plurality of duplicate records with the same key field content are found, so that the plurality of duplicate records become different records.
8. The apparatus of claim 7, wherein the field processing module comprises:
the sum modifying module is used for modifying the sum field of each unsent duplicate record when the state of more than 2 duplicate records in the multiple duplicate records is unsent, so that the sum of each unsent duplicate record is different but the total unsent sum is unchanged;
the record splitting module is used for splitting the unsent repeated record into 2 records when only one repeated record in the plurality of repeated records is unsent, the sum of the 2 split records is different but the total sum is unchanged, and the contents of other key fields are unchanged.
9. The apparatus of claim 6, wherein the record processing module comprises:
a record releasing module, configured to query the intercepted failure record information in the temporary record table, release 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 change the state of the matching record in the temporary record table to "sent";
and the record replacing module is used for sending the plurality of matching records of the temporary record table when the main ID field of the intercepted failure record information has a plurality of matching records in the temporary record table, and changing the states of the plurality of matching records in the temporary record table into sent states.
10. The apparatus of claim 6, wherein the anti-replay module comprises:
a deletion releasing module, configured to query the repeat operation request in the temporary record table, and if there is a matching record with the same key field content and the sent state, immediately delete the matching record from the temporary record table, and release the repeat operation request;
and the rejecting module is used for rejecting the repeated operation request when the deletion fails or no matching record with the same key field content and the sent state is detected.
CN202010488604.0A 2020-06-02 2020-06-02 Network request anti-reprocessing method and device Pending CN111708802A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010488604.0A CN111708802A (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 CN111708802A (en) 2020-06-02 2020-06-02 Network request anti-reprocessing method and device

Publications (1)

Publication Number Publication Date
CN111708802A true CN111708802A (en) 2020-09-25

Family

ID=72537562

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN111708802A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590662A (en) * 2021-08-04 2021-11-02 吉林亿联银行股份有限公司 Method and device for inquiring 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 (9)

* 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
US20130159344A1 (en) * 2010-10-20 2013-06-20 Microsoft Corporation 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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590662A (en) * 2021-08-04 2021-11-02 吉林亿联银行股份有限公司 Method and device for inquiring business transaction result, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
EP3776208B1 (en) Runtime self-correction for blockchain ledgers
CN110688425B (en) Method and system for conditionally deferring transactions for blockchains
US8745759B2 (en) Associated with abnormal application-specific activity monitoring in a computing network
US11558388B2 (en) Provisional computing resource policy evaluation
CN107818431B (en) Method and system for providing order track data
US20160027007A1 (en) Loosely Coupled Hosted Application System
US20050203952A1 (en) Tracing a web request through a web server
US20150112761A1 (en) Centralized customer contact database
CN111092745A (en) Log processing method and device based on block chain, computer equipment and storage medium
US10019308B1 (en) Disaster-proof event data processing
CN110188103A (en) Data account checking method, device, equipment and storage medium
KR101338150B1 (en) Method and apparatus for providing data about abnormal termination of program
CN111064725A (en) Code zero intrusion interface verification method and device
CN112068973A (en) Asynchronous information processing method and device of policy mode, server and storage medium
CN108650123B (en) Fault information recording method, device, equipment and storage medium
CN111708802A (en) Network request anti-reprocessing method and device
US11243979B1 (en) Asynchronous propagation of database events
US20180225325A1 (en) Application resiliency management using a database driver
CN114218303B (en) Transaction data processing system, processing method, medium and equipment
US20220350815A1 (en) Systems and methods for data format conversion
CN111741080B (en) Network file distribution method and device
CN113850664A (en) Data anomaly detection method and data reporting service
CN113177052A (en) Method and device for processing service data consistency of distributed system
CN112860770A (en) Report generation method and device, electronic equipment and storage medium
CN112579858A (en) Data crawling method and 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