Abnormal service processing method, apparatus, device, and storage medium

CN115994825BActive Publication Date: 2026-09-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211460441.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-09-22
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

由于分布式事务平台向全部的执行单元发起反交易,导致异常业务处理过程占用的计算机资源多,影响异常业务的处理效率

Benefits of technology

[0038]根据本公开实施例,通过响应于接收到来自用户的交易请求,根据交易请求确定单元化架构中用于执行交易业务的第一单元;通过第一单元执行与交易请求对应的第一业务逻辑,得到第一执行数据;响应于确定第一执行数据表征当前交易为异常业务,基于根据交易请求获取的与当前交易对应的用户标识、以及分区规则,确定单元化架构中的第二单元;通过第二单元执行第二业务逻辑,得到与交易请求对应的第二执行数据。因此,实现了异常业务场景下的反交易的点对点路由,无需将反交易路由至全部的执行单元,减少了下游的路由接收方,释放了存储多个路由操作的计算机空间,提高了异常业务处理效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994825B_ABST
    Figure CN115994825B_ABST
Patent Text Reader

Abstract

The present disclosure provides an abnormal business processing method and device, equipment and storage medium, which can be applied to the field of information security technology. The method is applied to a unit architecture, comprising: in response to receiving a transaction request from a user, obtaining a user identifier corresponding to the current transaction, and determining a first unit in the unit architecture according to the transaction request; executing a first business logic corresponding to the transaction request through the first unit to obtain first execution data, the first business logic including the operation logic of the current transaction; in response to determining that the first execution data represents that the current transaction is an abnormal business, determining a second unit in the unit architecture based on the user identifier and a partition rule, the second unit being used to execute a second business logic, the second business logic including the operation logic of restoring the abnormal business to a normal business; executing the second business logic through the second unit to obtain second execution data corresponding to the transaction request, so as to restore the running state of the current transaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information security technology, specifically to an abnormal business processing method, apparatus, electronic device, storage medium, and program product. Background Technology

[0002] A unitized architecture is an enterprise application deployment architecture based on user-defined execution units. Specifically, multiple groups of users are deployed within multiple execution units of a unitized architecture, with each execution unit deploying the main business services required by that user.

[0003] In related technologies, when a transaction anomaly occurs, the distributed transaction platform initiates reverse transactions to multiple execution units performing the business logic to ensure business consistency. However, because the distributed transaction platform initiates reverse transactions to all execution units, the processing of anomalies consumes significant computer resources, impacting the efficiency of handling such transactions. Summary of the Invention

[0004] In view of the above problems, this disclosure provides an abnormal business processing method, apparatus, device, storage medium and program product.

[0005] According to the first aspect of this disclosure, an exception handling method is provided, applied to a unitized architecture, the method comprising:

[0006] In response to receiving a transaction request from a user, the user identifier corresponding to the current transaction is obtained.

[0007] And determine the first unit in the unitized architecture used to execute the transaction based on the transaction request;

[0008] The first unit executes the first business logic corresponding to the transaction request to obtain the first execution data. The first business logic includes the operation logic of the current transaction.

[0009] In response to determining that the first execution data characterizes the current transaction as an abnormal business, a second unit in the unitized architecture is determined based on the user identifier and partitioning rules. This second unit is used to execute second business logic, which includes operational logic for restoring the abnormal business to normal business; and

[0010] The second unit executes the second business logic to obtain the second execution data corresponding to the transaction request, so as to restore the current transaction's running state.

[0011] According to embodiments of this disclosure, in response to receiving a transaction request from a user, obtaining a user identifier corresponding to the current transaction, and determining a first unit in the unitized architecture for executing transaction business based on the transaction request, includes:

[0012] Before executing the first business logic corresponding to the transaction request through the first unit, the target method is obtained from the graph storage data. The target method is used to obtain the user identifier, and the graph storage data is used to cache the target method.

[0013] The transaction parameters of the current transaction are used as parameters for the target method; the target method is executed to obtain the user identifier; and

[0014] User identifiers and transaction logs are stored in a common unit within a modular structure for managing business operations. The transaction logs include execution records that have obtained the user identifier.

[0015] According to embodiments of this disclosure, the target method is added to the unitized architecture via annotation, and the target method is used as the attribute value of the target attribute in the annotation to obtain the user identifier of the transaction.

[0016] According to embodiments of this disclosure, the method further includes:

[0017] After starting the first unit, the target method is obtained from the preset address based on the target attribute of the annotation of the current transaction;

[0018] Using the execution method name of the first unit as the primary key and the target method as the key, a graph is constructed to store the data; and

[0019] Cache the graph storage data to the memory of the common cell.

[0020] According to embodiments of this disclosure, the user identifier includes a combination of numbers in a preset form;

[0021] In response to determining that the first execution data characterizes the current transaction as an abnormal business, based on the user identifier and partitioning rules, a second unit in the unitized architecture is determined, including:

[0022] Based on the number combination and partitioning rules, the execution unit to which the current transaction belongs is calculated. The partitioning rules must include at least one of the following: random partitioning rule, sequential partitioning rule; and

[0023] If the execution unit is different from the first unit, the execution unit is determined to be the second unit.

[0024] According to embodiments of this disclosure, calculating the execution unit to which the current transaction belongs based on number combinations and partitioning rules includes:

[0025] Based on the number of partitioned units in the digital combination and unitized framework, the partition calculation result of the current transaction is obtained, and each unit in the partitioned unit is used to execute the transaction request from the user; and

[0026] Based on the partition calculation results and partition rules, determine the execution unit to which the current transaction belongs.

[0027] According to embodiments of this disclosure, a second unit executes a second business logic to obtain second execution data corresponding to the transaction request, in order to restore the current transaction's running state, including:

[0028] In response to the execution request initiated by the common unit to the second unit, determine the second business logic corresponding to the first business logic;

[0029] The processor in the second unit executes the second business logic to restore the current transaction's running state to the normal business state, thereby obtaining the second execution data corresponding to the transaction request.

[0030] A second aspect of this disclosure provides an exception handling apparatus for a unitized architecture, comprising:

[0031] The acquisition module is used to, in response to receiving a transaction request from a user, acquire the user identifier corresponding to the current transaction, and determine the first unit in the unitized architecture for executing the transaction business based on the transaction request;

[0032] The first execution module is configured to execute the first business logic corresponding to the transaction request through the first unit to obtain the first execution data, wherein the first business logic includes the operation logic of the current transaction;

[0033] The determination module is configured to, in response to the first execution data indicating that the current transaction is an abnormal transaction, determine a second unit in the unitized architecture based on the user identifier and partitioning rules. The second unit is used for a second business logic, which includes operational logic for restoring the abnormal transaction to a normal transaction.

[0034] The second execution module is used to execute the second business logic through the second unit to obtain the second execution data corresponding to the transaction request, so as to restore the running state of the current transaction.

[0035] A third aspect of this disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the above-described abnormal business processing method.

[0036] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described exception handling method.

[0037] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described abnormal business processing method.

[0038] According to embodiments of this disclosure, in response to receiving a transaction request from a user, a first unit in the unitized architecture for executing transaction business is determined based on the transaction request; the first unit executes a first business logic corresponding to the transaction request to obtain first execution data; in response to determining that the first execution data indicates that the current transaction is an abnormal transaction, a second unit in the unitized architecture is determined based on the user identifier corresponding to the current transaction obtained from the transaction request and the partitioning rules; the second unit executes a second business logic to obtain second execution data corresponding to the transaction request. Therefore, point-to-point routing for anti-transactions in abnormal business scenarios is achieved, eliminating the need to route anti-transactions to all execution units, reducing downstream routing receivers, freeing up computer space for storing multiple routing operations, and improving the efficiency of abnormal business processing.

[0039] Furthermore, even if the partitioning rules or execution units change, the above solution can still achieve point-to-point routing of reverse transactions in abnormal business scenarios, and will not result in the inability to route reverse transactions to the correct unit, thus preventing abnormal business from being unable to be processed. Attached Figure Description

[0040] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0041] Figure 1 This illustration illustrates an application scenario of the abnormal service processing method according to an embodiment of the present disclosure;

[0042] Figure 2 A flowchart illustrating an abnormal service processing method according to an embodiment of the present disclosure is shown schematically.

[0043] Figure 3 A flowchart illustrating a method for obtaining a user identifier according to an embodiment of the present disclosure is shown schematically.

[0044] Figure 4 A flowchart illustrating a caching method of a target method according to an embodiment of the present disclosure is shown schematically.

[0045] Figure 5 A flowchart illustrating a method for determining a second unit according to an embodiment of the present disclosure is shown schematically.

[0046] Figure 6 A schematic diagram of a modular architecture according to an embodiment of the present disclosure is shown.

[0047] Figure 7 A schematic diagram illustrating the structure of an abnormal service processing apparatus according to an embodiment of the present disclosure is shown; and

[0048] Figure 8 A block diagram of an electronic device suitable for an abnormal service processing method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation

[0049] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0050] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0051] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0052] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0053] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.

[0054] This disclosure provides an abnormal business processing method applied to a unitized architecture. The method includes: in response to receiving a transaction request from a user, obtaining a user identifier corresponding to the current transaction, and determining a first unit in the unitized architecture for executing the transaction business based on the transaction request; executing a first business logic corresponding to the transaction request through the first unit to obtain first execution data, the first business logic including the operation logic of the current transaction; in response to determining that the first execution data indicates that the current transaction is an abnormal business, determining a second unit in the unitized architecture based on the user identifier and partitioning rules, the second unit for executing a second business logic, the second business logic including the operation logic for restoring the abnormal business to normal business; and executing the second business logic through the second unit to obtain second execution data corresponding to the transaction request, so as to restore the running state of the current transaction.

[0055] In related technologies, when a business application software initiates a distributed transaction, the main transaction and all sub-transactions register and store the corresponding transaction data with the distributed transaction platform. In the case of two sub-transactions under a main transaction, the main transaction registers its main transaction information with the transaction platform before initiating the transaction. The transaction platform receives the registered transaction information through the transaction receiver and persists it to the transaction processor. Then, the transaction platform initiates the transaction business normally by sequentially launching sub-transaction 1 and sub-transaction 2. Before executing the actual transaction, each sub-transaction also registers its sub-transaction information with the transaction platform and associates it with the corresponding main transaction information. When an anomaly occurs in the positive transaction of the main transaction or a sub-transaction, the transaction processor notifies all sub-transactions to execute the reverse transaction to ensure the consistency of the entire transaction.

[0056] In this context, a positive transaction refers to a normal transaction, including deposits and withdrawals; a negative transaction is a transaction that moves in the opposite direction to a positive transaction, also known as a reversal transaction. Negative transactions are used to correct abnormal positive transactions caused by system malfunctions or other reasons.

[0057] In a unitized architecture, the distributed transaction platform is planned in a common unit, while the main transaction business is concentrated in a partitioned unit, which is further divided into multiple sub-units. Different transactions access the corresponding sub-unit for positive or negative transactions based on the user ID. During a positive transaction, since the transaction platform is in a common unit, business applications can send requests directly to the transaction platform. However, when the transaction platform initiates a negative transaction to a business application, the partitioning rules may change, causing the negative transaction to fail to be routed correctly to the partitioned unit where the current transaction is located. Although related technologies can notify all partitioned units to execute the negative transaction, in the event of multiple positive transactions encountering anomalies, this results in a large number of instructions initiating negative transactions, consuming significant resources and impacting execution efficiency.

[0058] Figure 1The illustration depicts an application scenario of the abnormal service processing method according to an embodiment of the present disclosure.

[0059] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0060] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various client applications, such as payment applications, banking clients, and web browser applications, can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103 to enable users to perform transaction operations through these client applications.

[0061] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0062] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user transaction requests, and feed back the processing results (such as web pages, information, or data obtained or generated based on user transaction requests) to the terminal devices.

[0063] It should be noted that the abnormal service processing method provided in this embodiment can generally be executed by server 105. Correspondingly, the abnormal service processing device provided in this embodiment can generally be located in server 105. The abnormal service processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the abnormal service processing device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0064] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0065] Figure 2 A flowchart illustrating an abnormal service processing method according to an embodiment of the present disclosure is shown.

[0066] like Figure 2 As shown, the method includes operations S210 to S240.

[0067] In operation S210, in response to receiving a transaction request from a user, the user identifier corresponding to the current transaction is obtained, and the first unit in the unitized architecture used to execute the transaction business is determined according to the transaction request.

[0068] According to embodiments of this disclosure, after logging in via a webpage or a bank's client application, a user can initiate a transaction request through either the webpage or the bank's client application. Since the user has completed the login process, the transaction request includes the user's identification information.

[0069] In response to receiving a transaction request from a user, the user identifier of the current transaction can be obtained by calling a preset method, where the user identifier can be a user ID.

[0070] In a unitized architecture, in response to a transaction request received from a user, the web page or a bank's client can directly route the user's main transaction to the first unit that executes the current transaction; then, the first unit initiates a request to the distributed transaction platform and registers the transaction information.

[0071] According to embodiments of this disclosure, the transaction request may include historical execution unit information of the current user, and the first unit in the unitized structure corresponding to the current user is determined based on the historical execution unit information. Alternatively, the first unit can be determined directly based on the user identifier in the transaction request.

[0072] In operation S220, the first business logic corresponding to the transaction request is executed through the first unit to obtain the first execution data.

[0073] According to embodiments of this disclosure, the first business logic includes the operational logic for the current transaction. Specifically, the current transaction includes various types of transaction services, such as deposit transactions, withdrawal transactions, and transfer transactions. Each type of transaction service corresponds to a different type of business logic.

[0074] According to embodiments of this disclosure, the first business logic corresponds to a positive transaction and is used to execute the normal business logic of the current transaction. The second business logic includes operational logic for restoring abnormal business to normal business, wherein the second business logic corresponds to a reverse transaction and is used to execute business logic in the opposite direction to the first business logic.

[0075] According to embodiments of this disclosure, a first unit executes a first business logic corresponding to a transaction request to obtain first execution data. The first execution data includes the execution result and running status of the current transaction. The execution result includes the user's account information after executing the first business logic, such as account balance, transfer amount, and transferor, and also includes prompt information after executing the first business logic, such as "transfer successful" and "transfer time".

[0076] According to embodiments of this disclosure, the operating status is used to indicate whether the current transaction is an abnormal business, including normal business and abnormal business.

[0077] For example, user A's current operation is to withdraw 500 yuan. The first unit executes the first business logic of the "withdrawal" type. After executing the first business logic, the execution result is: user A's updated account balance, such as "Current balance: 500 yuan", with the prompt message "Transfer failed". The running status is "Abnormal business".

[0078] In operation S230, in response to determining that the first execution data characterizes the current transaction as an abnormal business, a second unit in the unitized architecture is determined based on the user identifier and partitioning rules. The second unit is used to execute the second business logic.

[0079] According to embodiments of this disclosure, in response to determining that the first execution data characterizes the current transaction as an abnormal business, the execution request for a reverse transaction is routed to the execution unit of the current transaction, thereby restoring the current transaction's operational state to normal business. Since the reverse transaction is initiated by the distributed transaction platform in the unitized architecture, the correct point-to-point routing of the reverse transaction is ensured by determining the execution unit of the current transaction before routing the reverse transaction execution request.

[0080] According to embodiments of this disclosure, after determining that the current transaction is an abnormal business, a second unit for executing the current transaction is determined based on the user identifier and partitioning rules. Specifically, the partitioning calculation result is obtained by calculating the information represented by the user identifier; then, the execution unit pointed to by the partitioning calculation result is determined based on the partitioning rules, thus obtaining the second unit.

[0081] After determining that the current transaction is an abnormal business, since the partitioning rules and execution units can change according to system upgrade operations or system maintenance operations, the correct execution unit can be determined based on the user identifier and partitioning rules. The current transaction's running status will not be unable to be corrected due to changes in partitioning rules or execution units.

[0082] According to embodiments of this disclosure, partitioning rules are used to determine the execution units of multiple groups of users.

[0083] In operation S240, the second business logic is executed through the second unit to obtain the second execution data corresponding to the transaction request, so as to restore the current transaction running state.

[0084] According to embodiments of this disclosure, after determining the second unit, the second business logic is executed through the second unit to obtain the second execution data corresponding to the transaction request. The second execution data is similar to the first execution data, including execution results and running status, wherein the execution results include user account information and prompt information, and the running status includes "normal business" and "abnormal business".

[0085] According to embodiments of this disclosure, in response to receiving a transaction request from a user, a first unit in the unitized architecture for executing transaction business is determined based on the transaction request; the first unit executes a first business logic corresponding to the transaction request to obtain first execution data; in response to determining that the first execution data indicates that the current transaction is an abnormal business, a second unit in the unitized architecture is determined based on the user identifier corresponding to the current transaction obtained from the transaction request and the partitioning rules; the second unit executes a second business logic to obtain second execution data corresponding to the transaction request. Therefore, point-to-point routing for anti-transactions in abnormal business scenarios is achieved, eliminating the need to route anti-transactions to all execution units, reducing downstream routing receivers, freeing up computer space for storing multiple routing operations, and improving the efficiency of abnormal business processing.

[0086] Furthermore, even if the partitioning rules or execution units change, the above solution can still achieve point-to-point routing of reverse transactions in abnormal business scenarios, and will not result in the inability to route reverse transactions to the correct unit, thus preventing abnormal business from being unable to be processed.

[0087] Figure 3 A flowchart illustrating a method for obtaining a user identifier according to an embodiment of the present disclosure is shown.

[0088] like Figure 3 As shown, the method for obtaining user identifier in this embodiment includes operations S311 to S313, which can be used as a specific embodiment of operation S210.

[0089] In operation S311, before executing the first business logic corresponding to the transaction request through the first unit, the target method is obtained from the graph storage data. The target method is used to obtain the user identifier.

[0090] According to embodiments of this disclosure, after receiving a transaction request from a user and before executing the first business logic corresponding to the transaction request through the first unit, a target method is obtained from graph storage data, wherein the target method obtains a user identifier. That is, before executing the current transaction's main transaction, a target method for obtaining the user identifier is first obtained so that the user's identifier information is recorded before executing the main transaction, thereby establishing a connection between the user identifier and the current transaction.

[0091] The graph stores data for caching the target method.

[0092] Specifically, the target method can be named getCustomerId, and the call operations within the target method can be custom-developed by the business application or be a standard format predefined by the developers.

[0093] According to embodiments of this disclosure, the target method is added to the unitized architecture via annotation, and the target method, as the attribute value of the target attribute in the annotation, is used to obtain the user identifier of the transaction.

[0094] For example, by presetting the value of the cidGetter property on the transaction annotation @Dtx to getCustomerId, the user ID of the current transaction can be obtained before executing the first business logic.

[0095] In operation S312, the transaction parameters of the current transaction are used as parameters of the target method, the target method is executed, and the user identifier is obtained.

[0096] For example, if the current transaction's method is `doMainTx`, the current transaction's return result could be "success". When initiating a transaction, in the pre-enhancement of the main transaction aspect, the corresponding `cidGetter` method is retrieved from the graph storage data based on the current method. The parameters of the original method are used as the parameters of the `cidGetter` method, and the `cidGetter` method is executed to obtain the user ID of the current transaction.

[0097] In operation S313, the user identifier and transaction log are stored in a common unit in the unitized structure for managing business. The transaction log includes the execution record of obtaining the user identifier.

[0098] According to embodiments of this disclosure, after obtaining the user identifier, the user identifier and transaction log are persistently stored together in a unitized structure for managing business operations, such as a distributed transaction platform.

[0099] This disclosure provides an entry point for obtaining the user identifier during transaction execution by obtaining the target method before executing the transaction and executing the target method to obtain the user identifier. This allows for the rapid location of the user in the current transaction when an exception occurs, thus enabling point-to-point routing of the reverse transaction.

[0100] Figure 4 A flowchart illustrating a caching method of a target method according to an embodiment of the present disclosure is shown schematically.

[0101] like Figure 4 As shown, the caching method for the target method in this embodiment includes operations S410 to S430. Operations S410 to S430 are set before operation S230, and can also be set before operation S210, for pre-caching the target method when starting the unitized architecture.

[0102] When operating S410, after starting the first unit, the target method is obtained from the preset address based on the target attribute of the annotation of the current transaction.

[0103] According to embodiments of this disclosure, after the first unit is started for the first time or after the unitized architecture is started, the target method corresponding to the target attribute value is obtained in advance from the preset address.

[0104] For example, if the default address is a method database, the string containing "cidGetter" is determined from the default address of the method database, and then the method corresponding to that string is used as the target method.

[0105] In operation S420, the execution method name of the first unit is used as the primary key of the key-value pair, and the target method is used as the key value of the key-value pair to construct a graph to store the data.

[0106] According to embodiments of this disclosure, after obtaining the target method, the method name of the execution method of the first unit is used as the primary key of the key-value pair, and the method corresponding to cidGetter is used as the key-value pair to construct a map. Taking the doMainTx method as an example, the primary key of the constructed map is the method name of the doMainTx method, and the key-value pair is getCustomerId.

[0107] During operation S430, the graph storage data is cached in the memory of the common unit.

[0108] According to embodiments of this disclosure, after constructing graph storage data including obtaining user identifiers, the graph storage data is cached in the memory of the common unit. Specifically, the graph storage data can be stored in a distributed transaction platform within the common unit, so that the distributed transaction platform can call the graph storage data to determine the second unit and route a reverse transaction to the second unit.

[0109] Graph storage data can also be stored in other public units besides the distributed transaction platform, so that the distributed transaction platform can access it.

[0110] This disclosure speeds up transaction execution and improves transaction processing efficiency by caching the application's entry method at project startup.

[0111] Figure 5 A flowchart illustrating a method for determining a second unit according to an embodiment of the present disclosure is shown schematically.

[0112] like Figure 5 As shown, the method for determining the second unit in this embodiment includes operations S531 to S532, which can be used as a specific embodiment of operation S230.

[0113] In operation S531, the execution unit to which the current transaction belongs is calculated based on the combination of numbers and the partitioning rules. The partitioning rules include at least one of the following: random partitioning rules and sequential partitioning rules.

[0114] According to embodiments of this disclosure, the user identifier includes a combination of numbers in a preset form, such as a user ID. For example, the user ID of user "Zhang San" is 1001, and the user ID of user "Li Si" is 1103.

[0115] Partitioning rules are used to determine the execution units of multiple groups of users. The partitioning rules include at least one of the following: random partitioning rules and sequential partitioning rules.

[0116] For example, using a random partitioning rule, users with odd-numbered last digits in their user IDs are assigned to Unit 1, and users with even-numbered last digits are assigned to Unit 2. Using a sequential partitioning rule, users can be assigned to Units 1-9 according to their last digit from 0 to 9. Specifically, the partitioning rules and the number of partition units can be determined based on the actual situation.

[0117] According to embodiments of this disclosure, calculating the execution unit to which the current transaction belongs based on number combinations and partitioning rules includes: obtaining a partitioning calculation result for the current transaction based on the number combinations and the number of partitioning units in the unitized framework, wherein each unit in the partitioning unit is used to execute a transaction request from the user. The execution unit to which the current transaction belongs is determined based on the partitioning calculation result and the partitioning rules.

[0118] For example, taking the standard form of a user ID as a combination of numbers, dividing the user ID by the number of partition units yields the partition calculation result. This result includes the remainder after the division operation.

[0119] The partitioning rules are defined based on the number of partition units. For example, if there are 4 partition units, corresponding to units 1 through 4, the partitioning rules include: users with a remainder of 0 are assigned to unit 1, users with a remainder of 1 to unit 2, users with a remainder of 2 to unit 3, and users with a remainder of 3 to unit 4. Alternatively, users with a remainder of 0 can be assigned to unit 4, users with a remainder of 1 to unit 3, users with a remainder of 2 to unit 2, and users with a remainder of 3 to unit 1. It should be noted that the specific partitioning rules can be determined based on the actual situation.

[0120] After calculating the partitioning results based on the number of partition units and the numerical combination of the user ID, the execution unit of the current transaction can be determined according to the partitioning rules.

[0121] In operation S532, if the execution unit is different from the first unit, the execution unit is determined to be the second unit.

[0122] According to embodiments of this disclosure, partitioning rules may change when a user is conducting a positive transaction. In this case, since the user is currently conducting a transaction, the execution unit executing the first business logic is still performing a positive transaction. However, if the first execution data indicates that the current transaction is an abnormal transaction, a reverse transaction request needs to be routed to the execution unit after the partition change.

[0123] According to embodiments of this disclosure, after determining the execution unit for executing the second business logic, if the execution unit is determined to be the same as the first unit, the first unit is still used as the execution unit for executing the second business logic.

[0124] If it is determined that the first execution data characterizes the current transaction as an abnormal business, and the first unit is different from the execution unit, the execution unit used for the second business logic is determined as the second unit to be routed the reverse transaction request.

[0125] This disclosure avoids situations where reverse transactions cannot be executed due to changes in partitioning rules, thereby preventing the handling of abnormal business operations, by recalculating the execution unit where the current transaction is located in the event of transaction anomalies.

[0126] According to embodiments of this disclosure, a second unit executes a second business logic to obtain second execution data corresponding to the transaction request, in order to restore the current transaction's running state, including:

[0127] In response to the execution request initiated by the common unit to the second unit, determine the second business logic corresponding to the first business logic;

[0128] The processor in the second unit executes the second business logic to restore the current transaction's running state to the normal business state, thereby obtaining the second execution data corresponding to the transaction request.

[0129] According to embodiments of this disclosure, the second unit interacts with a distributed transaction platform within the common unit. After the distributed transaction platform determines that the second unit is the execution unit, it initiates an execution request to the second unit to initiate a reverse transaction. In response to the execution request from the distributed transaction platform within the common unit, the second unit determines a second business logic corresponding to the first business logic. The first business logic can be business logic corresponding to transactions such as deposits, withdrawals, or transfers; correspondingly, the second business logic can be business logic opposite to the direction of deposit execution, withdrawal execution, or transfer execution. Specifically, the type of the second business logic is related to the first business logic being executed in the current transaction.

[0130] According to an embodiment of this disclosure, the second unit includes a processor for executing second business logic to restore the current transaction's running state to a normal business state and obtain second execution data corresponding to the transaction request.

[0131] Figure 6 A schematic diagram of a modular architecture according to an embodiment of the present disclosure is shown.

[0132] like Figure 6 As shown, the modular architecture 600 includes partitioned units and common units. The partitioned units include multiple execution units for executing business logic, such as "RZ01-Unit 1" 601, "RZ02-Unit 2" 602, "RZ03-Unit 3" 603, and "RZ04-Unit 4" 604. The common unit includes a distributed transaction platform 605 for managing business logic. Each execution unit within a partitioned unit includes unit identifiers RZ01-RZ04 to distinguish between the multiple execution units.

[0133] According to embodiments of this disclosure, “RZ01-Unit 1” 601, “RZ02-Unit 2” 602, “RZ03-Unit 3” 603 and “RZ04-Unit 4” 604 are used to execute a first business logic and a second business logic corresponding to the first business logic, namely, a positive transaction and a negative transaction.

[0134] The distributed transaction platform 605 is used to interact with “RZ01-Unit 1” 601, “RZ02-Unit 2” 602, “RZ03-Unit 3” 603 and “RZ04-Unit 4” 604 so that the execution unit can execute positive and negative transactions according to the request of the distributed transaction platform.

[0135] Figure 7 A schematic block diagram of an abnormal service processing apparatus according to an embodiment of the present disclosure is shown.

