[go: up one dir, main page]

CN111932234B - Transaction data processing method and device - Google Patents

Transaction data processing method and device Download PDF

Info

Publication number
CN111932234B
CN111932234B CN202011016374.4A CN202011016374A CN111932234B CN 111932234 B CN111932234 B CN 111932234B CN 202011016374 A CN202011016374 A CN 202011016374A CN 111932234 B CN111932234 B CN 111932234B
Authority
CN
China
Prior art keywords
transaction
service node
processing pipeline
node valve
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011016374.4A
Other languages
Chinese (zh)
Other versions
CN111932234A (en
Inventor
周晶
王帅
李慧超
郑斌
孙博
刘坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid E Commerce Technology Co Ltd
State Grid Digital Technology Holding Co Ltd
Original Assignee
State Grid E Commerce Technology Co Ltd
State Grid Digital Technology Holding 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 State Grid E Commerce Technology Co Ltd, State Grid Digital Technology Holding Co Ltd filed Critical State Grid E Commerce Technology Co Ltd
Priority to CN202011016374.4A priority Critical patent/CN111932234B/en
Publication of CN111932234A publication Critical patent/CN111932234A/en
Application granted granted Critical
Publication of CN111932234B publication Critical patent/CN111932234B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/12Payment architectures specially adapted for electronic shopping systems

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a transaction data processing method and a device, wherein the method comprises the following steps: responding to the transaction instruction, and acquiring transaction data in the transaction instruction; creating a transaction processing pipeline corresponding to the transaction instruction by using a preset execution engine; the transaction processing pipeline comprises a plurality of service node valves which are sequenced in sequence; inputting transaction data into the transaction processing pipeline, so that each service node valve in the transaction processing pipeline processes the transaction data in sequence to obtain a transaction result corresponding to a transaction instruction; wherein the transaction data is the input of the first service node valve in the transaction processing pipeline, and the output of each service node valve in the transaction processing pipeline is used as the input of the next service node valve. By applying the method provided by the invention, the transaction data is processed through each service node valve in the transaction processing pipeline, so that the transaction result is obtained, the decoupling among the service node valves is realized, and the coding difficulty of the service codes is reduced.

Description

交易数据处理方法及装置Transaction data processing method and device

技术领域Technical Field

本发明涉及计算机技术领域,特别涉及一种交易数据处理方法及装置。The present invention relates to the field of computer technology, and in particular to a transaction data processing method and device.

背景技术Background technique

随着科学技术的发展,互联网技术也得到长足发展,各种互联网应用服务层出不穷,使得人们可以通过这些应用服务进行各式各样的活动,例如,网上购物。用户可以足不出户,就能在电商平台上购买自己需要的商品,给用户带来了极大的便利。With the development of science and technology, Internet technology has also made great progress, and various Internet application services have emerged in an endless stream, allowing people to carry out various activities through these application services, such as online shopping. Users can buy the goods they need on the e-commerce platform without leaving home, which brings great convenience to users.

现有的电商平台中,通常将业务划分成不同模块,如:购物车模块,订单模块,支付模块等,然后在业务层将这些模块组织起来,使得这些模块严重耦合在一起,并将大量的逻辑判断编在代码中,增加了业务编码的难度,不利于业务程序的开发,导致电商平台系统的维护成本高。In existing e-commerce platforms, businesses are usually divided into different modules, such as shopping cart module, order module, payment module, etc., and then these modules are organized at the business layer, which makes these modules severely coupled together and compiles a large amount of logical judgments into the code, increasing the difficulty of business coding, which is not conducive to the development of business programs and leads to high maintenance costs of the e-commerce platform system.

发明内容Summary of the invention

本发明所要解决的技术问题是提供一种交易数据处理方法,降低电商平台中的业务代码的耦合度。The technical problem to be solved by the present invention is to provide a transaction data processing method to reduce the coupling degree of business codes in an e-commerce platform.

本发明还提供了一种交易数据处理装置,用以保证上述方法在实际中的实现及应用。The present invention also provides a transaction data processing device to ensure the implementation and application of the above method in practice.

一种交易数据处理方法,包括:A transaction data processing method, comprising:

响应于交易指令,获取所述交易指令中的交易数据;In response to a transaction instruction, acquiring transaction data in the transaction instruction;

应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;Applying a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline includes a plurality of business node valves arranged in sequence;

将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。The transaction data is input into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain the transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline serves as the input of the next business node valve.

上述的方法,可选的,所述应用预先设置的执行引擎创建所述交易指令对应的交易处理管道,包括:In the above method, optionally, the application of a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction includes:

调用所述执行引擎生成初始交易处理管道;Calling the execution engine to generate an initial transaction processing pipeline;

确定所述交易指令对应的交易流程;所述交易流程包含多个交易环节;Determine the transaction process corresponding to the transaction instruction; the transaction process includes multiple transaction links;

获取每个所述交易环节各自对应的业务节点阀;Obtaining the business node valve corresponding to each of the transaction links;

基于所述交易流程中的各个所述交易环节的执行顺序将各个所述业务节点阀添加至所述初始交易处理管道;Adding each of the business node valves to the initial transaction processing pipeline based on the execution order of each of the transaction links in the transaction process;

将已添加各个所述业务节点阀的初始交易处理管道作为所述交易指令对应的交易处理管道。The initial transaction processing pipeline to which each of the service node valves has been added is used as the transaction processing pipeline corresponding to the transaction instruction.

上述的方法,可选的,所述将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果,包括:In the above method, optionally, the step of inputting the transaction data into the transaction processing pipeline so that each of the service node valves in the transaction processing pipeline processes the transaction data in turn to obtain a transaction result corresponding to the transaction instruction includes:

创建所述交易处理管道对应的管道上行文,并为所述交易数据分配处理标识符;Creating a pipeline upstream document corresponding to the transaction processing pipeline and assigning a processing identifier to the transaction data;

将携带处理标识的交易数据存放至所述管道上下文,触发所述交易处理管道中的每个所述业务节点阀按其对应的执行顺序执行数据处理操作,每个所述业务节点阀执行所述数据处理操作的过程,包括:在所述管道上下文中获取该业务节点阀的输入,并对该输入进行处理,得到该业务节点阀对应的输出,将该业务节点阀的输出存放至所述管道上下文中;The transaction data carrying the processing identifier is stored in the pipeline context, and each of the service node valves in the transaction processing pipeline is triggered to perform the data processing operation in the corresponding execution order. The process of each of the service node valves performing the data processing operation includes: obtaining the input of the service node valve in the pipeline context, processing the input, obtaining the output corresponding to the service node valve, and storing the output of the service node valve in the pipeline context;

其中,所述携带处理标识的交易数据为所述交易处理管道中的首个业务节点阀的输入,将所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入,直至获取到所述交易处理管道中的最后一个业务节点阀的输出;The transaction data carrying the processing identifier is the input of the first service node valve in the transaction processing pipeline, and the output of each service node valve in the transaction processing pipeline is used as the input of the next service node valve until the output of the last service node valve in the transaction processing pipeline is obtained;

将所述交易处理管道中的最后一个业务节点阀的输出确定为所述交易指令对应的交易结果。The output of the last service node valve in the transaction processing pipeline is determined as the transaction result corresponding to the transaction instruction.

上述的方法,可选的,还包括:The above method may optionally further include:

当检测到任意一个所述业务节点阀对数据处理失败时,执行数据回滚操作,以重新获取该业务节点阀的输入,使得该业务节点阀重新对该输入进行处理。When it is detected that any of the service node valves fails to process data, a data rollback operation is performed to reacquire the input of the service node valve so that the service node valve processes the input again.

上述的方法,可选的,所述获取所述交易指令中的交易数据,包括:In the above method, optionally, the step of obtaining the transaction data in the transaction instruction includes:

对所述交易指令进行解析,获得所述交易指令中的指令信息;Parsing the transaction instruction to obtain instruction information in the transaction instruction;

在所述指令信息中获取到所述交易数据。The transaction data is obtained in the instruction information.

一种交易数据处理装置,包括:A transaction data processing device, comprising:

获取单元,用于响应于交易指令,获取所述交易指令中的交易数据;an acquisition unit, configured to acquire the transaction data in the transaction instruction in response to the transaction instruction;

创建单元,用于应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;A creation unit, configured to apply a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline comprises a plurality of sequentially arranged business node valves;

处理单元,用于将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。A processing unit is used to input the transaction data into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain a transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline serves as the input of the next business node valve.

上述的装置,可选的,所述创建单元,包括:In the above device, optionally, the creation unit includes:

生成子单元,用于调用所述执行引擎生成初始交易处理管道;A generating subunit, used for calling the execution engine to generate an initial transaction processing pipeline;

第一确定子单元,用于确定所述交易指令对应的交易流程;所述交易流程包含多个交易环节;A first determining subunit is used to determine a transaction process corresponding to the transaction instruction; the transaction process includes multiple transaction links;

第一获取子单元,用于获取获取每个所述交易环节各自对应的业务节点阀;A first acquisition subunit is used to acquire the business node valve corresponding to each of the transaction links;

第一执行子单元,用于基于所述交易流程中的各个所述交易环节的执行顺序将各个所述业务节点阀添加至所述初始交易处理管道;A first execution subunit, configured to add each of the business node valves to the initial transaction processing pipeline based on the execution order of each of the transaction links in the transaction process;

第二执行子单元,用于将已添加各个所述业务节点阀的初始交易处理管道作为所述交易指令对应的交易处理管道。The second execution subunit is used to use the initial transaction processing pipeline to which each of the service node valves has been added as the transaction processing pipeline corresponding to the transaction instruction.

上述的装置,可选的,所述处理单元,包括:In the above device, optionally, the processing unit includes:

创建子单元,用于创建所述交易处理管道对应的管道上行文,并为所述交易数据分配处理标识符;A creation subunit is used to create a pipeline upstream document corresponding to the transaction processing pipeline and allocate a processing identifier for the transaction data;

处理子单元,用于将携带处理标识的交易数据存放至所述管道上下文,触发所述交易处理管道中的每个所述业务节点阀按其对应的执行顺序执行数据处理操作,所述数据处理操作,包括:在所述管道上下文中获取该业务节点阀的输入,并对该输入进行处理,得到该业务节点阀对应的输出,将该业务节点阀的输出存放至所述管道上下文中;A processing subunit is used to store the transaction data carrying the processing identifier into the pipeline context, trigger each of the business node valves in the transaction processing pipeline to perform a data processing operation in a corresponding execution order, wherein the data processing operation includes: obtaining an input of the business node valve in the pipeline context, processing the input, obtaining an output corresponding to the business node valve, and storing the output of the business node valve into the pipeline context;

其中,所述携带处理标识的交易数据为所述交易处理管道中的首个业务节点阀的输入,将所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入,直至获取到所述交易处理管道中的最后一个业务节点阀的输出;The transaction data carrying the processing identifier is the input of the first service node valve in the transaction processing pipeline, and the output of each service node valve in the transaction processing pipeline is used as the input of the next service node valve until the output of the last service node valve in the transaction processing pipeline is obtained;

第二确定子单元,将所述交易处理管道中的最后一个业务节点阀的输出确定为所述交易指令对应的交易结果。The second determining subunit determines the output of the last service node valve in the transaction processing pipeline as the transaction result corresponding to the transaction instruction.

上述的装置,可选的,所述处理单元还包括检测子单元;In the above device, optionally, the processing unit further includes a detection subunit;

所述检测子单元,用于当检测到任意一个所述业务节点阀数据处理失败时,执行数据回滚操作,以重新获取该业务节点阀的输入,使得该业务节点阀重新对该输入进行处理。The detection subunit is used to perform a data rollback operation when it is detected that data processing of any of the service node valves fails, so as to re-acquire the input of the service node valve so that the service node valve re-processes the input.

上述的装置,可选的,所述接收单元,包括:In the above device, optionally, the receiving unit includes:

解析子单元,用于对所述交易指令进行解析,获得所述交易指令中的交易参数信息;A parsing subunit, used to parse the transaction instruction to obtain transaction parameter information in the transaction instruction;

第二获取子单元,用于在所述交易参数信息中获取到所述交易数据。The second acquisition subunit is used to acquire the transaction data from the transaction parameter information.

与现有技术相比,本发明包括以下优点:Compared with the prior art, the present invention has the following advantages:

本发明提供了一种交易数据处理方法和装置,该方法包括:响应于交易指令,获取所述交易指令中的交易数据;应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。应用本发明提供的方法,通过交易处理管道中的各个业务节点阀对交易数据进行处理,得到交易结果,实现各个业务节点阀之间的解耦,降低业务代码的编码难度,有利于业务程序的开发,降低了电商平台系统的维护成本。The present invention provides a transaction data processing method and device, the method comprising: in response to a transaction instruction, obtaining the transaction data in the transaction instruction; applying a pre-set execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline comprises a plurality of sequentially arranged business node valves; inputting the transaction data into the transaction processing pipeline so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain a transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline is used as the input of the next business node valve. By applying the method provided by the present invention, the transaction data is processed by each business node valve in the transaction processing pipeline to obtain a transaction result, thereby achieving decoupling between each business node valve, reducing the coding difficulty of the business code, facilitating the development of business programs, and reducing the maintenance cost of the e-commerce platform system.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

图1为本发明提供的一种交易数据处理方法的方法流程图;FIG1 is a flow chart of a transaction data processing method provided by the present invention;

图2为本发明提供的一种创建交易处理管道的过程的流程图;FIG2 is a flow chart of a process of creating a transaction processing pipeline provided by the present invention;

图3为本发明提供的一种获得交易结果的过程的流程图;FIG3 is a flow chart of a process for obtaining a transaction result provided by the present invention;

图4为本发明提供的一种交易数据处理装置的结构示意图;FIG4 is a schematic diagram of the structure of a transaction data processing device provided by the present invention;

图5为本发明提供的一种电子设备的结构示意图。FIG5 is a schematic diagram of the structure of an electronic device provided by the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

本发明可用于众多通用或专用的计算装置环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器装置、包括以上任何装置或设备的分布式计算环境等等。The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.

本发明实施例提供了一种交易数据处理方法,该方法可以应用在多种系统平台,其执行主体可以为计算机终端或各种移动设备的处理器,所述方法的方法流程图如图1所示,具体包括:The embodiment of the present invention provides a transaction data processing method, which can be applied to various system platforms, and the execution subject can be a processor of a computer terminal or various mobile devices. The method flow chart of the method is shown in FIG1, and specifically includes:

S101:响应于交易指令,获取所述交易指令中的交易数据。S101: In response to a transaction instruction, acquiring transaction data in the transaction instruction.

本发明实施例提供的方法中,该交易指令可以为用户在预先设置的可视化界面触发的,该交易数据可以为该交易指令对应的业务的业务参数。In the method provided by the embodiment of the present invention, the transaction instruction may be triggered by the user in a preset visual interface, and the transaction data may be a business parameter of the business corresponding to the transaction instruction.

S102:应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀。S102: Apply a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline includes a plurality of business node valves arranged in sequence.

本发明实施例提供的方法中,每一个业务节点阀均具有其对应的数据处理逻辑。In the method provided by the embodiment of the present invention, each service node valve has its corresponding data processing logic.

其中,交易处理管道中包含多个依次按执行顺序排序的业务节点阀,该执行顺序由该交易指令对应的交易流程确定。Among them, the transaction processing pipeline contains multiple business node valves sorted in order of execution, and the execution order is determined by the transaction process corresponding to the transaction instruction.

S103:将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。S103: Input the transaction data into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain the transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline serves as the input of the next business node valve.

本发明实施例提供的方法中,可以将每个业务节点阀的输出存放至该交易处理管道对应的缓存区域,以作为下一业务节点阀的输入;该缓存区域用于交易处理管道全生命周期上下文支撑,用于存储各个业务节点阀的输入和输出。In the method provided by an embodiment of the present invention, the output of each business node valve can be stored in the cache area corresponding to the transaction processing pipeline as the input of the next business node valve; the cache area is used for full life cycle context support of the transaction processing pipeline and is used to store the input and output of each business node valve.

本发明实施例提供的一种交易数据处理方法,该方法包括:响应于交易指令,获取所述交易指令中的交易数据;应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。应用本发明提供的方法,通过交易处理管道中的各个业务节点阀对交易数据进行处理,得到交易结果,实现各个业务节点阀之间的解耦,降低业务代码的编码难度,有利于业务程序的开发,降低了电商平台系统的维护成本。A transaction data processing method provided by an embodiment of the present invention comprises: in response to a transaction instruction, obtaining the transaction data in the transaction instruction; applying a pre-set execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline comprises a plurality of sequentially arranged business node valves; inputting the transaction data into the transaction processing pipeline so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain a transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline is used as the input of the next business node valve. By applying the method provided by the present invention, the transaction data is processed by each business node valve in the transaction processing pipeline to obtain a transaction result, thereby achieving decoupling between each business node valve, reducing the coding difficulty of the business code, facilitating the development of business programs, and reducing the maintenance cost of the e-commerce platform system.

本发明实施例提供的方法中,基于上述的实施过程,具体的,所述应用预先设置的执行引擎创建所述交易指令对应的交易处理管道,如图2所示,具体包括:In the method provided by the embodiment of the present invention, based on the above implementation process, specifically, the application pre-set execution engine creates a transaction processing pipeline corresponding to the transaction instruction, as shown in FIG2, specifically including:

S201:调用执行引擎生成初始交易处理管道。S201: Calling the execution engine to generate an initial transaction processing pipeline.

本发明实施例提供的方法中,该执行引擎预先设置有生成交易管道的逻辑,可以调用该执行引擎生成初始交易处理管道。In the method provided by the embodiment of the present invention, the execution engine is pre-set with logic for generating a transaction pipeline, and the execution engine can be called to generate an initial transaction processing pipeline.

S202:确定交易指令对应的交易流程;所述交易流程包含多个交易环节。S202: Determine a transaction process corresponding to the transaction instruction; the transaction process includes multiple transaction links.

本发明实施例提供的方法中,可以确定该交易指令中包含业务参数,基于该业务参数确定该交易指令对应的交易业务,在此情况下,可以在预先建立的交易流程集合中确定该交易业务对应的交易流程,也可以确定该交易业务所需的各个交易环节以及各个交易环节的执行顺序,由该交易业务所需的各个交易环节以及各个交易环节的执行顺序组成该交易流程。In the method provided in the embodiment of the present invention, it can be determined that the transaction instruction contains business parameters, and the transaction business corresponding to the transaction instruction can be determined based on the business parameters. In this case, the transaction process corresponding to the transaction business can be determined in a pre-established transaction process set, and the various transaction links required for the transaction business and the execution order of each transaction link can also be determined. The transaction process is composed of the various transaction links required for the transaction business and the execution order of each transaction link.

S203:获取每个交易环节各自对应的业务节点阀。S203: Obtain the business node valve corresponding to each transaction link.

本发明实施例提供的方法中,该交易环节可以为解析购物车、获取用户地址信息、出仓、拆单、合单、计算运费、使用优惠券、组装订单信息等等。In the method provided by the embodiment of the present invention, the transaction link can be parsing the shopping cart, obtaining user address information, shipping, splitting orders, combining orders, calculating shipping costs, using coupons, assembling order information, etc.

其中,每个交易环节均具有其对应的业务节点阀,该业务节点阀被预先配置为执行该交易环节对应的处理逻辑,其中,每个所述业务节点阀均设置有触发器,该触发器用于决定是否执行该业务节点阀,触发器的触发条件依据该交易业务的业务需求进行设定。Among them, each transaction link has its corresponding business node valve, which is pre-configured to execute the processing logic corresponding to the transaction link, wherein each of the business node valves is provided with a trigger, which is used to determine whether to execute the business node valve, and the triggering condition of the trigger is set according to the business requirements of the transaction business.

S204:基于交易流程中的各个交易环节的执行顺序将各个业务节点阀添加至初始交易处理管道。S204: adding each business node valve to the initial transaction processing pipeline based on the execution order of each transaction link in the transaction process.

本发明实施例提供的方法中,该交易流程定义了各个交易环节之间的执行顺序,将各个业务节点阀添加至该初始交易处理管道,使得各个业务节点阀也按该执行顺序进行数据处理。In the method provided by the embodiment of the present invention, the transaction process defines the execution order between various transaction links, and each business node valve is added to the initial transaction processing pipeline, so that each business node valve also processes data according to the execution order.

S205:将已添加各个业务节点阀的初始交易处理管道作为交易指令对应的交易处理管道。S205: The initial transaction processing pipeline to which each service node valve has been added is used as the transaction processing pipeline corresponding to the transaction instruction.

应用本发明实施例提供的方法,通过配置,可以将相应的业务节点阀动态组合,以支撑新的交易流程,同时支持动态添加业务节点,装配到对应流程,满足业务扩展性要求,将业务点深度解耦,实现了灵活可变的交易流程技术支撑体系。By applying the method provided in the embodiment of the present invention, the corresponding business node valves can be dynamically combined through configuration to support new transaction processes. At the same time, it supports dynamic addition of business nodes and assembling them into corresponding processes to meet business scalability requirements, deeply decouple business points, and realize a flexible and variable transaction process technical support system.

本发明实施例提供的方法中,基于上述的实施过程,具体的,所述将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果,如图3所示,具体包括:In the method provided by the embodiment of the present invention, based on the above implementation process, specifically, the transaction data is input into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain the transaction result corresponding to the transaction instruction, as shown in FIG3, specifically including:

S301:创建交易处理管道对应的管道上行文,并为交易数据分配处理标识符。S301: Create a pipeline upstream document corresponding to the transaction processing pipeline and assign a processing identifier to the transaction data.

本发明实施例提供的方法中,该处理标识符可以用于触发交易处理管道对该交易数据进行处理,也可以用于记录该交易数据的处理流程,以便于交易数据处理管道中的业务节点阀数据处理失败时,基于该处理标识进行数据回滚。In the method provided by an embodiment of the present invention, the processing identifier can be used to trigger the transaction processing pipeline to process the transaction data, and can also be used to record the processing flow of the transaction data, so that when the business node valve data processing in the transaction data processing pipeline fails, data can be rolled back based on the processing identifier.

S302:将携带处理标识的交易数据存放至所述管道上下文,触发交易处理管道中的每个业务节点阀按其对应的执行顺序执行数据处理操作,每个业务节点阀执行数据处理操作的过程,包括:在管道上下文中获取该业务节点阀的输入,并对该输入进行处理,得到该业务节点阀对应的输出,将该业务节点阀的输出存放至管道上下文中。S302: Storing the transaction data carrying the processing identifier into the pipeline context, triggering each business node valve in the transaction processing pipeline to perform data processing operations in its corresponding execution order. The process of each business node valve performing the data processing operation includes: obtaining the input of the business node valve in the pipeline context, processing the input, obtaining the output corresponding to the business node valve, and storing the output of the business node valve in the pipeline context.

其中,携带处理标识的交易数据为交易处理管道中的首个业务节点阀的输入,将交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入,直至获取到交易处理管道中的最后一个业务节点阀的输出。Among them, the transaction data carrying the processing identifier is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline is used as the input of the next business node valve until the output of the last business node valve in the transaction processing pipeline is obtained.

本发明实施例提供的方法中,该管道上下文可以用于存储各个业务节点阀的输入和输出,每个业务节点阀的输入和输出与该处理标识符相对应。In the method provided by the embodiment of the present invention, the pipeline context can be used to store the input and output of each service node valve, and the input and output of each service node valve corresponds to the processing identifier.

具体的,每个业务节点阀按其对应的处理逻辑处理该业务节点阀的输入,从而得到该业务节点阀的输出。Specifically, each service node valve processes the input of the service node valve according to its corresponding processing logic, thereby obtaining the output of the service node valve.

其中,每个业务节点阀可以通过输入获取模块获取该业务节点阀的输入。Each service node valve may obtain the input of the service node valve through an input acquisition module.

S303:将交易处理管道中的最后一个业务节点阀的输出确定为交易指令对应的交易结果。S303: Determine the output of the last service node valve in the transaction processing pipeline as the transaction result corresponding to the transaction instruction.

应用本发明实施例提供的方法,能够基于各个业务节点阀的次序依赖,来组织各个业务节点阀完成交易数据的处理,得到交易结果。By applying the method provided in the embodiment of the present invention, it is possible to organize each service node valve to complete the processing of transaction data based on the order dependency of each service node valve to obtain a transaction result.

本发明实施例提供的方法中,基于上述的实施过程,具体的,还包括:The method provided in the embodiment of the present invention, based on the above implementation process, specifically, also includes:

当检测到任意一个所述业务节点阀对数据处理失败时,执行数据回滚操作,以重新获取该业务节点阀的输入,使得该业务节点阀重新对该输入进行处理。When it is detected that any of the service node valves fails to process data, a data rollback operation is performed to reacquire the input of the service node valve so that the service node valve processes the input again.

本发明实施例提供的方法中,业务节点阀可以包含异常回滚模块,用于检测该业务节点阀是否对其的输入处理失败,若处理失败,则进行数据回滚,以返回当前业务节点阀获取输入的步骤,或者返回该业务节点阀的前N个业务节点阀的获取输入的步骤。In the method provided by an embodiment of the present invention, the business node valve may include an abnormal rollback module for detecting whether the business node valve fails to process its input. If the processing fails, data is rolled back to return to the step of obtaining input by the current business node valve, or to the step of obtaining input by the first N business node valves of the business node valve.

本发明实施例提供的方法中,基于上述的实施过程,具体的,所述获取所述交易指令中的交易数据,包括:In the method provided by the embodiment of the present invention, based on the above implementation process, specifically, obtaining the transaction data in the transaction instruction includes:

对所述交易指令进行解析,获得所述交易指令中的指令信息;Parsing the transaction instruction to obtain instruction information in the transaction instruction;

在所述指令信息中获取到所述交易数据。The transaction data is obtained in the instruction information.

本发明实施例提供的方法中,该指令信息可以包括交易数据以及该交易数据对应的交易业务标识等,该交易数据可以为该交易业务标识对应的交易业务的业务参数。In the method provided by the embodiment of the present invention, the instruction information may include transaction data and a transaction service identifier corresponding to the transaction data, etc. The transaction data may be a service parameter of the transaction service corresponding to the transaction service identifier.

在本发明提供的一实施例中,为了实现交易代码的解耦,下面进行详细说明:In one embodiment provided by the present invention, in order to achieve the decoupling of the transaction code, the following is a detailed description:

第一、设计点-交易流程节点业务模型抽象方案-阀;可以通过管道阀模型抽象交易流程各个复杂的交易环节,基于每个交易环节的单一职责抽象:First, the design point - transaction process node business model abstraction scheme - valve; the pipeline valve model can be used to abstract the various complex transaction links of the transaction process, based on the single responsibility abstraction of each transaction link:

(1)可以设置交易环节对应的业务节点阀的接口,该接口可以为Valve接口,用于定义invoke调用方法和阀的执行顺序的setter方法和getter方法。(1) An interface of a business node valve corresponding to a transaction link may be set. The interface may be a Valve interface, which is used to define the setter method and getter method of the invoke method and the execution order of the valve.

(2)确定阀抽象类,其中,阀抽象类为AbstractValve类,实现了Valve接口,同时定义了抽象方法:isFilter用于控制是否执行该阀,bizHandler为阀核心业务逻辑处理函数,rollbackAdd用于执行失败追加到回滚链,successAdd用于执行成功追加到成功链。(2) Determine the valve abstract class, where the valve abstract class is the AbstractValve class, which implements the Valve interface and defines abstract methods: isFilter is used to control whether the valve is executed, bizHandler is the valve core business logic processing function, rollbackAdd is used to append execution failure to the rollback chain, and successAdd is used to append execution success to the success chain.

(3)OrderBasicValve、OrderProdValve等是阀的具体实现类,是业务节点的实际模型,各自承载着单一的职责。(3) OrderBasicValve, OrderProdValve, etc. are specific implementation classes of valves, which are actual models of business nodes and each carries a single responsibility.

第二、设计线-单个交易场景流程链式组织方案-管道;可以应用管道针对交易的某一单一流程场景进行组织,设置管道上下文,管道接口,管道实现三大部分:Second, design line - single transaction scenario process chain organization scheme - pipeline; pipeline can be used to organize a single process scenario of the transaction, set pipeline context, pipeline interface, pipeline implementation three parts:

(1)设置管道上下文,其中,该管道上下文可以为AbstractPipelineContext,可以用于交易流程管道全生命周期上下文支撑,存储各业务节点阀的执行请求和相应状态。(1) Setting a pipeline context, wherein the pipeline context may be AbstractPipelineContext, which may be used for context support of the entire life cycle of a transaction process pipeline and store execution requests and corresponding states of valves at each business node.

(2)设置管道接口,其中,该管道接口可以为Pipeline接口,该接口定义了业务调用链和维护该链的一些方法包含添加头尾以及中间业务节点等。(2) Setting a pipeline interface, wherein the pipeline interface may be a Pipeline interface, which defines a service call chain and some methods for maintaining the chain, including adding a head, a tail, and intermediate service nodes.

(3)PipelineImpl为Pipeline接口的实现,实现了具体逻辑。(3) PipelineImpl is the implementation of the Pipeline interface and implements the specific logic.

第三、设计面-交易流程全场景支撑方案-管道流;交易流程从执行引擎开始,到进入对应业务管道,根据配置的业务节点阀,调用对应的业务节点逻辑,到整个交易流程生命周期结束,在异常情况会触发对应的回滚链逻辑,执行引擎统一进行回滚。整个框架支撑动态的组织了整个业务链,提供了低耦合,高扩展的特性。Third, the design aspect - the full-scenario support solution for the transaction process - pipeline flow; the transaction process starts from the execution engine, enters the corresponding business pipeline, calls the corresponding business node logic according to the configured business node valve, and ends the entire transaction process life cycle. In the event of an abnormal situation, the corresponding rollback chain logic will be triggered, and the execution engine will roll back uniformly. The entire framework supports the dynamic organization of the entire business chain, providing low coupling and high scalability features.

与图1所述的方法相对应,本发明实施例还提供了一种交易数据处理装置,用于对图1中方法的具体实现,本发明实施例提供的交易数据处理装置可以应用于计算机终端或各种移动设备中,其结构示意图如图4所示,具体包括:Corresponding to the method described in FIG. 1 , an embodiment of the present invention further provides a transaction data processing device for implementing the method described in FIG. 1 . The transaction data processing device provided in the embodiment of the present invention can be applied to a computer terminal or various mobile devices. The schematic diagram of the structure is shown in FIG. 4 , and specifically includes:

获取单元401,用于响应于交易指令,获取所述交易指令中的交易数据;The acquisition unit 401 is used to acquire the transaction data in the transaction instruction in response to the transaction instruction;

创建单元402,用于应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;A creation unit 402 is used to apply a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline includes a plurality of sequentially arranged business node valves;

处理单元403,用于将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。The processing unit 403 is used to input the transaction data into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain the transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline serves as the input of the next business node valve.

在本发明实施例提供的一实施例中,基于上述的方案,具体的,所述创建单元402,包括:In an embodiment provided by an embodiment of the present invention, based on the above solution, specifically, the creating unit 402 includes:

生成子单元,用于调用所述执行引擎生成初始交易处理管道;A generating subunit, used for calling the execution engine to generate an initial transaction processing pipeline;

第一确定子单元,用于确定所述交易指令对应的交易流程;所述交易流程包含多个交易环节;A first determining subunit is used to determine a transaction process corresponding to the transaction instruction; the transaction process includes multiple transaction links;

第一获取子单元,用于获取获取每个所述交易环节各自对应的业务节点阀;A first acquisition subunit is used to acquire the business node valve corresponding to each of the transaction links;

第一执行子单元,用于基于所述交易流程中的各个所述交易环节的执行顺序将各个所述业务节点阀添加至所述初始交易处理管道;A first execution subunit, configured to add each of the business node valves to the initial transaction processing pipeline based on the execution order of each of the transaction links in the transaction process;

第二执行子单元,用于将已添加各个所述业务节点阀的初始交易处理管道作为所述交易指令对应的交易处理管道。The second execution subunit is used to use the initial transaction processing pipeline to which each of the service node valves has been added as the transaction processing pipeline corresponding to the transaction instruction.

在本发明实施例提供的一实施例中,基于上述的方案,具体的,所述处理单元403,包括:In an embodiment provided by the embodiment of the present invention, based on the above solution, specifically, the processing unit 403 includes:

创建子单元,用于创建所述交易处理管道对应的管道上行文,并为所述交易数据分配处理标识符;A creation subunit is used to create a pipeline upstream document corresponding to the transaction processing pipeline and allocate a processing identifier for the transaction data;

处理子单元,用于将携带处理标识的交易数据存放至所述管道上下文,触发所述交易处理管道中的每个所述业务节点阀按其对应的执行顺序执行数据处理操作,所述数据处理操作,包括:在所述管道上下文中获取该业务节点阀的输入,并对该输入进行处理,得到该业务节点阀对应的输出,将该业务节点阀的输出存放至所述管道上下文中;A processing subunit is used to store the transaction data carrying the processing identifier into the pipeline context, trigger each of the business node valves in the transaction processing pipeline to perform a data processing operation in a corresponding execution order, wherein the data processing operation includes: obtaining an input of the business node valve in the pipeline context, processing the input, obtaining an output corresponding to the business node valve, and storing the output of the business node valve into the pipeline context;

其中,所述携带处理标识的交易数据为所述交易处理管道中的首个业务节点阀的输入,将所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入,直至获取到所述交易处理管道中的最后一个业务节点阀的输出;The transaction data carrying the processing identifier is the input of the first service node valve in the transaction processing pipeline, and the output of each service node valve in the transaction processing pipeline is used as the input of the next service node valve until the output of the last service node valve in the transaction processing pipeline is obtained;

第二确定子单元,将所述交易处理管道中的最后一个业务节点阀的输出确定为所述交易指令对应的交易结果。The second determining subunit determines the output of the last service node valve in the transaction processing pipeline as the transaction result corresponding to the transaction instruction.

在本发明实施例提供的一实施例中,基于上述的方案,具体的,所述处理单元403还包括检测子单元;In an embodiment provided by the embodiment of the present invention, based on the above solution, specifically, the processing unit 403 further includes a detection subunit;

所述检测子单元,用于当检测到任意一个所述业务节点阀数据处理失败时,执行数据回滚操作,以重新获取该业务节点阀的输入,使得该业务节点阀重新对该输入进行处理。The detection subunit is used to perform a data rollback operation when it is detected that data processing of any of the service node valves fails, so as to re-acquire the input of the service node valve so that the service node valve re-processes the input.

在本发明实施例提供的一实施例中,基于上述的方案,具体的,所述接收单元401,包括:In an embodiment provided by the embodiment of the present invention, based on the above solution, specifically, the receiving unit 401 includes:

解析子单元,用于对所述交易指令进行解析,获得所述交易指令中的交易参数信息;A parsing subunit, used to parse the transaction instruction to obtain transaction parameter information in the transaction instruction;

第二获取子单元,用于在所述交易参数信息中获取到所述交易数据。The second acquisition subunit is used to acquire the transaction data from the transaction parameter information.

上述本发明实施例公开的交易数据处理装置中的各个单元和模块具体的原理和执行过程,与上述本发明实施例公开的交易数据处理方法相同,可参见上述本发明实施例提供的交易数据处理方法中相应的部分,这里不再进行赘述。The specific principles and execution processes of each unit and module in the transaction data processing device disclosed in the above embodiment of the present invention are the same as the transaction data processing method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the transaction data processing method provided in the above embodiment of the present invention, and will not be repeated here.

本发明实施例还提供了一种存储介质,所述存储介质包括存储的指令,其中,在所述指令运行时控制所述存储介质所在的设备执行上述交易数据处理方法。An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned transaction data processing method.

本发明实施例还提供了一种电子设备,其结构示意图如图5所示,具体包括存储器501,以及一个或者一个以上的指令502,其中一个或者一个以上指令502存储于存储器501中,且经配置以由一个或者一个以上处理器503执行所述一个或者一个以上指令502进行以下操作:An embodiment of the present invention further provides an electronic device, the structure diagram of which is shown in FIG5 , which specifically includes a memory 501 and one or more instructions 502, wherein the one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the following operations:

响应于交易指令,获取所述交易指令中的交易数据;In response to a transaction instruction, acquiring transaction data in the transaction instruction;

应用预先设置的执行引擎创建所述交易指令对应的交易处理管道;所述交易处理管道包含多个依次排序的业务节点阀;Applying a preset execution engine to create a transaction processing pipeline corresponding to the transaction instruction; the transaction processing pipeline includes a plurality of business node valves arranged in sequence;

将所述交易数据输入至所述交易处理管道,使得所述交易处理管道中的每个所述业务节点阀依次对所述交易数据进行处理,得到所述交易指令对应的交易结果;其中,所述交易数据为所述交易处理管道中的首个业务节点阀的输入,所述交易处理管道中的每个业务节点阀的输出作为下一业务节点阀的输入。The transaction data is input into the transaction processing pipeline, so that each of the business node valves in the transaction processing pipeline processes the transaction data in turn to obtain the transaction result corresponding to the transaction instruction; wherein the transaction data is the input of the first business node valve in the transaction processing pipeline, and the output of each business node valve in the transaction processing pipeline serves as the input of the next business node valve.

需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本发明时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and/or hardware.

通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。It can be known from the description of the above implementation mode that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or some parts of the embodiments.

以上对本发明所提供的一种交易数据处理方法进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The transaction data processing method provided by the present invention is introduced in detail above. The principle and implementation mode of the present invention are explained in this article by using specific examples. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims (10)

1. A transaction data processing method, comprising:
responding to a transaction instruction, and acquiring transaction data in the transaction instruction;
Creating a transaction processing pipeline corresponding to the transaction instruction by using a preset execution engine; the transaction processing pipeline comprises a plurality of service node valves which are sequentially ordered according to the execution sequence; the execution sequence of each service node valve is determined by a transaction flow corresponding to the transaction data, and the transaction flow comprises a plurality of transaction links; each service node valve is provided with data processing logic corresponding to the transaction link; the transaction link of each transaction flow comprises shopping carts, user address information acquisition, delivery, bill disassembly, bill combination, freight fee calculation, coupon use and order information assembly; each service node valve is provided with a trigger for determining whether to execute the service node valve; the trigger condition of the trigger is set according to the business requirement of the transaction business;
Inputting the transaction data into the transaction processing pipeline, so that each service node valve in the transaction processing pipeline processes the transaction data in sequence to obtain a transaction result corresponding to the transaction instruction; the transaction data is input of a first service node valve in the transaction processing pipeline, output of each service node valve in the transaction processing pipeline is stored in a buffer area corresponding to the transaction processing pipeline and used as input of a next service node valve, and the buffer area is used for supporting the full life cycle context of the transaction processing pipeline.
2. The method of claim 1, wherein the creating, by the execution engine preset by the application, a transaction processing pipeline corresponding to the transaction instruction includes:
Invoking the execution engine to generate an initial transaction processing pipeline;
Determining a transaction flow corresponding to the transaction instruction;
Acquiring service node valves corresponding to each transaction link;
Adding each service node valve to the initial transaction processing pipeline based on the execution sequence of each transaction link in the transaction flow;
and taking the initial transaction processing pipeline added with each service node valve as a transaction processing pipeline corresponding to the transaction instruction.
3. The method of claim 1, wherein the inputting the transaction data into the transaction processing pipeline, such that each service node valve in the transaction processing pipeline processes the transaction data in turn, obtains a transaction result corresponding to the transaction instruction, comprises:
creating a pipeline context corresponding to the transaction processing pipeline, and distributing a processing identifier for the transaction data;
Storing transaction data carrying a processing identifier to the pipeline context, triggering each service node valve in the transaction processing pipeline to execute data processing operation according to the corresponding execution sequence, and executing the data processing operation by each service node valve, wherein the process comprises the following steps: acquiring the input of the service node valve in the pipeline context, processing the input to obtain the output corresponding to the service node valve, and storing the output of the service node valve in the pipeline context;
The transaction data carrying the processing identifier is input of a first service node valve in the transaction processing pipeline, and output of each service node valve in the transaction processing pipeline is used as input of a next service node valve until output of a last service node valve in the transaction processing pipeline is obtained;
and determining the output of the last service node valve in the transaction processing pipeline as a transaction result corresponding to the transaction instruction.
4. A method according to claim 3, further comprising:
and when any service node valve is detected to fail in data processing, executing data rollback operation to reacquire the input of the service node valve, so that the service node valve can process the input again.
5. The method of claim 1, wherein the obtaining transaction data in the transaction instructions comprises:
analyzing the transaction instruction to obtain instruction information in the transaction instruction;
and acquiring the transaction data from the instruction information.
6. A transaction data processing device, comprising:
The acquisition unit is used for responding to the transaction instruction and acquiring transaction data in the transaction instruction;
The creation unit is used for creating a transaction processing pipeline corresponding to the transaction instruction by applying a preset execution engine; the transaction processing pipeline comprises a plurality of service node valves which are sequentially ordered according to the execution sequence; the execution sequence of each service node valve is determined by a transaction flow corresponding to the transaction data, and the transaction flow comprises a plurality of transaction links; each service node valve is provided with data processing logic corresponding to the transaction link; the transaction link of each transaction flow comprises shopping carts, user address information acquisition, delivery, bill disassembly, bill combination, freight fee calculation, coupon use and order information assembly; each service node valve is provided with a trigger for determining whether to execute the service node valve; the trigger condition of the trigger is set according to the business requirement of the transaction business;
The processing unit is used for inputting the transaction data into the transaction processing pipeline, so that each service node valve in the transaction processing pipeline sequentially processes the transaction data to obtain a transaction result corresponding to the transaction instruction; the transaction data is input of a first service node valve in the transaction processing pipeline, output of each service node valve in the transaction processing pipeline is stored in a buffer area corresponding to the transaction processing pipeline and used as input of a next service node valve, and the buffer area is used for supporting the full life cycle context of the transaction processing pipeline.
7. The apparatus of claim 6, wherein the creation unit comprises:
a generating subunit, configured to invoke the execution engine to generate an initial transaction processing pipeline;
The first determining subunit is used for determining a transaction flow corresponding to the transaction instruction;
the first acquisition subunit is used for acquiring the service node valve corresponding to each transaction link;
a first execution subunit, configured to add each service node valve to the initial transaction processing pipeline based on an execution order of each transaction link in the transaction flow;
And the second execution subunit is used for taking the initial transaction processing pipeline added with each service node valve as the transaction processing pipeline corresponding to the transaction instruction.
8. The apparatus of claim 6, wherein the processing unit comprises:
A creation subunit, configured to create a pipeline context corresponding to the transaction processing pipeline, and allocate a processing identifier to the transaction data;
the processing subunit is configured to store transaction data carrying a processing identifier into the pipeline context, and trigger each service node valve in the transaction processing pipeline to execute a data processing operation according to a corresponding execution sequence, where the data processing operation includes: acquiring the input of the service node valve in the pipeline context, processing the input to obtain the output corresponding to the service node valve, and storing the output of the service node valve in the pipeline context;
The transaction data carrying the processing identifier is input of a first service node valve in the transaction processing pipeline, and output of each service node valve in the transaction processing pipeline is used as input of a next service node valve until output of a last service node valve in the transaction processing pipeline is obtained;
And the second determining subunit determines the output of the last service node valve in the transaction processing pipeline as a transaction result corresponding to the transaction instruction.
9. The apparatus of claim 8, wherein the processing unit further comprises a detection subunit;
And the detection subunit is used for executing data rollback operation when detecting that any service node valve fails to process data so as to reacquire the input of the service node valve, so that the service node valve can process the input again.
10. The apparatus of claim 6, wherein the acquisition unit comprises:
the analysis subunit is used for analyzing the transaction instruction to obtain transaction parameter information in the transaction instruction;
and the second acquisition subunit is used for acquiring the transaction data in the transaction parameter information.
CN202011016374.4A 2020-09-24 2020-09-24 Transaction data processing method and device Active CN111932234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011016374.4A CN111932234B (en) 2020-09-24 2020-09-24 Transaction data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011016374.4A CN111932234B (en) 2020-09-24 2020-09-24 Transaction data processing method and device

Publications (2)

Publication Number Publication Date
CN111932234A CN111932234A (en) 2020-11-13
CN111932234B true CN111932234B (en) 2024-07-12

Family

ID=73334172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011016374.4A Active CN111932234B (en) 2020-09-24 2020-09-24 Transaction data processing method and device

Country Status (1)

Country Link
CN (1) CN111932234B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112700310B (en) * 2021-01-19 2021-09-07 汇通数科智能科技有限公司 Transaction order data optimization processing method based on E-commerce platform

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142925A (en) * 2019-12-23 2020-05-12 山东浪潮通软信息科技有限公司 Pipeline type data processing method, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8650151B2 (en) * 2011-01-24 2014-02-11 International Business Machines Corporation Transactional service pipeline
CN103810088B (en) * 2012-11-09 2017-06-09 阿里巴巴集团控股有限公司 The business valve method of testing and device of a kind of business pipeline
US10762479B2 (en) * 2017-04-05 2020-09-01 Samsung Sds Co., Ltd. Method and system for processing blockchain-based real-time transaction
CN108171494A (en) * 2017-11-23 2018-06-15 阿里巴巴集团控股有限公司 A kind of data processing method and device
CN109360092A (en) * 2018-08-31 2019-02-19 中国平安人寿保险股份有限公司 Transaction node configuration method, device and computer equipment
CN109584060A (en) * 2018-10-15 2019-04-05 平安科技(深圳)有限公司 Processing method, device and the computer equipment and storage medium of timing transaction task
CN109918216A (en) * 2019-03-07 2019-06-21 山东浪潮通软信息科技有限公司 A kind of data processing method and system based on pipeline

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142925A (en) * 2019-12-23 2020-05-12 山东浪潮通软信息科技有限公司 Pipeline type data processing method, equipment and storage medium

Also Published As

Publication number Publication date
CN111932234A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN108520454B (en) Method and system for calling back orders in real time
US9465725B2 (en) Software defect reporting
CN108628605A (en) Stream data processing method, device, server and medium
CN111782207B (en) Task stream code generation method, device, equipment and storage medium
CN111598575A (en) Business process control method and device, electronic equipment and readable storage medium
CN112346794A (en) Interface calling method, device, equipment and medium
CN108111554A (en) A kind of control method and device of access queue
CN113449022A (en) Method and device for processing service request
CN113392002B (en) Test system construction method, device, equipment and storage medium
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN111932234B (en) Transaction data processing method and device
CN113835780A (en) Incident response method and device
CN111427578B (en) Data conversion method, device and equipment
CN114428723A (en) Test system, system test method, related device and storage medium
US8751643B2 (en) Correlating event streams from independent processes in a complex business system using metadata associated with the transport interconnections
CN113901773B (en) Data accounting method, device, electronic equipment and storage medium
CN117273177A (en) Service processing method, device, electronic equipment and computer readable medium
CN113763094B (en) A business information processing method, device, server, medium and system
CN110740178B (en) Application service processing system and application service processing method
CN113300895A (en) Cable processing method and system and computing device
CN115134228B (en) Environmental link supply and detection method, device, equipment, medium and program product
US20070118652A1 (en) Bundling and sending work units to a server based on a weighted cost
CN115361446A (en) Transaction message processing method and device, storage medium and electronic equipment
CN116910034A (en) A data migration method, device, equipment and readable storage medium
CN112001715B (en) Application method and system of distributed front-end tool

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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: No. 308 Guang'anmen Inner Street, Xicheng District, Beijing, 100053

Applicant after: State Grid Digital Technology Holdings Co.,Ltd.

Applicant after: State Grid E-Commerce Technology Co.,Ltd.

Address before: 311 guanganmennei street, Xicheng District, Beijing 100053

Applicant before: STATE GRID ELECTRONIC COMMERCE Co.,Ltd.

Country or region before: China

Applicant before: State Grid E-Commerce Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant