WO2020259035A1 - 一种业务代码的生成、执行方法及装置 - Google Patents

一种业务代码的生成、执行方法及装置 Download PDF

Info

Publication number
WO2020259035A1
WO2020259035A1 PCT/CN2020/085724 CN2020085724W WO2020259035A1 WO 2020259035 A1 WO2020259035 A1 WO 2020259035A1 CN 2020085724 W CN2020085724 W CN 2020085724W WO 2020259035 A1 WO2020259035 A1 WO 2020259035A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
class
sub
code
command
Prior art date
Application number
PCT/CN2020/085724
Other languages
English (en)
French (fr)
Inventor
汤金林
李晶
彭荣杰
王顺云
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2020259035A1 publication Critical patent/WO2020259035A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Definitions

  • the present invention relates to the field of financial technology (Fintech), in particular to a method and device for generating and executing business codes.
  • An existing code generation method is: by building a business scaffolding code tool, the template can be used to automatically generate code.
  • This method is suitable for simple single-table services, and can quickly generate front-end interactive pages and back-end logic processing codes according to the database table structure.
  • multiple business processes may be involved, and business processes may be added or deleted.
  • opening a bank account involves multiple steps such as opening a card, setting up a secret, opening an account, binding contact information, and depositing an ID card image. Therefore, opening a bank account involves interaction issues between different systems.
  • the code tools in the prior art cannot automatically generate codes for complex business scenarios.
  • the present invention provides a method and device for generating and executing business codes, which are used to realize the generation of business codes in complex business scenarios.
  • the present invention provides a method for generating a service code.
  • the service includes multiple sub-services, and each sub-service has its own corresponding sub-service code; the method includes:
  • the command class is used to call the sub-service code; according to the preset execution sequence, the sub-service code
  • the command class composes the business combination class as the business code.
  • the business is divided into multiple sub-businesses according to business requirements, and command classes of each sub-business code are created respectively.
  • the command classes of each sub-business code are used to call the business codes of each sub-business and combine multiple command classes. It is a business combination class, which is used to call sub-business codes in sequence during business execution.
  • the present invention provides a service code execution method, the service includes multiple sub-services, and each sub-service has its corresponding sub-service code; the method includes:
  • the context class is used to record the input parameters and output parameters of the sub-service code during execution.
  • the command class is used to call the corresponding sub-service code; further, according to a preset execution order, the command classes of each sub-service code are formed into a service combination class as the service code; when the code is received After executing the instruction, control each of the command classes included in the service code to call its corresponding sub-service code one by one as the target code, and after bringing the input parameters contained in its associated context class into the target code, execute The target code stores the output result of the target code as the output parameter in the context class.
  • the business is divided into multiple sub-businesses according to business requirements, and the command classes of each sub-business code are created respectively.
  • the command classes of each sub-business code are used to call the business code of each sub-business, and the The command class is combined into a business combination class, and a context class is created at the same time.
  • the context class is used to record the input parameters and output parameters of the sub-business code during execution, and to associate the context class with each sub-business code.
  • the target code In the execution process of the business code, by controlling each command class to call its corresponding sub-business code as the target code, and after bringing the input parameters contained in its associated context class into the target code, the target code is executed so that the The method can implement business code execution in complex business scenarios, and can delete and adjust each sub-business in the business, execute the business according to the adjusted business code, and improve the flexibility of business execution.
  • the sub-service code corresponding to at least one sub-service in each sub-service is generated based on at least one inheritance class;
  • the command class for generating the sub-service code includes: receiving the inheritance of the sub-service code Class indication information, context type indication information and indication information of the sub-service code to generate the command class of the sub-service code.
  • the inheritance type indication information of the sub-service code is used to determine the inheritance type of the sub-service code.
  • the redundancy of the sub-service code can be reduced, and the error of the sub-service code can be reduced. Probability.
  • the context type indication information is used to associate with the command type of the sub-service code. In this way, the indication information of the sub-service code can be used to associate the sub-service code, so that when the service code is executed, the corresponding command type can be directly called As the target code.
  • a new addition instruction is also received, and the new addition instruction includes the command class to be added; further, the command class to be added
  • the command class of is added to the service combination class, and the context class is updated according to the input parameters and output parameters of the command class to be added.
  • a deletion instruction is received, and the deletion instruction includes the command class to be deleted; and the command class to be deleted is removed from the Deleted from the business portfolio class.
  • an adjustment instruction is further received, and the adjustment instruction includes the command class to be adjusted; according to the adjustment instruction, the service is adjusted The sequence of the command classes to be adjusted in the combined class; and the context class is updated according to the input parameters and output parameters of the command classes to be adjusted.
  • the code execution method can support one or more of the user's new instructions, delete instructions, and adjustment instructions, so as to realize the adjustment of each sub-business in the business and meet the needs of users for complex business processes , Improve the user experience.
  • the present invention also provides a service code generation device, the service includes multiple sub-services, each sub-service has its corresponding sub-service code; the device includes:
  • a processing unit configured to receive generation parameters of the service code, and generate command classes of each of the sub-service codes according to the generated parameters, and the command classes are used to call the sub-service codes;
  • the combination unit is used to group the command classes of each sub-service code into a service combination class according to a preset execution sequence, as the service code.
  • the present invention also provides a service code execution device, the service includes multiple sub-services, and each sub-service has its corresponding sub-service code; the device includes:
  • the processing unit is configured to create a context class of the business after receiving the generation parameters of the business code, and generate the command class of each of the sub-service codes, and the context class is used to record the input parameters of the sub-service code during execution And output parameters, the command class is used to call the corresponding sub-service code;
  • a combination unit configured to group the command classes of each of the sub-service codes into a service combination class according to a preset execution sequence, as the service code
  • the execution unit is used to control each of the command classes contained in the service code to call its corresponding sub-service code as the target code after receiving the code execution instruction, and to include the input parameters in the context class to which it is associated After bringing in the target code, execute the target code; and store the output result of the target code as the output parameter in the context class.
  • the sub-service code corresponding to at least one sub-service in each sub-service is generated based on at least one inheritance class; the processing unit is specifically configured to: receive inheritance class indication information and context of the sub-service code The category indication information and the indication information of the sub-service code generate the command class of the sub-service code.
  • the combination unit is further configured to: after the command classes of each of the sub-service codes are formed into a service combination class, receive a new instruction, where the new instruction includes the command class to be added; The command class to be added is added to the service combination class, and the context class is updated according to the input parameters and output parameters of the command class to be added.
  • the combination unit is further configured to: after the command classes of each sub-service code are formed into a service combination class, receive a deletion instruction, where the deletion instruction includes the command class to be deleted; The command class to be deleted is deleted from the business combination class.
  • the combination unit is further configured to: after the command classes of each of the sub-service codes are formed into a service combination class, receive an adjustment instruction, where the adjustment instruction includes the command class to be adjusted; The adjustment instruction adjusts the order of the command classes to be adjusted in the service combination class; and updates the context class according to the input parameters and output parameters of the command classes to be adjusted.
  • the present invention also provides a computing device, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, and execute the foregoing business code generation method according to the obtained program.
  • the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned business code generation method .
  • FIG. 1 is a schematic flowchart of a method for generating service codes according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for executing service codes provided by an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another method for executing service codes provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a display interface presented to users according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for generating service codes according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a service code execution device provided by an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • the responsibility chain mode in the embodiments of this application is a design mode. There are many objects in the chain of responsibility model, and each object is connected to form a chain through each object's reference to its next home. The request sent by the client is passed on this chain until an object on the chain decides to handle the request. The client making this request does not know which object on the chain can finally handle the request, which allows the system to dynamically reorganize and allocate responsibilities without affecting the client.
  • the complex business scenarios in the embodiments of this application refer to scenarios such as banks, securities, funds, etc.
  • users can set the business for this scenario according to their needs, and can further divide the business into multiple sub-businesses. Equivalently, the business includes multiple sub-businesses, and each sub-business has its own corresponding sub-business code.
  • FIG. 1 exemplarily shows a schematic diagram of a process corresponding to a method for generating a business code provided by an embodiment of the present invention, and the method may be executed by an apparatus for generating a business code.
  • the method includes:
  • Step 101 Receive the generation parameter of the service code, and generate the command class of each sub-service code according to the generation parameter.
  • the command class is used to call the sub-business code.
  • Step 102 According to a preset execution sequence, the command classes of each sub-service code are grouped into service combination classes as the service codes.
  • FIG. 2 exemplarily shows a schematic diagram of a process corresponding to a method for executing a service code according to an embodiment of the present invention, and the process may be executed by an apparatus for executing the service code.
  • the method includes:
  • Step 201 After receiving the generation parameters of the service code, create the context class of the service, and generate the command class of each sub-service code.
  • business codes can be divided into two categories, namely Context and Command.
  • the context is used to record the input and output parameters of the sub-business code when it is executed.
  • Command Used to call the corresponding sub-service code.
  • the context class is used to store the parameter information of each sub-business, such as the input parameters and intermediate results of each sub-business.
  • the command class corresponds to a certain unit of the complex business process, and the user implements the business details.
  • a command class corresponds to a sub-business.
  • the user can issue an instruction for creating a context class, for example, the name of the context class, package path and other information can be input through the front-end interface.
  • the instruction can include information such as the context name and package path.
  • the user can also issue instructions for creating a command class.
  • the name of the command class, the associated context class, inheritance class, package path and other information can be input through the front-end interface.
  • the instruction may include information such as the name of the command class, the associated context class, inheritance class, and package path.
  • the sub-service code when the command class of the sub-service code is generated, the sub-service code may be generated according to the received instruction information of the inheritance class of the sub-service code, the context type instruction information, and the instruction information of the sub-service code.
  • Command class The instruction information of the inheritance class of the sub-service code is used to determine the inheritance class of the sub-service code. By setting the inheritance class of the sub-service code, the redundancy of the sub-service code can be reduced, and the error probability of the sub-service code can be reduced.
  • the context type indication information is used to associate with the command type of the sub-service code.
  • the instruction information of the sub-service code is used to associate the sub-service code, so that when the service code is executed, the sub-service code corresponding to each command class can be called as the target code.
  • the inheritance class can be divided into an abstract business class (AbstractBizCommand) and an abstract business filter class (AbstractBizFilter).
  • the abstract business class is used to indicate the business processing logic of sub-business execution
  • the abstract business filter class is used to indicate the business processing logic and resource release logic of sub-business execution.
  • Abstract classes are used to standardize the attributes of each sub-business to avoid unnecessary code duplication. The intermediate results of the sub-business are formatted through the abstract class, which can avoid the problem of mistakes in manual format conversion by users.
  • Step 202 According to a preset execution sequence, the command classes of each sub-service code are grouped into service combination classes as the service codes.
  • the creation of the command classes of the multiple sub-service codes can be determined according to the preset logic, or it can be determined according to the received user's creation completion instruction. For example, after it is determined that the creation of multiple command classes is completed, the multiple command classes can be combined into a business combination class (Network Verify Chain) according to the creation order of the multiple command classes, and used as the business code.
  • a business combination class Network Verify Chain
  • Step 203 After receiving the code execution instruction, control each command class included in the service code to call its corresponding sub-service code one by one as the target code, and bring the input parameters contained in its associated context class into the After the target code, the target code is executed.
  • Step 204 Save the output result of the target code as the output parameter in the context class.
  • the business code includes multiple command classes, and each command class corresponds to a sub-service code.
  • the sub-service code corresponding to each command class is called one by one according to each command class as the target code, and each command class is associated with the corresponding input in the context class.
  • Output parameters When calling any command class, the input parameters corresponding to the command class will be input into the target code, and the generated output parameters will be recorded in the context class.
  • the business code includes command class 1, command class 2, and command class 3.
  • the input parameter corresponding to command class 1 can be determined from the context class, and the input parameter can be entered To the sub-service code, and the output parameters corresponding to the generated command class 1, are recorded in the context class.
  • the newly added instruction may include the command type to be added
  • the delete instruction may include the command type to be deleted
  • the adjustment instruction may include the command type to be adjusted.
  • the command class to be added in the newly added instruction can be added to the business combination class, and the context class can be updated according to the input parameters and output parameters of the command class to be added.
  • the command class to be deleted in the delete instruction can be deleted from the business combination class.
  • the order of the command classes to be adjusted in the business combination class can be adjusted according to the adjustment command and the command class to be adjusted in the adjustment command, and can be updated according to the input parameters and output parameters of the command class to be adjusted Context class.
  • Sub-business 1 Create online verification pipeline and update online verification results
  • Sub-business 2 OCR (Optical Character Recognition) security engine decision-making
  • Sub-business 3 Public security name and ID number match check
  • the above 3 sub-services correspond to 3 units (command type).
  • One context class and three command classes are created through the embodiment of the present invention, as shown in Table 1.
  • each command class in the business combination class can be controlled to call the sub-business code corresponding to each command class, that is, the target code, and can be based on each command.
  • the correspondence between the class and the context class brings the input parameters in the associated context class into the target code to execute the target code.
  • the client can call the networked verification combination class.
  • the OCR security engine decision command class can call related business data in the context class.
  • Perform specific OCR security engine decision logic to generate OCR recognition results, such as ID cards and names, and then save the OCR recognition results in the context class.
  • the resident ID check class can call related business data in the context class, execute the resident ID check logic, and save the resident ID check result in the context class.
  • the online verification service flow class can call related business data in the context class, execute the online verification business logic, and save the online verification business flow result in the context class.
  • the intermediate result data stored in the context class is persisted.
  • the business process combination class corresponding to the online verification context class is the online verification combination class.
  • the online verification business flow class, the OCR security engine decision command class, and the resident ID check class are used.
  • you can add the anti-fraud push command (AntiFraud Push Command) which is added as the last execution unit to the online verification combination class .
  • a display interface of the business combination class can also be generated, as shown in FIG. 4.
  • business process combination class Choin/context class (Context)
  • current command class Current Commands
  • order adjustment Order adjustment
  • Delete delete
  • candidate command class Candidate Commands
  • Add Add
  • the current command class is the command class that currently composes the business process composition class
  • the alternative command is the command class that currently does not compose the business process composition class.
  • the user can click the button corresponding to each command in the dialog box according to the needs to realize the adjustment of each sub-business in the business. For example, in FIG. 4, in the case where the user clicks the add button corresponding to the anti-fraud information push category of the alternative command, the anti-fraud information push category can be added to the business combination category.
  • the business is divided into multiple sub-businesses according to business requirements, and the command classes of each sub-business code are created respectively.
  • the command classes of each sub-business code are used to call the business code of each sub-business, and the The command class is combined into a business combination class, and a context class is created at the same time.
  • the context class is used to record the input parameters and output parameters of the sub-business code during execution, and to associate the context class with each sub-business code. In this way, the coupling of the entire business code can be reduced, the sub-business can be added or deleted, and the generated business code can be more easily tested and suitable for complex business processes.
  • Complicated business execution process and can delete and adjust each sub-business in the business, and execute the business according to the adjusted business code, which can also improve the flexibility of business execution.
  • FIG. 5 exemplarily shows the structure of a service code generation apparatus provided by an embodiment of the present invention, and the apparatus can execute the flow of the service code generation method.
  • a business includes multiple sub-businesses, and each sub-business has its own corresponding sub-business code.
  • the device includes:
  • the processing unit 501 is configured to receive generation parameters of the service code, and generate command classes of each of the sub-service codes according to the generated parameters, where the command classes are used to call the sub-service codes;
  • the combination unit 502 is configured to group the command classes of each sub-service code into a service combination class as the service code according to a preset execution sequence.
  • FIG. 6 exemplarily shows the structure of a service code execution apparatus provided by an embodiment of the present invention, and the apparatus can execute the flow of the service code execution method.
  • a business includes multiple sub-businesses, and each sub-business has its own corresponding sub-business code.
  • the device includes:
  • the processing unit 601 is configured to, after receiving the generation parameters of the service code, create a context class of the service, and generate the command class of each sub-service code, the context class is used to record the input of the sub-service code during execution Parameters and output parameters, the command class is used to call the corresponding sub-service code;
  • the combination unit 602 is configured to group the command classes of each sub-service code into a service combination class according to a preset execution sequence, and serve as the service code;
  • the execution unit 603 is configured to, after receiving the code execution instruction, control each of the command classes included in the service code to call their corresponding sub-service codes one by one as the target code, and to include the input in the context class to which they are associated After the parameters are brought into the target code, the target code is executed; and the output result of the target code is stored in the context class as the output parameter.
  • the sub-service code corresponding to at least one of the sub-services is generated based on at least one inherited class
  • the processing unit 601 is specifically configured to:
  • the combining unit 602 is further configured to:
  • a newly-added instruction is received, and the newly-added instruction includes the command class to be added;
  • the combining unit 602 is further configured to:
  • a deletion instruction is received, and the deletion instruction includes the command class to be deleted;
  • the command class to be deleted is deleted from the service combination class.
  • the combining unit 602 is further configured to:
  • an adjustment instruction is received, and the adjustment instruction includes the command class to be adjusted;
  • the order of the command classes to be adjusted in the service combination class is adjusted; and the context class is updated according to the input parameters and output parameters of the command classes to be adjusted.
  • an embodiment of the present invention also provides a computing device. As shown in FIG. 7, it includes at least one processor 701 and a memory 702 connected to the at least one processor.
  • the embodiment of the present invention does not limit the processing.
  • the connection between the processor 701 and the memory 702 in FIG. 7 is taken as an example.
  • the bus can be divided into address bus, data bus, control bus, etc.
  • the memory 702 stores instructions that can be executed by at least one processor 701. By executing the instructions stored in the memory 702, the at least one processor 701 can execute the aforementioned business code generation and execution methods included step.
  • the processor 701 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, and prevent maliciousness by running or executing instructions stored in the memory 702 and calling data stored in the memory 702. attack.
  • the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor.
  • the application processor mainly processes the operating system, user interface, and application programs.
  • the adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 701.
  • the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
  • the processor 701 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
  • the general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory 702 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
  • the memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
  • the memory 702 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 702 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
  • embodiments of the present invention also provide a computer-readable non-volatile storage medium, including computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, the computer executes the above service code.
  • the generation method When the computer reads and executes the computer-readable instructions, the computer executes the above service code. The generation method.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Technology Law (AREA)
  • Development Economics (AREA)
  • Stored Programmes (AREA)