[0136] like Figure 7As shown, the abnormal service processing device 700 of this embodiment includes an acquisition module 710, a first execution module 720, a determination module 730, and a second execution module 740.

[0137] The acquisition module 710 is configured to, in response to receiving a transaction request from a user, acquire the user identifier corresponding to the current transaction, and determine the first unit in the unitized architecture for executing the transaction business based on the transaction request. In one embodiment, the acquisition module 710 may be used to execute the operation S210 described above, which will not be repeated here.

[0138] The first execution module 720 is configured to execute first business logic corresponding to the transaction request through a first unit to obtain first execution data. The first business logic includes the operation logic of the current transaction. In one embodiment, the first execution module 720 can be used to execute the operation S220 described above, which will not be repeated here.

[0139] The determining module 730 is configured to, in response to the first execution data indicating that the current transaction is an abnormal service, determine a second unit in the unitized architecture based on the user identifier and partitioning rules. The second unit is used for a second business logic, which includes operation logic for restoring the abnormal service to a normal service. In one embodiment, the determining module 730 may be used to execute the operation S230 described above, which will not be repeated here.

[0140] The second execution module 740 is used to execute the second business logic through the second unit to obtain second execution data corresponding to the transaction request, so as to restore the running state of the current transaction. In one embodiment, the second execution module 740 can be used to execute the operation S240 described above, which will not be repeated here.

[0141] According to embodiments of this disclosure, the acquisition module 710 includes a first acquisition unit, a second acquisition unit, and a third acquisition unit.

[0142] The first acquisition unit is used to acquire a target method from graph storage data before executing the first business logic corresponding to the transaction request. The target method is used to acquire the user identifier, and the graph storage data is used to cache the target method. In one embodiment, the first acquisition unit can be used to execute the operation S311 described above, which will not be repeated here.

[0143] The second acquisition unit is used to take the transaction parameters of the current transaction as parameters of the target method, execute the target method, and obtain the user identifier. In one embodiment, the second acquisition unit can be used to execute the operation S312 described above, which will not be repeated here.

[0144] The third acquisition unit is used to store the user identifier and transaction log in a common unit for managing business within the unitized structure. The transaction log includes execution records of obtaining the user identifier. In one embodiment, the second acquisition unit can be used to perform the operation S313 described above, which will not be repeated here.

[0145] According to embodiments of this disclosure, the abnormal service processing device 700 further includes a cache module, wherein the cache module includes a first cache unit, a second cache unit, and a third cache unit.

[0146] The first cache unit is used to retrieve the target method from a preset address based on the target attribute of the annotation of the current transaction after the first unit is started. In one embodiment, the first cache unit can be used to execute the operation S410 described above, which will not be repeated here.

[0147] The second cache unit is used to construct the graph storage data by using the execution method name of the first unit as the primary key of the key-value pair and the target method as the key value of the key-value pair. In one embodiment, the second cache unit can be used to perform the operation S420 described above, which will not be repeated here.

[0148] The third cache unit is used to cache the graph storage data to the memory of the common unit. In one embodiment, the second cache unit can be used to perform the operation S430 described above, which will not be repeated here.

[0149] According to embodiments of this disclosure, the determining module 730 includes a first determining unit and a second determining unit.

[0150] The first determining unit is used to calculate the execution unit to which the current transaction belongs based on the numerical combination and the partitioning rule. The partitioning rule includes at least one of the following: random partitioning rule and sequential partitioning rule. In one embodiment, the first determining unit can be used to perform the operation S531 described above, which will not be repeated here.

[0151] The second determining unit is used to determine the execution unit as a second unit when the execution unit is different from the first unit. In one embodiment, the second determining unit may be used to perform the operation S532 described above, which will not be repeated here.

[0152] According to embodiments of this disclosure, the first determining unit includes a first determining subunit and a second determining subunit.

[0153] The first determining subunit is used to obtain the partition calculation result of the current transaction based on the combination of numbers and the number of partition units of the unitized framework, wherein each unit in the partition unit is used to execute the transaction request from the user.

[0154] The second determining subunit is used to determine the execution unit to which the current transaction belongs based on the partition calculation results and the partition rules.

[0155] According to embodiments of this disclosure, the second execution module 740 includes a first execution unit and a second execution unit.

[0156] The first execution unit is used to respond to the execution request initiated by the common unit to the second unit and determine the second business logic corresponding to the first business logic.

[0157] The second execution unit is used to execute the second business logic through the processor within the second unit, restore the current transaction's running state to the normal business state, and obtain the second execution data corresponding to the transaction request.

[0158] According to embodiments of this disclosure, any plurality of modules among the acquisition module 710, the first execution module 720, the determination module 730, and the second execution module 740 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the acquisition module 710, the first execution module 720, the determination module 730, and the second execution module 740 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these methods. Alternatively, at least one of the acquisition module 710, the first execution module 720, the determination module 730, and the second execution module 740 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.

