CN113590662B - Query method and device for business transaction result, storage medium and electronic equipment - Google Patents

Query method and device for business transaction result, storage medium and electronic equipment Download PDF

Info

Publication number
CN113590662B
CN113590662B CN202110890785.4A CN202110890785A CN113590662B CN 113590662 B CN113590662 B CN 113590662B CN 202110890785 A CN202110890785 A CN 202110890785A CN 113590662 B CN113590662 B CN 113590662B
Authority
CN
China
Prior art keywords
identifier
duplication
transaction
target
request
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
CN202110890785.4A
Other languages
Chinese (zh)
Other versions
CN113590662A (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.)
Jilin Yillion Bank Co ltd
Original Assignee
Jilin Yillion Bank Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin Yillion Bank Co ltd filed Critical Jilin Yillion Bank Co ltd
Priority to CN202110890785.4A priority Critical patent/CN113590662B/en
Publication of CN113590662A publication Critical patent/CN113590662A/en
Application granted granted Critical
Publication of CN113590662B publication Critical patent/CN113590662B/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/245Query processing
    • G06F16/2455Query execution
    • 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Computational Linguistics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a query method and a device for business transaction results, a storage medium and electronic equipment, wherein the method comprises the steps of determining a target identifier when a query request for querying a processing result of target business transaction is received; determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently; judging whether an anti-duplication identifier matched with a target identifier exists in the first anti-duplication identifier set; if the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining that the query result corresponding to the query request is transaction failure, and recording the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to refuse to process the target service transaction when receiving the processing request corresponding to the target service transaction. By applying the method of the invention, when the query request of the business transaction result reaches the system before the processing request of the transaction, repeated query is not needed, and the system load can be reduced.

Description

