Method and device for guaranteeing transaction consistency with respect to concurrent interface and electronic equipment

By obtaining online transaction requests and interface configuration files, determining the business interface and performing parallel call processing, the problem of inconsistent parallel call results in online transactions is solved, transaction consistency and accuracy are achieved, and the diversity and complexity of adapting to the business interfaces are simplified, exception handling configuration is reduced, and development and maintenance costs are reduced.

CN119960856APending Publication Date: 2025-05-09中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510058255.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The parallel calls of multiple interfaces in online transactions by the prior art cannot guarantee the overall consistency of the final business results, resulting in the need to manually adjust various business scenarios, and the correction cannot be made through a unified automatic process, which increases resource consumption and development and maintenance costs.

Method used

By obtaining online transaction requests and interface configuration files, the business interface is determined and parallel calls are performed. Get the call processing results. When the results are inconsistent, call the exception business interface again to ensure the consistency of the call results.

Benefits of technology

It realizes the exception mechanism requirements for parallel scenarios in online processing, ensures transaction consistency and accuracy, adapts to the diversity and complexity of business interfaces, simplifies exception handling configuration, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960856A_ABST
    Figure CN119960856A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for guaranteeing transaction consistency with respect to a concurrent interface and electronic equipment. The method comprises the following steps: acquiring an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; determining transaction service providers corresponding to the service interfaces, and performing parallel calling processing on the service interfaces according to the transaction service providers; and obtaining a call processing result of each service interface, and under the condition of determining that the call processing results are inconsistent, performing call processing on the abnormal service interface again according to the call processing results to determine that the call processing results of the service interfaces are consistent, the calling processing result is a response result of the transaction service provider corresponding to each service interface. The problems that the consistency of the overall service cannot be ensured for the final service result and manual adjustment is needed for each service scene in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of ensuring transaction consistency through concurrent interfaces, and in particular, to a method, device, computer-readable storage medium, and electronic device for ensuring transaction consistency through concurrent interfaces. Background Art

[0002] Existing online services have a parallel calling mode, that is, one system initiates calls to the interfaces of multiple systems, and the interface calls between the systems have different processing results (success, failure) in different scenarios;

[0003] In the prior art, parallel calls to multiple interfaces in an online transaction will produce multiple results, and the consistency of the overall business cannot be guaranteed for the final business results. Manual adjustments are required for each business scenario, or the initiator calls the failed interface individually and cannot correct it through a unified automatic process. This scenario consumes a lot of resources, and multiple consumers maintain redundant scenarios, which increases development and maintenance costs. Summary of the invention

[0004] The main purpose of the present application is to provide a method, device, computer-readable storage medium and electronic device for ensuring transaction consistency through a concurrent interface, so as to at least solve the problem that the prior art cannot guarantee the consistency of the overall business results and requires manual adjustments for each business scenario.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for ensuring transaction consistency with concurrent interfaces is provided, comprising: obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining multiple business interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; determining a transaction service provider corresponding to each of the business interfaces, and performing parallel call processing on each of the business interfaces according to the transaction service provider; obtaining a call processing result of each of the business interfaces, and when it is determined that multiple call processing results are inconsistent, performing call processing on the abnormal business interface again according to the call processing result to determine the consistency of the call processing results of the business interface, wherein the call processing result is a response result of the transaction service provider corresponding to each of the business interfaces.

[0006] Optionally, when it is determined that the call processing result is inconsistent, the abnormal business interface is called again according to the call processing result, including: when it is determined that the call processing result is inconsistent, determining whether there is a critical business interface among the business interfaces; when the critical business interface exists, determining whether the call processing result of the critical business interface is successful, wherein a success in the call processing result of the critical business interface indicates that the critical business interface has received a response result from the transaction business provider; when the call processing result of the critical business interface is a failure, calling the critical business interface again until the call processing result of the critical business interface is successful, wherein a failure in the call processing result of the critical business interface indicates that the critical business interface has not received a response result from the transaction business provider.

[0007] Optionally, after determining whether the call processing result of the key business interface is successful, the method further includes: if the call processing result of the key business interface is successful, not re-calling the other abnormal business interfaces.

[0008] Optionally, after determining whether there is a critical business interface among the business interfaces, the method further includes: in the absence of the critical business interface, determining the abnormal business interface according to the call processing result, wherein the abnormal business interface is the business interface for which the call processing result is failure; and performing call processing on the abnormal business interface again.

[0009] Optionally, after obtaining the call processing results of each of the business interfaces, the method also includes: determining whether the call processing results of each of the business interfaces are all failures; if the call processing results of each of the business interfaces are all failures, performing recovery processing on each of the business interfaces, and performing the parallel call processing again on each of the business interfaces after the recovery processing, wherein the recovery processing includes restarting the business interface service and repairing the business interface fault.

[0010] Optionally, after the abnormal business interface is called again according to the call processing result, the method further includes: determining the number of failures of the abnormal business interface, wherein the number of failures is the number of call processing results representing failures generated after multiple call processing of the abnormal business interface; when it is determined that the number of failures is greater than a preset number, generating a prompt message, wherein the prompt message is used to prompt relevant personnel to check the abnormal business interface.

[0011] Optionally, after performing call processing on the abnormal service interface again according to the call processing result, the method further includes: when it is determined that the call processing results of the service interface are consistent, sending the call processing result to the user end.

[0012] According to another aspect of the present application, there is provided a device for ensuring transaction consistency with respect to a concurrent interface, comprising: an acquisition unit, for acquiring an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of business interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; a first call processing unit, for determining a transaction service provider corresponding to each of the business interfaces, and performing parallel call processing on each of the business interfaces according to the transaction service provider; a second call processing unit, for acquiring a call processing result of each of the business interfaces, and in the case of determining that a plurality of the call processing results are inconsistent, performing call processing on an abnormal business interface again according to the call processing result, so as to determine the consistency of the call processing results of the business interfaces, wherein the call processing result is a response result of the transaction service provider corresponding to each of the business interfaces.

[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for ensuring transaction consistency with a concurrent interface.

[0014] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods for ensuring transaction consistency regarding a concurrent interface.

[0015] Apply the technical solution of the present application, obtain the online transaction request and the interface configuration file corresponding to the online transaction request, and determine the multiple business interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; determine the transaction service provider corresponding to each business interface, and perform parallel call processing on each business interface according to the transaction service provider; obtain the call processing result of each business interface, and when it is determined that multiple call processing results are inconsistent, call the abnormal business interface again according to the call processing result to determine the consistency of the call processing result of the business interface, wherein the call processing result is the response result of the transaction service provider corresponding to each business interface. Solve the abnormal mechanism requirements of parallel scenarios in online processing, in order to ensure transaction consistency and transaction accuracy, adapt to the diversity and complexity of business interfaces, according to the abnormal process that may occur in parallel transactions, maintain the abnormal scenario through custom configuration interface files, and provide a relatively simple abnormal processing configuration. The file only maintains the abnormal scenario and has a low coupling with the positive process file. Under this condition, complex business abnormal scenarios can be met through custom interface file configuration without changing the business logic code. The consistency of the interface call results within the same business is ensured through the custom interface configuration file, which is compatible with the complexity and diversity of abnormal scenarios and has flexible configuration. This solves the problem that the existing technology cannot guarantee the consistency of the final business results of the overall business and requires manual adjustments for each business scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for ensuring transaction consistency with respect to a concurrent interface provided in an embodiment of the present application is shown;

[0018] Figure 2 A flow chart of a method for ensuring transaction consistency through a concurrent interface provided according to an embodiment of the present application is shown;

[0019] Figure 3 A timing diagram showing a fully successful process of a parallel interface provided according to an embodiment of the present application is shown;

[0020] Figure 4 A timing diagram of a process in which all parallel interfaces fail according to an embodiment of the present application is shown;

[0021] Figure 5 A partially successful process timing diagram of a parallel interface provided according to an embodiment of the present application is shown;

[0022] Figure 6 Another partially successful process timing diagram of a parallel interface provided according to an embodiment of the present application is shown;

[0023] Figure 7 A structural block diagram of a device for ensuring transaction consistency through a concurrent interface provided according to an embodiment of the present application is shown.

[0024] The above drawings include the following reference numerals:

[0025] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION

[0026] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] As introduced in the background technology, the prior art cannot guarantee the consistency of the overall business for the final business results, and manual adjustments are required for each business scenario. In order to solve the problem that the prior art cannot guarantee the consistency of the overall business for the final business results, and manual adjustments are required for each business scenario, the embodiments of the present application provide a method, device, computer-readable storage medium and electronic device for ensuring transaction consistency through a concurrent interface.

[0030] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal for a method of ensuring transaction consistency through a concurrent interface according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0032] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for ensuring transaction consistency of concurrent interface in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by the communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a method for ensuring transaction consistency on a concurrent interface running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] Figure 2 1 is a flow chart of a method for ensuring transaction consistency through a concurrent interface according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0035] Step S201, obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0036] Specifically, by obtaining online transaction requests and interface configuration files, multiple business interfaces corresponding to online transaction requests can be accurately determined, thereby realizing data interaction between systems and the execution of business processes. This approach can improve the reliability and efficiency of the system, ensure the accuracy and consistency of data, and also simplify the management and maintenance of system interfaces. By analyzing interface configuration files and processing online transaction requests, the communication methods and data exchange rules between systems can be better understood, providing support and guarantee for system integration and the execution of business processes.

[0037] Step S202, determining the transaction service providers corresponding to the above service interfaces, and performing parallel call processing on the above service interfaces according to the above transaction service providers;

[0038] Step S203, obtaining the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0039] Through this embodiment, an online transaction request and an interface configuration file corresponding to the online transaction request are obtained, and multiple business interfaces corresponding to the online transaction request are determined according to the online transaction request and the interface configuration file; the transaction service provider corresponding to each of the business interfaces is determined, and each of the business interfaces is called and processed in parallel according to the transaction service provider; the call processing results of each of the business interfaces are obtained, and when it is determined that the multiple call processing results are inconsistent, the abnormal business interface is called and processed again according to the call processing result to determine the consistency of the call processing results of the business interface, wherein the call processing result is the response result of the transaction service provider corresponding to each of the business interfaces. The abnormal mechanism requirements of parallel scenarios in online processing are solved, in order to ensure transaction consistency and transaction accuracy, adapt to the diversity and complexity of business interfaces, according to the abnormal processes that may occur in parallel transactions, the abnormal scenarios are maintained through the custom configuration interface file, and a relatively simple abnormal processing configuration is provided. The file only maintains the abnormal scenarios and has a low coupling with the positive process file. Under this condition, complex business abnormal scenarios can be met through the custom interface file configuration without changing the business logic code. The consistency of the interface call results within the same business is ensured through the custom interface configuration file, which is compatible with the complexity and diversity of abnormal scenarios and has flexible configuration. This solves the problem that the existing technology cannot guarantee the consistency of the final business results of the overall business and requires manual adjustments for each business scenario.

[0040] During the specific implementation process, when it is determined that the above-mentioned call processing results are inconsistent, the abnormal business interface is called again according to the above-mentioned call processing results, including: when it is determined that the above-mentioned call processing results are inconsistent, determining whether there is a key business interface among the above-mentioned business interfaces; when the above-mentioned key business interface exists, determining whether the call processing result of the above-mentioned key business interface is successful, wherein the call processing result of the above-mentioned key business interface is successful, indicating that the above-mentioned key business interface has received a response result from the transaction service provider; when the call processing result of the above-mentioned key business interface is failed, calling the above-mentioned key business interface again until the call processing result of the above-mentioned key business interface is successful, wherein the call processing result of the above-mentioned key business interface is failure, indicating that the above-mentioned key business interface has not received a response result from the transaction service provider.

[0041] Among them, the key business interface refers to the important interface of the business, which means that it must be ensured that the key business interface receives the response from the provider and ensures that the key business interface responds successfully to achieve the normal process of the business. When the call processing result of the key business interface is determined to be successful, it is considered that the key business interface receives the response result from the transaction business provider.

[0042] Specifically, after determining whether the call processing result of the above-mentioned key business interface is successful, the above-mentioned method also includes: if the call processing result of the above-mentioned key business interface is successful, not calling the other above-mentioned abnormal business interfaces again.

[0043] When the method determines that a key business interface exists, it ensures that the key business interface responds successfully and other abnormal business interfaces may not be processed, thereby ensuring the consistency of the call results within the same business.

[0044] More specifically, after determining whether there is a critical business interface among the above-mentioned business interfaces, the above-mentioned method also includes: in the absence of the above-mentioned critical business interface, determining the above-mentioned abnormal business interface according to the above-mentioned call processing result, wherein the above-mentioned abnormal business interface is the above-mentioned business interface whose call processing result is failure; and calling and processing the above-mentioned abnormal business interface again.

[0045] This method improves the stability and fault tolerance of the system and ensures the reliability and stability of key business interfaces. At the same time, by re-calling the abnormal business interface, abnormal situations can be handled in a timely manner to ensure the normal operation of the business. This helps to improve the overall performance of the system and user experience, and reduce business interruptions and user complaints caused by abnormal situations.

[0046] Furthermore, after obtaining the call processing results of each of the above-mentioned business interfaces, the above-mentioned method also includes: determining whether the above-mentioned call processing results of each of the above-mentioned business interfaces are all failures; in the case that the above-mentioned call processing results of each of the above-mentioned business interfaces are all failures, performing recovery processing on each of the above-mentioned business interfaces, and performing the above-mentioned parallel call processing again on each of the above-mentioned business interfaces after the recovery processing, wherein the above-mentioned recovery processing includes restarting the business interface service and repairing the business interface fault.

[0047] This method improves the stability and reliability of the system and ensures the normal operation of the business interface. By timely discovering and handling business interface failures, system downtime can be reduced, system availability can be improved, and the normal operation of the business can be guaranteed. At the same time, recovery processing and restarting the business interface service can effectively repair the failure and ensure that the system can continue to operate normally. Overall, this recovery processing mechanism can improve the robustness and fault tolerance of the system and ensure the stable operation of the business.

[0048] Furthermore, after the abnormal business interface is called again according to the above-mentioned call processing result, the above-mentioned method also includes: determining the number of failures of the above-mentioned abnormal business interface, wherein the above-mentioned number of failures is the number of call processing results representing failures generated after multiple call processing of the above-mentioned abnormal business interface; when it is determined that the above-mentioned number of failures is greater than the preset number, generating a prompt message, wherein the above-mentioned prompt message is used to prompt relevant personnel to check the above-mentioned abnormal business interface.

[0049] Specifically, after the abnormal service interface is called again according to the call processing result, the method further includes: when it is determined that the call processing result of the service interface is consistent, sending the call processing result to the user end.

[0050] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for ensuring transaction consistency through a concurrent interface of the present application will be described in detail below in conjunction with specific embodiments.

[0051] In the prior art, parallel calls to multiple interfaces in an online transaction will produce multiple results, and the consistency of the overall business cannot be guaranteed for the final business results. Manual adjustments are required for each business scenario, or the initiator calls the failed interface individually and cannot correct it through a unified automatic process. This scenario consumes a lot of resources, and multiple consumers maintain redundant scenarios, which increases development and maintenance costs.

[0052] This embodiment involves a specific method for ensuring transaction consistency through concurrent interfaces, solving the requirements for exception mechanisms in parallel scenarios in online processing, adapting to the diversity and complexity of business interfaces to ensure transaction consistency and transaction accuracy, and providing a relatively simple exception handling configuration through maintenance of exception scenarios through custom configuration interface files based on the abnormal processes that may occur in parallel transactions. This file only maintains exception scenarios and has a low coupling with the normal process files. Based on this condition, complex business exception scenarios can be met through custom interface file configuration without changing the business logic code. The consistency of the interface call results within the same business is ensured through a custom interface configuration file, which has good compatibility with the complexity and diversity of exception scenarios and is flexible in configuration. Specifically includes the following contents:

[0053] Figure 3 This is the timing diagram of the parallel interface's complete success process, such as Figure 3As shown, the initiator initiates a call, the technical system receives the transaction request, and the technical system simultaneously triggers interface 1, interface 2, and interface 3 to call the provider, waiting for provider 1, provider 2, and provider 3 to return a response. After waiting for all providers to return a response, it determines whether it is normal; if interface 3 is abnormal, to ensure that all interfaces are successful, a retransmission is initiated for interface 3, and the result is responded to the initiator, ensuring that all parallel interfaces respond successfully.

[0054] Figure 4 This is the process timing diagram of all parallel interface failures, such as Figure 4 As shown, the initiator initiates a call, the technical system receives the transaction request, and the technical system simultaneously triggers interface 1, interface 2, and interface 3 to call the provider, waiting for provider 1, provider 2, and provider 3 to return a response. After waiting for all providers to return a response, it determines whether it is normal; if interface 1, interface 2, and interface 3 are all abnormal, to ensure that all interfaces are successful, recovery is initiated for interface 1, interface 2, and interface 3, and the result is responded to the initiator.

[0055] Figure 5 A partially successful process timing diagram for a parallel interface, such as Figure 5 As shown, the initiator initiates a call, the technical system receives the transaction request, and the technical system simultaneously triggers interface 1, interface 2, and key interface to call the provider, waiting for provider 1, provider 2, and provider 3 to return a response. After waiting for all providers to return a response, it determines whether it is normal; if the key interface is abnormal and the interface is partially successful, the key interface is resent, and the remaining failed interfaces are not processed, and the result is responded to the initiator.

[0056] Figure 6 Another partially successful process timing diagram for parallel interface, such as Figure 6 As shown, the initiator initiates the call, the technical system receives the transaction request, and the technical system simultaneously triggers interface 1, interface 2, and key interface to call the provider, waiting for provider 1, provider 2, and provider 3 to return a response. After waiting for all providers to return a response, it determines whether it is normal; if interface 2 is abnormal, ensure that the key interface is successful, do not perform any operation on the failed interface 2, and respond the result to the initiator.

[0057] This embodiment is based on a custom interface configuration file, and according to the exceptions generated by business needs, a custom configuration is arranged to control the call process. When an exception is generated in an online transaction call, the exception process is re-initiated by matching the custom interface configuration to ensure the consistency of the business. In addition, the focus of this embodiment is to customize and adapt the parallel interface exception call process in the form of file configuration to meet the target needs, and it can be combined and reorganized according to various exception results of the parallel interface.

[0058] The embodiment of the present application also provides a device for ensuring transaction consistency with respect to a concurrent interface. It should be noted that the device for ensuring transaction consistency with respect to a concurrent interface in the embodiment of the present application can be used to execute the method for ensuring transaction consistency with respect to a concurrent interface provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0059] The following is an introduction to the device for ensuring transaction consistency with respect to a concurrent interface provided in an embodiment of the present application.

[0060] Figure 7 Schematic diagram of a device for ensuring transaction consistency through a concurrent interface according to an embodiment of the present application. Figure 7 As shown, the device comprises:

[0061] The acquisition unit 71 is used to acquire an online transaction request and an interface configuration file corresponding to the online transaction request, and determine a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0062] The first call processing unit 72 is used to determine the transaction service provider corresponding to each of the above-mentioned service interfaces, and perform parallel call processing on each of the above-mentioned service interfaces according to the transaction service provider;

[0063] The second call processing unit 73 is used to obtain the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0064] In this embodiment, the acquisition unit is used to acquire an online transaction request and an interface configuration file corresponding to the online transaction request, and determine multiple business interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; the first call processing unit is used to determine the transaction service provider corresponding to each of the above business interfaces, and perform parallel call processing on each of the above business interfaces according to the above transaction service provider; the second call processing unit is used to acquire the call processing result of each of the above business interfaces, and when it is determined that the multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing result to determine the consistency of the call processing results of the above business interfaces, wherein the call processing result is the response result of the above transaction service provider corresponding to each of the above business interfaces. To solve the demand for exception mechanisms in parallel scenarios in online processing, to ensure transaction consistency and accuracy, to adapt to the diversity and complexity of business interfaces, according to the abnormal processes that may occur in parallel transactions, the maintenance of exception scenarios is done through custom configuration interface files, and a relatively simple exception handling configuration is provided. This file only maintains exception scenarios and has a low coupling with the positive process files. Based on this condition, complex business exception scenarios can be met through custom interface file configuration without changing the business logic code. The consistency of the interface call results within the same business is guaranteed through the custom interface configuration file, which has good compatibility with the complexity and diversity of exception scenarios and flexible configuration. This solves the problem that the existing technology cannot guarantee the consistency of the overall business for the final business results, and manual adjustments are required for each business scenario.

[0065] As an optional scheme, the second call processing unit includes a first determination module, a second determination module and a first call processing module; the first determination module is used to determine whether there is a key business interface in the above-mentioned business interface when it is determined that the above-mentioned call processing results are inconsistent; the second determination module is used to determine whether the call processing result of the above-mentioned key business interface is successful when the above-mentioned key business interface exists, wherein the call processing result of the above-mentioned key business interface is successful, indicating that the above-mentioned key business interface has received a response result from the above-mentioned transaction business provider; the first call processing module is used to call the above-mentioned key business interface again when the call processing result of the above-mentioned key business interface is failed, until the call processing result of the above-mentioned key business interface is successful, wherein the call processing result of the above-mentioned key business interface is failure, indicating that the above-mentioned key business interface has not received a response result from the above-mentioned transaction business provider.

[0066] An optional solution is that the second call processing unit also includes a second call processing module, which is used to determine whether the call processing result of the above-mentioned key business interface is successful, and if the call processing result of the above-mentioned key business interface is successful, not to call the other above-mentioned abnormal business interfaces again.

[0067] An optional solution, the second call processing unit also includes a third determination module and a third call processing module; the third determination module is used to determine the above-mentioned abnormal business interface according to the above-mentioned call processing result after determining whether there is a key business interface among the above-mentioned business interfaces, if the above-mentioned key business interface does not exist, wherein the above-mentioned abnormal business interface is the above-mentioned business interface whose call processing result is failure; the third call processing module is used to call and process the above-mentioned abnormal business interface again.

[0068] An optional scheme, the device also includes a first determination unit and a recovery processing unit, the determination unit is used to determine whether the above-mentioned call processing results of each of the above-mentioned business interfaces are all failures after obtaining the call processing results of each of the above-mentioned business interfaces; the recovery processing unit is used to perform recovery processing on each of the above-mentioned business interfaces when the above-mentioned call processing results of each of the above-mentioned business interfaces are all failures, and perform the above-mentioned parallel call processing on each of the above-mentioned business interfaces after the recovery processing again, wherein the above-mentioned recovery processing includes restarting the business interface service and repairing the business interface fault.