Abstract

一种业务代码的生成、执行方法及装置,涉及金融科技(Fintech)领域,用以适用于业务复杂场景中的业务代码的生成。其中,业务包括多个子业务,各子业务有其对应的子业务代码,代码执行方法包括:在接收业务代码的生成参数后,创建业务的上下文类,并生成各个子业务代码的命令类(201);按照预设的执行顺序,将各个子业务代码的命令类组成业务组合类,作为业务代码(202);在接收到代码执行指令后,控制业务代码包含的各个命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入目标代码后,执行目标代码(203);将所述目标代码的输出结果作为输出参数存入上下文类(204)。

Description

一种业务代码的生成、执行方法及装置
相关申请的交叉引用
本申请要求在2019年06月28日提交中国专利局、申请号为201910579389.2、申请名称为“一种业务代码的生成、执行方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及金融科技(Fintech)领域,尤其涉及一种业务代码的生成、执行方法及装置。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,业务代码的生成技术也不例外。但由于金融、支付行业的安全性和实时性要求,金融科技也对该技术提出了更高的要求。
一种现有的代码生成方式为:通过构建业务脚手架代码工具,实现利用模板自动生成代码。该种方式适用于简单的单表业务,能够根据数据库表结构快速生成前端交互页面以及后端逻辑处理代码。然而,在诸如银行、证券、基金等业务复杂场景中,会涉及到多个业务流程,且可能还会增加或删减业务流程。举例来说,银行开户涉及开卡、设密、开账户、绑定联系信息、身份证影像存证等多个步骤,因此银行开户会涉及到不同系统的交互问题。现有技术中的代码工具并不能针对业务复杂场景自动地生成代码。
发明内容
本发明提供一种业务代码的生成、执行方法及装置,用以实现在业务复杂场景中的业务代码的生成。
第一方面,本发明提供的一种业务代码的生成方法,所述业务包括多个子业务,各子业务有其分别对应的子业务代码;所述方法包括:
接收业务代码的生成参数,并根据所述生成参数生成各个所述子业务代码的命令类,所述命令类用于调用所述子业务代码;按照预设的执行顺序,将各子业务代码的命令类组成业务组合类,作为所述业务代码。
上述技术方案中,将业务按照业务需求划分为多个子业务,并分别创建各子业务代码的命令类,各子业务代码的命令类用于调用各子业务的业务代码,将多个命令类组合为业务组合类,用于在业务执行时按顺序调用子业务代码。如此,用户创建业务时,能够降低业务代码的耦合性,从而可以实现子业务的增加或删除,使得生成的业务代码能够容易测试且适用于复杂业务流程。
第二方面,本发明提供的一种业务代码的执行方法,所述业务包括多个子业务,各子业务有其分别对应的子业务代码;所述方法包括:
在接收业务代码的生成参数后,创建业务的上下文类,并生成各个所述子业务代码的命令类,所述上下文类用于记录所述子业务代码在执行时的输入参数和输出参数,所述命令类用于调用其对应的所述子业务代码;进一步地,按照预设的执行顺序,将各个所述子业务代码的命令类组成业务组合类,作为所述业务代码;在接收到代码执行指令后,控制所述业务代码包含的各个所述命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码,将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
上述技术方案中,将业务按照业务需求划分为多个子业务,并分别创建各子业务代码的命令类,各子业务代码的命令类用于调用各子业务的业务代码,将多个子业务代码的命令类组合为业务组合类,同时创建上下文类,该上下文类用于记录子业务代码在执行时的输入参数和输出参数,以及将上下文类与各子业务代码进行关联。采用该种方式,通过降低整个业务代码的耦合性,能够实现对子业务的增加或删除,使得生成的业务代码更容易测试并 能适用于复杂业务流程。在业务代码的执行过程中,通过控制各个命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入目标代码后,执行目标代码,使得该方法能够实现在复杂业务场景中执行业务代码,并可以对业务中的各子业务进行删减调整,按照调整后的业务代码执行业务,还能提高业务执行的灵活性。
可选的,所述各子业务中至少一个子业务对应的子业务代码是基于至少一个继承类生成的;所述生成所述子业务代码的命令类,包括:接收所述子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成所述子业务代码的命令类。
上述技术方案中,子业务代码的继承类指示信息用于确定该子业务代码的继承类,通过设置子业务代码的继承类,能够减少子业务代码的冗余性,以及降低子业务代码的出错概率。相应地,上下文类指示信息用于与子业务代码的命令类进行关联,如此,子业务代码的指示信息能够用于关联该子业务代码,从而在执行业务代码时,可以直接调用各命令类对应的子业务代码作为目标代码。
可选的,在所述将各个所述子业务代码的命令类组成业务组合类之后,还接收新增指令,所述新增指令中包括待增加的命令类;进一步地,将所述待增加的命令类添加至所述业务组合类,并根据所述待增加的命令类的输入参数和输出参数更新所述上下文类。
可选的,在所述将各个所述子业务代码的命令类组成业务组合类之后,接收删除指令,所述删除指令中包括待删除的命令类;将所述待删除的命令类从所述业务组合类中删除。
可选的,在所述将各个所述子业务代码的命令类组成业务组合类之后,还接收调整指令,所述调整指令中包括待调整的命令类;根据所述调整指令,调整所述业务组合类中所述待调整的命令类的顺序;并根据所述待调整的命令类的输入参数和输出参数更新所述上下文类。
上述技术方案中,代码执行方法可以支持用户的新增指令、删除指令、 调整指令中的一项或多项,从而能够实现对业务中的各子业务的调整,满足用户对复杂业务流程的需求,提高用户的体验。
第三方面,本发明还提供了一种业务代码的生成装置,所述业务包括多个子业务,各子业务有其分别对应的子业务代码;所述装置包括:
处理单元,用于接收业务代码的生成参数,并根据所述生成参数生成各个所述子业务代码的命令类,所述命令类用于调用所述子业务代码;
组合单元,用于按照预设的执行顺序,将各子业务代码的命令类组成业务组合类,作为所述业务代码。
第四方面,本发明还提供了一种业务代码的执行装置,所述业务包括多个子业务,各子业务有其对应的子业务代码;所述装置包括:
处理单元,用于在接收业务代码的生成参数后,创建业务的上下文类,并生成各个所述子业务代码的命令类,所述上下文类用于记录所述子业务代码在执行时的输入参数和输出参数,所述命令类用于调用其对应的所述子业务代码;
组合单元,用于按照预设的执行顺序,将各个所述子业务代码的命令类组成业务组合类,作为所述业务代码;
执行单元,用于在接收到代码执行指令后,控制所述业务代码包含的各个所述命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码;将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
可选的,所述各子业务中至少一个子业务对应的子业务代码是基于至少一个继承类生成的;所述处理单元,具体用于:接收所述子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成所述子业务代码的命令类。
可选的,所述组合单元还用于:在所述将各个所述子业务代码的命令类组成业务组合类之后,接收新增指令,所述新增指令中包括待增加的命令类;将所述待增加的命令类添加至所述业务组合类,并根据所述待增加的命令类 的输入参数和输出参数更新所述上下文类。
可选的,所述组合单元还用于:在所述将各个所述子业务代码的命令类组成业务组合类之后,接收删除指令,所述删除指令中包括待删除的命令类;将所述待删除的命令类从所述业务组合类中删除。
可选的,所述组合单元还用于:在所述将各个所述子业务代码的命令类组成业务组合类之后,接收调整指令,所述调整指令中包括待调整的命令类;根据所述调整指令,调整所述业务组合类中所述待调整的命令类的顺序;并根据所述待调整的命令类的输入参数和输出参数更新所述上下文类。
第五方面,本发明还提供了一种计算设备,包括:
存储器,用于存储程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述业务代码的生成方法。
第六方面,本发明还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述业务代码的生成方法。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种业务代码的生成方法的流程示意图;
图2为本发明实施例提供的一种业务代码的执行方法的流程示意图;
图3为本发明实施例提供的另一种业务代码的执行方法的流程示意图;
图4为本发明实施例提供的一种向用户展示的显示界面示意图;
图5为本发明实施例提供的一种业务代码的生成装置的结构示意图;
图6为本发明实施例提供的一种业务代码的执行装置的结构示意图;
图7为本发明实施例提供的一种计算设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
下面先对本申请实施例中的部分术语进行介绍。
本申请实施例中的责任链模式是一种设计模式。在责任链模式里存在很多对象,各个对象之间通过每一个对象对其下家的引用而连接起来形成一条链。客户端发出的请求在这个链上进行传递,直到链上的某一个对象决定处理此请求。发出这个请求的客户端并不知道链上的哪一个对象能够最终处理这个请求,这使得系统可以在不影响客户端的情况下动态地重新组织和分配责任。
本申请实施例中的业务复杂场景是指诸如银行、证券、基金等场景。在业务复杂场景中,用户可以根据需求设定针对该场景下的业务,并可以进一步将业务划分为多个子业务。相当于,业务包括多个子业务,且各子业务有其分别对应的子业务代码。
基于上述描述,图1示例性示出本发明实施例提供的一种业务代码的生成方法对应的流程示意图,该方法可以由业务代码的生成装置执行。如图1所示,该方法包括:
步骤101,接收业务代码的生成参数,并根据所述生成参数生成各个子业务代码的命令类。
其中,命令类用于调用子业务代码。
步骤102,按照预设的执行顺序,将各个子业务代码的命令类组成业务组合类,作为所述业务代码。
结合上述描述,图2示例性示出本发明实施例提供的一种业务代码的执行方法对应的流程示意图,该流程可以由业务代码的执行装置执行。如图2所示,该方法包括:
步骤201,在接收业务代码的生成参数后,创建业务的上下文类,并生成各个子业务代码的命令类。
在创建业务代码时,可以将业务代码分为2类,即上下文(Context)类和命令(Command)类,其中,上下文类用于记录子业务代码在执行时的输入参数和输出参数,命令类用于调用其对应的子业务代码。也可以说,上下文类用于存储各子业务的参数信息,如各子业务的输入参数、中间结果等信息。命令类对应复杂业务流程的某一个单元,由用户实现业务细节,一个命令类对应一个子业务。
示例性地,用户可以下发用于创建上下文类的指令,例如可以通过前端界面输入上下文类的名称、包路径等信息。如此,该指令中可以包括上下文名称、包路径等信息。用户还可以下发用于创建命令类的指令,例如可以通过前端界面输入命令类的名称、相关联的上下文类、继承类、包路径等信息。如此,该指令中可以包括命令类的名称、相关联的上下文类、继承类、包路径等信息。
在一种可选地实施方式中,在生成子业务代码的命令类时,可以根据接收到的子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成子业务代码的命令类。其中,子业务代码的继承类指示信息用于确定该子业务代码的继承类,通过设置子业务代码的继承类,能够减少子业务代码的冗余性,降低子业务代码的出错概率。上下文类指示信息用于与子业务代码的命令类进行关联。子业务代码的指示信息用于关联该子业务代码,从而在执行业务代码时,能够调用各命令类对应的子业务代码作为目标代码。
本申请实施例中,继承类可以分为抽象商业类(AbstractBizCommand)和抽象商业过滤类(AbstractBizFilter)。其中,抽象商业类用于指示执行子业 务的业务处理逻辑,抽象商业过滤类用于指示执行子业务的业务处理逻辑和资源释放逻辑。抽象类用于规范各子业务的属性,避免出现不必要的代码重复,通过抽象类将子业务的中间结果进行格式转换,能够避免由用户人工进行格式转换时出现失误的问题。
步骤202,按照预设的执行顺序,将各个子业务代码的命令类组成业务组合类,作为所述业务代码。
具体实施中,可以根据预设逻辑确定多个子业务代码的命令类创建完成,也可以是根据接收到的用户的创建完成指令来确定。例如,在确定多个命令类创建完成后,可以根据多个命令类的创建顺序,将多个命令类组合为业务组合类(Network Verify Chain),并作为业务代码。
步骤203,在接收到代码执行指令后,控制所述业务代码包含的各个命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码。
步骤204,将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
理解为,业务代码包括多个命令类,每个命令类对应子业务代码,按照各命令类逐一调用各命令类对应的子业务代码作为目标代码,且各命令类在上下文类中关联相应的输入输出参数,在调用任一个命令类时,都会将该命令类对应的输入参数输入至该目标代码中,将生成的输出参数记录在上下文类中。例如,业务代码包括命令类1、命令类2、命令类3,在调用命令类1对应的子业务代码时,可以从上下文类中确定该命令类1所对应的输入参数,将该输入参数输入至子业务代码中,以及生成命令类1所对应的输出参数,记录在上下文类中。
示例性地,还可以接收用户的新增指令、删除指令、调整指令中的一项或多项,从而实现对业务中的各子业务的调整。其中,新增指令中可以包括待增加的命令类,删除指令中可以包括待删除的命令类,调整指令中可以包括待调整的命令类。
具体的,在接收到新增指令后,可以将新增指令中待增加的命令类添加至业务组合类,并根据待增加的命令类的输入参数和输出参数更新上下文类。在接收到删除指令后,可以将删除指令中的待删除的命令类从业务组合类中删除。在接收到调整指令后,可以根据调整指令以及调整指令中的待调整的命令类,调整业务组合类中待调整的命令类的顺序,并可以根据待调整的命令类的输入参数和输出参数更新上下文类。
为了更好的解释本发明实施例,下面将以开设电子账户中“联网核查”的业务为例,描述如何执行代码生成和代码执行。
首先,将联网核查业务划分为各个子业务,各个子业务例如为:
子业务1:创建联网核查流水和更新联网核查结果;
子业务2:OCR(Optical Character Recognition,光学字符识别)安全引擎决策;
子业务3:公安姓名和身份证号匹配检查;
上述3个子业务对应3个单元(命令类)。通过本发明实施例创建1个上下文类和3个命令类,如表1所示。
Figure PCTCN2020085724-appb-000001
表1
然后,根据表1生成业务流程组合类,即联网核查组合类(NetworkVerify  Chain)。例如可以为如下示出的代码:
Figure PCTCN2020085724-appb-000002
进一步地,在上述业务流程组合类创建完成后,若接收到代码执行指令,则可以控制该业务组合类中各命令类调用各命令类对应的子业务代码,即目标代码,并可以根据各命令类与上下文类的对应关系,将关联的上下文类中的输入参数带入目标代码,以执行目标代码。
本示例中,执行过程可以参照图3所示。
当用户在客户端上创建联网核查上下文类实例时,客户端可以调用联网核查组合类,例如在调用OCR安全引擎决策命令类时,OCR安全引擎决策命令类可以调用上下文类中的相关业务数据,进行具体的OCR安全引擎决策逻辑,生成OCR识别结果,如身份证和姓名等,随后可以将该OCR识别结果保存至上下文类中。例如在调用居民身份证检查类时,居民身份证检查类可以调用上下文类中的相关业务数据,执行居民身份证检查逻辑,将居民身份检查结果保存至上下文类中。例如在调用联网核查业务流水类时,联网核查业务流水类可以调用上下文类中的相关业务数据,执行联网核查业务逻辑,将联网核查业务流水结果保存至上下文类中。此外,存储在该上下文类中的中间结果数据均为持久化保存。
如表1中,联网核查上下文类对应的业务流程组合类是联网核查组合类,当前使用了联网核查业务流水类、OCR安全引擎决策命令类和居民身份证检 查类。但在实际应用过程中,若要求在联网核查最后还增加用于反欺诈信息推送的子业务,则可以增加反欺诈信息推送类(AntiFraudPush Command),作为最后一个执行单元添加到联网核查组合类中。
进一步地,在生成业务组合类后,还可以生成该业务组合类的显示界面,如图4所示。该对话框中共六列,业务流程组合类(Chain)/上下文类(Context)、当前命令类(Current Commands)、顺序调整(Order Operation)、删除(Delete)、备选命令类(Candidate Commands)、增加(Add)。其中,当前命令类即当前组成业务流程组合类的命令类,备选命令即当前未组成业务流程组合类的命令类。用户可以根据需求点击对话框中的各命令对应的按钮,以实现对业务中的各子业务的调整。例如在图4中,在用户点击备选命令反欺诈信息推送类对应的增加按钮的情况下,可以将反欺诈信息推送类添加至业务组合类中。
上述技术方案中,将业务按照业务需求划分为多个子业务,并分别创建各子业务代码的命令类,各子业务代码的命令类用于调用各子业务的业务代码,将多个子业务代码的命令类组合为业务组合类,同时创建上下文类,该上下文类用于记录子业务代码在执行时的输入参数和输出参数,以及将上下文类与各子业务代码进行关联。采用该种方式,能够降低整个业务代码的耦合性,实现子业务的可增加或删除,且生成的业务代码能够更容易测试且适用于复杂业务流程。在业务代码的执行过程中,控制各个命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入目标代码后,执行目标代码,能够实现在复杂业务的执行过程,且可以对业务中的各子业务进行删减调整,按照调整后的业务代码执行业务,还能够提高业务执行的灵活性。
基于同一发明构思,图5示例性示出本发明实施例提供的一种业务代码的生成装置的结构,该装置可以执行业务代码的生成方法的流程。业务包括多个子业务,各子业务有其分别对应的子业务代码。如图5所示,所述装置包括:
处理单元501,用于接收业务代码的生成参数,并根据所述生成参数生成 各个所述子业务代码的命令类,所述命令类用于调用所述子业务代码;
组合单元502,用于按照预设的执行顺序,将各子业务代码的命令类组成业务组合类,作为所述业务代码。
基于同一发明构思,图6示例性示出本发明实施例提供的一种业务代码的执行装置的结构,该装置可以执行业务代码的执行方法的流程。业务包括多个子业务,各子业务有其分别对应的子业务代码。所述装置包括:
处理单元601,用于在接收业务代码的生成参数后,创建业务的上下文类,并生成各个所述子业务代码的命令类,所述上下文类用于记录所述子业务代码在执行时的输入参数和输出参数,所述命令类用于调用其对应的所述子业务代码;
组合单元602,用于按照预设的执行顺序,将各个所述子业务代码的命令类组成业务组合类,作为所述业务代码;
执行单元603,用于在接收到代码执行指令后,控制所述业务代码包含的各个所述命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码;将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
可选的,所述各子业务中至少一个子业务对应的子业务代码是基于至少一个继承类生成的;
所述处理单元601,具体用于:
接收所述子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成所述子业务代码的命令类。
可选的,所述组合单元602还用于:
在所述将各个所述子业务代码的命令类组成业务组合类之后,接收新增指令,所述新增指令中包括待增加的命令类;
将所述待增加的命令类添加至所述业务组合类,并根据所述待增加的命令类的输入参数和输出参数更新所述上下文类。
可选的,所述组合单元602还用于:
在所述将各个所述子业务代码的命令类组成业务组合类之后,接收删除指令,所述删除指令中包括待删除的命令类;
将所述待删除的命令类从所述业务组合类中删除。
可选的,所述组合单元602还用于:
在所述将各个所述子业务代码的命令类组成业务组合类之后,接收调整指令,所述调整指令中包括待调整的命令类;
根据所述调整指令,调整所述业务组合类中所述待调整的命令类的顺序;并根据所述待调整的命令类的输入参数和输出参数更新所述上下文类。
基于相同的技术构思,本发明实施例还提供了一种计算设备,如图7所示,包括至少一个处理器701,以及与至少一个处理器连接的存储器702,本发明实施例中不限定处理器701与存储器702之间的具体连接介质,图7中处理器701和存储器702之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器702存储有可被至少一个处理器701执行的指令,至少一个处理器701通过执行存储器702存储的指令,可以执行前述的业务代码的生成、执行方法中所包括的步骤。
其中,处理器701是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器702内的指令以及调用存储在存储器702内的数据,从而预防恶意攻击。可选的,处理器701可包括一个或多个处理单元,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。在一些实施例中,处理器701和存储器702可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器701可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件 组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器702作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器702可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器702是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器702还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述业务代码的生成方法。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设 备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (14)

  1. 一种业务代码的生成方法,其特征在于,所述业务包括多个子业务,各所述子业务有其分别对应的子业务代码;
    所述方法包括:
    接收业务代码的生成参数,并根据所述生成参数生成各个所述子业务代码的命令类,所述命令类用于调用所述子业务代码;
    按照预设的执行顺序,将各子业务代码的命令类组成业务组合类,作为所述业务代码。
  2. 一种业务代码的执行方法,其特征在于,所述业务包括多个子业务,各所述子业务有其对应的子业务代码;
    所述方法包括:
    在接收业务代码的生成参数后,创建业务的上下文类,并生成各个所述子业务代码的命令类,所述上下文类用于记录所述子业务代码在执行时的输入参数和输出参数,所述命令类用于调用其对应的所述子业务代码;
    按照预设的执行顺序,将各个所述子业务代码的命令类组成业务组合类,作为所述业务代码;
    在接收到代码执行指令后,控制所述业务代码包含的各个所述命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码;
    将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
  3. 如权利要求2所述的方法,其特征在于,所述各子业务中至少一个子业务对应的子业务代码是基于至少一个继承类生成的;
    所述生成所述子业务代码的命令类,包括:
    接收所述子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成所述子业务代码的命令类。
  4. 如权利要求2所述的方法,其特征在于,在所述将各个所述子业务代 码的命令类组成业务组合类之后,还包括:
    接收新增指令,所述新增指令中包括待增加的命令类;
    将所述待增加的命令类添加至所述业务组合类,并根据所述待增加的命令类的输入参数和输出参数更新所述上下文类。
  5. 如权利要求2所述的方法,其特征在于,在所述将各个所述子业务代码的命令类组成业务组合类之后,还包括:
    接收删除指令,所述删除指令中包括待删除的命令类;
    将所述待删除的命令类从所述业务组合类中删除。
  6. 如权利要求2所述的方法,其特征在于,在所述将各个所述子业务代码的命令类组成业务组合类之后,还包括:
    接收调整指令,所述调整指令中包括待调整的命令类;
    根据所述调整指令,调整所述业务组合类中所述待调整的命令类的顺序;并根据所述待调整的命令类的输入参数和输出参数更新所述上下文类。
  7. 一种业务代码的生成装置,其特征在于,所述业务包括多个子业务,各所述子业务有其分别对应的子业务代码;
    所述装置包括:
    处理单元,用于接收业务代码的生成参数,并根据所述生成参数生成各个所述子业务代码的命令类,所述命令类用于调用所述子业务代码;
    组合单元,用于按照预设的执行顺序,将各子业务代码的命令类组成业务组合类,作为所述业务代码。
  8. 一种业务代码的执行装置,其特征在于,所述业务包括多个子业务,各所述子业务有其对应的子业务代码;
    所述装置包括:
    处理单元,用于在接收业务代码的生成参数后,创建业务的上下文类,并生成各个所述子业务代码的命令类,所述上下文类用于记录所述子业务代码在执行时的输入参数和输出参数,所述命令类用于调用其对应的所述子业务代码;
    组合单元,用于按照预设的执行顺序,将各个所述子业务代码的命令类组成业务组合类,作为所述业务代码;
    执行单元,用于在接收到代码执行指令后,控制所述业务代码包含的各个所述命令类逐一调用其对应的子业务代码作为目标代码,并在将其关联的上下文类中包含的输入参数带入所述目标代码后,执行所述目标代码;将所述目标代码的输出结果作为所述输出参数存入所述上下文类。
  9. 如权利要求8所述的装置,其特征在于,所述各子业务中至少一个子业务对应的子业务代码是基于至少一个继承类生成的;
    所述处理单元,具体用于:
    接收所述子业务代码的继承类指示信息、上下文类指示信息和子业务代码的指示信息,生成所述子业务代码的命令类。
  10. 如权利要求8所述的装置,其特征在于,所述组合单元还用于:
    在所述将各个所述子业务代码的命令类组成业务组合类之后,接收新增指令,所述新增指令中包括待增加的命令类;
    将所述待增加的命令类添加至所述业务组合类,并根据所述待增加的命令类的输入参数和输出参数更新所述上下文类。
  11. 如权利要求8所述的装置,其特征在于,所述组合单元还用于:
    在所述将各个所述子业务代码的命令类组成业务组合类之后,接收删除指令,所述删除指令中包括待删除的命令类;
    将所述待删除的命令类从所述业务组合类中删除。
  12. 如权利要求8所述的装置,其特征在于,所述组合单元还用于:
    在所述将各个所述子业务代码的命令类组成业务组合类之后,接收调整指令,所述调整指令中包括待调整的命令类;
    根据所述调整指令,调整所述业务组合类中所述待调整的命令类的顺序;并根据所述待调整的命令类的输入参数和输出参数更新所述上下文类。
  13. 一种计算设备,其特征在于,包括:
    存储器,用于存储程序指令;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至6任一项所述的方法。
  14. 一种计算机可读非易失性存储介质,其特征在于,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利要求1至6任一项所述的方法。
PCT/CN2020/085724 2019-06-28 2020-04-20 一种业务代码的生成、执行方法及装置 WO2020259035A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910579389.2A CN110288324A (zh) 2019-06-28 2019-06-28 一种业务代码的生成、执行方法及装置
CN201910579389.2 2019-06-28

Publications (1)

Publication Number Publication Date
WO2020259035A1 true WO2020259035A1 (zh) 2020-12-30

Family

ID=68020142

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/085724 WO2020259035A1 (zh) 2019-06-28 2020-04-20 一种业务代码的生成、执行方法及装置

Country Status (2)

Country Link
CN (1) CN110288324A (zh)
WO (1) WO2020259035A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110288324A (zh) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 一种业务代码的生成、执行方法及装置
CN113032398B (zh) * 2021-03-26 2022-12-13 苏宁易购集团股份有限公司 多类型业务的业务处理方法、计算机设备和存储介质
CN113064588B (zh) * 2021-04-07 2024-01-30 浪潮通用软件有限公司 命令编排方法、装置及计算机可读介质
CN113312039A (zh) * 2021-06-25 2021-08-27 武汉众邦银行股份有限公司 一种构建责任树模式通用代码框架的方法及装置
CN117369783B (zh) * 2023-12-06 2024-02-23 之江实验室 一种安全代码生成模型的训练方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181771A1 (en) * 2003-03-12 2004-09-16 Microsoft Corporation Framework for supporting business software applications
CN101593111A (zh) * 2009-05-31 2009-12-02 大连新中连软件集团有限公司 一种业务组件及基于业务组件的应用软件开发方法和系统
CN105739980A (zh) * 2016-01-28 2016-07-06 滴滴(中国)科技有限公司 业务的统一开发方法和设备
CN106610837A (zh) * 2016-12-26 2017-05-03 中国建设银行股份有限公司 一种应用程序的开发方法及开发平台
CN109408216A (zh) * 2018-11-12 2019-03-01 北京字节跳动网络技术有限公司 任务生成方法、装置、设备及存储介质
CN110288324A (zh) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 一种业务代码的生成、执行方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040181771A1 (en) * 2003-03-12 2004-09-16 Microsoft Corporation Framework for supporting business software applications
CN101593111A (zh) * 2009-05-31 2009-12-02 大连新中连软件集团有限公司 一种业务组件及基于业务组件的应用软件开发方法和系统
CN105739980A (zh) * 2016-01-28 2016-07-06 滴滴(中国)科技有限公司 业务的统一开发方法和设备
CN106610837A (zh) * 2016-12-26 2017-05-03 中国建设银行股份有限公司 一种应用程序的开发方法及开发平台
CN109408216A (zh) * 2018-11-12 2019-03-01 北京字节跳动网络技术有限公司 任务生成方法、装置、设备及存储介质
CN110288324A (zh) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 一种业务代码的生成、执行方法及装置

Also Published As

Publication number Publication date
CN110288324A (zh) 2019-09-27

Similar Documents

Publication Publication Date Title
WO2020259035A1 (zh) 一种业务代码的生成、执行方法及装置
CN108595157B (zh) 区块链数据的处理方法、装置、设备和存储介质
WO2019214029A1 (zh) 财务数据制证方法、装置、计算机设备及存储介质
US20060259423A1 (en) Centralized payment processing system
CN111091358B (zh) 多支付渠道的统一处理方法及系统
CN109993651B (zh) 数据核算业务指令集校验方法、装置、计算机设备和介质
WO2020233402A1 (zh) 应付账款订单校验方法、装置、设备及存储介质
CN111833034A (zh) 一种批量扣款方法、支付服务器、计算机设备及存储介质
CN110941488A (zh) 一种任务处理方法、装置、设备和存储介质
CN112711640A (zh) 一种业务受理流程配置的方法及装置
CN116071150A (zh) 数据处理方法、银行产品推广、风控系统、服务器及介质
CN116360769A (zh) 代码生成方法、装置、设备及存储介质
US20170322777A1 (en) Presentation Oriented Rules-based Technical Architecture Display Framework
CN112800063A (zh) 基于数据结构的自动贯标方法及装置
CN112651716A (zh) 数据处理方法、设备及存储介质
CN111209283A (zh) 一种数据处理方法及装置
CN116860805A (zh) 数据处理方法、装置、计算机设备及存储介质
JP5689298B2 (ja) 会計単位間振替仕訳分割システムと方法およびプログラム
CN112633996B (zh) 信贷订单分发方法、计算机设备及其可读存储介质
CN111865726B (zh) 业务消息测试方法、装置、计算机系统和存储介质
CN114707961A (zh) 基于审批流配置的待审批任务执行方法、装置、设备、介质和程序产品
AU2019404304B2 (en) Gain and loss computation for cryptocurrency transactions
US9342541B1 (en) Presentation oriented rules-based technical architecture display framework (PORTRAY)
CN114416805B (zh) 数据核对方法、装置、计算机设备和存储介质
US20230244859A1 (en) System and method for automatically sharing verified user information across remote systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20831908

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.04.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20831908

Country of ref document: EP

Kind code of ref document: A1