Query method and device for business transaction result, storage medium and electronic equipment
Technical Field
The present invention relates to the field of business processing technologies, and in particular, to a method and apparatus for querying a business transaction result, a storage medium, and an electronic device.
Background
With the development of computer technology, various business systems have become one of the important ways to process business transactions. In order to increase the service processing capacity of a service system to cope with larger and larger traffic volumes, the service system usually adopts a high concurrency mode, for example, adopts a distributed micro service cluster, and the system can process multiple requests simultaneously and in parallel.
In an actual business scenario, after a processing request of a business transaction is triggered, there is often a query request of a processing result of the business transaction immediately following the query request. In the transmission process of the request, network jitter or service blocking and the like occur sometimes, and a service system for processing the service transaction may receive a query request of a service transaction result before receiving the processing request of the service transaction, and at this time, the query result is abnormal.
In order to avoid the abnormal inquiry situation, at present, under the condition that no transaction exists, the business transaction result is not returned temporarily, but the inquiry is repeated within the preset time, and the same result is returned after the preset time, so that the business transaction result of the transaction failure is returned. The repeated inquiry mode can cause certain pressure to the service system, so that the system resources are more tense, and system abnormality is easy to cause.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a query method for business transaction results, so as to solve the problems of high system load and easy system abnormality caused by repeated query under the condition that no transaction exists.
The embodiment of the invention also provides a query device of the business transaction result, which is used for ensuring the practical realization and application of the method.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a query method of business transaction results comprises the following steps:
when a query request for querying a processing result of a target business transaction is received, determining a target identifier, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
Determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
Judging whether an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set;
if the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining that the query result corresponding to the query request is transaction failure, and recording the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to refuse to process the target service transaction when receiving the processing request corresponding to the target service transaction.
The method, optionally, the recording process of the anti-duplication identifier in the first anti-duplication identifier set includes:
When a processing request for processing a first business transaction is received, determining a first identifier, wherein the first identifier is a transaction identifier corresponding to the first business transaction;
determining a second anti-duplication identification set, wherein the second anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
Judging whether an anti-duplication identifier matched with the first identifier exists in the second anti-duplication identifier set;
And if the second anti-duplication identifier set does not have the anti-duplication identifier matched with the first identifier, carrying out service processing on the first service transaction based on the processing request corresponding to the first service transaction, and recording the first identifier as the anti-duplication identifier corresponding to the first service transaction.
The method, optionally, the recording process of the anti-duplication identifier in the first anti-duplication identifier set includes:
when a query request for querying a processing result of a second business transaction is received, determining a second identifier, wherein the second identifier is a transaction identifier corresponding to the second business transaction;
determining a third anti-duplication identification set, wherein the third anti-duplication identification set comprises a plurality of anti-duplication identifications recorded currently;
Judging whether an anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set;
and if the third anti-duplication identifier set does not have the anti-duplication identifier matched with the second identifier, recording the second identifier as the anti-duplication identifier corresponding to the second business transaction.
In the above method, optionally, when receiving the processing request corresponding to the target service transaction, the rejecting processing the target service transaction includes:
When a processing request corresponding to the target business transaction is received, determining a fourth anti-duplication identification set, wherein the fourth anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
judging whether an anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set;
And if the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set, rejecting to respond to the processing request corresponding to the target business transaction.
The method, optionally, further comprises:
If the first anti-duplication identification set has the anti-duplication identification matched with the target identification, determining a target anti-duplication identification, wherein the target anti-duplication identification is the anti-duplication identification matched with the target identification in the first anti-duplication identification set;
determining a request type corresponding to the target anti-duplication identifier;
If the request type is a processing type request of the business transaction, judging whether the business processing flow corresponding to the target business transaction is finished currently or not;
And if the business processing flow corresponding to the target business transaction is completed, determining a processing result corresponding to the business processing flow, and determining a query result corresponding to the query request based on the processing result corresponding to the business processing flow.
The method, optionally, further comprises:
if the service processing flow corresponding to the target service transaction is not completed currently, determining the query time corresponding to the query request and the transaction time corresponding to the target service transaction;
Determining a time interval between the transaction time and the inquiry time, and judging whether the time interval is smaller than a preset time length;
if the time interval is smaller than the preset time length, determining that the query result corresponding to the query request is that the transaction is being processed;
and if the time interval is not smaller than the preset time length, determining that the query result corresponding to the query request is transaction failure.
The method, optionally, further comprises:
If the request type is a query type request of a service processing result, determining that the query result corresponding to the query request is transaction failure.
A business transaction result query device, comprising:
the first determining unit is used for determining a target identifier when a query request for querying a processing result of a target business transaction is received, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
The second determining unit is used for determining a first anti-duplication identification set, and the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
The first judging unit is used for judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier;
and the first recording unit is used for determining that the query result corresponding to the query request is transaction failure if the anti-duplication identifier matched with the target identifier does not exist in the first anti-duplication identifier set, and recording the target identifier as the anti-duplication identifier corresponding to the target business transaction so as to refuse to process the target business transaction when the processing request corresponding to the target business transaction is received.
The above device, optionally, further comprises:
The third determining unit is used for determining a first identifier when a processing request for processing the first business transaction is received, wherein the first identifier is a transaction identifier corresponding to the first business transaction;
A fourth determining unit, configured to determine a second anti-duplication identifier set, where the second anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
The second judging unit is used for judging whether the second anti-duplication identifier set has the anti-duplication identifier matched with the first identifier;
And the second recording unit is used for carrying out service processing on the first service transaction based on the processing request corresponding to the first service transaction if the anti-duplication identifier matched with the first identifier does not exist in the second anti-duplication identifier set, and recording the first identifier as the anti-duplication identifier corresponding to the first service transaction.
The above device, optionally, further comprises:
A fifth determining unit, configured to determine a second identifier when a query request for querying a processing result of a second service transaction is received, where the second identifier is a transaction identifier corresponding to the second service transaction;
A sixth determining unit, configured to determine a third anti-duplication identifier set, where the third anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
A third judging unit, configured to judge whether an anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set;
And the third recording unit is used for recording the second identifier as the anti-duplication identifier corresponding to the second service transaction if the anti-duplication identifier matched with the second identifier does not exist in the third anti-duplication identifier set.
The above device, optionally, further comprises:
A seventh determining unit, configured to determine a fourth anti-duplication identifier set when a processing request corresponding to the target service transaction is received, where the fourth anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
A fourth judging unit, configured to judge whether an anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set;
and the refusing response unit is used for refusing to respond to the processing request corresponding to the target business transaction if the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set.
The above device, optionally, further comprises:
An eighth determining unit, configured to determine a target anti-duplication identifier if an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set, where the target anti-duplication identifier is an anti-duplication identifier matched with the target identifier in the first anti-duplication identifier set;
a ninth determining unit, configured to determine a request type corresponding to the target anti-duplication identifier;
a fifth judging unit, configured to judge whether a service processing procedure corresponding to the target service transaction is currently completed if the request type is a processing type request of the service transaction;
And a tenth determining unit, configured to determine a processing result corresponding to the service processing flow if the service processing flow corresponding to the target service transaction is completed, and determine a query result corresponding to the query request based on the processing result corresponding to the service processing flow.
The above device, optionally, further comprises:
An eleventh determining unit, configured to determine a query time corresponding to the query request and a transaction time corresponding to the target business transaction if the business processing flow corresponding to the target business transaction is not completed currently;
A sixth judging unit configured to determine a time interval between the transaction time and the inquiry time, and judge whether the time interval is less than a predetermined length of time;
A twelfth determining unit, configured to determine that a query result corresponding to the query request is that a transaction is being processed if the time interval is less than the predetermined time length;
and a thirteenth determining unit, configured to determine that the query result corresponding to the query request is a transaction failure if the time interval is not less than the predetermined duration.
The above device, optionally, further comprises:
And the fourteenth determining unit is used for determining that the query result corresponding to the query request is transaction failure if the request type is the query type request of the service processing result.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium resides to perform a method of querying a business transaction outcome as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform a method of querying a business transaction outcome as described above by one or more processors.
Based on the query method of the business transaction result provided by the embodiment of the invention, the query method comprises the following steps: when a query request for querying a processing result of the target business transaction is received, determining a target identifier, wherein the target identifier is a transaction identifier corresponding to the target business transaction; determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently; judging whether an anti-duplication identifier matched with a target identifier exists in the first anti-duplication identifier set; if the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining that the query result corresponding to the current query request is transaction failure, and recording the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to reject to process the target service transaction when receiving the processing request corresponding to the target service transaction. By using the method provided by the embodiment of the invention, the transaction identifier of the business transaction is recorded as the anti-duplication identifier, when the query request of the business transaction result is received, whether the transaction identifier of the currently queried target business transaction is matched with the recorded anti-duplication identifier can be judged, if the transaction identifier is not matched, the processing request of the target business transaction is not received currently, the transaction failure is returned as the query result, and the processing is not performed when the processing request of the business transaction is received subsequently, so that the previous query result is matched with the final processing result, the query is not required to be repeated, the system load can be reduced, the system load is reduced, the tension state of system resources is avoided to be aggravated, and the normal operation of the system is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for querying a business transaction result according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for querying a business transaction result according to an embodiment of the present invention;
Fig. 3 is a signaling flow chart of a method for processing a business transaction according to an embodiment of the present invention;
fig. 4 is a signaling flow chart of a query method for service transaction results according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a query device for a business transaction result according to an embodiment of the present invention;
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As known from the background art, the current high concurrency situation in the service network is more frequent. Often, the system receives a query request of a service transaction before receiving a processing request of the service transaction due to network jitter, database congestion, or micro-service congestion of a distributed service. Under the scene, the query request responding to the business transaction returns a query result which does not exist in the transaction to the user, and when the processing request of the business transaction is received, the business transaction is normally completed, and the query result is inconsistent with the processing result of the business transaction, so that the query is abnormal, and a certain resource loss is caused.
At present, in order to avoid abnormal inquiry caused by receiving an inquiry request, a special response code is generally defined as an identifier in the message transmission of the association system, and the association system performs special processing when receiving the agreed special response code within an agreed time period after the inquiry is triggered. For example, when the response code 999999-original transaction information does not exist, and the calling system (the service system needing to obtain the query result) receives the response code, the original transaction cannot be immediately judged as failure, the original transaction is needed to be treated, and the query is repeated within a stipulated time period, and after the stipulated time period is reached, the query result is returned as transaction failure only when the information that the transaction does not exist is still returned, and the original transaction order (closing the transaction order) is set as failure. Therefore, in the current query method, the calling system repeatedly queries the processing result of the service transaction, and a certain pressure is caused to the service system (the service system for processing the specific service transaction), if the service system is blocking the transaction, the original transaction information does not exist, and the repeated query of the calling system may lead to more intense service system resources and cause the abnormality of the service system. And secondly, the failed business transaction cannot close the order in time, the order can be closed by the service system after the failure information is fed back or the appointed time period is reached, the accurate query time is difficult to determine, the closing time of the order is difficult to control, the feedback of the query result is relatively slow, and the user experience is poor. In addition, in some inquiry scenes, waiting until closing the order in a contracted time may cause transaction to cross days, possibly affecting batch reconciliation, failing to give a calling system and issue transaction detail files, affecting normal business work.
Therefore, the embodiment of the invention provides a query method for service transaction results, which processes the service transaction as transaction failure if the query request is received before the processing request is received, so as to avoid repeated query and reduce the system load.
The embodiment of the invention provides a query method of business transaction results, which can be applied to various business systems for processing business transactions, wherein an execution subject of the method can be a server of the system, and a flow chart of the method is shown in fig. 1 and comprises the following steps:
S101: when a query request for querying a processing result of a target business transaction is received, determining a target identifier, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
In the method provided by the embodiment of the invention, when the server of the service system receives the request for inquiring the processing result of a certain service transaction, the transaction identifier of the target service transaction to be inquired currently can be used as the target identifier.
The query request mentioned in the method provided by the embodiment of the invention can be a query request sent by a user through a front-end system, or can be a query request triggered by a system calling a service at fixed time. The business transaction can be a transaction such as payment transaction and the like with exchange or buying and selling meanings, and can also be various transactions related to business transaction, namely the business transaction mentioned in the embodiment of the invention generally refers to business orders of various businesses.
S102: determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
In the method provided by the embodiment of the invention, the received flow information of the business transaction can be dropped into a database, namely recorded in the database, at the entry gateway layer of the system. By received business transaction is meant a business transaction that receives related requests, including processing requests and query requests. The same business transaction does not have repeated records, and the anti-duplication identifications are different from each other. The transaction identifier which can uniquely represent the business transaction in the running water information of each business transaction recorded in the database can be used as the anti-duplication identifier of the business transaction, and the transaction identifier can be the running water number of the transaction. When a query request is received, each recorded anti-duplication identifier, that is, the identifier of the service transaction for which the relevant processing request or query request was received before, can be obtained from the information currently recorded in the database. And forming each currently recorded anti-duplication identifier into a first anti-duplication identifier set. The anti-duplication identifiers in the first anti-duplication identifier set are used for representing that the corresponding business transaction is in a responded state, that is, the related request of the corresponding business transaction is received before the corresponding business transaction, and the corresponding business transaction triggers a business processing flow or fails to process the business transaction.
S103: judging whether an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set;
In the method provided by the embodiment of the invention, each anti-duplication identifier in the first anti-duplication identifier set can be respectively compared with the target identifier to judge whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier. If one anti-duplication identifier exists in each anti-duplication identifier and is the same as the target identifier, determining that the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier, and if each anti-duplication identifier is different from the target identifier, the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier.
S104: determining that the query result corresponding to the query request is transaction failure, and recording the target identifier as an anti-duplication identifier corresponding to the target business transaction, so as to refuse to process the target business transaction when receiving the processing request corresponding to the target business transaction.
In the method provided by the embodiment of the invention, if the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining the transaction result of the target business transaction as transaction failure, and feeding back the transaction failure as the query result corresponding to the query request. And simultaneously, the target identifier, namely the transaction identifier of the target business transaction is used as the anti-re-identifier of the target business transaction to be recorded in the database. If a processing request of the target business transaction is received later, the transaction identification of the transaction is recorded, and the current business system is regarded as responding to the transaction, and the processing of the target business transaction is refused, namely the business processing flow of the transaction is not triggered any more, and the processing is carried out as failure transaction.
Based on the method provided by the embodiment of the invention, when the query request of the processing result of the business transaction is received, whether each pre-recorded anti-duplication identifier is matched with the transaction identifier of the currently queried business transaction can be judged so as to judge whether the current business transaction is responded currently, namely whether the related request of the business transaction is received before. And under the condition that each anti-weight identifier is not matched with the transaction identifier, namely, the related request of the service transaction is not received before the current query request is received, and the actual service processing flow of the service transaction is not triggered, processing the service transaction as a failure transaction. By applying the method provided by the embodiment of the invention, if the query request of the business transaction is received before the processing request of the business transaction is received, the business transaction can be processed in a failure transaction in both query and processing aspects, the query result can be returned immediately when the query request is received, and the processing result of the business transaction can be ensured to be consistent with the query result. The processing result of the business transaction is not required to be repeatedly inquired, the system load can be reduced, the shortage of system resources is avoided being aggravated, and the normal operation of the system is guaranteed. And secondly, the transaction order can be closed in time, the query result feedback is more in time, and the service experience of the user can be improved. In addition, the transaction cross-day is avoided, and normal business work is guaranteed.
In order to better explain the method provided by the embodiment of the present invention, on the basis of the method shown in fig. 1, the embodiment of the present invention provides a further method for querying a business transaction result, where the recording process of the anti-duplication identifier in the first anti-duplication identifier set mentioned in step S102 includes:
When a processing request for processing a first business transaction is received, determining a first identifier, wherein the first identifier is a transaction identifier corresponding to the first business transaction;
In the method provided by the embodiment of the invention, when the processing request for processing the business transaction is received, the transaction identifier of the business transaction which is currently requested to be processed can be determined, and the transaction identifier is used as the first identifier.
Determining a second anti-duplication identification set, wherein the second anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
In the method provided by the embodiment of the invention, each anti-duplication identifier recorded before the current processing request is received can be formed into the second anti-duplication identifier set, namely the transaction identifier of the business transaction which has received the related request before.
Judging whether an anti-duplication identifier matched with the first identifier exists in the second anti-duplication identifier set;
In the method provided by the embodiment of the invention, each anti-duplication identifier in the second anti-duplication identifier set can be respectively compared with the first identifier, and if one anti-duplication identifier is the same as the first identifier, the anti-duplication identifier matched with the first identifier exists in the second anti-duplication identifier set. If all the anti-duplication identifiers in the second anti-duplication identifier set are different from the first identifier, determining that the anti-duplication identifier matched with the first identifier does not exist in the second anti-duplication identifier set.
And if the second anti-duplication identifier set does not have the anti-duplication identifier matched with the first identifier, carrying out service processing on the first service transaction based on the processing request corresponding to the first service transaction, and recording the first identifier as the anti-duplication identifier corresponding to the first service transaction.
In the method provided by the embodiment of the invention, if the second anti-duplication identifier set does not have the anti-duplication identifier matched with the first identifier, the first service transaction processed by the current request is not responded before, that is, the request related to the first service transaction is not received. The actual business processing flow of the first business transaction can be triggered based on the processing request of the first business transaction, and the first identifier is used as the anti-re-identification corresponding to the first business transaction and recorded in the database so as to indicate that the first business transaction is responded.
Based on the method provided by the embodiment of the invention, the recording process of the anti-duplication identification in the first anti-duplication identification set is described, namely the anti-duplication identification in the first anti-duplication identification set can be recorded after receiving the processing request of the business transaction. The transaction identifier of the business transaction can be recorded as an anti-duplication identifier when the processing request of the business transaction is received in advance, so that the processing result can be further queried when the query request is received later.
Further, on the basis of the method shown in fig. 1, the embodiment of the present invention provides another query method for a business transaction result, where the recording process of the anti-re-identification in the first anti-re-identification set mentioned in step S102 includes:
when a query request for querying a processing result of a second business transaction is received, determining a second identifier, wherein the second identifier is a transaction identifier corresponding to the second business transaction;
In the method provided by the embodiment of the invention, when the request for inquiring the processing result of the business transaction is received, the transaction identifier of the business transaction which is currently requested to be inquired can be used as the second identifier.
Determining a third anti-duplication identification set, wherein the third anti-duplication identification set comprises a plurality of anti-duplication identifications recorded currently;
in the method provided by the embodiment of the invention, each anti-duplication identifier recorded before the current query request is received can be formed into the third anti-duplication identifier set.
Judging whether an anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set;
In the method provided by the embodiment of the invention, each anti-duplication identifier in the third anti-duplication identifier set can be respectively compared with the second identifier, and if one anti-duplication identifier is the same as the second identifier, the anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set. If all the anti-weight identifiers in the third anti-weight identifier set are different from the second identifier, no anti-weight identifier matched with the second identifier exists in the third anti-weight identifier set.
And if the third anti-duplication identifier set does not have the anti-duplication identifier matched with the second identifier, recording the second identifier as the anti-duplication identifier corresponding to the second business transaction.
In the method provided by the embodiment of the invention, if the anti-duplication identifier matched with the second identifier does not exist in the third anti-duplication identifier set, the fact that the second service transaction is not responded before the processing result of the request for inquiring the second service transaction is received, that is, the related request of the second service transaction is not received is indicated, and the second identifier is recorded as the anti-duplication identifier of the second service transaction. And simultaneously, feeding back the transaction failure as a processing result of the second business transaction.
Based on the method provided by the embodiment of the invention, the recording process of the other type of anti-re-identification in the first anti-re-identification set is described, namely, the anti-re-identification in the first anti-re-identification set can be recorded after the query request of the business transaction is received. The transaction identifier of the business transaction can be recorded as an anti-duplication identifier when the inquiry request of the business transaction is received, so that the business transaction can be processed as a failure transaction when the processing request is received later or the inquiry request is received again.
In combination with the embodiments provided in the foregoing recording process related to the anti-duplication identifier in the first anti-duplication identifier set, it can be seen that the anti-duplication identifier in the first anti-duplication identifier set may be recorded after receiving a processing request of a service transaction, or may be recorded after receiving a query request, that is, for a certain service transaction, the system records the anti-duplication identifier corresponding to the service transaction when receiving a related request of the service transaction for the first time, and does not perform repeated recording when receiving the related request again later.
It should be noted that, the recording operation of each anti-duplication identifier in the first anti-duplication identifier set is performed before the query request of the target business transaction is received in step S101 in the method shown in fig. 1. The current time of receiving the related request mentioned in the recording process in the above embodiments of the recording process refers to not the time of receiving the request in the method shown in fig. 1, that is, each anti-duplication identifier in the second anti-duplication identifier set or the third anti-duplication identifier set is the anti-duplication identifier recorded before the related request is received in the corresponding process.
On the other hand, the above two embodiments regarding the anti-duplication identification recording process are only for better explaining the embodiments provided by the anti-duplication identification recording in the method provided by the embodiments of the present invention, the two types of anti-duplication identification recording processes are not related to each other, and each embodiment only describes the anti-duplication identification recording process corresponding to a certain business transaction. In a specific implementation process, the recording process of each anti-duplication identifier in the first anti-duplication identifier set is recorded according to actual conditions, and each anti-duplication identifier may be recorded when a processing request of a service transaction is received, may be recorded when a query request is received, or may be recorded in various manners, so that the implementation function of the method provided by the embodiment of the invention is not affected.
In the method provided by the embodiment of the invention, based on the form record data of a table, a duplication prevention table is constructed to record the flow information of each business transaction which has received the related request, and the main element fields of each business transaction record in the duplication prevention table can be shown in the following table:
Channel coding channel_no
Water flow number serial_no
Transaction code trade_code
Transaction date trade_date
Transaction time trade_time
Time stamp time_stamp
Transaction status trade_statu
Response code ret_code
Response information ret_message
The serial number can be used as a main key (anti-duplication mark), and the channel code and the serial number can be used as a combined main key (anti-duplication mark). The specific primary key field can be determined according to the service attribute of the actual service system, if the serial number is used as the primary key, the serial number is indicated to be globally unique, and if the channel code and the serial number are used as the combined primary key, the serial number of each channel is indicated to be unique. The serial number in the method provided by the embodiment of the invention refers to the serial number of a specific business transaction, and if the record in the anti-duplication table is recorded when a processing request of the business transaction is received, the serial number is the serial number of the business transaction requested to be processed. If the record in the anti-duplication table is recorded when the inquiry request is received, the serial number is the serial number of the business transaction requesting inquiry.
It should be noted that, the main element fields shown in the above table are only one embodiment provided for better explaining the method provided by the embodiment of the present invention, and in a specific implementation process, the specific service element fields can be determined according to actual service requirements, so that the implementation function of the method provided by the embodiment of the present invention is not affected.
In order to better explain the method provided by the embodiment of the present invention, on the basis of the method shown in fig. 1, the embodiment of the present invention provides a method for querying a service transaction result, where a process for rejecting to process the target service transaction when receiving a processing request corresponding to the target service transaction, which is mentioned in step S104, includes:
When a processing request corresponding to the target business transaction is received, determining a fourth anti-duplication identification set, wherein the fourth anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
In the method provided by the embodiment of the invention, if a request for processing the target business transaction is received, all the currently recorded anti-duplication identifications are formed into a fourth anti-duplication identification set.
Judging whether an anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set;
In the method provided by the embodiment of the invention, each anti-duplication identifier in the fourth anti-duplication identifier set can be compared with the target identifier, if one anti-duplication identifier exists in the fourth anti-duplication identifier set and is the same as the target identifier, the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set, and if all the anti-duplication identifiers are different from the target identifier, the anti-duplication identifier matched with the target identifier does not exist in the fourth anti-duplication identifier set.
And if the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set, rejecting to respond to the processing request corresponding to the target business transaction.
In the method provided by the embodiment of the invention, in the scenario of the method shown in fig. 1, if after the target identifier is recorded as the anti-duplication identifier corresponding to the target service transaction, a processing request corresponding to the target service transaction is received, the anti-duplication identifier corresponding to the target identifier already exists in the fourth anti-duplication identifier set, so that the matching result is that the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set, the target service transaction is processed as a failed transaction, and the corresponding service processing flow is not triggered.
It should be noted that the embodiments of the present invention are only to better illustrate a specific embodiment provided by the process of rejecting the processing of the target business transaction after the target identifier is recorded as the anti-duplication identifier. For the processing flow when the processing request corresponding to the target business transaction is received, the processing flow is the same as the processing flow when the processing request of any business transaction is received, referring to the embodiment provided by the process of recording the anti-re-identification when the processing request is received, if the anti-re-identification matching process at the moment does not match the corresponding anti-re-identification in the business transaction currently requested to be processed, the transaction identification is used as the anti-re-identification record, and the specific business processing flow is triggered.
Based on the method provided by the embodiment of the invention, under the condition that the processing request of the corresponding transaction is received after the query request of the target business transaction is received, the corresponding anti-duplication mark can be matched, the target business transaction is failed to be responded, the target business transaction is treated as the failed transaction at the moment, the subsequent business processing is not carried out any more, and the final processing result of the target business transaction can be ensured to be consistent with the query result fed back in advance.
Further, with reference to the flowchart shown in fig. 2, the embodiment of the present invention provides a method for querying a business transaction result, and on the basis of the method shown in fig. 1, the method provided in the embodiment of the present invention further includes:
S105: determining a target anti-duplication identifier, wherein the target anti-duplication identifier is an anti-duplication identifier matched with the target identifier in the first anti-duplication identifier set;
In the method provided by the embodiment of the present invention, in the process of determining whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier in the step S103, if the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier, the anti-duplication identifier matched with the target identifier in each anti-duplication identifier in the first anti-duplication identifier set is used as the target anti-duplication identifier.
S106: determining a request type corresponding to the target anti-duplication identifier;
In the method provided by the embodiment of the invention, the corresponding request identifier can be obtained from the pre-recorded flow information corresponding to the target anti-duplication identifier, for example, in the main element field of the anti-duplication table provided in the above embodiment, the transaction code can be used as the request identifier to determine the request type corresponding to the target anti-duplication identifier. In the method provided by the embodiment of the invention, the request for requesting to process the business transaction can correspond to one type of transaction code, and the request for requesting to inquire the processing result of the business transaction can correspond to another type of transaction code. The request type corresponding to the target anti-duplication identifier characterizes the type of the request triggering the recording of the target anti-duplication identifier, namely, characterizes whether the target anti-duplication identifier is recorded when receiving the processing request of the corresponding business transaction or recorded when receiving the query request of the corresponding business transaction.
S107: the request type is a processing type request of business transaction;
in the method provided by the embodiment of the invention, if the request type corresponding to the target anti-duplication identifier is a processing type request of the business transaction, namely, the target anti-duplication identifier is recorded when the processing request of the corresponding business transaction is received, namely, before the query request of the current target business transaction is received, the request related to the target business transaction, which is received by the system first, is the processing request corresponding to the target business transaction.
S108: judging whether the business processing flow corresponding to the target business transaction is finished currently or not;
In the method provided by the embodiment of the invention, whether the target business transaction is processed or not can be judged through the business processing records in the database, namely whether a final processing result is obtained or not.
S109: and determining a processing result corresponding to the business processing flow, and determining a query result corresponding to the query request based on the processing result corresponding to the business processing flow.
In the method provided by the embodiment of the invention, if the business processing flow corresponding to the target business transaction is finished currently, namely the final processing result of the target business transaction is obtained, the final processing result is determined, and the final processing result is used as a query result to feed back. If the final processing result is that the transaction is successful, the query result is also that the transaction is successful, and if the final processing result is that the transaction is failed, the query result is that the transaction is failed.
Based on the method provided by the embodiment of the invention, under the condition that the query request is received after the processing request is received, the query result is further fed back according to the processing result, and the query of the transaction processing result under normal conditions is ensured.
Further, on the basis of the method shown in fig. 2, the embodiment of the present invention provides another query method for a business transaction result, where the method provided by the embodiment of the present invention further includes:
if the service processing flow corresponding to the target service transaction is not completed currently, determining the query time corresponding to the query request and the transaction time corresponding to the target service transaction;
In the method provided by the embodiment of the present invention, through the judging process mentioned in step S108, if the service processing flow of the target service transaction is currently incomplete, that is, there is no final processing result yet, the query time corresponding to the query request is determined, that is, the time of sending the current query request, and the transaction time of the target service transaction, that is, the time of sending the processing request of the target service transaction, is obtained from the flow information of the target service transaction.
Determining a time interval between the transaction time and the inquiry time, and judging whether the time interval is smaller than a preset time length;
In the method provided by the embodiment of the invention, a time length can be preset, and the preset time length can be set according to the conditions of the service processing capacity and the like of the system. The predetermined time length characterizes the longest response time of the system to the request, namely, for a processing request, if the system fails to complete the service processing flow corresponding to the processing request after the predetermined time length after the request is triggered, the system cannot normally complete the service processing flow. In the method provided by the embodiment of the invention, the time interval between the transaction time and the inquiry time can be determined, and the time interval is compared with the preset duration.
If the time interval is smaller than the preset time length, determining that the query result corresponding to the query request is that the transaction is being processed;
in the method provided by the embodiment of the invention, if the interval between the current inquiry time and the transaction time is smaller than the preset time length, the inquiry result is determined to be the transaction being processed.
And if the time interval is not smaller than the preset time length, determining that the query result corresponding to the query request is transaction failure.
In the method provided by the embodiment of the invention, if the time interval between the inquiry time and the transaction time is greater than or equal to the preset time length, the inquiry result is determined as the transaction failure.
Based on the method provided by the embodiment of the invention, a preset time length representing normal processing time can be set according to the architecture of the service system. The inquiry result of the transaction being processed can be fed back within the preset time, and the inquiry result of the transaction failure can be fed back after the preset time, so that the transaction can be closed timely when the transaction is abnormal in the processing process, the failed transaction can be processed, the user experience can be further improved, and normal business processing work can be ensured.
Further, on the basis of the method shown in fig. 2, the embodiment of the present invention provides another query method for a business transaction result, where the method provided by the embodiment of the present invention further includes:
If the request type is a query type request of a service processing result, determining that the query result corresponding to the query request is transaction failure.
In the method provided by the embodiment of the present invention, if the request type determined in step S106 is a query type request of a service processing result, that is, the target anti-duplication identifier is recorded when a query request for querying a processing result of a corresponding service transaction is received, that is, a request related to a target service transaction, which is received first before the current query request is received, is also a query request corresponding to the target service transaction. According to the method provided by the embodiment of the invention, when the related request of the business transaction received at first is the query request, the business transaction is processed as the failed transaction, so that the query result is determined as the transaction failure.
Based on the method provided by the embodiment of the invention, under the condition that the system has received the related request of the business transaction and the first received request is also the query request, the business transaction can be processed as the failure transaction, and the consistency of the query result can be ensured.
In order to better explain the method provided by the embodiment of the present invention, the overall processing flow of the processing request and the query request of the business transaction will be briefly described with reference to fig. 3 and fig. 4.
As shown in the signaling flow chart of fig. 3, in the method provided by the embodiment of the present invention, a processing procedure for a service transaction includes:
1.1. receiving a business transaction;
in the method provided by the embodiment of the invention, the receipt of the service transaction means that the service system receives the processing request of the service transaction.
1.2. Inserting a record into the anti-duplication table;
and inserting the flow information of the currently received business transaction into an anti-duplication table in the database.
1.3. Insertion failure, transaction rejection;
if the database reports errors, the main key conflict is prompted, namely, the running water information of the current business transaction cannot be inserted into the anti-duplication table, if the running water information of the business transaction exists in the anti-duplication table, the business transaction is refused, and failure transaction processing is carried out.
1.4. The insertion is successful, and the service processing is started;
If the current running water information of the business transaction is successfully inserted into the anti-duplication table, normal business processing is started.
1.5. An order form library is used for carrying out business processing;
And recording the related information of the business transaction into an order form in a database, and performing business processing. The order form in the database is used for recording the relevant information of the business transaction which has triggered the business processing flow currently.
1.6. Returning a service processing result and updating the anti-duplication table;
And after the business is processed, returning a processing result, and updating the transaction state of the business transaction in the anti-duplication table.
1.7. And returning a service processing result.
The processing result of the business transaction is returned to the calling system (namely, the system which sends the business transaction processing request to the current business system).
As shown in the signaling flow chart of fig. 4, in the method provided by the embodiment of the present invention, a processing procedure of a query request for a processing result of a service transaction includes:
2.1. Receiving a query transaction;
in the method provided by the embodiment of the invention, the query transaction is received, namely the query request for querying the processing result of the business transaction is received, and the query processing result is regarded as the query transaction.
2.2. Inserting a record into the anti-duplication table;
and inserting the flow information of the business transaction currently requested to be queried into the anti-duplication table.
2.3. The insertion is successful, and the original transaction is returned to be absent;
If the running water information is successfully inserted into the anti-duplication table, the fact that the system does not receive the business transaction at present is proved, the original transaction (namely the business transaction requesting query) information does not exist can be directly returned to the called system (namely the system requesting query of the processing result of the business transaction), and the called system can process the original transaction in a failure mode.
2.4. Failure in insertion, querying the anti-duplication table data;
if the running water information fails to be inserted into the anti-duplication table, the original transaction running water information in the anti-duplication table is indicated. And inquiring the anti-duplication table data according to the original transaction flow information.
2.5.1. The anti-duplicate list is recorded as inquiry transaction, and return transaction does not exist;
if the transaction code in the flow record of the business transaction in the anti-duplication table is the transaction code of the query transaction, the business transaction is proved not to be received, or the query transaction of the business transaction arrives before the business transaction, the business transaction fails, and the original transaction information can be returned to the calling system to be absent.
2.5.2. The anti-duplication list is recorded as business transaction, and if the processing result exists, the processing result in the anti-duplication list is returned;
If the transaction code in the flow record of the business transaction in the anti-duplication table is the transaction code of the business transaction, judging whether the final state of the business transaction is recorded in the anti-duplication table. If the state of the business transaction is successful or failed, the transaction state is directly returned.
2.6. The anti-duplicate list is recorded as business transaction, and no processing result exists;
If the final state of the business transaction is not in the anti-duplication table, namely the transaction state is in process, the order table record is queried.
2.7. Inquiring the business state recorded in the order form;
2.8.1. the final processing result is recorded in the order form, and the processing result is returned;
Inquiring records in the order form, and inquiring the result of the business transaction, returning the result to the calling system according to the order form state in the order form, and updating the state of the business transaction in the anti-duplication form.
2.8.2. The final processing result is not recorded in the order list, and the processing result is returned to the processing;
and inquiring records in the order form, and inquiring the date and time of the transaction recorded in the anti-duplication form if no result of the business transaction is inquired. If the interval between the inquiry transaction time and the original transaction time is larger than the appointed time, returning that the original transaction information does not exist, and calling the system to treat the original transaction as failure. If the interval between the inquiry transaction time and the service transaction time is smaller than the appointed time, returning to the processing.
2.9. Updating the anti-duplication table data according to the state recorded in the order table;
2.10. And returning a processing result.
On the basis of the method provided by the embodiment of the invention, under the scene that the business transaction arrives first and the query transaction arrives later, the system receives the business transaction first, the serial number of the business transaction enters the anti-duplication table, even if the data of the order table does not fall into the database in time due to the system fault, the system does not directly return to the original transaction information to be absent under the condition that the record exists in the anti-duplication table and the order table does not exist. But rather determines whether to conduct the checklist process only by determining the time interval between the original transaction and the current query transaction.
On the basis of the method provided by the embodiment of the invention, under the condition that the inquiry transaction arrives first and the business transaction arrives later, the system receives the inquiry transaction first and inserts the serial number of the original transaction in the inquiry transaction message into the anti-duplication table, and when the business transaction is received, the serial number of the original transaction fails to be inserted into the anti-duplication table, and the system regards the original transaction as failure. And the consistency of the transaction final states inquired before and after the inquiry transaction is ensured. When the system receives the inquiry transaction, the insertion of the anti-duplication table is successful, which means that the business transaction is not received, and the original transaction can be directly returned to the calling party. And the calling party can treat the original transaction returned by the service party as failure.
According to the method provided by the embodiment of the invention, through the constraint of the database primary key, the serial number of the business transaction is consistent with the serial number field of the original transaction corresponding to the inquiry transaction, so that no repeated data can be effectively controlled in the duplicate prevention table. The time of closing the ticket, and the mechanism of closing the ticket may be autonomously controlled based on the record of the anti-duplication table. And the processing logic and the docking difficulty of the calling party are effectively reduced. The method can effectively prevent the abnormality of the inquiry caused by network and system faults before the transaction reaches the system, and ensures that the result inquired by the inquiry transaction does not have a completely opposite final state.
Corresponding to the query method of the service transaction result shown in fig. 1, the embodiment of the invention also provides a query device of the service transaction result, which is used for realizing the method shown in fig. 1, and the structure schematic diagram is shown in fig. 5, and comprises:
A first determining unit 201, configured to determine, when a query request for querying a processing result of a target service transaction is received, a target identifier, where the target identifier is a transaction identifier corresponding to the target service transaction;
A second determining unit 202, configured to determine a first anti-duplication identifier set, where the first anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
A first determining unit 203, configured to determine whether an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set;
And the first recording unit 204 is configured to determine that the query result corresponding to the query request is a transaction failure if the anti-duplication identifier matched with the target identifier does not exist in the first anti-duplication identifier set, and record the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to reject processing of the target service transaction when receiving the processing request corresponding to the target service transaction.
By applying the device provided by the embodiment of the invention, if the query request of the business transaction is received before the processing request of the business transaction is received, the business transaction can be processed in a failure transaction in both query and processing aspects, the query result can be returned immediately when the query request is received, and the processing result of the business transaction can be ensured to be consistent with the query result. The processing result of the business transaction is not required to be repeatedly inquired, the system load can be reduced, the shortage of system resources is avoided being aggravated, and the normal operation of the system is guaranteed. And secondly, the transaction order can be closed in time, the query result feedback is more in time, and the service experience of the user can be improved. In addition, the transaction cross-day is avoided, and normal business work is guaranteed.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
The third determining unit is used for determining a first identifier when a processing request for processing the first business transaction is received, wherein the first identifier is a transaction identifier corresponding to the first business transaction;
A fourth determining unit, configured to determine a second anti-duplication identifier set, where the second anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
The second judging unit is used for judging whether the second anti-duplication identifier set has the anti-duplication identifier matched with the first identifier;
And the second recording unit is used for carrying out service processing on the first service transaction based on the processing request corresponding to the first service transaction if the anti-duplication identifier matched with the first identifier does not exist in the second anti-duplication identifier set, and recording the first identifier as the anti-duplication identifier corresponding to the first service transaction.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
A fifth determining unit, configured to determine a second identifier when a query request for querying a processing result of a second service transaction is received, where the second identifier is a transaction identifier corresponding to the second service transaction;
A sixth determining unit, configured to determine a third anti-duplication identifier set, where the third anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
A third judging unit, configured to judge whether an anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set;
And the third recording unit is used for recording the second identifier as the anti-duplication identifier corresponding to the second service transaction if the anti-duplication identifier matched with the second identifier does not exist in the third anti-duplication identifier set.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
A seventh determining unit, configured to determine a fourth anti-duplication identifier set when a processing request corresponding to the target service transaction is received, where the fourth anti-duplication identifier set includes a plurality of anti-duplication identifiers that have been recorded currently;
A fourth judging unit, configured to judge whether an anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set;
and the refusing response unit is used for refusing to respond to the processing request corresponding to the target business transaction if the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
An eighth determining unit, configured to determine a target anti-duplication identifier if an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set, where the target anti-duplication identifier is an anti-duplication identifier matched with the target identifier in the first anti-duplication identifier set;
a ninth determining unit, configured to determine a request type corresponding to the target anti-duplication identifier;
a fifth judging unit, configured to judge whether a service processing procedure corresponding to the target service transaction is currently completed if the request type is a processing type request of the service transaction;
And a tenth determining unit, configured to determine a processing result corresponding to the service processing flow if the service processing flow corresponding to the target service transaction is completed, and determine a query result corresponding to the query request based on the processing result corresponding to the service processing flow.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
An eleventh determining unit, configured to determine a query time corresponding to the query request and a transaction time corresponding to the target business transaction if the business processing flow corresponding to the target business transaction is not completed currently;
A sixth judging unit configured to determine a time interval between the transaction time and the inquiry time, and judge whether the time interval is less than a predetermined length of time;
A twelfth determining unit, configured to determine that a query result corresponding to the query request is that a transaction is being processed if the time interval is less than the predetermined time length;
and a thirteenth determining unit, configured to determine that the query result corresponding to the query request is a transaction failure if the time interval is not less than the predetermined duration.
On the basis of the device provided by the embodiment, the device provided by the embodiment of the invention further comprises:
And the fourteenth determining unit is used for determining that the query result corresponding to the query request is transaction failure if the request type is the query type request of the service processing result.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein when the instructions run, the equipment where the storage medium is located is controlled to execute the query method of the business transaction result.
The embodiment of the present invention further provides an electronic device, whose structural schematic diagram is shown in fig. 6, specifically including a memory 301, and one or more instructions 302, where the one or more instructions 302 are stored in the memory 301, and configured to be executed by the one or more processors 303, where the one or more instructions 302 perform the following operations:
when a query request for querying a processing result of a target business transaction is received, determining a target identifier, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
Determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
Judging whether an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set;
if the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining that the query result corresponding to the query request is transaction failure, and recording the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to refuse to process the target service transaction when receiving the processing request corresponding to the target service transaction.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the 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 invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for querying a business transaction result, comprising:
when a query request for querying a processing result of a target business transaction is received, determining a target identifier, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
Determining a first anti-duplication identification set, wherein the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
Judging whether an anti-duplication identifier matched with the target identifier exists in the first anti-duplication identifier set;
If the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier, determining that the query result corresponding to the query request is transaction failure, and recording the target identifier as the anti-duplication identifier corresponding to the target service transaction, so as to refuse to process the target service transaction when receiving the processing request corresponding to the target service transaction;
the determining the first anti-duplication identification set includes:
When a query request is received, each recorded anti-duplication identifier is obtained from a database, each recorded anti-duplication identifier is formed into a first anti-duplication identifier set, and the anti-duplication identifiers in the first anti-duplication identifier set are used for representing that the corresponding business transaction is in a responded state;
The judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier or not comprises the following steps:
Comparing each anti-duplication identifier in the first anti-duplication identifier set with the target identifier respectively, and judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier or not;
If one anti-duplication identifier exists in each anti-duplication identifier and is the same as the target identifier, determining that the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier, and if each anti-duplication identifier is different from the target identifier, the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier.
2. The method of claim 1, wherein the recording of the anti-duplication identifiers in the first set of anti-duplication identifiers comprises:
When a processing request for processing a first business transaction is received, determining a first identifier, wherein the first identifier is a transaction identifier corresponding to the first business transaction;
determining a second anti-duplication identification set, wherein the second anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
Judging whether an anti-duplication identifier matched with the first identifier exists in the second anti-duplication identifier set;
And if the second anti-duplication identifier set does not have the anti-duplication identifier matched with the first identifier, carrying out service processing on the first service transaction based on the processing request corresponding to the first service transaction, and recording the first identifier as the anti-duplication identifier corresponding to the first service transaction.
3. The method of claim 1, wherein the recording of the anti-duplication identifiers in the first set of anti-duplication identifiers comprises:
when a query request for querying a processing result of a second business transaction is received, determining a second identifier, wherein the second identifier is a transaction identifier corresponding to the second business transaction;
determining a third anti-duplication identification set, wherein the third anti-duplication identification set comprises a plurality of anti-duplication identifications recorded currently;
Judging whether an anti-duplication identifier matched with the second identifier exists in the third anti-duplication identifier set;
and if the third anti-duplication identifier set does not have the anti-duplication identifier matched with the second identifier, recording the second identifier as the anti-duplication identifier corresponding to the second business transaction.
4. The method according to claim 1, wherein rejecting processing the target business transaction when receiving the processing request corresponding to the target business transaction comprises:
When a processing request corresponding to the target business transaction is received, determining a fourth anti-duplication identification set, wherein the fourth anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
judging whether an anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set;
And if the anti-duplication identifier matched with the target identifier exists in the fourth anti-duplication identifier set, rejecting to respond to the processing request corresponding to the target business transaction.
5. The method as recited in claim 1, further comprising:
If the first anti-duplication identification set has the anti-duplication identification matched with the target identification, determining a target anti-duplication identification, wherein the target anti-duplication identification is the anti-duplication identification matched with the target identification in the first anti-duplication identification set;
determining a request type corresponding to the target anti-duplication identifier;
If the request type is a processing type request of the business transaction, judging whether the business processing flow corresponding to the target business transaction is finished currently or not;
And if the business processing flow corresponding to the target business transaction is completed, determining a processing result corresponding to the business processing flow, and determining a query result corresponding to the query request based on the processing result corresponding to the business processing flow.
6. The method as recited in claim 5, further comprising:
if the service processing flow corresponding to the target service transaction is not completed currently, determining the query time corresponding to the query request and the transaction time corresponding to the target service transaction;
Determining a time interval between the transaction time and the inquiry time, and judging whether the time interval is smaller than a preset time length;
if the time interval is smaller than the preset time length, determining that the query result corresponding to the query request is that the transaction is being processed;
and if the time interval is not smaller than the preset time length, determining that the query result corresponding to the query request is transaction failure.
7. The method as recited in claim 5, further comprising:
If the request type is a query type request of a service processing result, determining that the query result corresponding to the query request is transaction failure.
8. A business transaction result query device, comprising:
the first determining unit is used for determining a target identifier when a query request for querying a processing result of a target business transaction is received, wherein the target identifier is a transaction identifier corresponding to the target business transaction;
The second determining unit is used for determining a first anti-duplication identification set, and the first anti-duplication identification set comprises a plurality of anti-duplication identifications which are recorded currently;
The first judging unit is used for judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier;
The first recording unit is used for determining that the query result corresponding to the query request is transaction failure if the anti-duplication identifier matched with the target identifier does not exist in the first anti-duplication identifier set, and recording the target identifier as the anti-duplication identifier corresponding to the target business transaction so as to refuse to process the target business transaction when the processing request corresponding to the target business transaction is received;
the determining the first anti-duplication identification set includes:
When a query request is received, each recorded anti-duplication identifier is obtained from a database, each recorded anti-duplication identifier is formed into a first anti-duplication identifier set, and the anti-duplication identifiers in the first anti-duplication identifier set are used for representing that the corresponding business transaction is in a responded state;
The judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier or not comprises the following steps:
Comparing each anti-duplication identifier in the first anti-duplication identifier set with the target identifier respectively, and judging whether the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier or not;
If one anti-duplication identifier exists in each anti-duplication identifier and is the same as the target identifier, determining that the first anti-duplication identifier set has the anti-duplication identifier matched with the target identifier, and if each anti-duplication identifier is different from the target identifier, the first anti-duplication identifier set does not have the anti-duplication identifier matched with the target identifier.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform a method of querying a business transaction outcome according to any one of claims 1 to 7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform a method of querying a business transaction outcome as claimed in any of claims 1-7 by one or more processors.
CN202110890785.4A 2021-08-04 2021-08-04 Query method and device for business transaction result, storage medium and electronic equipment Active CN113590662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110890785.4A CN113590662B (en) 2021-08-04 2021-08-04 Query method and device for business transaction result, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110890785.4A CN113590662B (en) 2021-08-04 2021-08-04 Query method and device for business transaction result, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113590662A CN113590662A (en) 2021-11-02
CN113590662B true CN113590662B (en) 2024-05-10

Family

ID=78254862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110890785.4A Active CN113590662B (en) 2021-08-04 2021-08-04 Query method and device for business transaction result, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113590662B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116089483B (en) * 2023-03-16 2023-07-18 深圳市思为软件技术有限公司 Event query method and related device based on real estate management system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170250979A1 (en) * 2016-02-25 2017-08-31 InAuth, Inc. Systems and methods for recognizing a device
CN111708802A (en) * 2020-06-02 2020-09-25 拉卡拉支付股份有限公司 Network request anti-reprocessing method and device
CN111708771A (en) * 2020-06-17 2020-09-25 深圳前海微众银行股份有限公司 Data duplicate checking method, device, equipment and computer storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170250979A1 (en) * 2016-02-25 2017-08-31 InAuth, Inc. Systems and methods for recognizing a device
CN111708802A (en) * 2020-06-02 2020-09-25 拉卡拉支付股份有限公司 Network request anti-reprocessing method and device
CN111708771A (en) * 2020-06-17 2020-09-25 深圳前海微众银行股份有限公司 Data duplicate checking method, device, equipment and computer storage medium

Also Published As

Publication number Publication date
CN113590662A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
US7912858B2 (en) Data synchronization method
CN109614209B (en) Task processing method, application server and system
CN108491252B (en) Distributed transaction processing method and distributed system
CN105095462A (en) Method and system for processing webpage repeated requests
CN111291000B (en) File acquisition method, equipment and storage medium based on block chain
CN108509392B (en) Multi-mechanism account checking method, system, computer equipment and storage medium
JP2002528966A (en) Method and apparatus for deploying service modules in service nodes distributed to an intelligent network
CN113268471B (en) Method, proxy connection pool, system, device and medium for processing distributed transaction
CN113590662B (en) Query method and device for business transaction result, storage medium and electronic equipment
CN111861481A (en) Block chain account checking method and system
CN111125240B (en) Distributed transaction realization method and device, electronic equipment and storage medium
US20230336557A1 (en) Resource allocating and management in a computer network
CN114896337A (en) Data uplink method, system, equipment and computer readable storage medium
CN115643271A (en) Method, device, server and medium for synchronizing multi-application data on cloud
US20170124611A1 (en) Methods for Monitoring and Valuating Transactions for Document Processes
CN112486726B (en) Time rollback method and system for blockchain
CN113778950A (en) Credit file obtaining method, index server, query server and medium
CN112860746A (en) Cache reduction-based method, equipment and system
CN111897874B (en) Data security exchange and operation method based on hybrid chain
JP2001306380A (en) Two-phase commitment evading system and its program recording medium
CN108763247B (en) Method and device for processing user request in data migration process
CN116308142A (en) Business auditing method, device, electronic equipment and storage medium
US20050036483A1 (en) Method and system for managing programs for web service system
CN114896338A (en) Data uplink method, system, equipment and computer readable storage medium
CN114896336A (en) Data uplink method, system, equipment and computer readable 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