[0069] In an optional scheme, the device also includes a second determination unit and a generation unit, the second determination unit is used to determine the number of failures of the above-mentioned abnormal business interface after obtaining the call processing results of each of the above-mentioned business interfaces, wherein the above-mentioned number of failures is the number of call processing results representing failures generated after multiple call processing of the above-mentioned abnormal business interface; the generation unit is used to generate a prompt message when it is determined that the above-mentioned number of failures is greater than a preset number, wherein the above-mentioned prompt message is used to prompt relevant personnel to check the above-mentioned abnormal business interface.

[0070] In an optional solution, the device also includes a sending unit, which is used to send the above-mentioned call processing result to the user end after calling the abnormal business interface again according to the above-mentioned call processing result and determining that the above-mentioned call processing result of the above-mentioned business interface is consistent.

[0071] The device for ensuring transaction consistency with a concurrent interface includes a processor and a memory. The acquisition unit, the first call processing unit, the second call processing unit, etc. are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.

[0072] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem that the existing technology cannot guarantee the consistency of the overall business results for the final business results, and manual adjustments are required for each business scenario.

[0073] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0074] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program. When the program is running, the device where the computer-readable storage medium is located is controlled to execute the method for ensuring transaction consistency with a concurrent interface.

[0075] Specifically, the methods for concurrent interfaces to ensure transaction consistency include:

[0076] Step S201, obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0077] Step S202, determining the transaction service providers corresponding to the above service interfaces, and performing parallel call processing on the above service interfaces according to the above transaction service providers;

[0078] Step S203, obtaining the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0079] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for ensuring transaction consistency with a concurrent interface is executed when the program is running.

[0080] Specifically, the methods for concurrent interfaces to ensure transaction consistency include:

[0081] Step S201, obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0082] Step S202, determining the transaction service providers corresponding to the above service interfaces, and performing parallel call processing on the above service interfaces according to the above transaction service providers;

[0083] Step S203, obtaining the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0084] An embodiment of the present invention provides an electronic device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:

[0085] Step S201, obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0086] Step S202, determining the transaction service providers corresponding to the above service interfaces, and performing parallel call processing on the above service interfaces according to the above transaction service providers;

[0087] Step S203, obtaining the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0088] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0089] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:

[0090] Step S201, obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file;

[0091] Step S202, determining the transaction service providers corresponding to the above service interfaces, and performing parallel call processing on the above service interfaces according to the above transaction service providers;

[0092] Step S203, obtaining the call processing results of each of the above-mentioned business interfaces. When it is determined that multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the above-mentioned business interfaces, wherein the call processing results are the response results of the above-mentioned transaction service providers corresponding to each of the above-mentioned business interfaces.

[0093] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0094] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0095] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0098] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0099] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0100] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0101] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0102] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0103] 1) A device for ensuring transaction consistency of concurrent interfaces in the present application comprises: an acquisition unit for acquiring an online transaction request and an interface configuration file corresponding to the online transaction request, and determining multiple business interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; a first call processing unit for determining the transaction service provider corresponding to each of the above business interfaces, and performing parallel call processing on each of the above business interfaces according to the above transaction service provider; a second call processing unit for acquiring the call processing results of each of the above business interfaces, and in the case of determining that the multiple call processing results are inconsistent, performing call processing on the abnormal business interface again according to the call processing result to determine the consistency of the call processing results of the above business interfaces, wherein the call processing result is the response result of the above transaction service provider corresponding to each of the above business interfaces. The problem that the prior art cannot guarantee the consistency of the final business results and needs to be manually adjusted for each business scenario is solved.

[0104] 2) A method for ensuring transaction consistency through concurrent interfaces in the present application includes: obtaining an online transaction request and an interface configuration file corresponding to the online transaction request, and determining multiple business interfaces corresponding to the online transaction request based on the online transaction request and the interface configuration file; determining the transaction service provider corresponding to each of the above business interfaces, and performing parallel call processing on each of the above business interfaces according to the above transaction service provider; obtaining the call processing results of each of the above business interfaces, and in the case of determining that multiple call processing results are inconsistent, performing call processing on the abnormal business interface again according to the call processing results to determine the consistency of the call processing results of the above business interfaces, wherein the call processing results are the response results of the above transaction service providers corresponding to each of the above business interfaces. This solves the problem that the prior art cannot guarantee the consistency of the overall business for the final business results, and manual adjustments are required for each business scenario.

[0105] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for ensuring transaction consistency with a concurrent interface, characterized in that: include: Acquire an online transaction request and an interface configuration file corresponding to the online transaction request, and determine a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; Determine the transaction service provider corresponding to each of the service interfaces, and perform parallel call processing on each of the service interfaces according to the transaction service provider; Obtain the call processing result of each of the business interfaces. When it is determined that multiple call processing results are inconsistent, call the abnormal business interface again according to the call processing result to determine the consistency of the call processing results of the business interface, wherein the call processing result is the response result of the transaction service provider corresponding to each of the business interfaces.

2. The method according to claim 1, characterized in that When it is determined that the call processing result is inconsistent, calling the abnormal service interface again according to the call processing result, including: In the case where it is determined that the call processing results are inconsistent, determining whether there is a key business interface in the business interface; In the case where the key business interface exists, determining whether the call processing result of the key business interface is successful, wherein the call processing result of the key business interface is successful, indicating that the key business interface has received a response result from the transaction service provider; In the case where the call processing result of the key business interface is failure, the key business interface is called again until the call processing result of the key business interface is success, wherein the call processing result of the key business interface is failure, which indicates that the key business interface has not received a response result from the transaction service provider.

3. The method according to claim 2, characterized in that After determining whether the call processing result of the key business interface is successful, the method further includes: When the call processing result of the key business interface is successful, no call processing is performed again on the other abnormal business interfaces.

4. The method according to claim 2, characterized in that: After determining whether the service interface has a key service interface, the method further includes: In the case where the key service interface does not exist, determining the abnormal service interface according to the call processing result, wherein the abnormal service interface is the service interface for which the call processing result is failure; The abnormal service interface is called again.

5. The method according to claim 1, characterized in that After obtaining the call processing results of each of the business interfaces, the method further includes: Determine whether the call processing results of each of the business interfaces are all failures; When the call processing results of each of the business interfaces are failures, each of the business interfaces is restored, and the parallel call processing is performed again on each of the restored business interfaces, wherein the recovery processing includes restarting the business interface service and repairing the business interface failure.

6. The method according to claim 1, characterized in that After the abnormal service interface is called again according to the call processing result, the method further includes: Determine the number of failures of the abnormal service interface, wherein the number of failures is the number of times that a call processing result indicating failure is generated after multiple calls to the abnormal service interface; When it is determined that the number of failures is greater than a preset number, a prompt message is generated, wherein the prompt message is used to prompt relevant personnel to check the abnormal service interface.

7. The method according to claim 1, characterized in that After the abnormal service interface is called again according to the call processing result, the method further includes: When it is determined that the call processing results of the service interface are consistent, the call processing results are sent to the user end.

8. A device for ensuring transaction consistency with a concurrent interface, characterized in that: include: an acquisition unit, configured to acquire an online transaction request and an interface configuration file corresponding to the online transaction request, and determine a plurality of service interfaces corresponding to the online transaction request according to the online transaction request and the interface configuration file; A first call processing unit, used to determine the transaction service provider corresponding to each of the service interfaces, and perform parallel call processing on each of the service interfaces according to the transaction service provider; The second call processing unit is used to obtain the call processing results of each of the business interfaces. When it is determined that the multiple call processing results are inconsistent, the abnormal business interface is called again according to the call processing results to determine the consistency of the call processing results of the business interfaces, wherein the call processing results are the response results of the transaction service providers corresponding to each of the business interfaces.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for ensuring transaction consistency with a concurrent interface as described in any one of claims 1 to 7.

10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of claims 1 to 7 regarding ensuring transaction consistency through a concurrent interface.