Summary of the invention
The main object of the present invention is to provide a kind of server, message processing method and computer readable storage medium, purportIt is solving when the data process method of business processing side's gateway interface changes, code need to be remodified and restart business and askedThe problem of side's of asking server.
To achieve the above object, a kind of server proposed by the present invention, the server include memory and processor, instituteIt states and is stored with message handler on memory, the message handler realizes following steps when being executed by the processor:
Obtaining step: when receiving the instruction of default first kind service request, the default first kind business of this is obtainedBusiness information;
First query steps: according in the business information of acquisition business processing side's service identity information and in advance reallyMapping relations between fixed business processing side's service identity information and configuration information inquire the default first kind industryIt is engaged in corresponding configuration information;
Second query steps: according in the business information of acquisition business processing side's service identity information and in advance reallyMapping relations between fixed business processing side's service identity information and gateway interface information inquire the default first kindThe corresponding gateway interface information of type business;
Assembling steps: according to the business information and the configuration information, default first kind service request message is assembled;
Sending step: the default first kind service request message after assembling is sent to the gateway inquiredThe corresponding service request side's gateway interface of interface message, for service request side's gateway interface by the default first kind industryBusiness request message is sent to corresponding business processing side's gateway interface.
Preferably, first query steps include:
It is closed according to the mapping between predetermined business processing side's service identity information and configuration information identifierSystem, inquires the corresponding configuration information identifier of business processing side's service identity information in the business information;
It is inquired according to the mapping relations between the predetermined configuration information identifier and configuration information, determinationThe corresponding configuration information of the configuration information identifier, the configuration information, which is that the default first kind business is corresponding, matchesConfidence breath.
Preferably, the obtaining step includes:
The service requesting information in the default first kind service request instruction is extracted, according to the service requesting informationAnd predetermined selection rule selects alternative optimum service channel in predetermined a plurality of service channel;
Obtain the service channel information of the optimal service channel, and by the service requesting information and service channel informationBusiness information as the default first kind business.
Preferably, the processor executes the message handler, after the sending step, also realizes following stepIt is rapid:
Receive the default first kind business returned packet that service request side's gateway interface returns, and according to inquiringThe configuration information, parse the default first kind business returned packet.
Preferably, the processor executes the message handler, after the sending step, also realizes following stepIt is rapid:
When not receiving the default first kind business returned packet in preset duration, start default Second TypeBusiness, the default Second Type business includes inquiry business;
When the default Second Type business of starting is inquiry business, inquiry business identification information is generated, and obtainThe corresponding business information of default first kind service request message to be checked, and business processing side is extracted from the business informationService identity information and service identification information are as inquiry business information;
At business processing side's service identity information, inquiry business identification information and the predetermined businessMapping relations between reason side's service identity information, inquiry business identification information and configuration information three obtain the inquiry industryIt is engaged in corresponding configuration information;
At business processing side's service identity information, inquiry business identification information and the predetermined businessMapping relations between reason side's service identity information, inquiry business identification information and gateway interface information three are looked into described in acquisitionAsk the corresponding gateway interface information of business information;
According to the inquiry business information and the configuration information, inquiry request message is assembled, and will be described in after assemblingInquiry request message is sent to the corresponding service request side's gateway interface of the gateway interface information of acquisition, asks for the businessThe inquiry request message is sent to corresponding business processing side's gateway interface by the side's of asking gateway interface;
The inquiry returned packet that service request side's gateway interface returns is received, and according to the configuration information, parsingThe inquiry returned packet, to obtain query result.
In addition, to achieve the above object, the present invention also proposes a kind of message processing method, which is characterized in that this method packetIt includes:
Obtaining step: when receiving the instruction of default first kind service request, the default first kind business of this is obtainedBusiness information;
First query steps: according in the business information of acquisition business processing side's service identity information and in advance reallyMapping relations between fixed business processing side's service identity information and configuration information inquire the default first kind industryIt is engaged in corresponding configuration information;
Second query steps: according in the business information of acquisition business processing side's service identity information and in advance reallyMapping relations between fixed business processing side's service identity information and gateway interface information inquire the default first kindThe corresponding gateway interface information of type business;
Assembling steps: according to the business information and the configuration information, default first kind service request message is assembled;
Sending step: the default first kind service request message after assembling is sent to the gateway inquiredThe corresponding service request side's gateway interface of interface message, for service request side's gateway interface by the default first kind industryBusiness request message is sent to corresponding business processing side's gateway interface.
Preferably, the obtaining step includes:
The service requesting information in the default first kind service request instruction is extracted, according to the service requesting informationAnd predetermined selection rule selects alternative optimum service channel in predetermined a plurality of service channel;
Obtain the service channel information of the optimal service channel, and by the service requesting information and service channel informationBusiness information as the default first kind business.
Preferably, after the sending step, this method further include:
Receive the default first kind business returned packet that service request side's gateway interface returns, and according to inquiringThe configuration information, parse the default first kind business returned packet.
Preferably, after the sending step, this method further include:
When not receiving the default first kind business returned packet in preset duration, start default Second TypeBusiness, the default Second Type business includes inquiry business;
When the default Second Type business of starting is inquiry business, inquiry business identification information is generated, and obtainThe corresponding business information of default first kind service request message to be checked, and business processing side is extracted from the business informationService identity information and service identification information are as inquiry business information;
At business processing side's service identity information, inquiry business identification information and the predetermined businessMapping relations between reason side's service identity information, inquiry business identification information and configuration information three obtain the inquiry industryIt is engaged in corresponding configuration information;
At business processing side's service identity information, inquiry business identification information and the predetermined businessMapping relations between reason side's service identity information, inquiry business identification information and gateway interface information three are looked into described in acquisitionAsk the corresponding gateway interface information of business information;
According to the inquiry business information and the configuration information, inquiry request message is assembled, and will be described in after assemblingInquiry request message is sent to the corresponding service request side's gateway interface of the gateway interface information of acquisition, asks for the businessThe inquiry request message is sent to corresponding business processing side's gateway interface by the side's of asking gateway interface;
The inquiry returned packet that service request side's gateway interface returns is received, and according to the configuration information, parsingThe inquiry returned packet, to obtain query result.
In addition, to achieve the above object, the present invention also proposes a kind of computer readable storage medium, described computer-readableStorage medium is stored with message handler, and the message handler can be executed by least one processor so that it is described extremelyA step of few processor executes message processing method as described in any one of the above embodiments.
The present invention obtains the business information of default first kind business, is believed according to the business of the default first kind business of thisThe corresponding configuration information of breath inquiry this first kind business and gateway interface information, according to business information and configuration information, groupDefault first kind service request message is filled, and the default first kind service request message after assembling is sent to corresponding netClose interface.Compared to the prior art, the present invention with business processing side's progress interface when docking, according to the gateway of business processing sideInterface data handles logic and configuration information is arranged, when service request side needs that business processing side is called to carry out business processing, rootAccording to configuration information assembling, analytic message and call gateway interface.The present invention is at the gateway interface data of business processing sideWhen reason logic changes, it is not necessary to modify code and server is restarted, it is only necessary to modify to corresponding configuration information, after modificationConfiguration information once saving, then come into force, under the premise of not influencing service request method, system and operating normally, improve and beSystem maintenance efficiency.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, andIt is non-to be used to limit the scope of the invention.
As shown in fig.1, being the optional application environment schematic diagram of each embodiment one of the invention.
In the present embodiment, present invention can apply to include but are not limited to, server 1, multiple client 2, Duo GeyeIt is engaged in the application environment of requesting party's gateway interface 3, multiple business processing side's gateway interfaces 4, business processing side's server 5.ServiceDevice 1 is communicated to connect with multiple client 2 and multiple service request side's gateway interfaces respectively, and each service request side's gateway interface 3It is communicated to connect with corresponding business processing side's gateway interface 4, multiple business processing side's gateway interfaces 4 and business processing side's server5 communication connections.
The client 2 is the client of service request side, which will use for providing user interfaceThe default first kind service request instruction of family triggering is sent to the processing of server 1, and receives the business processing that server 1 returnsAs a result.
The server 1 is the server of service request side, which realizes this for running message handlerThe step of invention message processing method.
Service request side's gateway interface 3 is used to receive the message of the transmission of server 1, and the message is sent to correspondenceBusiness processing side's gateway interface 4, service request side's gateway interface 3 is also used to receive business processing side's gateway interface 4 and returnsThe message returned, and the message of the return is sent to service request side's gateway interface 3.
Business processing side's gateway interface 4 is used to receive the message of the transmission of service request side's gateway interface 3, and by the reportText is parsed into the readable data of business processing side's server 5, and business processing side's gateway interface 4 is also used to business processing sideThe data assembling that server 5 is sent is sent to corresponding service request side's gateway interface 3 at message.
Business processing side's server 5 is used to receive the data of the transmission of business processing side's gateway interface 4, according to the dataBusiness processing is carried out, and by the result return value business processing side gateway interface 4 of business processing.
So far, oneself is through describing the application environment of each embodiment of the present invention and the hardware configuration and function of relevant device in detailEnergy.In the following, above-mentioned application environment and relevant device will be based on, each embodiment of the invention is proposed.
The present invention proposes a kind of message handler.
Referring to Fig. 2, being the running environment schematic diagram of 10 first embodiment of message handler of the present invention.
In the present embodiment, message handler 10 is installed and is run in server 1.Server 1 is that one kind can be byAccording to the instruction for being previously set or storing, the equipment of calculating and/or information processing is carried out automatically.The server 1 may include, but notIt is only limitted to, memory 11, processor 12 and display 13.Fig. 2 illustrates only the server 1 with component 11-13, but should manageSolution is, it is not required that implements all components shown, the implementation that can be substituted is more or less component.
Memory 11 can be the internal storage unit of server 1, such as the hard disk of the server 1 in some embodimentsOr memory.Memory 11 is also possible to match on the External memory equipment of server 1, such as server 1 in further embodimentsStandby plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD)Card, flash card (Flash Card) etc..Further, memory 11 can also both including server 1 internal storage unit orIncluding External memory equipment.Memory 11 is installed at the application software and Various types of data, such as message of server 1 for storingManage the program code etc. of program 10.Memory 11 can be also used for temporarily storing the data that has exported or will export.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit,CPU), microprocessor or other data processing chips, program code or processing data for being stored in run memory 11, exampleSuch as execute message handler 10.
Display 13 can be in some embodiments light-emitting diode display, liquid crystal display, touch-control liquid crystal display andOLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Display 13 is for being shown inThe information that is handled in server 1 and for showing visual user interface.The component 11-13 of server 1 is total by programLine is in communication with each other.
Referring to Fig. 3, being the Program modual graph of 10 first embodiment of message handler of the present invention.In the present embodiment,Message handler 10 can be divided into one or more modules, one or more module is stored in memory 11,And it is performed by one or more processors (the present embodiment is processor 12), to complete the present invention.For example, in Fig. 3, messageIt is die-filling that processing routine 10 can be divided into the first acquisition module 101, the first enquiry module 102, the second enquiry module 103, groupBlock 104 and sending module 105.The so-called module of the present invention is the series of computation machine program instruction for referring to complete specific functionSection, the implementation procedure than program more suitable for description message handler 10 in the server 1, in which:
First obtains module 101, for when receiving the instruction of default first kind service request, obtaining this default theThe business information of one type service.
Specifically, above-mentioned default first kind service request instruction can be initiated by user by client, for example, user needsIt to be paid by business processing side, when jumping to the payment page, trigger the default first kind service request.
Above-mentioned default first kind business includes but is not limited to: collecting business pays out business and authentication services.
So-called collecting business refers to based on holder and trade company (for example, e-commerce platform of service request side's operation) labelBusiness entrustment agreement is ordered, permits trade company according to protocol conventions, requested to holder's destiny account and completes specified fund paymentBusiness is transferred for realizing based on the cardholder account fund under agreement purposes to merchant account orientation.
So-called business of paying out refers to that trade company's (for example, e-commerce platform of service request side's operation) settles accounts from itself unitAccount carries out fund to holder appointed bank card account and draws the business paid, such as settlement of insurance claim, fund share out bonus, pay out payment for goods.
So-called authentication services refer to whether business processing side verifying user possesses the business of access system rights.
Referring to Fig. 4, described first, which obtains module 101, includes selecting unit 1011, acquiring unit 1012, in which:
Selecting unit 1011, for extracting the service requesting information in the default first kind service request instruction, rootAlternative optimum industry is selected in predetermined a plurality of service channel according to the service requesting information and predetermined selection ruleBusiness channel.
Specifically, above-mentioned service requesting information includes type of service, service identification information, business tine information.
Wherein, the type of service includes collecting business, pays out business and authentication services.
The service identification information includes business number, for example, O/No. etc..
Above-mentioned business tine information based on type of service difference it is different, if such as type of service be collecting business orPerson pays out business, then business tine information includes payer information, beneficiary information, transaction amount quantity etc.;If type of serviceFor authentication services, then business tine information includes subscriber identity information, bank card information etc..
Above-mentioned service channel is the business processing link divided according to the service that business processing side provides.For example, Unionpay's generationReceive channel, Unionpay pays out channel, Unionpay's authentication channel, bank A withholds channel, bank A pays out channel, bank A authenticates channel etc..
The service that above-mentioned business processing side provides is the accessible business in the business processing side.
In the other embodiments in addition to the present embodiment, also service channel can be divided according to specific application scenarios, thisInvention is not construed as limiting this.
Preferably, above-mentioned predetermined selection rule includes: in the present embodiment
Firstly, determining the service channel for supporting this business as service channel to be selected according to the service requesting information.
Whether one service channel supports the judgment method of the default first kind business of this as follows:
According to the type of service, judge whether the service channel possesses the power of the processing default first kind business of thisLimit, if it is not, then determining that the service channel does not support the default first kind business of this, if so, continuing to judge the service channelWhether (for example, some channel possible breakdown, then the channel close) is opened.
When the default first kind business is authentication services, if the service channel is opened, the service channel is determinedIt supports the default first kind business of this, if the service channel is not opened, determines that the service channel does not support this default theOne type service.
When the default first kind business is collecting business or pays out business, according in the business tine informationTransaction amount quantity, judge whether the service channel of the unlatching meets preset limit condition (for example, judging the industry of the unlatchingThe new friendship that the business channel same day processed transaction amount total amount is obtained plus the transaction amount quantity in the business tine informationWhether easy amount of money total amount is less than preset threshold), if satisfied, then determining that the service channel supports the default first kind business of thisService channel, if not satisfied, then determining that the service channel does not support the default first kind business of this.
Then, the parameters sortnig based on each service channel to be selected is ranked up processing to the service channel to be selected,And export ranking results.
Above-mentioned parameters sortnig includes service rate, (i.e. business processing side completes collecting business or pays out industry business timelinessThe time required to business), priority etc..The parameters sortnig can be set according to demand, however it is not limited to the above-mentioned content enumerated.
The above-mentioned parameters sortnig based on each service channel to be selected is ranked up processing to the service channel to be selectedStep specifically includes:
The service channel to be selected is ranked up by the sequence based on priority from high to low.
The service channel to be selected of equal priority is ranked up based on the sequence of service rate from low to high.
Priority and payment rate service channel to be selected all the same are carried out based on the sequence of business timeliness from short to longSequence, to obtain service channel to be selected by excellent to bad ranking results.
Above-mentioned service rate refers to the service rate that business processing direction service request side collects.And if type of service isAuthentication services, then business timeliness is not as parameters sortnig.
Finally, being based on the ranking results, the service channel to be selected of preset condition will be met as optimal service channel.
Above-mentioned preset condition can be set as needed, for example, if the ranking results be service channel to be selected by excellent to badSequence sequence as a result, then the preset condition be the primary service channel to be selected of selected and sorted.
Acquiring unit 1012, for obtaining the service channel information of the optimal service channel, and by the service requestThe business information of information and service channel information as the default first kind business.
Preferably, in the present embodiment, the service channel information of above-mentioned optimal service channel includes business processing side's service markKnow information, so-called business processing side's service identity information refers to the identification information for the service that business processing side provides, for example, bankIt is 001002 that A, which withholds service identity information,.
In the other embodiments in addition to the present embodiment, the service channel information of above-mentioned optimal service channel may also includeBusiness processing side's authority identification information, for example, bank's A authority identification information is 001.
First enquiry module 102, for business processing side's service identity information in the business information according to acquisitionAnd the mapping relations between predetermined business processing side's service identity information and configuration information, inquire described default theThe corresponding configuration information of one type service.
Specifically, above-mentioned configuration information is arranged previously according to the gateway interface data process method of business processing side.
Referring to Fig. 5, it is preferable that in the present embodiment, above-mentioned first enquiry module 102 includes the first query unit 1021, theTwo query units 1022, in which:
First query unit 1021, for according to predetermined business processing side's service identity information and with confidenceThe mapping relations between identifier are ceased, the business processing side's service identity information inquired in the business information is corresponding with confidenceIt ceases identifier (for example, configuration information ID).
The corresponding configuration information identifier of business processing side's service identity information is the default first kind industryIt is engaged in corresponding configuration information identifier.
Mapping relations between above-mentioned business processing side's service identity information and configuration information identifier can be stored in correspondingMapping table in.
Second query unit 1022, for according between the predetermined configuration information identifier and configuration informationMapping relations determine the corresponding configuration information of the configuration information identifier inquired, and the configuration information is described pre-If the corresponding configuration information of first kind business.
Specifically, the mapping relations between the configuration information identifier and configuration information can be stored in corresponding mapping and closeIt is in table.
In addition, above-mentioned first query unit 1021, second are looked into referring to figure in the other embodiments in addition to the present embodimentAsking unit 1022 can be replaced by third query unit (not shown), and the third query unit is used for:
According in the business information of acquisition business processing side's service identity information and the predetermined business processingMapping relations between square service identity information, configuration information identifier and configuration information three, inquire the business processing sideThe corresponding configuration information of service identity information is to get to the corresponding configuration information of the default first kind business.
Preferably, in the present embodiment, when message handler 10 is executed by processor 12, described according to acquisitionBusiness processing side's service identity information and predetermined business processing side's service identity information in business information with matchMapping relations between confidence breath are also realized before the step of inquiring the default first kind business corresponding configuration informationFollowing steps: all configuration informations of load (parse) in memory, it is all with confidence needed for subsequent Message processing of the present inventionBreath can be inquired from memory.In addition, detecting whether the configuration information has update in real time or periodically, if so, in memoryReload the configuration information.
Second enquiry module 103, for business processing side's service identity information in the business information according to acquisitionAnd the mapping relations between predetermined business processing side's service identity information and gateway interface information, it inquires described pre-If the corresponding gateway interface information of first kind business.
Specifically, above-mentioned gateway interface refers to the gateway interface of service request side's setting, it is generally the case that service request sideOne gateway is set for each business processing side, and the respective services provided according to the business processing side are arranged multiple gateways and connectMouthful.
Above-mentioned gateway interface information includes gateway interface identifier (for example, gateway interface ID).
Mapping relations between above-mentioned business processing side's service identity information and gateway interface information can at above-mentioned businessMapping relations between reason side's service identity information and configuration information identifier are stored in same mapping relation table, alternatively, onMark can be serviced with above-mentioned business processing side by stating the mapping relations between business processing side's service identity information and gateway interface informationThe mapping relations known between information and configuration information identifier are stored respectively in different mapping tables.
Module 104 is assembled, for default first kind business being assembled and being asked according to the business information and the configuration informationSeek message.
Above-mentioned configuration information defines default first kind industry according to the gateway interface data process method of business processing sideTherefore the rigging of business request message is based on the rigging, assembles business information as message content, so as toBusiness processing side can directly read the default first kind service request report when receiving the first kind service request messageText.
Sending module 105 is inquired for the default first kind service request message after assembling to be sent toThe corresponding service request side's gateway interface of the gateway interface information, so that service request side's gateway interface will be described defaultFirst kind service request message is sent to corresponding business processing side's gateway interface.
Specifically, firstly, the default first kind service request message after assembling is sent to the service request inquiredSquare gateway interface, and the corresponding business information of default first kind service request message is subjected to storage processing (for example, being stored inIn database).Then, the default first kind service request message is sent to by service request side's gateway interface correspondingBusiness processing side's gateway interface, business processing side's gateway interface are right after receiving the default first kind service request messageThe default first kind business of this is handled.
The present embodiment obtains the business information of default first kind business, according to the business of the default first kind business of thisInformation inquires the corresponding configuration information of this first kind business and gateway interface information, according to business information and configuration information,Default first kind service request message is assembled, and the default first kind service request message after assembling is sent to correspondingGateway interface.Compared to the prior art, the present embodiment with business processing side's progress interface when docking, according to business processing sideConfiguration information is arranged in gateway interface data process method, when service request side needs that business processing side is called to carry out business processingWhen, according to configuration information assembling, analytic message and call gateway interface.Gateway interface of the present embodiment in business processing sideWhen data process method changes, it is not necessary to modify code and server is restarted, it is only necessary to it modifies to corresponding configuration information,Modified configuration information then comes into force once saving, and under the premise of not influencing service request method, system normal operation, mentionsHigh system maintenance efficiency.
As shown in fig. 6, Fig. 6 is the Program modual graph of 10 second embodiment of message handler of the present invention.
For the present embodiment on the basis of first embodiment, which further includes receiving module 106, and receiving module 106 is used forThe default first kind business returned packet that service request side's gateway interface returns is received, and is matched according to inquiringConfidence breath, parses the default first kind business returned packet.
Specifically, business processing side's gateway interface returns to default first kind business returned packet to corresponding service requestSquare gateway interface, service request side's gateway interface return to the default first kind business returned packet.Due to the configuration informationIn include according to the parsing data of the pre-set returned packet field of service processing side's gateway interface data process method, becauseThis can parse default first kind business returned packet according to the configuration information.
If including error code in the default first kind business returned packet, according to predetermined business processing modeMapping relations between service identity information and error code parsing information search corresponding error code parsing information, and according to thisThe error code parsing information found carries out escape to the error code.
Preferably, in the present embodiment, when the type of service of the default first kind business is collecting business or is paid outWhen business, message handler 10 further includes update module (not shown), and the update module is used for, according to the businessTransaction amount quantity in solicited message, every daily trading limit data of the payer of more new record are (from every daily trading limit numberTransaction amount is reduced in).
The update module is also used to, when the default first kind business returned packet according to parsing determines that collecting business is lostWhen losing or paying out service fail, every daily trading limit data of the payer of more new record are (from every daily trading limit dataThe transaction amount that rollback is reduced).
As shown in fig. 7, Fig. 7 is the Program modual graph of 10 3rd embodiment of message handler of the present invention.
For the present embodiment on the basis of the first, second embodiment, which further includes starting module 107, inquiry business mouldBlock 108, in which:
Starting module 107, for when not receiving the default first kind business returned packet in preset duration,Start default Second Type business.
Specifically, the default Second Type business includes inquiry business.
Preferably, the program further includes inquiry business module 108 in the present embodiment, and inquiry business module 108 is used for:
Firstly, inquiry business identification information is generated when the default Second Type business of starting is inquiry business, andThe corresponding business information of default first kind service request message to be checked is obtained, and is extracted from business from the business informationReason side's service identity information and service identification information are as inquiry business information.
Specifically, due to being sent to service requester gateway interface in default first kind service request message to be checkedWhen, the corresponding business information of the default first kind service request message to be checked is subjected to storage processing, thus, it is only required to fromThe corresponding business information of the default first kind service request message to be checked is found out in memory space.
Then, according to business processing side's service identity information, inquiry business identification information and predetermined describedMapping relations between business processing side's service identity information, inquiry business identification information and configuration information three, described in acquisitionThe corresponding configuration information of inquiry business.
Specifically, according to business processing side's service identity information, inquiry business identification information and the predetermined industryThe mapping relations being engaged between processing side's service identity information, inquiry business identification information and configuration information identifier three, inquiryThe corresponding configuration information identifier (for example, configuration information ID) of the inquiry business.Specifically, the above-mentioned predetermined industryMapping relations between business processing side's service identity information, inquiry business identification information and configuration information identifier three can storeIn corresponding mapping table.
According to the configuration information identifier and the predetermined configuration information identifier inquired and with confidenceMapping relations between breath inquire the corresponding configuration information of the configuration information identifier.Inquire obtained configuration information markAccording with corresponding configuration information is the corresponding configuration information of the inquiry business.The configuration information identifier and configuration information itBetween mapping relations can be stored in corresponding mapping table.
Then, according to business processing side's service identity information, inquiry business identification information and predetermined describedMapping relations between business processing side's service identity information, inquiry business identification information and gateway interface information three obtainThe corresponding gateway interface information of the inquiry business information.
Above-mentioned predetermined business processing side's service identity information, inquiry business identification information and gateway interface letterCease mapping relations and above-mentioned predetermined business processing side's service identity information between three, inquiry business mark is believedMapping relations between breath and configuration information identifier three can be stored in same mapping relation table, can also be stored respectively in notIn same mapping table.
Then, according to the inquiry business information and the configuration information, inquiry request message is assembled, and will be after assemblingThe inquiry request message is sent to the corresponding service request side's gateway interface of the gateway interface information of acquisition, for the industryThe inquiry request message is sent to corresponding business processing side's gateway interface by business requesting party's gateway interface.
Specifically, inquiry is defined according to the gateway interface data process method of business processing side due to above-mentioned configuration informationTherefore the rigging of request message is based on the rigging, assembles using inquiry business information as message content, withJust business processing side can directly read the inquiry request message when receiving the inquiry request message.
Finally, receive the inquiry returned packet that service request side's gateway interface returns, and according to the configuration information,The inquiry returned packet is parsed, to obtain query result.
Specifically, due to including to be set in advance according to service processing side's gateway interface data process method in the configuration informationTherefore the parsing data for the inquiry returned packet field set according to the configuration information, can solve inquiry returned packetAnalysis, to obtain query result.
The present embodiment passes through starting when not receiving the default first kind business returned packet in preset durationInquiry business would know that the state of the currently processed default first kind business in business processing side, so that reason state is according to thisMake to adjust business processing strategy.
In addition, the present invention proposes a kind of message processing method.
As shown in figure 8, Fig. 8 is the flow diagram of message processing method first embodiment of the present invention.
In the present embodiment, this method comprises:
Step S10 obtains the default first kind business of this when receiving the instruction of default first kind service requestBusiness information.
Specifically, above-mentioned default first kind service request instruction can be initiated by user by client, for example, user needsIt to be paid by business processing side, when jumping to the payment page, trigger the default first kind service request.
Above-mentioned default first kind business includes but is not limited to: collecting business pays out business and authentication services.
So-called collecting business refers to based on holder and trade company (for example, e-commerce platform of service request side's operation) labelBusiness entrustment agreement is ordered, permits trade company according to protocol conventions, requested to holder's destiny account and completes specified fund paymentBusiness is transferred for realizing based on the cardholder account fund under agreement purposes to merchant account orientation.
So-called business of paying out refers to that trade company's (for example, e-commerce platform of service request side's operation) settles accounts from itself unitAccount carries out fund to holder appointed bank card account and draws the business paid, such as settlement of insurance claim, fund share out bonus, pay out payment for goods.
So-called authentication services refer to whether business processing side verifying user possesses the business of access system rights.
It is specifically included referring to Fig. 9, the step S10:
Step S11 extracts the service requesting information in the default first kind service request instruction, according to the businessSolicited message and predetermined selection rule select alternative optimum service channel in predetermined a plurality of service channel.
Specifically, above-mentioned service requesting information includes type of service, service identification information, business tine information.
Wherein, the type of service includes collecting business, pays out business and authentication services.
The service identification information includes business number, for example, O/No. etc..
Above-mentioned business tine information be based on type of service difference it is different, if such as type of service be collecting business orBusiness is paid out, then business tine information includes payer information, beneficiary information, transaction amount quantity etc.;If type of service isAuthentication services, then business tine information includes subscriber identity information, bank card information etc..
Above-mentioned service channel is the business processing link divided according to the service that business processing side provides.For example, Unionpay's generationReceive channel, Unionpay pays out channel, Unionpay's authentication channel, bank A withholds channel, bank A pays out channel, bank A authenticates channel etc..
The service that above-mentioned business processing side provides is the accessible business in the business processing side.
In the other embodiments in addition to the present embodiment, also service channel can be divided according to specific application scenarios, thisInvention is not construed as limiting this.
Preferably, above-mentioned predetermined selection rule includes: in the present embodiment
Firstly, determining the service channel for supporting this business as service channel to be selected according to the service requesting information.Whether one service channel supports the judgment method of the default first kind business of this as follows:
According to the type of service, judge whether the service channel possesses the power of the processing default first kind business of thisLimit, if it is not, then determining that the service channel does not support the default first kind business of this, if so, continuing to judge the service channelWhether (for example, some channel possible breakdown, then the channel close) is opened.
When the default first kind business is authentication services, if the service channel is opened, the service channel is determinedIt supports the default first kind business of this, if the service channel is not opened, determines that the service channel does not support this default theOne type service.
When the default first kind business is collecting business or pays out business, according in the business tine informationTransaction amount quantity, judge whether the service channel of the unlatching meets preset limit condition (for example, judging the industry of the unlatchingThe new friendship that the business channel same day processed transaction amount total amount is obtained plus the transaction amount quantity in the business tine informationWhether easy amount of money total amount is less than preset threshold), if satisfied, then determining that the service channel supports the default first kind business of thisService channel, if not satisfied, then determining that the service channel does not support the default first kind business of this.
Then, the parameters sortnig based on each service channel to be selected is ranked up processing to the service channel to be selected,And export ranking results.
Above-mentioned parameters sortnig includes service rate, (i.e. business processing side completes collecting business or pays out industry business timelinessThe time required to business), priority etc..The parameters sortnig can be set according to demand, however it is not limited to the above-mentioned content enumerated.
The above-mentioned parameters sortnig based on each service channel to be selected is ranked up processing to the service channel to be selectedStep specifically includes:
The service channel to be selected is ranked up by the sequence based on priority from high to low.
The service channel to be selected of equal priority is ranked up based on the sequence of service rate from low to high.
Priority and payment rate service channel to be selected all the same are carried out based on the sequence of business timeliness from short to longSequence, to obtain service channel to be selected by excellent to bad ranking results.
Above-mentioned service rate refers to the service rate that business processing direction service request side collects.And if type of service isAuthentication services, then business timeliness is not as parameters sortnig.
Finally, being based on the ranking results, the service channel to be selected of preset condition will be met as optimal service channel.
Above-mentioned preset condition can be set as needed, for example, if the ranking results be service channel to be selected by excellent to badSequence sequence as a result, then the preset condition be the primary service channel to be selected of selected and sorted.
Step S12, obtains the service channel information of the optimal service channel, and by the service requesting information and businessBusiness information of the channel information as the default first kind business.
Preferably, in the present embodiment, the service channel information of above-mentioned optimal service channel includes business processing side's service markKnow information, so-called business processing side's service identity information refers to the identification information for the service that business processing side provides, for example, bankIt is 001002 that A, which withholds service identity information,.
In the other embodiments in addition to the present embodiment, the service channel information of above-mentioned optimal service channel may also includeBusiness processing side's authority identification information, for example, bank's A authority identification information is 001.
Step S20, according to business processing side's service identity information in the business information of acquisition and predeterminedMapping relations between business processing side's service identity information and configuration information inquire the default first kind business pairThe configuration information answered.
Specifically, above-mentioned configuration information is arranged previously according to the gateway interface data process method of business processing side.
Referring to Fig.1 0, it is preferable that in the present embodiment, above-mentioned steps S20 is specifically included:
Step S21, according between predetermined business processing side's service identity information and configuration information identifierMapping relations, inquire the corresponding configuration information identifier (example of business processing side's service identity information in the business informationSuch as, configuration information ID).
The corresponding configuration information identifier of business processing side's service identity information is the default first kind industryIt is engaged in corresponding configuration information identifier.
Mapping relations between above-mentioned business processing side's service identity information and configuration information identifier can be stored in correspondingMapping table in.
Step S22 is determined according to the mapping relations between the predetermined configuration information identifier and configuration informationThe corresponding configuration information of the configuration information identifier inquired, the configuration information are the default first kind businessCorresponding configuration information.
Specifically, the mapping relations between the configuration information identifier and configuration information can be stored in corresponding mapping and closeIt is in table.
In addition, above-mentioned steps S21, S22 can be replaced by following steps in the other embodiments in addition to the present embodiment:
According in the business information of acquisition business processing side's service identity information and the predetermined business processingMapping relations between square service identity information, configuration information identifier and configuration information three, inquire the business processing sideThe corresponding configuration information of service identity information is to get to the corresponding configuration information of the default first kind business.
Preferably, in the present embodiment, before step S20, this method further include: load (parsing) is all in memoryConfiguration information, all configuration informations needed for subsequent message processing method of the present invention can be inquired from memory.In addition, in real time orTiming detects whether the configuration information has update, if so, reloading the configuration information in memory.
Step S30, according to business processing side's service identity information in the business information of acquisition and predeterminedMapping relations between business processing side's service identity information and gateway interface information inquire the default first kind industryIt is engaged in corresponding gateway interface information.
Specifically, above-mentioned gateway interface refers to the gateway interface of service request side's setting, it is generally the case that service request sideOne gateway is set for each business processing side, and the respective services provided according to the business processing side are arranged multiple gateways and connectMouthful.
Above-mentioned gateway interface information includes gateway interface identifier (for example, gateway interface ID).
Mapping relations between above-mentioned business processing side's service identity information and gateway interface information can at above-mentioned businessMapping relations between reason side's service identity information and configuration information identifier are stored in same mapping relation table, alternatively, onMark can be serviced with above-mentioned business processing side by stating the mapping relations between business processing side's service identity information and gateway interface informationThe mapping relations known between information and configuration information identifier are stored respectively in different mapping tables.
Above-mentioned steps S20 can be performed simultaneously with step S30 and also execute respectively, and the present invention is to step S20 and step S30Execution sequencing be not construed as limiting.
Step S40 assembles default first kind service request message according to the business information and the configuration information.
Above-mentioned configuration information defines default first kind industry according to the gateway interface data process method of business processing sideTherefore the rigging of business request message is based on the rigging, assembles business information as message content, so as toBusiness processing side can directly read the default first kind service request report when receiving the first kind service request messageText.
The default first kind service request message after assembling is sent to the gateway inquired by step S50The corresponding service request side's gateway interface of interface message, so that service request side's gateway interface is by the default first kindService request message is sent to corresponding business processing side's gateway interface.
Specifically, firstly, the default first kind service request message after assembling is sent to the service request inquiredSquare gateway interface, and the corresponding business information of default first kind service request message is subjected to storage processing (for example, being stored inIn database).Then, the default first kind service request message is sent to by service request side's gateway interface correspondingBusiness processing side's gateway interface, business processing side's gateway interface are right after receiving the default first kind service request messageThe default first kind business of this is handled.
The present embodiment obtains the business information of default first kind business, according to the business of the default first kind business of thisInformation inquires the corresponding configuration information of this first kind business and gateway interface information, according to business information and configuration information,Default first kind service request message is assembled, and the default first kind service request message after assembling is sent to correspondingGateway interface.Compared to the prior art, the present embodiment with business processing side's progress interface when docking, according to business processing sideConfiguration information is arranged in gateway interface data process method, when service request side needs that business processing side is called to carry out business processingWhen, according to configuration information assembling, analytic message and call gateway interface.Gateway interface of the present embodiment in business processing sideWhen data process method changes, it is not necessary to modify code and server is restarted, it is only necessary to it modifies to corresponding configuration information,Modified configuration information then comes into force once saving, and under the premise of not influencing service request method, system normal operation, mentionsHigh system maintenance efficiency.
As shown in figure 11, Figure 11 is the flow diagram of message processing method second embodiment of the present invention.
The present embodiment is on the basis of first embodiment, this method further include:
Step S60 receives the default first kind business returned packet that service request side's gateway interface returns, and rootAccording to the configuration information inquired, the default first kind business returned packet is parsed.
Specifically, business processing side's gateway interface returns to default first kind business returned packet to corresponding service requestSquare gateway interface, service request side's gateway interface return to the default first kind business returned packet.Due to the configuration informationIn include according to the parsing data of the pre-set returned packet field of service processing side's gateway interface data process method, becauseThis can parse default first kind business returned packet according to the configuration information.
If including error code in the default first kind business returned packet, according to predetermined business processing modeMapping relations between service identity information and error code parsing information search corresponding error code parsing information, and according to thisThe error code parsing information found carries out escape to the error code.
Preferably, in the present embodiment, when the type of service of the default first kind business is collecting business or is paid outWhen business, before step S50, further includes:
According to the transaction amount quantity in the service requesting information, every daily trading limit number of the payer of more new recordAccording to (reducing transaction amount from every daily trading limit data).
When the type of service of the default first kind business is collecting business or when paying out business, step S60 itAfterwards, further includes:
If determining collecting business failure according to the default first kind business returned packet of parsing or paying out business mistakeIt loses, then every daily trading limit data (trade gold that rollback is reduced from every daily trading limit data of the payer of more new recordVolume).
As shown in figure 12, Figure 12 is the flow diagram of message processing method 3rd embodiment of the present invention.
The present embodiment is on the basis of the first, second embodiment, this method further include:
Step S70, when not receiving the default first kind business returned packet in preset duration, starting is defaultSecond Type business.
Specifically, the default Second Type business includes inquiry business.
Preferably, in the present embodiment, after the step s 70, this method further include:
Firstly, inquiry business identification information is generated when the default Second Type business of starting is inquiry business, andThe corresponding business information of default first kind service request message to be checked is obtained, and is extracted from business from the business informationReason side's service identity information and service identification information are as inquiry business information.
Specifically, due to being sent to service requester gateway interface in default first kind service request message to be checkedWhen, the corresponding business information of the default first kind service request message to be checked is subjected to storage processing, therefore, in stepIn S80, it is only necessary to find out the corresponding business information of the default first kind service request message to be checked from memory space i.e.It can.
Then, according to business processing side's service identity information, inquiry business identification information and predetermined describedMapping relations between business processing side's service identity information, inquiry business identification information and configuration information three, described in acquisitionThe corresponding configuration information of inquiry business.
Specifically, according to business processing side's service identity information, inquiry business identification information and the predetermined industryThe mapping relations being engaged between processing side's service identity information, inquiry business identification information and configuration information identifier three, inquiryThe corresponding configuration information identifier (for example, configuration information ID) of the inquiry business.Specifically, the above-mentioned predetermined industryMapping relations between business processing side's service identity information, inquiry business identification information and configuration information identifier three can storeIn corresponding mapping table.
According to the configuration information identifier and the predetermined configuration information identifier inquired and with confidenceMapping relations between breath inquire the corresponding configuration information of the configuration information identifier.Inquire obtained configuration information markAccording with corresponding configuration information is the corresponding configuration information of the inquiry business.The configuration information identifier and configuration information itBetween mapping relations can be stored in corresponding mapping table.
Then, according to business processing side's service identity information, inquiry business identification information and predetermined describedMapping relations between business processing side's service identity information, inquiry business identification information and gateway interface information three obtainThe corresponding gateway interface information of the inquiry business information.
Above-mentioned predetermined business processing side's service identity information, inquiry business identification information and gateway interface letterCease mapping relations and above-mentioned predetermined business processing side's service identity information between three, inquiry business mark is believedMapping relations between breath and configuration information identifier three can be stored in same mapping relation table, can also be stored respectively in notIn same mapping table.
Then, according to the inquiry business information and the configuration information, inquiry request message is assembled, and will be after assemblingThe inquiry request message is sent to the corresponding service request side's gateway interface of the gateway interface information of acquisition, for the industryThe inquiry request message is sent to corresponding business processing side's gateway interface by business requesting party's gateway interface.
Specifically, inquiry is defined according to the gateway interface data process method of business processing side due to above-mentioned configuration informationTherefore the rigging of request message is based on the rigging, assembles using inquiry business information as message content, withJust business processing side can directly read the inquiry request message when receiving the inquiry request message.
Finally, receive the inquiry returned packet that service request side's gateway interface returns, and according to the configuration information,The inquiry returned packet is parsed, to obtain query result.
Specifically, due to including to be set in advance according to service processing side's gateway interface data process method in the configuration informationTherefore the parsing data for the inquiry returned packet field set according to the configuration information, can solve inquiry returned packetAnalysis, to obtain query result.
The present embodiment passes through starting when not receiving the default first kind business returned packet in preset durationInquiry business would know that the state of the currently processed default first kind business in business processing side, so that reason state is according to thisMake to adjust business processing strategy.
Further, the present invention also proposes that a kind of computer readable storage medium, the computer readable storage medium are depositedMessage handler is contained, the message handler can be executed by least one processor, so that at least one described processingDevice executes the step of message processing method in any of the above-described embodiment.
The above description is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all at thisUnder the inventive concept of invention, using equivalent structure transformation made by description of the invention and accompanying drawing content, or directly/use indirectlyIt is included in other related technical areas in scope of patent protection of the invention.