The content of the invention
It is a primary object of the present invention to propose a kind of method for processing business, adapter and computer-readable recording medium,
It is intended to reduce the development cost of service code, improves the flexibility of service code.
To achieve the above object, the present invention provides a kind of method for processing business, and the method for processing business includes following step
Suddenly:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
Alternatively, the business processing request for receiving trading platform system and sending, obtains the business processing request and takes
Before the step of service identification information of band, in addition to:
For different types of business set corresponding to service identification information and routing configuration information, will set result preserve to
In routing configuration information database.
Alternatively, the external service system interface includes file interface and business processing interface, described according to the road
The step of calling external service system interface by configuration information includes:
The external service system interface interchange type of the business processing request is determined according to the routing configuration information;
When the interface interchange type is the file interface, the material of the business is obtained from the trading platform system
Expect file, call the file interface so that the material file got is uploaded into the external service system;
When the interface interchange type is the business processing interface, the request ginseng of the business processing interface is obtained
Number, the required parameter got is subjected to the first form conversion and encryption and endorsed processing, calls the business processing interface
So that the required parameter after processing is uploaded into the external service system.
Alternatively, the service processing result for receiving the external service system interface and returning and by the result
The step of feeding back to the trading platform system includes:
The service processing result that the business processing interface returns is received, solution label are decrypted in the service processing result
The trading platform system is fed back to after being changed with the second form.
Alternatively, service processing result that the external service system interface the returns and result is anti-is being received
After the step of being fed to the trading platform system, the method for processing business also includes:
When receiving the online heat deployment instruction of user's triggering, online heat deployment packet is obtained;
The online heat deployment packet according to getting carries out online hot portion to the routing configuration information database
Administration.
In addition, to achieve the above object, the present invention also provides a kind of adapter, and the adapter includes:Memory, processing
Device and the business processing program that can be run on the memory and on the processor is stored in, the business processing program quilt
Following steps are realized during the computing device:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
Alternatively, the business processing program by the computing device when also realize following steps:
For different types of business set corresponding to service identification information and routing configuration information, will set result preserve to
In routing configuration information database.
Alternatively, the external service system interface includes file interface and business processing interface, the business processing journey
Following steps are also realized when sequence is by the computing device:
The external service system interface interchange type of the business processing request is determined according to the routing configuration information;
When the interface interchange type is the file interface, the material of the business is obtained from the trading platform system
Expect file, call the file interface so that the material file got is uploaded into the external service system;
When the interface interchange type is the business processing interface, the request ginseng of the business processing interface is obtained
Number, the required parameter got is subjected to the first form conversion and encryption and endorsed processing, calls the business processing interface
So that the required parameter after processing is uploaded into the external service system.
Alternatively, the business processing program by the computing device when also realize following steps:
The service processing result that the business processing interface returns is received, solution label are decrypted in the service processing result
The trading platform system is fed back to after being changed with the second form.
In addition, to achieve the above object, the present invention also provides a kind of computer-readable recording medium, described computer-readable
Business processing program is stored with storage medium, the business processing program realizes following steps when being executed by processor:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
The present invention receives the business processing request that trading platform system is sent, and obtains the industry that the business processing request carries
Business identification information;Default routing configuration information database is searched according to the service identification information, obtains the road of the business
By configuration information;External service system interface is called according to the routing configuration information;Receive the external service system interface
The result is simultaneously fed back to the trading platform system by the service processing result of return.The present invention is by transaction platform
Adapter is disposed between system and external service system, and routing configuration information database is set based on adapter, so as to new
When increasing type of service, developer need to only write the routing configuration information code of Added Business, without developing whole item again
Mesh code, the development cost of service code is reduced, in addition, in business change, developer need to only change the road of adapter
By configuration information code, the flexibility of service code is improved.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are:The business processing request that trading platform system is sent is received, is obtained
The service identification information that the business processing request carries;Default routing configuration information is searched according to the service identification information
Database, obtain the routing configuration information of the business;External service system interface is called according to the routing configuration information;Connect
Receive the service processing result that the external service system interface returns and the result is fed back into the transaction platform system
System.
Following defect be present in existing business processing code:1) development cost is higher.For Added Business type, exploit person
Member needs again exploration project code, it is necessary to expend more time cost and human cost;2) source code flexible is not high.Due to
Code and business it is highly integrated, the change of business can cause the frequent modification of code, cause higher error probability and test
Cost, and transition and the frequent change of business over time, code can also can be more and more too fat to move, cause code to be difficult to tie up
Shield.
The present invention is set by disposing adapter between trading platform system and external service system, and based on adapter
Routing configuration information database, so as to which in Added Business type, developer need to only write the routing configuration letter of Added Business
Code is ceased, without developing whole item code again, reduces the development cost of service code, in addition, in business change,
Developer need to only change the routing configuration information code of adapter, improve the flexibility of service code.
The present invention provides a kind of method for processing business.
As shown in figure 1, Fig. 1 is the adapter structure schematic diagram for the hardware running environment that scheme of the embodiment of the present invention is related to.
Adapter of the present invention can be router, interchanger, server, PC or virtual machine facility.
As shown in figure 1, the adapter can include:Processor 1001, such as CPU, network interface 1004, user interface
1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used to realize the connection communication between these components.
User interface 1003 can include display screen (Display), input block such as keyboard (Keyboard), optional user interface
1003 can also include wireline interface, the wave point of standard.Network interface 1004 can optionally connect including the wired of standard
Mouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or stable memory
(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
It will be understood by those skilled in the art that the restriction of the adapter structure shown in Fig. 1 not structure paired adapters, can
With including than illustrating more or less parts, either combining some parts or different parts arrangement.
As shown in figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network
Believe module, Subscriber Interface Module SIM and business processing program.
In the adapter shown in Fig. 1, network interface 1004 is mainly used in connecting background server, enters with background server
Row data communication;User interface 1003 is mainly used in connecting client (user terminal), enters row data communication with client;And handle
Device 1001 can be used for calling the business processing program stored in memory 1005, and perform following operate:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
Further, processor 1001 can call the business processing program stored in memory 1005, also perform following
Operation:
For different types of business set corresponding to service identification information and routing configuration information, will set result preserve to
In routing configuration information database.
Further, processor 1001 can call the business processing program stored in memory 1005, also perform following
Operation:
The external service system interface interchange type of the business processing request is determined according to the routing configuration information;
When the interface interchange type is the file interface, the material of the business is obtained from the trading platform system
Expect file, call the file interface so that the material file got is uploaded into the external service system;
When the interface interchange type is the business processing interface, the request ginseng of the business processing interface is obtained
Number, the required parameter got is subjected to the first form conversion and encryption and endorsed processing, calls the business processing interface
So that the required parameter after processing is uploaded into the external service system.
Further, processor 1001 can call the business processing program stored in memory 1005, also perform following
Operation:
The service processing result that the business processing interface returns is received, solution label are decrypted in the service processing result
The trading platform system is fed back to after being changed with the second form.
Further, processor 1001 can call the business processing program stored in memory 1005, also perform following
Operation:
When receiving the online heat deployment instruction of user's triggering, online heat deployment packet is obtained;
The online heat deployment packet according to getting carries out online hot portion to the routing configuration information database
Administration.
Based on above-mentioned hardware configuration, method for processing business embodiment of the present invention is proposed.
Reference picture 2, Fig. 2 be method for processing business first embodiment of the present invention schematic flow sheet, the method for processing business
Including:
Step S10, the business processing request that trading platform system is sent is received, obtain what the business processing request carried
Service identification information;
Method for processing business of the present invention can be realized by connecting the adapter of trading platform system and external service system, fit
Orchestration can be router, interchanger, server, PC or virtual machine facility.
In the present embodiment, trading platform system and the docking of multiple external service systems, for by the business of transaction platform
Processing request is forwarded to corresponding external service system, so that external service system carries out corresponding business processing, below with industry
It is engaged in illustrating for financial class business.
First, user triggers business processing in the interaction page that trading platform system front end is shown and asked, at the business
Request can open an account reason including fund, fund is applied to purchase, fund is redeemed, accounts information is inquired about, accounts information is changed, accounts information opens
With disable, product electronic contract information is submitted, on line clearance pay or line on the service request such as clearance inquiry, trading platform system
Backstage identification type of service simultaneously obtains service identification information, and the business processing request for carrying service identification information is sent to suitable
Orchestration, after adapter receives the business processing request of trading platform system transmission, the packet of business processing request is entered
To obtain service identification information therein, the service identification information is used to distinguish different types of service, can be industry for row parsing
Business code or Business Name, can be specifically configured in advance by transaction platform developer according to different types of service.
Step S20, default routing configuration information database is searched according to the service identification information, obtains the business
Routing configuration information;
Then, adapter searches default routing configuration information database, the road according to the service identification information got
Need to pre-set according to business by developer by configuration information database, the routing configuration for preserving different business is believed
Breath.So-called routing configuration information, refer to being used to represent file interface calling order according to the different and setting of type of service
With the configuration information of business processing interface interchange order, the business processing on transaction platform is asked according to certain order with realizing
Route to distinct interface or different server.For example the open an account routing configuration information of business of fund can be:The first step, upload
Material open an account to Fund Company SFTP (Secure File Transfer Protocol, secure file transportation protocol) server,
Second step, account opening request is submitted to be opened an account https interfaces to Fund Company, it is assumed that the open an account service code of business of fund is
010001, then adapter fund is inquired by the can of service code 010001 and opened an account the routing configuration information of business.
It should be noted that in newly one external financial mechanism of docking or Added Business type, developer only needs to compile
The routing configuration information code of Added Business is write, such as, distribute service code for newly-increased type of service, define calling interface class
Type and calling interface parameter, are then saved in routing configuration information database;In business change, developer only needs
The routing configuration information code of adapter is changed, for example docking port realizes that class and interface parameters are modified, processing is flexible, can
Autgmentability is strong.
Step S30, external service system interface is called according to the routing configuration information;
After the routing configuration information of business is got, adapter calls external business system according to the routing configuration information
System interface.So that above-mentioned fund opens an account business as an example, route first is first carried out after routing configuration information is got in adapter
Step, downloads to open an account and material file and is uploaded to Fund Company's SFTP servers from internal cloud platform, then performs route the
Two steps, the interface IP address and interface parameter list for needing to ask are obtained according to Fund Company and type of service, to call outside base
King Company's operation system interface, afterwards, outside Fund Company's operation system perform corresponding open an account logic, such as docking port parameter
And the material file uploaded verifies etc., and service processing result is returned, the service processing result can include business
Handle successfully with business processing failure information, when business processing fails, outside Fund Company's operation system returns to corresponding lose
Reason is lost, material file of such as opening an account is undesirable, information solicitation of opening an account does not meet specification.
Step S40, receive the service processing result that the external service system interface the returns and result is anti-
It is fed to the trading platform system.
Adapter receives the service processing result that external service system returns, and result then is fed back into transaction platform
System, after trading platform system receives the result of remitting money of adapter return, the result that will remit money is shown in user front end.With
Exemplified by clearing payment transaction on line, the success if system for settling account of the same trade or business is remitted money, the successful information that will remit money is back to transaction platform
System front end is to prompt user that this is merchandised successfully;If system for settling account of the same trade or business is remitted money unsuccessfully, by failure cause (such as account balance
Deficiency, account have been canceled) trading platform system front end is back to, to prompt this Fail Transaction of user, now user can
To implement corresponding remedial measure, such as account charging, replacing clearing account etc. according to failure cause.
In the present embodiment, adapter receives the business processing request that trading platform system is sent, and obtains at the business
The service identification information that reason request carries;Default routing configuration information database is searched according to the service identification information, obtained
To the routing configuration information of the business;External service system interface is called according to the routing configuration information;Receive described outer
The result is simultaneously fed back to the trading platform system by the service processing result of portion's operation system interface return.This implementation
Example sets routing configuration information by disposing adapter between trading platform system and external service system, and based on adapter
Database, so as to which in Added Business type, developer need to only write the routing configuration information code of Added Business, without
Again whole item code is developed, reduces the development cost of service code, in addition, in business change, developer only needs
The routing configuration information code of adapter is changed, improves the flexibility of service code.
Further, reference picture 3, Fig. 3 are the schematic flow sheet of method for processing business second embodiment of the present invention.Based on upper
The embodiment shown in Fig. 2 is stated, before step S10, can be included:
Step S50, for service identification information and routing configuration information corresponding to the setting of different types of business, tied setting
Fruit is preserved into routing configuration information database.
In the present embodiment, developer need to be in advance service identification information and road corresponding to the setting of different types of business
By configuration information, and result will be set to preserve into the routing configuration information database of adapter.Wherein, service identification information is used
Can be service code or Business Name in distinguishing different type of service, such as, can be business 1, business 2 ..., business n
Service code 1,2 ..., n, and routing configuration information 1 corresponding to setting respectively, routing configuration information 2 ..., route are distributed respectively
Configuration information n, routing configuration information should include routing order, routing interface and interface parameters.In this way, subsequent adaptation device is connecing
When receiving the business processing request of trading platform system transmission, it becomes possible to the service identification letter carried in being asked according to business processing
Breath identification type of service, and determine that such business needs the interface called, protected so as to provide premise for the normal operation of business
Card.
Further, based on method for processing business second embodiment of the present invention, method for processing business the 3rd of the present invention is proposed
Embodiment.Reference picture 4, Fig. 4 are the refinement step schematic diagram of step S30 in Fig. 3.Based on the embodiment shown in above-mentioned Fig. 3, step
S30 can include:
Step S31, determine that the external service system interface that the business processing is asked is adjusted according to the routing configuration information
Use type;
Step S32, when the interface interchange type is the file interface, from described in trading platform system acquisition
The material file of business, the file interface is called so that the material file got is uploaded into the external business system
System;
Step S33, when the interface interchange type is the business processing interface, obtain the business processing interface
Required parameter, the required parameter got is subjected to the first form conversion and encryption and endorsed processing, is called at the business
Interface is managed so that the required parameter after processing is uploaded into the external service system.
In the present embodiment, external service system interface includes file interface and business processing interface, wherein, file interface
For realizing that the file between trading platform system and external service system transmits, such as SFTP service interfaces, FTP (File
Transfer Protocol, FTP) service interface etc., business processing Interface User realizes business processing logic, such as
Query interface, payment interface, verification interface etc..
After adapter gets routing configuration information, according to the file interface parameter that is configured in routing configuration information and
Business processing interface parameters just can determine that the external service system interface interchange type and calling order of business processing request.
When interface interchange type is the file interface, adapter obtains the material text of business from trading platform system
Part, the file interface is then called so that the material file got is uploaded into external service system, opened an account business with fund
Exemplified by, the material file of opening an account that the fund business of opening an account needs user to upload mainly includes the copy of the business license, organization's generation
Code copy, status of a legal person card copy, fund business letter of authority copy etc., cloud platform of the adapter from transaction system
These material files are downloaded, and outside Fund Company is uploaded to by the way that SFTP service interfaces or FTP service interface are corresponding
SFTP servers or ftp server.
When interface interchange type is the business processing interface, adapter obtains the required parameter of business processing interface,
And the required parameter got is subjected to the first form conversion and encryption and endorsed processing, wherein, required parameter is to realize industry
Parameter needed for business, for example opened an account business for fund, its required parameter are opened an account the ginseng such as mechanism information, date of opening an account including request
Number, because the data message form of Fund Company is varied, such as xml forms, json forms, form forms, therefore, exploitation
Personnel need to pre-define the parameter format of the defined of different external service system interfaces, and adapter is getting interface requests
During parameter, parameter format as defined in outside Fund Company is converted into first, can be with such as when required parameter form is json
It is the forms such as xml, plain text, form to be defined according to interface by json corresponding conversions, after row format conversion is entered, to ensure number
According to safety, adapter is encrypted and endorsed according to preset algorithm (such as rsa algorithms, md5 algorithms) to required parameter again, then calls
Business processing interface by the required parameter after processing to be uploaded to external service system.
Further, step S40 can include:
Step S41, the service processing result that the business processing interface returns is received, the service processing result is carried out
The trading platform system is fed back to after decryption solution label and the conversion of the second form.
Adapter is carried out service processing result corresponding when receiving the service processing result of business processing interface return
Decryption solution label and the conversion of the second form, to be converted into after parameter format as defined in trading platform system, to feed back to transaction flat
Platform system.
The present embodiment adapter calls different external service system interfaces according to the difference of routing configuration information, and right
Interface parameters enters row format conversion and encryption is endorsed, and enables adaptation to the needs of different external service system interfaces, improves number
According to the security of transmission, the normal operation of business ensure that.
Further, reference picture 5, Fig. 5 are the schematic flow sheet of method for processing business fourth embodiment of the present invention.Based on this
The embodiment of invention method for processing business first, second, and third, after the step s 40, it can also include:
Step S60, when receiving the online heat deployment instruction of user's triggering, obtain online heat deployment packet;
Step S70, the routing configuration information database is carried out according to the online heat deployment packet got
Online heat deployment.
In the present embodiment, when trading platform system Added Business type or business change, developer can be based on suitable
The interactive interface of orchestration triggers online heat deployment instruction, and adapter is being received after the instruction of line heat deployment, can be according to online
Heat deployment packet carries out online heat deployment to routing configuration information database.Specifically, online heat deployment packet includes needing
The class file of routing configuration information database, and specific Service Component are write, for increasing or changing routing configuration letter newly
Breath, Data Format Transform rule and encryption and decryption, add the behaviors such as sign test, adapter new class file or specific Service Component
Class file or Service Component old in routing configuration information database are replaced, related service code is carried out online so as to realize
Heat deployment.
In this way, service operation and change can become very simple, even strong business correlation code can also be placed on heat
In deployment package, online heat deployment is realized, without restarting project, does not also interfere with other service lines, testing cost
It is very low with modification risk.
The present invention also provides a kind of adapter.
Adapter of the present invention includes:Memory, processor and it is stored on the memory and can be on the processor
The business processing program of operation, the business processing program are realized lower step during the computing device:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
Further, the business processing program is also realized lower step during the computing device:
For different types of business set corresponding to service identification information and routing configuration information, will set result preserve to
In routing configuration information database.
Further, the external service system interface includes file interface and business processing interface, the business processing
Program is also realized lower step during the computing device:
The external service system interface interchange type of the business processing request is determined according to the routing configuration information;
When the interface interchange type is the file interface, the material of the business is obtained from the trading platform system
Expect file, call the file interface so that the material file got is uploaded into the external service system;
When the interface interchange type is the business processing interface, the request ginseng of the business processing interface is obtained
Number, the required parameter got is subjected to the first form conversion and encryption and endorsed processing, calls the business processing interface
So that the required parameter after processing is uploaded into the external service system.
Further, the business processing program is also realized lower step during the computing device:
The service processing result that the business processing interface returns is received, solution label are decrypted in the service processing result
The trading platform system is fed back to after being changed with the second form.
Wherein, the method that the business processing program run on the processor is realized when being performed can refer to the present invention
Method for processing business embodiment, here is omitted.
The present invention also provides a kind of computer-readable recording medium.
Business processing program is stored with computer-readable recording medium of the present invention, the business processing program is by processor
Following steps are realized during execution:
The business processing request that trading platform system is sent is received, obtains the service identification that the business processing request carries
Information;
Default routing configuration information database is searched according to the service identification information, the route for obtaining the business is matched somebody with somebody
Confidence ceases;
External service system interface is called according to the routing configuration information;
Receive the service processing result that the external service system interface returns and feed back to the result described
Trading platform system.
Wherein, the method that the business processing program run on the processor is realized when being performed can refer to the present invention
Method for processing business embodiment, here is omitted.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or system including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or system institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Other identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions are make it that a station terminal adapter (can be hand
Machine, computer, server, air conditioner, or network adapter etc.) perform method described in each embodiment of the present invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair
The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.