[0159] Figure 8 A block diagram of an electronic device suitable for an abnormal service processing method according to an embodiment of the present disclosure is shown schematically.

[0160] like Figure 8As shown, an electronic device 800 according to an embodiment of this disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.

[0161] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0162] According to embodiments of this disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.

[0163] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0164] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.

[0165] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the exception handling methods provided in the embodiments of this disclosure.

[0166] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0167] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0168] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0169] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0170] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0171] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0172] The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this disclosure. It should be understood that the above descriptions are merely specific embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. An exception handling method applied to a unitized architecture, the method comprising: In response to receiving a transaction request from a user, the system obtains the user identifier corresponding to the current transaction and determines the first unit in the unitized architecture for executing the transaction business based on the transaction request. The first unit executes the first business logic corresponding to the transaction request to obtain first execution data, wherein the first business logic includes the operation logic of the current transaction. In response to determining that the first execution data characterizes the current transaction as an abnormal business, a second unit in the unitized architecture is determined based on the user identifier and partitioning rules. The second unit is used to execute a second business logic, which includes operation logic to restore the abnormal business to a normal business. as well as The second unit executes the second business logic to obtain the second execution data corresponding to the transaction request, so as to restore the current transaction's running state.

2. The method according to claim 1, wherein, The step of responding to receiving a transaction request from a user, obtaining the user identifier corresponding to the current transaction, and determining the first unit in the unitized architecture for executing transaction business based on the transaction request includes: Before executing the first business logic corresponding to the transaction request through the first unit, a target method is obtained from the graph storage data. The target method is used to obtain the user identifier, and the graph storage data is used to cache the target method. The transaction parameters of the current transaction are used as parameters of the target method, and the target method is executed to obtain the user identifier; and The user identifier and transaction log are stored in a common unit in the unitized architecture used for business management, and the transaction log includes the execution record of obtaining the user identifier.

3. The method according to claim 2, wherein, The target method is added to the unitized architecture through annotation, and the target method is used as the attribute value of the target attribute in the annotation to obtain the user identifier of the transaction.

4. The method according to claim 3, further comprising: After the first unit is started, the target method is obtained from the preset address according to the target attribute of the annotation of the current transaction; The graph storage data is constructed by using the execution method name of the first unit as the primary key of the key-value pair and the target method as the key value of the key-value pair. as well as The graph storage data is cached in the memory of the common unit.

5. The method according to claim 1, wherein, The user identifier includes a preset combination of numbers; In response to determining that the first execution data characterizes the current transaction as an abnormal business, the second unit in the unitized architecture is determined based on the user identifier and partitioning rules, including: Based on the numerical combination and the partitioning rules, the execution unit to which the current transaction belongs is calculated, wherein the partitioning rules include at least one of the following: random partitioning rules, sequential partitioning rules; and If the execution unit is different from the first unit, the execution unit is identified as the second unit.

6. The method according to claim 5, wherein, The step of calculating the execution unit to which the current transaction belongs based on the numerical combination and the partitioning rules includes: Based on the numerical combination and the number of partition units in the unitized architecture, the partition calculation result of the current transaction is obtained, where each unit in the partition unit is used to execute the transaction request from the user; and Based on the partition calculation results and the partition rules, the execution unit to which the current transaction belongs is determined.

7. The method according to claim 1, wherein, The step of executing the second business logic through the second unit to obtain the second execution data corresponding to the transaction request, so as to restore the current transaction's running state, includes: In response to the execution request initiated by the common unit to the second unit, the second business logic corresponding to the first business logic is determined; The processor in the second unit executes the second business logic to restore the current transaction's running state to the normal business state, thereby obtaining the second execution data corresponding to the transaction request.

8. An exception handling device, applied to a unitized architecture, comprising: The acquisition module is used to, in response to receiving a transaction request from a user, acquire the user identifier corresponding to the current transaction, and determine the first unit in the unitized architecture for executing the transaction business based on the transaction request; The first execution module is configured to execute the first business logic corresponding to the transaction request through the first unit to obtain the first execution data, wherein the first business logic includes the operation logic of the current transaction; The determination module is used to determine the second unit in the unitized architecture based on the user identifier and partitioning rules in response to the first execution data indicating that the current transaction is an abnormal business. The second unit is used to execute the second business logic, which includes the operation logic of restoring the abnormal business to normal business. as well as The second execution module is used to execute the second business logic through the second unit to obtain the second execution data corresponding to the transaction request, so as to restore the running state of the current transaction.

9. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Transaction data processing method and device, computer equipment and storage medium

    CN112613993A

  • Distributed transaction different-library mode anti-transaction calling method and device

    CN113515352A