CN116012158A - Service processing method, device, equipment and storage medium - Google Patents

Service processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN116012158A
CN116012158A CN202310032399.0A CN202310032399A CN116012158A CN 116012158 A CN116012158 A CN 116012158A CN 202310032399 A CN202310032399 A CN 202310032399A CN 116012158 A CN116012158 A CN 116012158A
Authority
CN
China
Prior art keywords
transaction
service
model
determining
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310032399.0A
Other languages
Chinese (zh)
Inventor
曾利辉
戴宜通
张纪国
杨宇鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310032399.0A priority Critical patent/CN116012158A/en
Publication of CN116012158A publication Critical patent/CN116012158A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a service processing method, a device, equipment and a storage medium, which can be applied to the technical field of computers. The method comprises the following steps: acquiring a distributed transaction request for processing transaction service, wherein the distributed transaction request comprises transaction data; determining the service type of the transaction service according to the transaction data; determining a business model matched with the business type from a business model database to obtain a target business model; determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model; and calling a transaction interface to process transaction business.

Description

Service processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a service processing method, apparatus, device, medium, and program product.
Background
A transaction may refer to an operation unit in which all operations eventually remain in a consistent behavior, either all operations succeed or all operations are revoked. And distributed transactions refer to the participants of the transaction, the servers supporting the transaction, the resource servers, and the transaction manager being located on different nodes of different distributed systems, respectively. In short, a large operation consists of different small operations, which are distributed on different servers and belong to different applications, and in order to ensure the data consistency of different nodes, the distributed transaction needs to ensure that the small operations are either all successful or all failed. However, the distributed transaction has more nodes participating in the transaction, so that the transaction link is easy to fail, thereby causing transaction failure and inconsistent data.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: in the related art, the method for flushing distributed transactions cannot be commonly used in different systems, and has high complexity, so that the flushing efficiency is low.
Disclosure of Invention
In view of the foregoing, the present disclosure provides business processing methods, apparatuses, devices, media, and program products.
According to a first aspect of the present disclosure, there is provided a service processing method, including:
acquiring a distributed transaction request for processing transaction service, wherein the distributed transaction request comprises transaction data;
determining the service type of the transaction service according to the transaction data;
determining a business model matched with the business type from a business model database to obtain a target business model;
determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model;
and calling a transaction interface to process transaction business.
According to an embodiment of the present disclosure, determining a transaction interface corresponding to a transaction service according to model parameters in a target service model includes:
obtaining model parameters corresponding to a target service model from a service model database;
Determining transaction interface parameters according to the model parameters;
and determining a transaction interface corresponding to the transaction service according to the transaction interface parameters.
According to an embodiment of the present disclosure, determining a service type of a transaction service according to transaction data includes:
determining format information of transaction data according to the transaction data;
under the condition that the format information of the transaction data does not meet the target format, acquiring a preset data mapping table;
converting format data to be converted in the transaction data into standard data of a target format according to the data mapping table;
and determining the service type of the transaction service according to the standard data.
According to an embodiment of the present disclosure, the above method further includes:
determining a calling result of the transaction interface according to the execution state of the transaction service;
and determining the execution flow record of the transaction service based on the calling result of the transaction interface to obtain a flow record list.
According to an embodiment of the present disclosure, the above method further includes:
determining input parameters in response to input operation of a user in a visual interface;
generating a model file in a target file format according to the input parameters;
under the condition that the verification of the model file is successful, determining a service model corresponding to the model file;
And uploading the business model corresponding to the model file to a business model database.
According to an embodiment of the present disclosure, the above method further includes:
under the condition that the execution state of the transaction service is determined to be failed, the retry times of the transaction interface are obtained;
and under the condition that the retry times meet a preset threshold value, the transaction interface is called again to process transaction business.
According to an embodiment of the disclosure, the calling mode of the transaction interface at least comprises one of the following: synchronous calling mode, asynchronous calling mode and concurrent calling mode;
invoking a transaction interface to process a transaction service, comprising:
determining a target calling mode of the transaction interface from a plurality of calling modes according to the model parameters;
and calling a transaction interface to process transaction business according to the target calling mode.
A second aspect of the present disclosure provides a service processing apparatus, including:
the acquisition module is used for acquiring a distributed transaction request for processing transaction service, wherein the distributed transaction request comprises transaction data;
the first determining module is used for determining the service type of the transaction service according to the transaction data;
the first obtaining module is used for determining a service model matched with the service type from the service model database to obtain a target service model;
The second determining module is used for determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model;
the first processing module is used for calling the transaction interface to process transaction business.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.
According to the business processing method, the business processing device, the business processing equipment, the medium and the program product provided by the disclosure, a distributed transaction request for processing transaction business is obtained, wherein the distributed transaction request comprises transaction data; determining the service type of the transaction service according to the transaction data; determining a business model matched with the business type from a business model database to obtain a target business model; determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model; and calling a transaction interface to process transaction business. Because the business model matched with the transaction business is preset, when the business request of the transaction business is received, the target business model can be acquired from the business model database. The transaction interface is determined according to model parameters in the target service model, transaction service is processed through the transaction interface, development of the transaction interface can be achieved through simple parameter configuration and flexible combination of the transaction interface, and the method can be applied to different distributed transaction processing systems, so that the technical effects that in the related technology, a distributed transaction method cannot be commonly used in different systems, the complexity is high, the transaction efficiency is low, the problem of consistency in the transaction service is solved, and the development efficiency of the distributed transaction is improved are at least partially solved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a business processing method, apparatus, device, medium and program product according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a business processing method according to an embodiment of the disclosure;
fig. 3 schematically illustrates a flow chart of a business processing method according to a further embodiment of the present disclosure;
fig. 4 schematically shows a block diagram of a service processing apparatus according to an embodiment of the present disclosure; and
fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a business processing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the related data (such as including but not limited to personal information of a user) are collected, stored, used, processed, transmitted, provided, disclosed, applied and the like, all conform to the regulations of related laws and regulations, necessary security measures are adopted, and the public welcome is not violated.
In the related art, in order to ensure consistency of transaction data, a distributed transaction is generally subjected to positive compensation, and for a transaction mode of positive compensation, the following problems exist: firstly, a developer needs to realize the calling of all interfaces of positive transaction and towards positive transaction, and needs to ensure the calling sequence, the parameter assembly, the verification of request and response data, the processing of interface abnormal conditions and the like, so that the developer needs to develop a large amount of codes, and the complexity is high; secondly, the calling modes of all systems are different in the development of the transaction interface and the transaction interface, and the unified use mode is lacked, so that the code universality is low; finally, due to the lack of flexible arrangement modes, free combination of multiple calling modes of concurrent, asynchronous and synchronous calling of interfaces cannot be realized, a synchronous sequence calling mode is generally used, the efficiency is low, the existing framework needs the system groups to respectively realize the development of the interfaces, and the optimal use performance of the calling modes of the interfaces cannot be ensured.
In view of this, an embodiment of the present disclosure provides a service processing method, which obtains a distributed transaction request for processing a transaction service, where the distributed transaction request includes transaction data; determining the service type of the transaction service according to the transaction data; determining a business model matched with the business type from a business model database to obtain a target business model; determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model; and calling a transaction interface to process transaction business. Because the business model matched with the transaction business is preset, when the business request of the transaction business is received, the target business model can be acquired from the business model database. The transaction interface is determined according to model parameters in the target service model, transaction service is processed through the transaction interface, development of the transaction interface can be achieved through simple parameter configuration and flexible combination of the transaction interface, and the method can be applied to different distributed transaction processing systems, so that the technical effects that in the related technology, a distributed transaction method cannot be commonly used in different systems, the complexity is high, the transaction efficiency is low, the problem of consistency in the transaction service is solved, and the development efficiency of the distributed transaction is improved are at least partially solved.
Fig. 1 schematically illustrates an application scenario diagram of a service processing method according to an embodiment of the present disclosure.
As shown in fig. 1, an 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 is a medium used to provide 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, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the service processing method provided in the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the service processing apparatus provided in the embodiments of the present disclosure may be generally disposed in the server 105. The service processing method provided by the embodiment of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the service processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The service processing method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 5 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flow chart of a traffic handling method according to an embodiment of the present disclosure.
As shown in fig. 2, the service processing method of this embodiment includes operations S210 to S250.
In operation S210, a distributed transaction request for processing a transaction service is acquired, wherein the distributed transaction request includes transaction data.
According to embodiments of the present disclosure, the transaction service may be a transfer service, a deposit service, a withdrawal service, or the like.
According to embodiments of the present disclosure, the distributed transaction request may be a request initiated based on a transaction service, for example, may be a transfer request, a deposit request, a withdrawal request, and the like.
According to an embodiment of the present disclosure, the transaction data may include data related to a transaction service, for example, data of a transfer amount, a payee, a payer, etc. in a transfer service, and data of a deposit amount, a depositor, etc. in a deposit service.
According to the embodiment of the disclosure, the distributed transaction requests of a plurality of transaction services can be acquired simultaneously.
In operation S220, a service type of the transaction service is determined according to the transaction data.
According to an embodiment of the present disclosure, the transaction type of the transaction service may be orthogonal or may be orthogonal, and the transaction data may include service identification data for identifying the transaction service.
According to the embodiment of the disclosure, since the orthogonalization is easy to be initiated under the condition that the orthogonalization is easy to occur, the service type of the transaction service can be determined according to the occurrence frequency of the service identifier in the transaction data, the service type of the transaction service can be determined to be positive transaction under the condition that the service identifier in the transaction data occurs for the first time, and the service type of the transaction service can be determined to be positive transaction under the condition that the service identifier in the transaction data does not occur for the first time. Identification information for identifying the service type may be added to the distributed transaction request.
In operation S230, a business model matching the business type is determined from the business model database, and a target business model is obtained.
According to an embodiment of the present disclosure, the business model in the business model database may be a pre-saved model, the business model database may include a plurality of business models, different transaction businesses may correspond to different business models, and the positive transaction and the impact transaction of the transaction business may also correspond to different business models. Each business model may include a transaction interface that the transaction business needs to call, a protocol type of the transaction interface, the protocol type may be a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP), a transmission control protocol (Transmission Control Protocol, TCP), a remote procedure call protocol (Remote Procedure Call, RPC), etc., parameters (external incoming) that the transaction interface enters, and a sequence of the transaction interface calls, etc.
According to the embodiment of the disclosure, a model identifier can be configured in each service model, a matching result is obtained by matching the service type with the model identifier, and the service model matched with the service type is determined according to the matching result, so that a target service model is obtained.
In operation S240, a transaction interface corresponding to the transaction service is determined according to model parameters in the target service model.
According to an embodiment of the present disclosure, the model parameter in the target transaction model may be a parameter of a transaction interface that the transaction service needs to call, thereby determining the transaction interface corresponding to the transaction service.
According to the embodiment of the disclosure, in the case that the service type of the transaction service is positive transaction, the target service model obtained by matching is a model corresponding to the orthogonal easiness of the transaction service, so that the invoked transaction interface is a transaction interface corresponding to the orthogonal easiness; under the condition that the business type of the transaction business is towards positive transaction, the target business model obtained by matching is a model which corresponds to the towards quadrature easiness of the transaction business, and therefore, the invoked transaction interface is a transaction interface which corresponds to the towards quadrature easiness of the transaction business.
According to an embodiment of the present disclosure, in a case where there are a plurality of transaction services, the determined target service model service is also a plurality of, and a plurality of transaction interfaces are determined according to each of the plurality of target service models.
In operation S250, the transaction interface is invoked to process the transaction service.
According to the embodiment of the disclosure, the calling mode of the transaction interface can be various, and the transaction interface can be called according to the calling mode set in the service model to process the transaction service.
According to the embodiment of the disclosure, a distributed transaction request for processing transaction service is acquired, wherein the distributed transaction request comprises transaction data; determining the service type of the transaction service according to the transaction data; determining a business model matched with the business type from a business model database to obtain a target business model; determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model; and calling a transaction interface to process transaction business. Because the business model matched with the transaction business is preset, when the business request of the transaction business is received, the target business model can be acquired from the business model database. The transaction interface is determined according to model parameters in the target service model, transaction service is processed through the transaction interface, development of the transaction interface can be achieved through simple parameter configuration and flexible combination of the transaction interface, and the method can be applied to different distributed transaction processing systems, so that the technical effects that in the related technology, a distributed transaction developing method cannot be commonly used in different systems, the complexity is high, the developing efficiency is low are achieved, the problem of consistency in the transaction service is solved, and the development efficiency of the distributed transaction is improved are at least partially solved.
According to an embodiment of the present disclosure, determining a transaction interface corresponding to a transaction service according to model parameters in a target service model includes:
obtaining model parameters corresponding to a target service model from a service model database;
determining transaction interface parameters according to the model parameters;
and determining a transaction interface corresponding to the transaction service according to the transaction interface parameters.
According to an embodiment of the present disclosure, model parameters corresponding to a target business model may be stored in a business model database, and thus, in the case of determining a target business model from business model data, corresponding model parameters corresponding to the target business model may be acquired from the business model database.
According to the embodiment of the disclosure, the transaction interface parameters can be identified from the model parameters, so that the transaction interface corresponding to the transaction service is determined according to the transaction interface parameters, the transaction interface parameters can be set according to the preset format, and the transaction interface parameters can be quickly identified each time the transaction interface parameters in the model parameters are identified.
According to the embodiment of the disclosure, model parameters corresponding to a plurality of target business models can be acquired simultaneously, and transaction interfaces corresponding to a plurality of transaction businesses are determined.
According to the embodiment of the disclosure, the transaction interface corresponding to the transaction service can be rapidly determined by setting the transaction interface parameters in the model parameters in advance, so that the processing efficiency of the transaction service is improved.
According to an embodiment of the present disclosure, determining a service type of a transaction service according to transaction data includes:
determining format information of transaction data according to the transaction data;
under the condition that the format information of the transaction data does not meet the target format, acquiring a preset data mapping table;
converting format data to be converted in the transaction data into standard data of a target format according to the data mapping table;
and determining the service type of the transaction service according to the standard data.
According to the embodiment of the disclosure, the transaction data of different transaction systems can be in different formats, and the format of the transaction data can be identified to determine format information of the transaction data.
According to embodiments of the present disclosure, the format information of the transaction data may be a coded format of different data, for example, the identification data of the transaction service may be displayed as "code" in the transaction data, or the amount of money in the transaction data may be displayed as binary "111110100".
According to an embodiment of the present disclosure, the preset data mapping table may include conversion conditions set according to data formats of different transaction systems, and the conversion conditions may be standard data for converting the transaction data into the target format in case that it is determined that format information of the transaction data does not match the target format.
According to an embodiment of the present disclosure, the target format may be "number" of identification data, decimal amount, or the like, for example, "encoding" may be converted into the target format "number" in the case where format information of transaction data is determined to be "encoding", and "111110100" may be converted into the target format decimal "500" in the case where format information of transaction data is determined to be binary "111110100".
According to the embodiment of the disclosure, the format of the standard data is a unified target format, so that a unified method for identifying the service type can be set to identify the standard data and determine the service type of the transaction service.
According to the embodiment of the disclosure, the transaction data is converted into the standard data with the target format according to the preset data mapping table, and the format in the standard data is uniform, so that the service type can be rapidly determined according to the standard data, and the service processing efficiency is improved.
According to an embodiment of the present disclosure, the above method further includes:
determining a calling result of the transaction interface according to the execution state of the transaction service;
and determining the execution flow record of the transaction service based on the calling result of the transaction interface to obtain a flow record list.
According to the embodiment of the disclosure, whether the transaction service is processed to be completed or not can be detected to determine the execution state of the transaction service, the calling result of the transaction interface is determined to be incomplete calling when the execution state of the transaction service is processing failure, and the calling result of the transaction interface is determined to be complete calling when the execution state of the transaction service is processing success.
According to the embodiment of the disclosure, in the case that the calling result of the transaction interface is determined to be the incomplete calling, the execution flow record of the transaction service can be determined to be the flow record of processing failure, and in the case that the calling result of the transaction interface is determined to be the complete calling, the execution flow record of the transaction service can be determined to be the flow record of processing success.
According to the embodiment of the disclosure, the execution state of each transaction service can be recorded by writing the execution flow record into the flow record table.
According to the embodiment of the disclosure, whether the current transaction service has a corresponding execution flow record or not can be determined by inquiring the flow record table, so that whether the transaction service is a positive transaction or not is determined, and under the condition that the execution flow record corresponding to the transaction service exists in the flow record table, the fact that the transaction service has already processed the positive transaction can be determined, and the current transaction service is the positive transaction.
According to the embodiment of the disclosure, the execution state of each transaction service can be recorded through the flow record table, and the problem node of the transaction service can be rapidly positioned from the flow record table under the condition that the transaction service is wrong, so that the problem node can be rapidly solved.
Fig. 3 schematically shows a flow chart of a traffic handling method according to a further embodiment of the present disclosure.
As shown in fig. 3, the service processing method includes operations S310 to S340.
In operation S310, an input parameter is determined in response to an input operation of the user in the visual interface.
In operation S320, a model file in a target file format is generated according to the input parameters.
In operation S330, in case that the verification of the model file is successful, a service model corresponding to the model file is determined.
In operation S340, the business model corresponding to the model file is uploaded to the business model database.
According to an embodiment of the present disclosure, the visual interface may be an interface of the positive compensation frame, through which a user may perform an input operation, and in response to the input operation of the user, input parameters may be received.
According to the embodiments of the present disclosure, the input parameters may be a transaction interface parameter that the transaction service needs to call, a protocol type parameter of the transaction interface, a parameter that the transaction interface transmits in, and a sequence parameter that the transaction interface calls, a processing parameter in the case that the transaction interface calls in error, a parameter in the data mapping table, an execution state judgment parameter of the transaction service, and so on.
According to an embodiment of the present disclosure, the object file format may be a json state language definition format file, and the model file of the object file format may be generated from the input parameters.
According to the embodiment of the disclosure, the generated model file can be checked, whether parameters in the model file are set reasonably or not is determined, and under the condition that the model file is checked successfully, a service model corresponding to the model file can be generated according to the model file.
According to an embodiment of the present disclosure, a business model is uploaded into a business model database so that a business model corresponding to a transaction business can be acquired from the business model database when a distributed transaction request is acquired.
According to the embodiment of the disclosure, the input operation is performed through the visual interface, so that the forward compensation model of the distributed transaction request can be developed, different business models can be set according to different business services, and the transaction interface needing to be called can be determined only by acquiring the set transaction interface parameters in the business models, so that the quick processing of the business services is realized.
According to an embodiment of the present disclosure, the above method further includes:
Under the condition that the execution state of the transaction service is determined to be failed, the retry times of the transaction interface are obtained;
and under the condition that the retry times meet a preset threshold value, the transaction interface is called again to process transaction business.
According to the embodiment of the disclosure, the execution state of the transaction service can be acquired by the transaction manager, and since the distributed transaction has a plurality of execution nodes, a plurality of branch transactions can be arranged in each transaction service, the execution state of each branch transaction in the transaction can be judged under the condition that the transaction service is orthogonal, and under the condition that all branch transactions in the transaction are determined to be successfully executed, the execution state of the successful execution can be reported to the transaction manager, and meanwhile, a successful result is returned.
According to the embodiment of the disclosure, the retry times of the transaction interfaces can be set in the target service model, if the branch transaction calling interfaces are wrong, whether the transaction interfaces are re-called can be determined according to the retry times of the transaction interfaces set by the target service model, if the transaction interfaces are determined to be re-called to process the transaction service, whether the retry time is overtime is required to be calculated, if the retry time is not overtime, the retry is executed, and meanwhile, the execution state is reported to the transaction manager.
According to the embodiment of the disclosure, under the condition that the transaction service is a positive transaction, the execution state of each branch transaction in the positive transaction can be judged, and under the condition that all branch transactions of the positive transaction are successful, the success state is reported to the transaction manager.
According to embodiments of the present disclosure, whether to flush orthogonal ease may be decided by the transaction manager according to the execution state of the transaction being conducted.
According to the embodiment of the disclosure, the processing success efficiency of the transaction service can be improved by setting the retry times of the transaction interface.
According to an embodiment of the disclosure, the calling mode of the transaction interface at least comprises one of the following: synchronous calling mode, asynchronous calling mode and concurrent calling mode;
invoking a transaction interface to process a transaction service, comprising:
determining a target calling mode of the transaction interface from a plurality of calling modes according to the model parameters;
and calling a transaction interface to process transaction business according to the target calling mode.
According to the embodiment of the disclosure, the synchronous calling mode is that when a plurality of transaction interfaces are provided, the next transaction interface can be continuously called after one transaction interface is called according to a certain sequence; the asynchronous calling mode is that under the condition that a plurality of transaction interfaces are provided, the calling of each transaction interface is independent and is not influenced by the calling results of other transaction interfaces; the concurrent calling mode refers to that all transaction interfaces can be called at the same time under the condition that a plurality of transaction interfaces are provided.
According to the embodiment of the disclosure, the target calling mode of the transaction interface can be preset in the service model, and the target calling mode of the transaction interface can be determined according to model parameters.
According to the embodiment of the disclosure, in the case that the transaction interfaces are plural, the target call mode of the transaction interfaces may be one or more of a synchronous call mode, an asynchronous call mode and a concurrent call mode, for example, the transaction interfaces to be called are 4, the transaction interfaces 1 and 2 are concurrent call modes, the transaction interfaces 1 and 2 are respectively synchronous call modes with the transaction interface 3, the transaction interfaces 1, 2 and 3 are respectively asynchronous call modes between the transaction interfaces 4, so that the target call mode between the 4 transaction interfaces may be simultaneous call of the transaction interfaces 1 and 2, and in the case that the call of the transaction interfaces 1 and 2 is completed, the transaction interface 3 is called, and in this process, the transaction interface 4 may be called at any time.
According to the embodiment of the disclosure, the transaction interface is called according to the target calling mode to process the transaction service, and the calling efficiency of the transaction interface can be improved under the condition that multiple calling modes can be used simultaneously.
Based on the service processing method, the disclosure also provides a service processing device. The device will be described in detail below in connection with fig. 4.
Fig. 4 schematically shows a block diagram of a service processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the service processing apparatus 400 of this embodiment includes an acquisition module 410, a first determination module 420, a first obtaining module 430, a second determination module 440, and a first processing module 450.
The acquiring module 410 is configured to acquire a distributed transaction request for processing a transaction service, where the distributed transaction request includes transaction data. In an embodiment, the obtaining module 410 may be configured to perform the operation S210 described above, which is not described herein.
The first determining module 420 is configured to determine a service type of the transaction service according to the transaction data. In an embodiment, the first determining module 420 may be used to perform the operation S220 described above, which is not described herein.
The first obtaining module 430 is configured to determine a service model that matches the service type from the service model database, and obtain a target service model. In an embodiment, the obtaining module 430 may be configured to perform the operation S230 described above, which is not described herein.
The second determining module 440 is configured to determine a transaction interface corresponding to the transaction service according to the model parameters in the target service model. In an embodiment, the second determining module 440 may be configured to perform the operation S240 described above, which is not described herein.
The first processing module 450 is configured to invoke the transaction interface to process the transaction service. In an embodiment, the processing module 450 may be configured to perform the operation S250 described above, which is not described herein.
According to an embodiment of the present disclosure, the second determining module for determining a transaction interface corresponding to a transaction service according to model parameters in the target service model includes:
the first determining unit is used for acquiring model parameters corresponding to the target service model from the service model database;
the second determining unit is used for determining transaction interface parameters according to the model parameters;
and the third determining unit is used for determining the transaction interface corresponding to the transaction service according to the transaction interface parameters.
According to an embodiment of the present disclosure, the first determining module for determining a service type of a transaction service according to transaction data includes:
a fourth determining unit, configured to determine format information of the transaction data according to the transaction data;
a fifth determining unit, configured to obtain a preset data mapping table when it is determined that format information of the transaction data does not meet the target format;
a sixth determining unit, configured to convert format data to be converted in the transaction data into standard data of a target format according to the data mapping table;
And the seventh determining unit is used for determining the service type of the transaction service according to the standard data.
According to an embodiment of the present disclosure, the above apparatus further includes:
the third determining module is used for determining the calling result of the transaction interface according to the execution state of the transaction service;
and the second obtaining module is used for determining the execution flow record of the transaction service based on the calling result of the transaction interface to obtain a flow record list.
According to an embodiment of the present disclosure, the above apparatus further includes:
a fourth determining module, configured to determine an input parameter in response to an input operation of a user in the visual interface;
the generating module is used for generating a model file in a target file format according to the input parameters;
a fifth determining module, configured to determine a service model corresponding to the model file if the model file is successfully verified;
and the uploading module is used for uploading the business model corresponding to the model file to the business model database.
According to an embodiment of the present disclosure, the above apparatus further includes:
the second acquisition module is used for acquiring the retry times of the transaction interface under the condition that the execution state of the transaction service is determined to be failed;
and the second processing module is used for recalling the transaction interface to process the transaction service under the condition that the retry times meet the preset threshold value.
According to an embodiment of the disclosure, the calling mode of the transaction interface at least comprises one of the following: synchronous calling mode, asynchronous calling mode and concurrent calling mode;
the first processing module for calling the transaction interface to process the transaction service comprises:
the first processing unit is used for determining a target calling mode of the transaction interface from a plurality of calling modes according to the model parameters;
and the second processing unit is used for calling the transaction interface to process transaction business according to the target calling mode.
According to an embodiment of the present disclosure, any of the acquisition module 410, the first determination module 420, the first obtaining module 430, the second determination module 440, and the first processing module 450 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the acquisition module 410, the first determination module 420, the first derivation module 430, the second determination module 440, and the first processing module 450 may be implemented at least in part 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 a package, an Application Specific Integrated Circuit (ASIC), or as hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or as any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the acquisition module 410, the first determination module 420, the first obtaining module 430, the second determination module 440, and the first processing module 450 may be at least partially implemented as a computer program module, which when executed may perform the respective functions.
Fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a business processing method according to an embodiment of the disclosure.
As shown in fig. 5, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. The processor 501 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)), or the like. The processor 501 may also include on-board memory for caching purposes. The processor 501 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are stored. The processor 501, ROM 502, and RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the program may be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 500 may also include an input/output (I/O) interface 505, the input/output (I/O) interface 505 also being connected to the bus 504. The electronic device 500 may also include one or more of the following components connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code means for causing a computer system to carry out the business processing methods provided by the embodiments of the present disclosure when the computer program product is run on the computer system.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, and/or installed from a removable medium 511 via the communication portion 509. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (11)

1. A business processing method, comprising:
acquiring a distributed transaction request for processing transaction service, wherein the distributed transaction request comprises transaction data;
Determining the service type of the transaction service according to the transaction data;
determining a service model matched with the service type from a service model database to obtain a target service model;
determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model;
and calling the transaction interface to process the transaction service.
2. The method of claim 1, wherein the determining a transaction interface corresponding to the transaction service according to model parameters in the target service model comprises:
obtaining model parameters corresponding to the target service model from the service model database;
determining transaction interface parameters according to the model parameters;
and determining a transaction interface corresponding to the transaction service according to the transaction interface parameters.
3. The method of claim 1, wherein the determining the transaction type of the transaction based on the transaction data comprises:
determining format information of the transaction data according to the transaction data;
acquiring a preset data mapping table under the condition that the format information of the transaction data does not meet a target format;
Converting format data to be converted in the transaction data into standard data of the target format according to the data mapping table;
and determining the service type of the transaction service according to the standard data.
4. A method according to any one of claims 1 to 3, further comprising:
determining a calling result of the transaction interface according to the execution state of the transaction service;
and determining the execution flow record of the transaction service based on the calling result of the transaction interface to obtain a flow record list.
5. The method of claim 4, further comprising:
determining input parameters in response to input operation of a user in a visual interface;
generating a model file in a target file format according to the input parameters;
under the condition that the model file is successfully checked, determining a service model corresponding to the model file;
and uploading the business model corresponding to the model file to the business model database.
6. The method of claim 4, further comprising:
under the condition that the execution state of the transaction service is determined to be failed, the retry times of the transaction interface are obtained;
and under the condition that the retry times meet a preset threshold value, the transaction interface is called again to process the transaction service.
7. The method of claim 1, wherein the calling mode of the transaction interface comprises at least one of the following: synchronous calling mode, asynchronous calling mode and concurrent calling mode;
the calling the transaction interface to process the transaction service comprises the following steps:
determining a target calling mode of the transaction interface from a plurality of calling modes according to the model parameters;
and calling the transaction interface to process the transaction service according to the target calling mode.
8. A traffic processing apparatus comprising:
the system comprises an acquisition module, a transaction processing module and a transaction processing module, wherein the acquisition module is used for acquiring a distributed transaction request for processing transaction service, and the distributed transaction request comprises transaction data;
the first determining module is used for determining the service type of the transaction service according to the transaction data;
the first obtaining module is used for determining a service model matched with the service type from a service model database to obtain a target service model;
the second determining module is used for determining a transaction interface corresponding to the transaction service according to the model parameters in the target service model;
and the processing module is used for calling the transaction interface to process the transaction service.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
CN202310032399.0A 2023-01-10 2023-01-10 Service processing method, device, equipment and storage medium Pending CN116012158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310032399.0A CN116012158A (en) 2023-01-10 2023-01-10 Service processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310032399.0A CN116012158A (en) 2023-01-10 2023-01-10 Service processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116012158A true CN116012158A (en) 2023-04-25

Family

ID=86020970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310032399.0A Pending CN116012158A (en) 2023-01-10 2023-01-10 Service processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116012158A (en)

Similar Documents

Publication Publication Date Title
CN111277639B (en) Method and device for maintaining data consistency
CN112288577B (en) Transaction processing method, device, electronic equipment and medium for distributed service
CN112463729B (en) Data file warehousing method and device, electronic equipment and medium
CN108933695B (en) Method and apparatus for processing information
CN111127181A (en) Voucher bookkeeping method and device
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN110223179B (en) Data processing method, device, system and medium for fund
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
EP3828705A1 (en) Method and apparatus for processing a service of an abnormal server
US10831590B2 (en) Error handling
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN116012158A (en) Service processing method, device, equipment and storage medium
CN112783903B (en) Method and device for generating update log
CN114610895A (en) Work order pushing method and device, electronic equipment and storage medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN111131354B (en) Method and apparatus for generating information
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium
CN112395194A (en) Method and device for accessing test platform
CN112084114A (en) Method and apparatus for testing an interface
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN116071075A (en) Transaction integrity verification method, apparatus, device, medium and program product
CN115168238A (en) Test method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination